def fresh_config(): return Config(executors=[ HighThroughputExecutor( label='Cori_HTEX_multinode', # This is the network interface on the login node to # which compute nodes can communicate # address=address_by_interface('bond0.144'), max_workers=1, address=address_by_interface('bond0.144'), provider=SlurmProvider( 'debug', # Partition / QOS nodes_per_block=2, init_blocks=1, # string to prepend to #SBATCH blocks in the submit # script to the scheduler eg: '#SBATCH --constraint=knl,quad,cache' scheduler_options=user_opts['cori']['scheduler_options'], # Command to be run before starting a worker, such as: # 'module load Anaconda; source activate parsl_env'. worker_init=user_opts['cori']['worker_init'], # We request all hyperthreads on a node. launcher=SrunLauncher(overrides='-c 272'), walltime='00:10:00', # Slurm scheduler on Cori can be slow at times, # increase the command timeouts cmd_timeout=120, ), ) ])
def fresh_config(): return Config( executors=[ HighThroughputExecutor( label="htex", heartbeat_period=15, heartbeat_threshold=120, worker_debug=False, max_workers=1, address=address_by_interface('ib0'), provider=PBSProProvider( launcher=MpiRunLauncher(), # string to prepend to #PBS blocks in the submit # script to the scheduler # E.g., project name scheduler_options=user_opts['nscc']['scheduler_options'], # Command to be run before starting a worker, such as: # 'module load Anaconda; source activate parsl_env'. worker_init=user_opts['nscc']['worker_init'], nodes_per_block=2, min_blocks=1, max_blocks=1, cpus_per_node=24, walltime="00:20:00", cmd_timeout=300, ), ), ], strategy='simple', )
from parsl.config import Config from parsl.providers import SlurmProvider from parsl.launchers import SrunLauncher from parsl.executors import HighThroughputExecutor from parsl.addresses import address_by_interface config = Config( executors=[ HighThroughputExecutor( label='Cori_HTEX_multinode', # This is the network interface on the login node to # which compute nodes can communicate address=address_by_interface('bond0.144'), cores_per_worker=2, provider=SlurmProvider( 'debug', # Partition / QOS nodes_per_block=2, init_blocks=1, # string to prepend to #SBATCH blocks in the submit # script to the scheduler eg: '#SBATCH --constraint=knl,quad,cache' scheduler_options='', # Command to be run before starting a worker, such as: # 'module load Anaconda; source activate parsl_env'. worker_init='', # We request all hyperthreads on a node. launcher=SrunLauncher(overrides='-c 272'), walltime='00:20:00', # Slurm scheduler on Cori can be slow at times, # increase the command timeouts cmd_timeout=120,
def parslConfigFromCompute(compute): """Given a Compute instance, return a setup parsl configuration""" if isinstance(compute, EC2Compute): # NOTE: Assumes the paropt is being run on an EC2 instance with access to metadata service try: public_ip = getAWSPublicIP() # get the required environment variables required_env_vars = [ "PAROPT_AWS_REGION", "PAROPT_AWS_KEY_NAME", "PAROPT_AWS_STATE_FILE", "PAROPT_AWS_IAM_INSTANCE_PROFILE_ARN" ] env_vars = { varname.replace('PAROPT_AWS_', '').lower(): os.getenv(varname) for varname in required_env_vars } missing_vars = [ varname for varname, value in env_vars.items() if value == None ] if missing_vars: raise Exception( "Missing required environment variables for running parsl with AWS:\n{}" .format(missing_vars)) parsl_config = Config( executors=[ HighThroughputExecutor( label='htex_local', address=public_ip, worker_port_range=(54000, 54050), interchange_port_range=(54051, 54100), cores_per_worker=1, max_workers=1, provider=AWSProvider( image_id=compute.ami, instance_type=compute.instance_model, worker_init= 'pip3 install git+https://[email protected]/globus-labs/ParaOpt@Chaofeng_modification', # git+https://[email protected]/chaofengwu/paropt',#git+https://[email protected]/macintoshpie/paropt', nodes_per_block=1, init_blocks=1, max_blocks=1, min_blocks=0, walltime='24:00:00', spot_max_bid=2.0, **env_vars), ) ], strategy=None, ) return parsl_config except KeyError as e: logger.error('Failed initializing aws config: {}'.format(e)) raise e except (HTTPError, URLError, OSError) as e: logger.error('Request to metadata service failed: {}'.format(e)) raise e elif isinstance(compute, LocalCompute): return Config(executors=[ ThreadPoolExecutor(max_threads=8, label='local_threads') ]) elif isinstance(compute, PBSProCompute): # NOTE: Assumes the paropt is being run on an PBS node with access to metadata service try: parsl_config = Config( executors=[ HighThroughputExecutor( label="htex", heartbeat_period=15, heartbeat_threshold=120, worker_debug=True, max_workers=4, address=address_by_interface('ib0'), provider=PBSProProvider( launcher=MpiRunLauncher(), # PBS directives (header lines): for array jobs pass '-J' option # scheduler_options='#PBS -J 1-10', scheduler_options=compute.scheduler_options, # Command to be run before starting a worker, such as: # 'module load Anaconda; source activate parsl_env'. worker_init=compute.worker_init, # number of compute nodes allocated for each block nodes_per_block=1, min_blocks=1, max_blocks=5, cpus_per_node=compute.cpus_per_node, # medium queue has a max walltime of 24 hrs walltime=compute.walltime), ), ], monitoring=MonitoringHub( hub_address=address_by_interface('ib0'), hub_port=55055, resource_monitoring_interval=10, ), strategy='simple', retries=3, app_cache=True, checkpoint_mode='task_exit') return parsl_config except KeyError as e: logger.error('Failed initializing PBSPro config: {}'.format(e)) raise e else: raise Exception('Unknown Compute type')
import argparse import time import parsl import pytest from parsl.providers import LocalProvider from parsl.channels import LocalChannel from parsl.launchers import SingleNodeLauncher from parsl.config import Config from parsl.executors import HighThroughputExecutor try: from parsl.addresses import address_by_interface address = address_by_interface('enx00e112002c62') except OSError: print("***************ERROR****************************") print("Interface doesn't exist, falling back to default, 127.0.0.1") print("***************ERROR****************************") address = '127.0.01' config = Config( executors=[ HighThroughputExecutor( poll_period=1, address=address, label="htex_local", worker_debug=True, cores_per_worker=1, heartbeat_period=1, heartbeat_threshold=2, worker_ports=(54759, 54330),
nodes_per_block = 1 tasks_per_node = target_workers % args.cores_per_node else: nodes_per_block = int(target_workers / args.cores_per_node) tasks_per_node = args.cores_per_node config = Config( executors=[ HighThroughputExecutor( label="funcx_local", # worker_debug=True, worker_mode="singularity_reuse", container_image=os.path.expanduser("~/sing-run.simg"), cores_per_worker=int(args.cores_per_node / tasks_per_node), max_workers=1, address=address_by_interface("eth0"), provider=CobaltProvider(launcher=SingleNodeLauncher(), init_blocks=1, max_blocks=1, queue=args.queue, account='DLHub', worker_init="source activate funcx_5"), ) ], run_dir="/home/tskluzac/FuncX/evaluation/runinfo", strategy=None, ) parsl.clear() dfk = parsl.load(config) executor = list(dfk.executors.values())[0]
from parsl.config import Config from parsl.executors import HighThroughputExecutor from parsl.launchers import JsrunLauncher from parsl.providers import LSFProvider from parsl.addresses import address_by_interface config = Config( executors=[ HighThroughputExecutor( label='Summit_HTEX', # On Summit ensure that the working dir is writeable from the compute nodes, # for eg. paths below /gpfs/alpine/world-shared/ working_dir='YOUR_WORKING_DIR_ON_SHARED_FS', address=address_by_interface( 'ib0'), # This assumes Parsl is running on login node worker_port_range=(50000, 55000), provider=LSFProvider( launcher=JsrunLauncher(), walltime="00:10:00", nodes_per_block=2, init_blocks=1, max_blocks=1, worker_init= '', # Input your worker environment initialization commands project='YOUR_PROJECT_ALLOCATION', cmd_timeout=60), ) ], )
from parsl.config import Config #from parsl.monitoring.monitoring import MonitoringHub from parsl.providers import SlurmProvider from parsl.executors import HighThroughputExecutor from parsl.launchers import SrunLauncher from parsl.addresses import address_by_interface#address_by_hostname #from parsl.executors.threads import ThreadPoolExecutor #from parsl.data_provider.file_noop import NoOpFileStaging #from parsl.data_provider.data_manager import default_staging config = Config( executors=[ HighThroughputExecutor( address=address_by_interface('ib0'),#address_by_hostname(), label='htex', cores_per_worker=24, # number of cores used by one task max_workers=24, # number of cores per node provider=SlurmProvider( partition='nvidia_long', nodes_per_block=6, # number of nodes cmd_timeout = 120, # duration for which the provider will wait for a command to be invoked on a remote system init_blocks=1, launcher=SrunLauncher(overrides='-c 24'), max_blocks=1, min_blocks=1, parallelism=1, move_files=False, scheduler_options = '#SBATCH -J WfRNAseq\n', walltime='01:00:00', worker_init='module load bowtie2/2.3\nmodule load samtools/1.10_gnu\nmodule load python/3.8.2\nmodule load java/jdk-8u201\nmodule load R/3.5.2_openmpi_2.0_gnu\n' ),
from parsl.providers import PBSProProvider from parsl.launchers import MpiRunLauncher from parsl.config import Config from parsl.executors import HighThroughputExecutor from parsl.addresses import address_by_interface from parsl.monitoring.monitoring import MonitoringHub config = Config( executors=[ HighThroughputExecutor( label="htex", heartbeat_period=15, heartbeat_threshold=120, worker_debug=True, max_workers=4, address=address_by_interface('ib0'), provider=PBSProProvider( launcher=MpiRunLauncher(), # PBS directives (header lines): for array jobs pass '-J' option scheduler_options='#PBS -J 1-10', # Command to be run before starting a worker, such as: # 'module load Anaconda; source activate parsl_env'. worker_init='', # number of compute nodes allocated for each block nodes_per_block=3, min_blocks=3, max_blocks=5, cpus_per_node=24, # medium queue has a max walltime of 24 hrs walltime='24:00:00'), ),
def workflow_config(name, nodes, cores_per_node=24, interval=30, monitor=False): import parsl from parsl.config import Config from parsl.channels import LocalChannel from parsl.launchers import SrunLauncher from parsl.providers import LocalProvider from parsl.addresses import address_by_interface from parsl.executors import HighThroughputExecutor from parsl.monitoring.monitoring import MonitoringHub parsl.set_stream_logger() parsl.set_file_logger('script.output', level=logging.DEBUG) logging.info('Configuring Parsl Workflow Infrastructure') #Read where datasets are... env_str = str() with open('parsl.env', 'r') as reader: env_str = reader.read() logging.info(f'Task Environment {env_str}') mon_hub = MonitoringHub( workflow_name=name, hub_address=address_by_interface('ib0'), hub_port=60001, resource_monitoring_enabled=True, monitoring_debug=False, resource_monitoring_interval=interval, ) if monitor else None config = Config( executors=[ HighThroughputExecutor( label=name, # Optional: The network interface on node 0 which compute nodes can communicate with. # address=address_by_interface('enp4s0f0' or 'ib0') address=address_by_interface('ib0'), # one worker per manager / node max_workers=cores_per_node, provider=LocalProvider( channel=LocalChannel(script_dir='.'), # make sure the nodes_per_block matches the nodes requested in the submit script in the next step nodes_per_block=nodes, # make sure launcher=SrunLauncher(overrides=f'-c {cores_per_node}'), cmd_timeout=120, init_blocks=1, max_blocks=1, worker_init=env_str, ), ) ], monitoring=mon_hub, strategy=None, ) logging.info('Loading Parsl Config') parsl.load(config) return
parser.add_argument("--client-port", default=5560, type=int, help="Port for client to communicate on") parser.add_argument("--localhost", default=False, action="store_true", help="True if communication is on localhost") args = parser.parse_args() if not args.localhost: with open(CLIENT_IP_FILE, "r") as fh: client_ip = fh.read().strip() print("Read IP {} from file {}".format(client_ip, CLIENT_IP_FILE)) interchange_ip = address_by_interface("eth0") with open(INTERCHANGE_IP_FILE, "w") as fh: fh.write(interchange_ip) print("Wrote IP address {} to file {}".format(interchange_ip, INTERCHANGE_IP_FILE)) else: client_ip = "localhost" interchange = Process(target=dealer_interchange, kwargs={ "manager_ip": client_ip, "manager_port": args.client_port, "worker_port": args.worker_port }) interchange.daemon = True interchange.start()