コード例 #1
0
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()
コード例 #2
0
ファイル: setup_cmd.py プロジェクト: marshallward/payu
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)
コード例 #3
0
def runcmd(model_type, config_path, lab_path):

    lab = Laboratory(model_type, config_path, lab_path)
    expt = Experiment(lab)
    runlog = Runlog(expt)

    runlog.push()
コード例 #4
0
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()
コード例 #5
0
ファイル: run_cmd.py プロジェクト: Subhash1998/product_sale
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()
コード例 #6
0
ファイル: ghsetup_cmd.py プロジェクト: strat123123/payu
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.')
コード例 #7
0
ファイル: push_cmd.py プロジェクト: rmholmes/payu
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.')
コード例 #8
0
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()
コード例 #9
0
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()
コード例 #10
0
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)
コード例 #11
0
ファイル: build_cmd.py プロジェクト: aidanheerdegen/payu
def runcmd(model_type, config_path, lab_path):

    lab = Laboratory(model_type, config_path, lab_path)
    expt = Experiment(lab)

    expt.build_model()
コード例 #12
0
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()
コード例 #13
0
ファイル: run_cmd.py プロジェクト: nicjhan/payu
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()
コード例 #14
0
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()
コード例 #15
0
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)
コード例 #16
0
def runcmd(model_type, config_path, lab_path):

    lab = Laboratory(model_type, config_path, lab_path)
    expt = Experiment(lab)

    expt.archive()
コード例 #17
0
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()