Creating a New Execution Environment Plugin

For the purposes of this tutorial, I will assume you are creating a new HPC Plugin HAL, and the code for that plugin lives in $HOME/git/plugins/hpc/HAL.

If you are creating a new HPC plugin for an existing platform that comes with SIERRA (e.g., ARGoS) you have two options:

  1. Following Creating a New Platform Plugin to create a new platform to add support for your execution environment within the existing platform.

  2. Open a pull request for SIERRA with your created HPC plugin to get it into the main repo. This should be the preferred option, as most execution environment plugins have utility beyond whatever group initially wrote them.

In either case, the steps to actually create the code are below.

Create The Code

Create the following filesystem structure and content in $HOME/git/plugins/hpc/HAL. Each file is required; any number of additional files can be included.

Within this file, you may define the following classes, which must be named EXACTLY as specified, otherwise SIERRA will not detect them. If you omit a required class, you will get an error on SIERRA startup. If you try to use a part of SIERRA which requires an optional class you omitted, you will get a runtime error.

Platform Plugin Classes

Class

Required?

Conforms to interface?

ParsedCmdlineConfigurer

No

IParsedCmdlineConfigurer

ExpRunShellCmdsGenerator

No

IExpRunShellCmdsGenerator

ExpShellCmdsGenerator

No

IExpShellCmdsGenerator

ExecEnvChecker

No

IExecEnvChecker

Below is a sample/skeleton plugin.py to use as a starting point.

from sierra.core.experiment import bindings

@implements.implements(bindings.IParsedCmdlineConfigurer)
class ParsedCmdlineConfigurer():
    """A class that conforms to
    :class:`~sierra.core.experiment.bindings.IParsedCmdlineConfigurer`.
    """

@implements.implements(bindings.IExpRunShellCmdsGenerator)
class ExpRunShellCmdsGenerator():
   """
   A class that conforms to
   :class:`sierra.core.experiment.bindings.IExpRunShellCmdsGenerator`.

   """

@implements.implements(bindings.IRunShellCmdsGenerator)
class ExpShellCmdsGenerator():
   """
   A class that conforms to
   :class:`sierra.core.experiment.bindings.IExpShellCmdsGenerator`.

   """

@implements.implements(bindings.IExecEnvChecker)
class ExecEnvChecker():
    """A class that conforms to
    :class:`~sierra.core.experiment.bindings.IExecEnvChecker`.
 """

Connect to SIERRA

  1. Put $HOME/git/plugins on your SIERRA_PLUGIN_PATH. Then your plugin can be selected as --exec-env=hpc.HAL.

Note

Execution environment plugin names have the same constraints as python package names (e.g., no dots).