@@ -910,8 +910,8 @@ def make_spec(self, cmd=None, arg=None):
910
910
spec = self .psij .JobSpec ()
911
911
spec .executable = cmd
912
912
spec .arguments = arg
913
- spec .stdout_path = ' /pydra/pydra/engine/demo.stdout'
914
- spec .stderr_path = ' /pydra/pydra/engine/demo.stderr'
913
+ spec .stdout_path = " /pydra/pydra/engine/demo.stdout"
914
+ spec .stderr_path = " /pydra/pydra/engine/demo.stderr"
915
915
916
916
return spec
917
917
@@ -923,33 +923,39 @@ def make_job(self, spec, attributes):
923
923
async def exec_psij (self , runnable , rerun = False ):
924
924
import psij
925
925
import pickle
926
+
926
927
self .psij = psij
927
- jex = psij .JobExecutor .get_instance (' slurm' )
928
+ jex = psij .JobExecutor .get_instance (" slurm" )
928
929
929
930
if isinstance (runnable , TaskBase ):
930
- with open (' /pydra/pydra/engine/my_function.pkl' , 'wb' ) as file :
931
+ with open (" /pydra/pydra/engine/my_function.pkl" , "wb" ) as file :
931
932
pickle .dump (runnable ._run , file )
932
- spec = self .make_spec ("python3.9" , ["/pydra/pydra/engine/run_pickled_function.py" ])
933
+ spec = self .make_spec (
934
+ "python3.9" , ["/pydra/pydra/engine/run_pickled_function.py" ]
935
+ )
933
936
else : # it could be tuple that includes pickle files with tasks and inputs
934
937
ind , task_main_pkl , task_orig = runnable
935
- with open (' /pydra/pydra/engine/my_function.pkl' , 'wb' ) as file :
938
+ with open (" /pydra/pydra/engine/my_function.pkl" , "wb" ) as file :
936
939
pickle .dump (load_and_run , file )
937
- with open (' /pydra/pydra/engine/taskmain.pkl' , 'wb' ) as file :
940
+ with open (" /pydra/pydra/engine/taskmain.pkl" , "wb" ) as file :
938
941
pickle .dump (task_main_pkl , file )
939
- with open (' /pydra/pydra/engine/ind.pkl' , 'wb' ) as file :
942
+ with open (" /pydra/pydra/engine/ind.pkl" , "wb" ) as file :
940
943
pickle .dump (ind , file )
941
- spec = self .make_spec ("python3.9" , ["/pydra/pydra/engine/run_pickled_function_2.py" ])
944
+ spec = self .make_spec (
945
+ "python3.9" , ["/pydra/pydra/engine/run_pickled_function_2.py" ]
946
+ )
942
947
943
948
job = self .make_job (spec , None )
944
949
jex .submit (job )
945
950
job .wait ()
946
-
951
+
947
952
return
948
953
949
954
def close (self ):
950
955
"""Finalize the internal pool of tasks."""
951
956
pass
952
957
958
+
953
959
WORKERS = {
954
960
"serial" : SerialWorker ,
955
961
"cf" : ConcurrentFuturesWorker ,
0 commit comments