I'm still working on getting executorlib integrated into pyiron_workflow by wrapping the executors so that the cache directory/key is automatically set using lexical information in the workflow -- i.e. to set the path to the cache according to the labels/parent labels of nodes in the graph. This is working perfectly for SingleNodeExecutor, but SlurmClusterExecutor is locking in the cache_directory at initialization (and indeed creating the folder then too #704).
This is not an absolute show-stopper -- I could leverage the cache_key exclusively, or set certain expectations/demands on how a SlurmClusterExecutor is accessed by pyiron_workflow users -- but the most convenient and intuitive for me would be to simply have it behave as like the SingleNodeExecutor.
Concretely, when I run this:
importosimporttimefromexecutorlibimportSingleNodeExecutordeffoo(x):
time.sleep(3)
returnx+1withSingleNodeExecutor(
cache_directory="not_this_dir",
) asexe:
future=exe.submit(
foo, 1, resource_dict={
"cache_directory": "rather_this_dir", "cache_key": "foo",
},
)
print(future.result())It is nicely putting all the caching in ./rather_this_dir. But with SLURM:
importosimporttimefromexecutorlibimportSlurmClusterExecutordeffoo(x):
time.sleep(3)
returnx+1withSlurmClusterExecutor(
cache_directory="not_this_dir",
resource_dict={"partition": "s.cmfe"}
) asexe:
future=exe.submit(
foo, 1, resource_dict={
"cache_directory": "rather_this_dir", "cache_key": "foo",
},
)
print(future.result())It runs OK and recognizes my "cache_key", but puts everything in ./not_this_dir.
I can see where the file-based system writes the undesirable directory too early (#704) but when I tried to figure out how to make this modification myself I wound up getting very lost (#703). Is such a modification possible?
EDIT: completed hyperlinks
I'm still working on getting
executorlibintegrated intopyiron_workflowby wrapping the executors so that the cache directory/key is automatically set using lexical information in the workflow -- i.e. to set the path to the cache according to the labels/parent labels of nodes in the graph. This is working perfectly forSingleNodeExecutor, butSlurmClusterExecutoris locking in thecache_directoryat initialization (and indeed creating the folder then too #704).This is not an absolute show-stopper -- I could leverage the
cache_keyexclusively, or set certain expectations/demands on how aSlurmClusterExecutoris accessed bypyiron_workflowusers -- but the most convenient and intuitive for me would be to simply have it behave as like theSingleNodeExecutor.Concretely, when I run this:
It is nicely putting all the caching in
./rather_this_dir. But with SLURM:It runs OK and recognizes my
"cache_key", but puts everything in./not_this_dir.I can see where the file-based system writes the undesirable directory too early (#704) but when I tried to figure out how to make this modification myself I wound up getting very lost (#703). Is such a modification possible?
EDIT: completed hyperlinks