Parsl workflows are developed completely independently from their execution environment. Parsl offers an extensible configuration model through which the execution environment and communication with that environment is configured. Parsl is configured using :class:`~parsl.config.Config` object. For more information, see the :class:`~parsl.config.Config` class documentation. The following shows how the configuration can be loaded.
import parsl from parsl.config import Config from parsl.executors.threads import ThreadPoolExecutor config = Config( executors=[ThreadPoolExecutor()], lazy_errors=True ) parsl.load(config)
Configuration How-To and Examples:
Please note that all configuration examples below import a user_opts file where all user specific options are defined. To use the configuration, these options must be defined either by creating a user_opts file, or explicitly edit the configuration with user specific information.
The configuration provided to Parsl dictates the shape and limits of various resources to be provisioned for the workflow. Therefore it is important to carefully evaluate certain aspects of the workflow and the planned compute resources to determine an ideal configuration match.
Here are a series of question to help formulate a suitable configuration:
- Where would you like the tasks that comprise the workflow to execute?
|Amazon Web Services||
|Slurm based cluster or supercomputer||
|Torque/PBS based cluster or supercomputer||
|Cobalt based cluster or supercomputer||
|GridEngine based cluster or grid||
|Condor based cluster or grid||
- How many and how long are the tasks? How many nodes do you have to execute them ?
|Node scale||Task Duration||Task Count||Suitable Executor|
|Nodes=1||<1s - minutes||0-100K||
|1<=Nodes<=1000||<1s - minutes||0-1M||
- If you are running on a cluster or supercomputer, will you request multiple nodes per block ? Note that in this case a block is equivalent to a batch job.
|Provider||Executor choice||Suitable Launchers|
|Any except systems using Aprun||Any||
|Aprun based systems||Any||
|Provider||Executor choice||Suitable Launchers|
If you are on a Cray system, you most likely need the AprunLauncher to launch workers unless you are on a native Slurm system like :ref:`configuring_nersc_cori`
- Where will you run the main parsl process vs the tasks?
|Workflow location||Execution target||Suitable channel|
|Laptop/Workstation||Clusters with no 2FA||SSHChannel|
|Laptop/Workstation||Clusters with 2FA||SSHInteractiveLoginChannel|
The following snippet shows an example configuration for executing remotely on San Diego Supercomputer Center's Comet supercomputer. The example uses an SSHChannel to connect remotely to Comet, the SlurmProvider to interface with the Slurm scheduler used by Comet and the SrunLauncher to launch workers.
.. literalinclude:: ../../parsl/configs/comet_ipp_multinode.py
The following snippet shows an example configuration for accessing NERSC's Cori supercomputer. This example uses the IPythonParallel executor and connects to Cori's Slurm scheduler. It uses a remote SSH channel that allows the IPythonParallel controller to be hosted on the script's submission machine (e.g., a PC). It is configured to request 2 nodes configured with 1 TaskBlock per node. Finally it includes override information to request a particular node type (Haswell) and to configure a specific Python environment on the worker nodes using Anaconda.
.. literalinclude:: ../../parsl/configs/cori_ipp_multinode.py
The following snippet shows an example configuration for executing on Argonne Leadership Computing Facility's Theta supercomputer. This example uses the IPythonParallel executor and connects to Theta's Cobalt scheduler using the CobaltProvider. This configuration assumes that the script is being executed on the login nodes of Theta.
.. literalinclude:: ../../parsl/configs/theta_local_ipp_multinode.py
The following snippet shows an example configuration for executing remotely on Argonne Leadership Computing Facility's Cooley analysis and visualization system. The example uses an SSHInteractiveLoginChannel to connect remotely to Cooley using ALCF's 2FA token. The configuration uses the CobaltProvider to interface with Cooley's scheduler.
.. literalinclude:: ../../parsl/configs/cooley_ssh_il_single_node.py
The following snippet shows an example configuration for executing remotely on Swan, an XC50 machine hosted by the Cray Partner Network. The example uses an SSHChannel to connect remotely Swan, uses the TorqueProvider to interface with the scheduler and the AprunLauncher to launch workers on the machine
.. literalinclude:: ../../parsl/configs/swan_ipp_multinode.py
The snippet below shows an example configuration for executing from a login node on IN2P3's Computing Centre. The configuration uses the LocalProvider to run on a login node primarily to avoid GSISSH, which Parsl does not support yet. This system uses Grid Engine which Parsl interfaces with using the GridEngineProvider.
.. literalinclude:: ../../parsl/configs/cc_in2p3_local_single_node.py
This Midway cluster is a campus cluster hosted by the Research Computing Center at the University of Chicago. The snippet below shows an example configuration for executing remotely on Midway. The configuration uses the SSHProvider to connect remotely to Midway, uses the SlurmProvider to interface with the scheduler, and uses the SrunProvider to launch workers.
.. literalinclude:: ../../parsl/configs/midway_ipp_multinode.py
The Open Science Grid (OSG) is a national, distributed computing Grid spanning over 100 individual sites to provide tens of thousands of CPU cores. The snippet below shows an example configuration for executing remotely on OSG. The configuration uses the SSHProvider to connect remotely to OSG, uses the CondorProvider to interface with the scheduler.
.. literalinclude:: ../../parsl/configs/osg_ipp_multinode.py
Please note that boto3 library is a requirement to use AWS with Parsl. This can be installed via python3 -m pip install libsubmit+aws
Amazon Web services is a commercial cloud service which allows you to rent a range of computers and other computing services. The snippet below shows an example configuration for provisioning nodes from the Elastic Compute Cloud (EC2) service. The first run would configure a Virtual Private Cloud and other networking and security infrastructure that will be re-used in subsequent runs. The configuration uses the AWSProvider to connect to AWS
.. literalinclude:: ../../parsl/configs/ec2_single_node.py
For help constructing a configuration, you can click on class names such as :class:`~parsl.config.Config` or :class:`~parsl.executors.ipp.IPyParallelExecutor` to see the associated class documentation. The same documentation can be accessed interactively at the python command line via, for example:
>>> from parsl.config import Config >>> help(Config)