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
2 changes: 2 additions & 0 deletions pylammpsmpi/wrapper/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class LammpsASELibrary:
def __init__(
self,
working_directory: Optional[str] = None,
hostname_localhost: Optional[bool] = None,
cores: int = 1,
comm: Optional[object] = None,
logger: Optional[object] = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
self._interactive_library = LammpsBase(
cores=self._cores,
working_directory=working_directory,
hostname_localhost=hostname_localhost,
executor=executor,
)

Expand Down
2 changes: 2 additions & 0 deletions pylammpsmpi/wrapper/concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(
cores: int = 8,
oversubscribe: bool = False,
working_directory: str = ".",
hostname_localhost: Optional[bool] = None,
cmdargs: list = None,
executor: Optional[BaseExecutor] = None,
):
Expand Down Expand Up @@ -102,6 +103,7 @@ def __init__(
block_allocation=True,
max_workers=1,
init_function=init_function,
hostname_localhost=hostname_localhost,
resource_dict={
"cores": self.cores,
"cwd": self.working_directory,
Expand Down
2 changes: 2 additions & 0 deletions pylammpsmpi/wrapper/extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def __init__(
cores: int = 1,
oversubscribe: bool = False,
working_directory: str = ".",
hostname_localhost: Optional[bool] = None,
client: Any = None,
cmdargs: Optional[list[str]] = None,
executor: Optional[BaseExecutor] = None,
Expand All @@ -269,6 +270,7 @@ def __init__(
cores=self.cores,
oversubscribe=self.oversubscribe,
working_directory=self.working_directory,
hostname_localhost=hostname_localhost,
cmdargs=cmdargs,
executor=executor,
)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_ase_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TestLammpsASELibrary(unittest.TestCase):
def test_static(self):
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand Down Expand Up @@ -83,6 +84,7 @@ def test_static(self):
def test_small_displacement(self):
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand Down Expand Up @@ -128,6 +130,7 @@ def test_small_displacement(self):
def test_velocities(self):
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand Down Expand Up @@ -180,6 +183,7 @@ def test_velocities(self):
def test_small_displacement_skewed(self):
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand Down Expand Up @@ -226,6 +230,7 @@ def test_static_with_statement(self):
structure = bulk("Al").repeat([2, 2, 2])
with LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=2,
comm=None,
logger=None,
Expand Down Expand Up @@ -508,6 +513,7 @@ def test_individual_calculation(self):
for structure in self.structure_lst:
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand All @@ -533,6 +539,7 @@ def test_interactive_calculation(self):
energy_lst = []
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand All @@ -559,6 +566,7 @@ def test_interactive_calculation_inverse(self):
energy_lst = []
lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=None,
logger=logging.getLogger("TestStaticLogger"),
Expand Down
2 changes: 2 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def setUpClass(cls):
cores=1,
oversubscribe=False,
working_directory=".",
hostname_localhost=True,
cmdargs=["-cite", cls.citation_file],
)
cls.lmp.file(cls.lammps_file)
Expand All @@ -32,6 +33,7 @@ def test_file_not_found(self):
cores=1,
oversubscribe=False,
working_directory=".",
hostname_localhost=True,
cmdargs=["-cite", self.citation_file],
)
with self.assertRaises(FileNotFoundError):
Expand Down
1 change: 1 addition & 0 deletions tests/test_concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def setUpClass(cls):
cores=1,
oversubscribe=False,
working_directory=".",
hostname_localhost=True,
cmdargs=["-cite", cls.citation_file],
)
cls.lmp.file(cls.lammps_file).result()
Expand Down
1 change: 1 addition & 0 deletions tests/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def calc_lmp(structure):

lmp = LammpsASELibrary(
working_directory=None,
hostname_localhost=True,
cores=1,
comm=MPI.COMM_SELF,
logger=None,
Expand Down
5 changes: 4 additions & 1 deletion tests/test_pylammpsmpi_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def setUpClass(cls):
cls.execution_path = os.path.dirname(os.path.abspath(__file__))
cls.citation_file = os.path.join(cls.execution_path, "citations.txt")
cls.lammps_file = os.path.join(cls.execution_path, "in.simple")
cls.lmp = LammpsLibrary(cores=2, cmdargs=["-cite", cls.citation_file])
cls.lmp = LammpsLibrary(
cores=2, cmdargs=["-cite", cls.citation_file], hostname_localhost=True
)
cls.lmp.file(cls.lammps_file)

@classmethod
Expand Down Expand Up @@ -116,6 +118,7 @@ def test_version(self):
lammps_file = os.path.join(execution_path, "in.simple")
with SingleNodeExecutor(
block_allocation=True,
hostname_localhost=True,
max_workers=1,
init_function=init_function,
resource_dict={
Expand Down
Loading