Commit 8f5350e0 authored by Ambra Di Piano's avatar Ambra Di Piano
Browse files

draft mapper sbatch

parent b08c33c9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -51,5 +51,12 @@ def make_simulator_sbatch(jobname, configuration, node_number):
def make_mapper_sh():
    return

def make_mapper_sbatch():
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_simulator_conf(jobname_conf, configuration, node_number, mode='simulator')
    make_sh(jobname, configuration['slurm'], jobname_conf, jobname_sh, jobname_log)
    system(f"sbatch {jobname_sh}")
    return
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -47,6 +47,16 @@ def base_mapper(configuration_file, seeds=None):
    log.info(f"Process complete, took {time() - clock} s")

def slurm_submission(configuration_file, nodes):
    configuration = load_yaml_conf(configuration_file)
    log = set_logger(get_log_level(configuration['logging']['level']))
    # create output dir
    log.info(f"Creating {configuration['simulator']['output']}")
    makedirs(configuration['simulator']['output'], exist_ok=True)
    # sbatch jobs per each nodes
    configuration['slurm']['nodes'] = nodes
    for node_number in range(configuration['slurm']['nodes']):
        jobname = f"{configuration['slurm']['name']}_{node_number+1}"
        make_mapper_sbatch(jobname, configuration, node_number)
    return