From adb2cf3a52cc3a6e732a7a731e0078aeda44287d Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 25 Jul 2023 11:48:42 -0600 Subject: [PATCH 1/2] MPIPoolExecutor flux fix --- pympipool/parallel_executors/mpipool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pympipool/parallel_executors/mpipool.py b/pympipool/parallel_executors/mpipool.py index 27215dee..3d9a5085 100644 --- a/pympipool/parallel_executors/mpipool.py +++ b/pympipool/parallel_executors/mpipool.py @@ -33,7 +33,9 @@ def main(): if cwd not in sys.path: sys.path.insert(1, cwd) - with MPIPoolExecutor(int(argument_dict["total_cores"])) as executor: + with MPIPoolExecutor( + max_workers=int(argument_dict["total_cores"]), path=sys.path + ) as executor: if executor is not None: context, socket = connect_to_socket_interface( host=argument_dict["host"], port=argument_dict["zmqport"] From 6d82306f8774878ad00f4b27a161c4e7352149c8 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 25 Jul 2023 11:52:24 -0600 Subject: [PATCH 2/2] Add comments --- pympipool/parallel_executors/mpiexec.py | 1 + pympipool/parallel_executors/mpipool.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pympipool/parallel_executors/mpiexec.py b/pympipool/parallel_executors/mpiexec.py index 9f7490ee..412bf9c0 100644 --- a/pympipool/parallel_executors/mpiexec.py +++ b/pympipool/parallel_executors/mpiexec.py @@ -35,6 +35,7 @@ def main(): memory = None + # required for flux interface - otherwise the current path is not included in the python path cwd = abspath(".") if cwd not in sys.path: sys.path.insert(1, cwd) diff --git a/pympipool/parallel_executors/mpipool.py b/pympipool/parallel_executors/mpipool.py index 3d9a5085..11116c86 100644 --- a/pympipool/parallel_executors/mpipool.py +++ b/pympipool/parallel_executors/mpipool.py @@ -29,12 +29,14 @@ def main(): future_dict = {} argument_dict = parse_arguments(argument_lst=sys.argv) + # required for flux interface - otherwise the current path is not included in the python path cwd = abspath(".") if cwd not in sys.path: sys.path.insert(1, cwd) with MPIPoolExecutor( - max_workers=int(argument_dict["total_cores"]), path=sys.path + max_workers=int(argument_dict["total_cores"]), + path=sys.path, # required for flux interface - otherwise the current path is not included in the python path ) as executor: if executor is not None: context, socket = connect_to_socket_interface(