Skip to content

Commit 2b31f2e

Browse files
authored
Merge pull request #123 from pyiron/env_fix
Always include the current path in the PYTHONPATH if it is not already
2 parents 1b783d3 + b1e0ce9 commit 2b31f2e

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

pympipool/parallel_executors/mpiexec.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from os.path import abspath
12
import pickle
23
import sys
34

@@ -33,6 +34,11 @@ def main():
3334
socket = None
3435

3536
memory = None
37+
38+
cwd = abspath(".")
39+
if cwd not in sys.path:
40+
sys.path.insert(1, cwd)
41+
3642
while True:
3743
# Read from socket
3844
if mpi_rank_zero:

pympipool/parallel_executors/mpipool.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from os.path import abspath
12
import pickle
23
import sys
34

@@ -27,6 +28,11 @@ def main():
2728

2829
future_dict = {}
2930
argument_dict = parse_arguments(argument_lst=sys.argv)
31+
32+
cwd = abspath(".")
33+
if cwd not in sys.path:
34+
sys.path.insert(1, cwd)
35+
3036
with MPIPoolExecutor(int(argument_dict["total_cores"])) as executor:
3137
if executor is not None:
3238
context, socket = connect_to_socket_interface(

0 commit comments

Comments
 (0)