Example #1
0
class GrayScott(Campaign):
    name = "Gray-Scott-compression"
    codes = [("gray-scott", dict(exe="gray-scott", sleep_after=1)), ("compression", dict(exe="compression")) ]
    supported_machines = ['local', 'theta']
    scheduler_options = {
        "theta": {
            "queue": "debug-flat-quad",
            "project": "CSC249ADCD01",
        }
    }
    umask = '027'
    sweeps = [
     p.SweepGroup(name="gsc",
                  walltime=timedelta(minutes=30),
                  component_subdirs=True,
                  component_inputs={
                      'gray-scott': ['settings.json','adios2.xml'],
                      'compression': ['adios2.xml','sz.config','zc.config']
                  },
      parameter_groups=
      [p.Sweep([
          p.ParamCmdLineArg("gray-scott", "settings", 1, ["settings.json"]),
          p.ParamConfig("gray-scott", "L", "settings.json", "L",
                          [32]),
          p.ParamConfig("gray-scott", "noise", "settings.json", "noise",
                          [0.01]),
          p.ParamRunner('gray-scott', 'nprocs', [4] ),
          p.ParamCmdLineArg("compression", "input", 1, ["../gray-scott/gs.bp"]),
          p.ParamCmdLineArg("compression", "output", 2, ["CompressionOutput.bp"]),
          p.ParamCmdLineArg("compression", "compressor", 3, ["1"]),          
          p.ParamRunner('compression', 'nprocs', [1] )          
        ]),
      ]),
    ]
Example #2
0
def get_sweep_params(adios_engine):
    # Setup the sweep parameters for a Sweep
    return [
        # ParamRunner 'nprocs' specifies the no. of ranks to be spawned
        p.ParamRunner('simulation', 'nprocs', [1]),

        # Create a ParamCmdLineArg parameter to specify a command line argument to run the application
        p.ParamCmdLineArg('simulation', 'settings', 1, ["settings.json"]),

        # Edit key-value pairs in the json file
        # Sweep over two values for the F key in the json file. Alongwith 4 values for the nprocs property for
        #   the pdf_calc code, this Sweep will create 2*4 = 8 experiments.
        p.ParamConfig('simulation', 'feed_rate_U', 'settings.json', 'F',
                      [0.01]),
        p.ParamConfig('simulation', 'kill_rate_V', 'settings.json', 'k',
                      [0.048]),

        # Setup an environment variable
        # p.ParamEnvVar       ('simulation', 'openmp', 'OMP_NUM_THREADS', [4]),

        # Change the engine for the 'SimulationOutput' IO object in the adios xml file to SST for coupling.
        # As both the applications use the same xml file, you need to do this just once.
        p.ParamADIOS2XML('simulation', 'sim output engine', 'SimulationOutput',
                         'engine', [{
                             adios_engine: {}
                         }]),

        # Now setup options for the pdf_calc application.
        # Sweep over four values for the nprocs
        p.ParamRunner('pdf_calc', 'nprocs', [1]),
        p.ParamCmdLineArg('pdf_calc', 'infile', 1, ['gs.bp']),
        p.ParamCmdLineArg('pdf_calc', 'outfile', 2, ['pdf']),
    ]
