Skip to content

Commit 8ea8256

Browse files
committed
add psij subtype to WORKERS
1 parent 4fd8bb2 commit 8ea8256

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pydra/engine/workers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,15 @@ def close(self):
893893

894894

895895
class PsijWorker(Worker):
896-
def __init__(self, **kwargs):
896+
def __init__(self, subtype=None, **kwargs):
897897
"""Initialize worker."""
898898
try:
899899
import psij
900900
except ImportError:
901901
logger.critical("Please install psij.")
902902
raise
903903
logger.debug("Initialize PsijWorker")
904+
self.subtype = subtype
904905

905906
def run_el(self, interface, rerun=False, **kwargs):
906907
"""Run a task."""
@@ -926,7 +927,7 @@ async def exec_psij(self, runnable, rerun=False):
926927
import os
927928

928929
self.psij = psij
929-
jex = psij.JobExecutor.get_instance("slurm")
930+
jex = psij.JobExecutor.get_instance(self.subtype)
930931
absolute_path = os.path.dirname(__file__)
931932

932933
if isinstance(runnable, TaskBase):
@@ -976,5 +977,5 @@ def close(self):
976977
"slurm": SlurmWorker,
977978
"dask": DaskWorker,
978979
"sge": SGEWorker,
979-
"psij": PsijWorker,
980+
**{"psij-" + subtype: lambda subtype=subtype: PsijWorker(subtype=subtype) for subtype in ["local", "slurm"]},
980981
}

0 commit comments

Comments
 (0)