2727class FileTaskScheduler (TaskSchedulerBase ):
2828 def __init__ (
2929 self ,
30- cache_directory : str = "executorlib_cache" ,
30+ cache_directory : Optional [ str ] = None ,
3131 resource_dict : Optional [dict ] = None ,
3232 execute_function : Callable = execute_with_pysqa ,
3333 terminate_function : Optional [Callable ] = None ,
@@ -53,6 +53,7 @@ def __init__(
5353 default_resource_dict = {
5454 "cores" : 1 ,
5555 "cwd" : None ,
56+ "cache_directory" : cache_directory ,
5657 }
5758 if resource_dict is None :
5859 resource_dict = {}
@@ -61,12 +62,9 @@ def __init__(
6162 )
6263 if execute_function == execute_in_subprocess and terminate_function is None :
6364 terminate_function = terminate_subprocess
64- cache_directory_path = os .path .abspath (cache_directory )
65- os .makedirs (cache_directory_path , exist_ok = True )
6665 self ._process_kwargs = {
6766 "future_queue" : self ._future_queue ,
6867 "execute_function" : execute_function ,
69- "cache_directory" : cache_directory_path ,
7068 "resource_dict" : resource_dict ,
7169 "terminate_function" : terminate_function ,
7270 "pysqa_config_directory" : pysqa_config_directory ,
@@ -98,7 +96,9 @@ def create_file_executor(
9896 disable_dependencies : bool = False ,
9997):
10098 if cache_directory is None :
101- cache_directory = "executorlib_cache"
99+ resource_dict ["cache_directory" ] = os .path .abspath ("executorlib_cache" )
100+ else :
101+ resource_dict ["cache_directory" ] = os .path .abspath (cache_directory )
102102 if block_allocation :
103103 raise ValueError (
104104 "The option block_allocation is not available with the pysqa based backend."
@@ -114,7 +114,6 @@ def create_file_executor(
114114 check_nested_flux_executor (nested_flux_executor = flux_executor_nesting )
115115 check_flux_log_files (flux_log_files = flux_log_files )
116116 return FileTaskScheduler (
117- cache_directory = cache_directory ,
118117 resource_dict = resource_dict ,
119118 pysqa_config_directory = pysqa_config_directory ,
120119 backend = backend .split ("_submission" )[0 ],
0 commit comments