Skip to content

Commit

Permalink
Rename interactive backend scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 30, 2024
1 parent f6bf0ca commit 351a9fa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pympipool/shared/executorbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,20 +417,20 @@ def _get_backend_path(cores: int):
Get command to call backend as a list of two strings
Args:
cores (int): Number of cores used to execute the task, if it is greater than one use mpiexec.py else serial.py
cores (int): Number of cores used to execute the task, if it is greater than one use mpiexec_interactive.py else serial_interactive.py
Returns:
list[str]: List of strings containing the python executable path and the backend script to execute
"""
command_lst = [sys.executable]
if cores > 1 and importlib.util.find_spec("mpi4py") is not None:
command_lst += [_get_command_path(executable="mpiexec.py")]
command_lst += [_get_command_path(executable="mpiexec_interactive.py")]
elif cores > 1:
raise ImportError(
"mpi4py is required for parallel calculations. Please install mpi4py."
)
else:
command_lst += [_get_command_path(executable="serial.py")]
command_lst += [_get_command_path(executable="serial_interactive.py")]
return command_lst


Expand All @@ -439,7 +439,7 @@ def _get_command_path(executable: str):
Get path of the backend executable script
Args:
executable (str): Name of the backend executable script, either mpiexec.py or serial.py
executable (str): Name of the backend executable script, either mpiexec_interactive.py or serial_interactive.py
Returns:
str: absolute path to the executable script
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backend_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import cloudpickle
import zmq

from pympipool.backend.serial import main
from pympipool.backend.serial_interactive import main


def calc(i, j):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_shared_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_interface_mpi(self):
sys.executable,
os.path.abspath(
os.path.join(
__file__, "..", "..", "pympipool", "backend", "mpiexec.py"
__file__, "..", "..", "pympipool", "backend", "mpiexec_interactive.py"
)
),
"--zmqport",
Expand All @@ -62,7 +62,7 @@ def test_interface_serial(self):
sys.executable,
os.path.abspath(
os.path.join(
__file__, "..", "..", "pympipool", "backend", "serial.py"
__file__, "..", "..", "pympipool", "backend", "serial_interactive.py"
)
),
"--zmqport",
Expand Down

0 comments on commit 351a9fa

Please sign in to comment.