Example #3
0
class GrayScott(Campaign):
    # A name for the campaign
    name = "gray_scott"

    # Define your workflow. Setup the applications that form the workflow.
    # exe may be an absolute path.
    # The adios xml file is automatically copied to the campaign directory.
    # 'runner_override' may be used to launch the code on a login/service node as a serial code
    #   without a runner such as aprun/srun/jsrun etc.
    codes = [
        ("simulation", dict(exe="gray-scott", adios_xml_file='adios2.xml')),
        ("pdf_calc",
         dict(exe="pdf_calc",
              adios_xml_file='adios2.xml',
              runner_override=False)),
    ]

    # List of machines on which this code can be run
    supported_machines = ['local', 'titan', 'theta']

    # Kill an experiment right away if any workflow components fail (just the experiment, not the whole group)
    kill_on_partial_failure = True

    # Any setup that you may need to do in an experiment directory before the experiment is run
    run_dir_setup_script = None

    # A post-process script that is run for every experiment after the experiment completes
    run_post_process_script = None

    # Directory permissions for the campaign sub-directories
    umask = '027'

    # Options for the underlying scheduler on the target system. Specify the project ID and job queue here.
    scheduler_options = {
        'theta': {
            'project': 'CSC249ADCD01',
            'queue': 'default'
        }
    }

    # A way to setup your environment before the experiment runs. Export environment variables such as LD_LIBRARY_PATH here.
    app_config_scripts = {'local': 'setup.sh', 'theta': 'env_setup.sh'}

    # Setup the sweep parameters for a Sweep
    sweep1_parameters = [
        # ParamRunner 'nprocs' specifies the no. of ranks to be spawned
        p.ParamRunner('simulation', 'nprocs', [512]),

        # Create a ParamCmdLineArg parameter to specify a command line argument to run the application
        p.ParamCmdLineArg('simulation', 'settings', 1, ["settings.json"]),

        # Edit key-value pairs in the json file
        # Sweep over two values for the F key in the json file. Alongwith 4 values for the nprocs property for
        #   the pdf_calc code, this Sweep will create 2*4 = 8 experiments.
        p.ParamConfig('simulation', 'feed_rate_U', 'settings.json', 'F',
                      [0.01, 0.02]),
        p.ParamConfig('simulation', 'kill_rate_V', 'settings.json', 'k',
                      [0.048]),

        # Setup an environment variable
        # p.ParamEnvVar       ('simulation', 'openmp', 'OMP_NUM_THREADS', [4]),

        # Change the engine for the 'SimulationOutput' IO object in the adios xml file to SST for coupling.
        # As both the applications use the same xml file, you need to do this just once.
        p.ParamADIOS2XML('simulation', 'SimulationOutput', 'engine', [{
            'SST': {}
        }]),

        # Now setup options for the pdf_calc application.
        # Sweep over four values for the nprocs
        p.ParamRunner('pdf_calc', 'nprocs', [32, 64, 128, 256]),
        p.ParamCmdLineArg('pdf_calc', 'infile', 1, ['gs.bp']),
        p.ParamCmdLineArg('pdf_calc', 'outfile', 2, ['pdf']),
    ]

    # Create a Sweep object. This one does not define a node-layout, and thus, all cores of a compute node will be
    #   utilized and mapped to application ranks.
    sweep1 = p.Sweep(parameters=sweep1_parameters)

    # Create another Sweep object and set its node-layout to spawn 16 simulation processes per node, and
    #   4 processes of pdf_calc per node. On Theta, different executables reside on separate nodes as node-sharing
    #   is not permitted on Theta.
    sweep2_parameters = copy.deepcopy(sweep1_parameters)
    sweep2 = p.Sweep(
        node_layout={'theta': [{
            'simulation': 16
        }, {
            'pdf_calc': 4
        }]},
        parameters=sweep2_parameters)

    # Create a SweepGroup and add the above Sweeps. Set batch job properties such as the no. of nodes,
    sweepGroup1 = p.SweepGroup(
        "sg-1",  # A unique name for the SweepGroup
        walltime=3600,  # Total runtime for the SweepGroup
        per_run_timeout=
        600,  # Timeout for each experiment                                
        parameter_groups=[sweep1, sweep2],  # Sweeps to include in this group
        launch_mode='default',  # Launch mode: default, or MPMD if supported
        nodes=128,  # No. of nodes for the batch job.
        # rc_dependency={'pdf_calc':'simulation',}, # Specify dependencies between workflow components
        run_repetitions=
        2,  # No. of times each experiment in the group must be repeated (Total no. of runs here will be 3)
    )

    # Activate the SweepGroup
    sweeps = [sweepGroup1]
