Skip to content

Commit b85501e

Browse files
committed
Now Autosubmit exits in case of receiving hetjobs, which are not implemented yet
1 parent 0823ab3 commit b85501e

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

autosubmit/platforms/headers/fluxoverslurm_header.py

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,13 @@ class FluxOverSlurmHeader(object):
2727

2828
def get_proccesors_directive(self, job, parameters, het=-1):
2929
"""
30-
Returns processors directive for the specified job
30+
Returns processors directive for the specified job.
3131
3232
:param job: job to create processors directive for
3333
:type job: Job
3434
:return: processors directive
3535
:rtype: str
3636
"""
37-
if het > -1 and len(job.het['NODES']) > 0:
38-
if job.het['NODES'][het] == '':
39-
job_nodes = 0
40-
else:
41-
job_nodes = job.het['NODES'][het]
42-
if len(job.het['PROCESSORS']) == 0 or job.het['PROCESSORS'][het] == '' or job.het['PROCESSORS'][
43-
het] == '1' and int(job_nodes) > 0:
44-
return ""
45-
else:
46-
return "FLUX: --nslots {0}".format(job.het['PROCESSORS'][het])
4737
if job.nodes == "":
4838
job_nodes = 0
4939
else:
@@ -55,52 +45,41 @@ def get_proccesors_directive(self, job, parameters, het=-1):
5545

5646
def get_nodes_directive(self, job, parameters, het=-1):
5747
"""
58-
Returns nodes directive for the specified job
48+
Returns nodes directive for the specified job.
5949
:param job: job to create nodes directive for
6050
:type job: Job
6151
:return: nodes directive
6252
:rtype: str
6353
"""
64-
if het > -1 and len(job.het['NODES']) > 0:
65-
if job.het['NODES'][het] != '':
66-
return "FLUX: --nodes {0}".format(job.het['NODES'][het])
54+
if parameters['NODES'] != '':
55+
return "FLUX: --nodes {0}".format(parameters['NODES'])
6756
else:
68-
if parameters['NODES'] != '':
69-
return "FLUX: --nodes {0}".format(parameters['NODES'])
70-
return ""
57+
return ""
7158

72-
# noinspection PyMethodMayBeStatic,PyUnusedLocal
7359
def get_memory_directive(self, job, parameters, het=-1):
74-
# TODO: [ENGINES] Implement this method
75-
Log.warning("Directive 'mem' is not currently supported for Flux jobs. Ignoring it")
60+
Log.warning("Directive 'mem' is not supported for Flux jobs. Ignoring it")
7661
return ""
7762

78-
# noinspection PyMethodMayBeStatic,PyUnusedLocal
7963
def get_memory_per_task_directive(self, job, parameters, het=-1):
80-
# TODO: [ENGINES] Implement this method
81-
Log.warning("Directive 'mem-per-cpu' is not currently supported for Flux jobs. Ignoring it")
64+
Log.warning("Directive 'mem-per-cpu' is not supported for Flux jobs. Ignoring it")
8265
return ""
8366

8467
def get_threads_per_task(self, job, parameters, het=-1):
8568
"""
86-
Returns threads per task directive for the specified job
69+
Returns threads per task directive for the specified job.
8770
8871
:param job: job to create threads per task directive for
8972
:type job: Job
9073
:return: threads per task directive
9174
:rtype: str
9275
"""
93-
# There is no threads per task, so directive is empty
94-
if het > -1 and len(job.het['NUMTHREADS']) > 0:
95-
if job.het['NUMTHREADS'][het] != '':
96-
return "FLUX: --cores-per-slot {0}".format(job.het['NUMTHREADS'][het])
76+
if parameters['NUMTHREADS'] != '':
77+
return "FLUX: --cores-per-slot {0}".format(parameters['NUMTHREADS'])
9778
else:
98-
if parameters['NUMTHREADS'] != '':
99-
return "FLUX: --cores-per-slot {0}".format(parameters['NUMTHREADS'])
100-
return ""
79+
return ""
10180

10281
def get_custom_directives(self, job, parameters, het=-1):
103-
Log.warning("Jobs within a wrapper using the Flux method do not currently support custom directives.")
82+
Log.warning("Jobs within a wrapper using the Flux method do not support custom directives.")
10483
return ""
10584

10685
def get_tasks_per_node(self, job, parameters, het=-1):
@@ -109,12 +88,13 @@ def get_tasks_per_node(self, job, parameters, het=-1):
10988
return ""
11089

11190
def calculate_het_header(self, job, parameters):
112-
Log.warning("Heterogeneous configurations are not currently supported for Flux jobs. Ignoring them")
113-
return ""
91+
# TODO: [ENGINES] Implement heterogeneous jobs for Flux
92+
raise NotImplementedError("Heterogeneous configurations are not currently supported for Flux jobs.")
11493

11594
def get_wallclock_directive(self, job, parameters):
11695
"""
117-
Returns wallclock directive for the specified job
96+
Returns wallclock directive for the specified job.
97+
Assumes wallclock is given in HH:MM format.
11898
11999
:param job: job to create wallclock directive for
120100
:type job: Job
@@ -128,7 +108,7 @@ def get_wallclock_directive(self, job, parameters):
128108

129109
def get_exclusive_directive(self, job, parameters, het=-1):
130110
"""
131-
Returns account directive for the specified job
111+
Returns account directive for the specified job.
132112
133113
:param job: job to create account directive for
134114
:type job: Job

0 commit comments

Comments
 (0)