11from pathlib import Path
2- from typing import Optional
2+ from typing import Optional , Union
33
44
55class JobExecutorConfig (object ):
@@ -25,11 +25,49 @@ def __init__(self, launcher_log_file: Optional[Path] = None,
2525 that the exit code file, likely written on a service node, can be accessed by PSI/J,
2626 likely running on a head node.
2727 """
28- self .launcher_log_file = launcher_log_file
28+ self ._launcher_log_file = launcher_log_file
29+
2930 if work_directory :
30- self .work_directory = work_directory
31+ self ._work_directory = work_directory
3132 else :
32- self .work_directory = JobExecutorConfig .DEFAULT_WORK_DIRECTORY
33+ self ._work_directory = JobExecutorConfig .DEFAULT_WORK_DIRECTORY
34+
35+ @property
36+ def launcher_log_file (self ) -> Optional [Path ]:
37+ """
38+ Configure the executor's launcher log file.
39+
40+ Parameters
41+ ----------
42+ launcher_log_file
43+ If specified, log messages from launcher scripts (including
44+ output from pre- and post- launch scripts) will be directed to this file.
45+ """
46+ return self ._launcher_log_file
47+
48+ @launcher_log_file .setter
49+ def launcher_log_file (self , value : Optional [Union [str , Path ]]) -> None :
50+ if value :
51+ self ._launcher_log_file = Path (value )
52+
53+ @property
54+ def work_directory (self ) -> Path :
55+ """
56+ Configure the execor's work directory.
57+
58+ Parameters
59+ ----------
60+ work_directory
61+ A directory where submit scripts and auxiliary job files will be generated. In a,
62+ cluster this directory needs to point to a directory on a shared filesystem. This is so
63+ that the exit code file, likely written on a service node, can be accessed by PSI/J,
64+ likely running on a head node.
65+ """
66+ return self ._work_directory
67+
68+ @work_directory .setter
69+ def work_directory (self , value : Union [str , Path ]) -> None :
70+ self ._work_directory = Path (value )
3371
3472
3573JobExecutorConfig .DEFAULT = JobExecutorConfig ()
0 commit comments