Commit a0c5c6ed authored by Lukas Weber's avatar Lukas Weber
Browse files

make python clusterutils run

parent 082a3b88
......@@ -2,8 +2,7 @@ import tempfile
import os
import sys
batchscript_claix18 = '''
#!/usr/bin/env zsh
batchscript_claix18 = '''#!/usr/bin/env zsh
# Autogenerated by loadleveller targeting the claix18 cluster. Do not edit.
......@@ -17,8 +16,7 @@ batchscript_claix18 = '''
#SBATCH --error=error.%x
{custom_cmds}
{mpirun} $FLAGS_MPI_BATCH {cmd}
{mpirun} $FLAGS_MPI_BATCH {mc_cmd}
'''
batchscript_templates = {
......@@ -74,7 +72,8 @@ def run(jobname, jobconfig, cmd):
else:
with tempfile.NamedTemporaryFile(mode='w',delete=False) as f:
f.write(generate_batchscript(batchscript_templates[sysinfo], cmd, jobname, jobconfig))
bscriptname = f.name()
bscriptname = f.name
mpicmd = batch_commands[sysinfo].format(batchscript=bscriptname)
print('$ '+mpicmd)
os.system()
os.system(mpicmd)
os.unlink(f.name)
......@@ -28,11 +28,11 @@ if args.single and args.merge:
sys.exit(1)
with open(jobfile_name, 'r') as f:
jobfile = yaml.safeload(f)
jobfile = yaml.safe_load(f)
jobconfig_path = os.path.expandvars(os.path.expanduser(jobfile['jobconfig']))
with open(jobconfig_path) as f:
jobconfig = yaml.safeload(f)
jobconfig = yaml.safe_load(f)
mcbinary = os.path.expandvars(os.path.expanduser(jobconfig['mc_binary']))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment