def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() pbs_vars = cli.set_env_vars(run_args.init_run, run_args.n_runs, run_args.lab_path, run_args.dir_path) for var in pbs_vars: os.environ[var] = str(pbs_vars[var]) lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab) if 'PBS_NCPUS' not in os.environ: # Not a PBS batch job: set ncpus in environment if 'collate_ncpus' in expt.config: os.environ['NCPUS'] = str(expt.config['collate_ncpus']) expt.collate() if expt.postscript: expt.postprocess()
def runcmd(model_type, config_path, lab_path, force_archive, reproduce=False, force=False): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab, reproduce=reproduce, force=force) expt.setup(force_archive=force_archive)
def runcmd(model_type, config_path, lab_path): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) runlog = Runlog(expt) runlog.push()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() pbs_vars = cli.set_env_vars(run_args.init_run, run_args.n_runs) for var in pbs_vars: os.environ[var] = str(pbs_vars[var]) lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab) expt.profile()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab) expt.setup() expt.run() expt.archive() if expt.n_runs > 0: expt.resubmit()
def runcmd(model_type, config_path, lab_path): """Execute the command.""" lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) if expt.runlog.enabled: expt.runlog.github_setup() else: print('payu: Runlog must be enabled to configure GitHub sync.')
def runcmd(model_type, config_path, lab_path): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) if expt.runlog.enabled: expt.runlog.push() else: print('payu: Runlog must be enabled to push repositories.')
def runcmd(model_type, config_path, lab_path, force_archive): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) expt.setup(force_archive=force_archive)
def runcmd(model_type, config_path, lab_path): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) expt.build_model()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab, reproduce=run_args.reproduce) n_runs_per_submit = expt.config.get('runspersub', 1) subrun = 1 while True: print('nruns: {0} nruns_per_submit: {1} subrun: {2}' ''.format(expt.n_runs, n_runs_per_submit, subrun)) expt.setup() expt.run() expt.archive() # Finished runs if expt.n_runs == 0: break # Need to manually increment the run counter if still looping if n_runs_per_submit > 1 and subrun < n_runs_per_submit: expt.counter += 1 expt.set_output_paths() # Does not make sense to reproduce a multiple run. Take care of # this with argument processing? expt.reproduce = False else: break subrun += 1 if expt.n_runs > 0: expt.resubmit()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab) expt.setup() n_runs_per_submit = expt.config.get('runspersub', 1) subrun = 1 while subrun <= n_runs_per_submit and expt.n_runs > 0: print('nruns: {0} nruns_per_submit: {1} subrun: {2}' ''.format(expt.n_runs, n_runs_per_submit, subrun)) expt.setup() expt.run() expt.archive() # Need to manually increment the run counter if still looping if n_runs_per_submit > 1 and subrun < n_runs_per_submit: expt.counter += 1 expt.set_output_paths() subrun += 1 if expt.n_runs > 0: expt.resubmit()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab) expt.setup() n_runs_per_submit = expt.config.get('runspersub', 1) subrun = 1 while subrun <= n_runs_per_submit and expt.n_runs > 0: print('nruns: {} nruns_per_submit: {} subrun: {}' ''.format(expt.n_runs, n_runs_per_submit, subrun)) expt.setup() expt.run() expt.archive() # Need to manually increment the run counter if still looping if n_runs_per_submit > 1 and subrun < n_runs_per_submit: expt.counter += 1 expt.set_output_paths() subrun += 1 if expt.n_runs > 0: expt.resubmit()
def runcmd(model_type, config_path, hard_sweep, lab_path): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) expt.sweep(hard_sweep)
def runcmd(model_type, config_path, lab_path): lab = Laboratory(model_type, config_path, lab_path) expt = Experiment(lab) expt.archive()
def runscript(): parser = argparse.ArgumentParser() for arg in arguments: parser.add_argument(*arg['flags'], **arg['parameters']) run_args = parser.parse_args() lab = Laboratory(run_args.model_type, run_args.config_path, run_args.lab_path) expt = Experiment(lab, reproduce=run_args.reproduce, force=run_args.force) n_runs_per_submit = expt.config.get('runspersub', 1) subrun = 1 while True: print('nruns: {0} nruns_per_submit: {1} subrun: {2}' ''.format(expt.n_runs, n_runs_per_submit, subrun)) expt.setup() expt.run() expt.archive() # Finished runs if expt.n_runs == 0: break # Need to manually increment the run counter if still looping if n_runs_per_submit > 1 and subrun < n_runs_per_submit: expt.counter += 1 # Re-initialize manifest: important to clear out restart manifest # note no attempt to preserve reproduce flag, it makes no sense # to on subsequent runs expt.manifest = Manifest(expt.config.get('manifest', {}), reproduce=False) expt.set_output_paths() # Does not make sense to reproduce a multiple run. # Take care of this with argument processing? expt.reproduce = False else: break subrun += 1 if expt.n_runs > 0: expt.resubmit()