Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pylammpsmpi/mpi/lmpmpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ def _run_lammps_mpi(argument_lst):
context = zmq.Context()
socket = context.socket(zmq.PAIR)
port_selected = argument_lst[argument_lst.index("--zmqport") + 1]
socket.connect("tcp://localhost:" + port_selected)
if "--host" in argument_lst:
host = argument_lst[argument_lst.index("--host") + 1]
else:
host = "localhost"
socket.connect("tcp://" + host + ":" + port_selected)
else:
context, socket = None, None
# Lammps executable
Expand Down
6 changes: 6 additions & 0 deletions pylammpsmpi/utils/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Distributed under the terms of "New BSD License", see the LICENSE file.

import os
import socket
from pympipool import SocketInterface


Expand Down Expand Up @@ -39,6 +40,11 @@ def _initialize_socket(
"--zmqport",
str(port_selected),
]
if enable_flux_backend:
cmds += [
"--host",
socket.gethostname(),
]
if cmdargs is not None:
cmds.extend(cmdargs)
interface.bootup(command_lst=cmds, cwd=cwd)
Expand Down