PARSL_LOCAL_CONFIG_TEMPLATE = """
from parsl.executors import WorkQueueExecutor, ThreadPoolExecutor
from parsl.providers import LocalProvider
from parsl.monitoring.monitoring import MonitoringHub
from parsl.addresses import address_by_hostname
from parsl.utils import get_all_checkpoints


provider = LocalProvider(init_blocks=0, min_blocks=0, max_blocks=1)
executors = [WorkQueueExecutor(label="work_queue", port=9000, shared_fs=True,
                               provider=provider, autolabel=False,
                               address=address_by_hostname()),
             ThreadPoolExecutor(max_threads=1, label="submit-node")]

monitoring = MonitoringHub(hub_address=address_by_hostname(),
                           hub_port=55055,
                           monitoring_debug=False,
                           resource_monitoring_interval=60)

config = parsl.config.Config(strategy="simple",
                             garbage_collect=False,
                             app_cache=True,
                             executors=executors,
                             retries=1)

DFK = parsl.load(config)
"""

PARSL_SLURM_CONFIG_TEMPLATE = """
from parsl.executors import WorkQueueExecutor, ThreadPoolExecutor
from parsl.providers import SlurmProvider
from parsl.launchers import SrunLauncher


PROVIDER_OPTIONS = dict(nodes_per_block={nodes},
                        exclusive=True,
                        init_blocks=0,
                        min_blocks=0,
                        max_blocks=1,
                        parallelism=0,
                        launcher=SrunLauncher(
                            overrides='-K0 -k --slurmd-debug=verbose'),
                        cmd_timeout=300)

SCHEDULER_OPTIONS = ("#SBATCH --constraint={constraint}\n"
                     "#SBATCH --qos={qos}\n")

provider = SlurmProvider('None', walltime='00:{walltime}:00',
                         scheduler_options=SCHEDULER_OPTIONS,
                         **PROVIDER_OPTIONS)

executors = [WorkQueueExecutor(label='work_queue', port=9000, shared_fs=True,
                               provider=provider, autolabel=False),
             ThreadPoolExecutor(max_threads=1, label='submit-node')]
config = parsl.config.Config(strategy='simple',
                             garbage_collect=False,
                             app_cache=True,
                             executors=executors,
                             retries=1)

DFK = parsl.load(config)
"""


PARSL_RUN_TEMPLATE = """
#!/bin/env python

import os
import parsl
{parsl_config}

@parsl.bash_app(executors=['work_queue'], cache=True,
                ignore_for_cache=['stdout', 'stderr'])
def run_command(command, inputs=(), stdout=None, stderr=None,
    return command

command = '{parsl_command}'
resource_spec = {{'memory': {memory}, 'cores': 1, 'disk': 0}}

futures = []
for pixel in {hpix_list_str}:
    comm = command.format(pixel=pixel)
    logfile = f'{jobname}-{{pixel}}.log'
    futures.append(run_command(comm, stdout=logfile, stderr=logfile,
                               parsl_resource_specifications=resource_spec))

[_.result() for _ in futures]
"""

@@ -139,62 +139,8 @@
 der%0A
-from parsl.monitoring.monitoring import MonitoringHub%0A
 from
@@ -183,16 +183,16 @@
 ostname%0A
+
 from par
@@ -579,225 +579,8 @@
 )%5D%0A%0A
-monitoring = MonitoringHub(hub_address=address_by_hostname(),%0A                           hub_port=55055,%0A                           monitoring_debug=False,%0A                           resource_monitoring_interval=60)%0A%0A
 conf
@@ -1486,16 +1486,17 @@
 traint%7D%5C
+%5C
 n%22%0A     
@@ -1532,16 +1532,17 @@
 s=%7Bqos%7D%5C
+%5C
 n%22)%0A%0Apro
@@ -2443,16 +2443,52 @@
 rr=None,
+ parsl_resource_specification=None):
 %0A    ret
@@ -2783,16 +2783,16 @@
 ogfile,%0A
+
         
@@ -2842,17 +2842,16 @@
 fication
-s
 =resourc

Fix parsl template typos