Loading astrort/configure/slurmjobs.py +7 −8 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ def make_sh(jobname, slurmconf, jobname_conf, jobname_sh, jobname_log, mode='sim f.write(f"\nsource activate {slurmconf['environment']}") if mode == 'simulator': f.write(f"\npython {join(dirname(abspath(__file__)).replace('configure', 'simulator'), 'base_simulator.py')} -f {jobname_conf}\n") elif mode == 'mapper': f.write(f"\npython {join(dirname(abspath(__file__)).replace('configure', 'simulator'), 'base_mapper.py')} -f {jobname_conf}\n") else: raise ValueError(f"Invalid 'mode' {mode}") Loading @@ -48,15 +50,12 @@ def make_simulator_sbatch(jobname, configuration, node_number): make_sh(jobname, configuration['slurm'], jobname_conf, jobname_sh, jobname_log) system(f"sbatch {jobname_sh}") def make_mapper_sh(): return def make_mapper_sbatch(jobname, configuration, node_number): output = configuration['simulator']['output'] jobname_sh = join(output, f"{jobname}_simulator.sh") jobname_log = join(output, f"{jobname}_simulator.slurm") jobname_conf = join(output, f"{jobname}_simulator.yml") make_configuration(jobname_conf, configuration, node_number, mode='simulator') output = configuration['mapper']['output'] jobname_sh = join(output, f"{jobname}_mapper.sh") jobname_log = join(output, f"{jobname}_mapper.slurm") jobname_conf = join(output, f"{jobname}_mapper.yml") make_configuration(jobname_conf, configuration, node_number, mode='mapper') make_sh(jobname, configuration['slurm'], jobname_conf, jobname_sh, jobname_log) system(f"sbatch {jobname_sh}") return No newline at end of file Loading
astrort/configure/slurmjobs.py +7 −8 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ def make_sh(jobname, slurmconf, jobname_conf, jobname_sh, jobname_log, mode='sim f.write(f"\nsource activate {slurmconf['environment']}") if mode == 'simulator': f.write(f"\npython {join(dirname(abspath(__file__)).replace('configure', 'simulator'), 'base_simulator.py')} -f {jobname_conf}\n") elif mode == 'mapper': f.write(f"\npython {join(dirname(abspath(__file__)).replace('configure', 'simulator'), 'base_mapper.py')} -f {jobname_conf}\n") else: raise ValueError(f"Invalid 'mode' {mode}") Loading @@ -48,15 +50,12 @@ def make_simulator_sbatch(jobname, configuration, node_number): make_sh(jobname, configuration['slurm'], jobname_conf, jobname_sh, jobname_log) system(f"sbatch {jobname_sh}") def make_mapper_sh(): return def make_mapper_sbatch(jobname, configuration, node_number): output = configuration['simulator']['output'] jobname_sh = join(output, f"{jobname}_simulator.sh") jobname_log = join(output, f"{jobname}_simulator.slurm") jobname_conf = join(output, f"{jobname}_simulator.yml") make_configuration(jobname_conf, configuration, node_number, mode='simulator') output = configuration['mapper']['output'] jobname_sh = join(output, f"{jobname}_mapper.sh") jobname_log = join(output, f"{jobname}_mapper.slurm") jobname_conf = join(output, f"{jobname}_mapper.yml") make_configuration(jobname_conf, configuration, node_number, mode='mapper') make_sh(jobname, configuration['slurm'], jobname_conf, jobname_sh, jobname_log) system(f"sbatch {jobname_sh}") return No newline at end of file