1
1
"""
2
- Aiida plugin for yascheduler
2
+ Aiida plugin for yascheduler,
3
+ with respect to the supported yascheduler engines
3
4
"""
4
5
5
6
import aiida .schedulers
6
7
from aiida .schedulers .datastructures import JobState , JobInfo , NodeNumberJobResource
8
+ from aiida .orm import load_node
9
+
7
10
8
11
_MAP_STATUS_YASCHEDULER = {
9
12
"QUEUED" : JobState .QUEUED ,
@@ -67,12 +70,15 @@ def _get_submit_script_header(self, job_tmpl):
67
70
Return the submit script header, using the parameters from the
68
71
job_tmpl.
69
72
"""
70
- lines = []
73
+ aiida_code = load_node (job_tmpl .codes_info [0 ]['code_uuid' ])
74
+
75
+ # We map the lowercase code labels onto yascheduler engines,
76
+ # so that the required input file(s) can be deduced
77
+ lines = ["ENGINE={}" .format (aiida_code .label .lower ())]
78
+
71
79
if job_tmpl .job_name :
72
80
lines .append ("LABEL={}" .format (job_tmpl .job_name ))
73
81
74
- # TODO too specific for engine.pcrystal
75
- lines += ["INPUT=INPUT" , "STRUCT=fort.34" ]
76
82
return "\n " .join (lines )
77
83
78
84
def _get_submit_command (self , submit_script ):
@@ -88,7 +94,8 @@ def _parse_submit_output(self, retval, stdout, stderr):
88
94
"""
89
95
if stderr .strip ():
90
96
self .logger .warning ("Stderr when submitting: {}" .format (stderr .strip ()))
91
- return stdout .split (":" )[1 ].strip ()
97
+
98
+ return stdout .strip ()
92
99
93
100
def _parse_joblist_output (self , retval , stdout , stderr ):
94
101
"""
0 commit comments