Example #4
0
class GrayScott(Campaign):
    name = "Gray-Scott"
    codes = [("gray-scott", dict(exe="gray-scott"))]
    app_config_scripts = {'summit': 'env_summit.sh'}
    supported_machines = ['local', 'theta', 'summit']
    scheduler_options = {
        "theta": {
            "queue": "debug-flat-quad",
            "project": "CSC249ADCD01",
        },
        "summit": {
            "project": "csc299",
        }
    }
    kill_on_partial_failure = True

    umask = '027'

    nprocs = 6

    shared_node = SummitNode()
    for i in range(nprocs):
        shared_node.cpu[i] = "gray-scott:{}".format(i)
        shared_node.gpu[i] = ["gray-scott:{}".format(i)]
    shared_node_layout = [shared_node]

    L = [256]
    noise = [1.e-5]

    Du = [0.1, 0.2, 0.3]
    Dv = [0.05, 0.1, 0.15]
    F = [0.01, 0.02, 0.03]
    k = [0.048, 0.04, 0.06]

    sweep_parameters = \
    [
        p.ParamCmdLineArg("gray-scott", "settings", 1, ["settings.json"]),
        p.ParamConfig("gray-scott", "L", "settings.json", "L",
                      L),
        p.ParamConfig("gray-scott", "noise", "settings.json", "noise",
                      noise),
        p.ParamConfig("gray-scott", "Du", "settings.json", "Du",
                      Du),
        p.ParamConfig("gray-scott", "Dv", "settings.json", "Dv",
                      Dv),
        p.ParamConfig("gray-scott", "F", "settings.json", "F",
                      F),
        p.ParamConfig("gray-scott", "k", "settings.json", "k",
                      k),
        p.ParamRunner('gray-scott', 'nprocs', [nprocs] ),
    ]

    sweep = p.Sweep(parameters=sweep_parameters,
                    node_layout={'summit': shared_node_layout})
    nodes = len(noise) * len(Du) * len(Dv) * len(F) * len(k)

    sweeps = \
    [
        p.SweepGroup(
            name = "gs",
            walltime = timedelta(minutes=60),
            nodes = nodes,
            component_subdirs = True,
            component_inputs = {
                'gray-scott': ['settings.json','adios2.xml'],
            },
            parameter_groups = [sweep]
        )
    ]
Example #5
0
class param_test(Campaign):
    """
    Fake campaign designed to exercise all param types. Instead of real codes,
    bash scripts that echo args and cat files are used.

    NOTE: ParamAdiosXML is exercised by heat_transfer_*.py, not used here,
    all other types should be included.
    """
    # Used in job names submitted to scheduler.
    name = "param_test"

    # Scripts that just print args and exit. print1.sh also cats it's
    # config file.
    codes = [("print1", dict(exe="print1.sh")),
             ("print2", dict(exe="print2.sh")),
             ("print3", dict(exe="print3.sh"))]

    # Files to be copied from app dir to all run component directories,
    # e.g. for use with ParamConfig and ParamAdiosXML.
    inputs = ["all.conf"]

    # Document which machines the campaign is designed to run on. An
    # error will be raised if a different machine is specified on the
    # cheetah command line.
    supported_machines = ['local', 'cori', 'titan', 'theta']

    # Per machine scheduler options. Keys are the machine name, values
    # are dicts of name value pairs for the options for that machine.
    # Options must be explicitly supported by Cheetah, this is not
    # currently a generic mechanism.
    scheduler_options = {
        "cori": {
            "queue": "debug",
            "constraint": "haswell",
            "license": "SCRATCH,project",
        },
        "titan": {
            "queue": "debug",
            "project": "csc242",
        },
        "theta": {
            "queue": "debug-flat-quad",
            "project": "CSC249ADCD01",
        }
    }

    sweeps = [
        p.SweepGroup(
            name="test",
            nodes=4,
            walltime=timedelta(minutes=5),
            component_subdirs=True,
            component_inputs={
                'print1': ['print1.conf'],
                'print2': ['print2.ini'],
                'print3': ['print3.xml'],
            },
            parameter_groups=[
                p.Sweep([
                    p.ParamCmdLineArg("print1", "arg1", 1, ["val1", "val2"]),
                    p.ParamCmdLineArg("print1", "arg2", 2, [64, 128]),
                    p.ParamCmdLineOption("print1", "opt1", "--opt1",
                                         [0.2, 0.3]),
                    p.ParamCmdLineOption(
                        "print1", "derived", "--derived",
                        lambda d: d["print1"]["arg2"] * d["print2"]["opt1"]),
                    p.ParamKeyValue("print1", "config1", "print1.conf",
                                    "config1", ["c1", "c2"]),
                    p.ParamCmdLineArg("print2", "arg1", 1, ["1lav"]),
                    p.ParamCmdLineArg("print2", "arg2", 2, [2]),
                    p.ParamCmdLineOption("print2", "opt1", "--opt1", [-100]),
                    p.ParamKeyValue("print2", "kvconfig", "print2.ini",
                                    "mykey", ["cv1", "cv2"]),
                    p.ParamCmdLineArg("print3", "arg1", 1, ["val3.1"]),
                    p.ParamConfig("print3", "xmlconfig", "print3.xml",
                                  "WIDGET_VALUE", ["somevalue"]),
                ]),
            ]),
    ]