From 261cec4593019402f4ec57be2a8b2fbeaae35814 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 9 May 2024 00:21:28 -0500 Subject: [PATCH 1/8] Update concurrent.py --- pylammpsmpi/wrapper/concurrent.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pylammpsmpi/wrapper/concurrent.py b/pylammpsmpi/wrapper/concurrent.py index bc5f70e..e93ccf4 100644 --- a/pylammpsmpi/wrapper/concurrent.py +++ b/pylammpsmpi/wrapper/concurrent.py @@ -11,6 +11,7 @@ interface_bootup, cancel_items_in_queue, MpiExecInterface, + SrunInterface, ) @@ -32,6 +33,7 @@ def execute_async( cores=1, oversubscribe=False, cwd=None, + use_srun=False, ): executable = os.path.join( os.path.dirname(os.path.abspath(__file__)), "..", "mpi", "lmpmpi.py" @@ -39,13 +41,21 @@ def execute_async( cmds = [sys.executable, executable] if cmdargs is not None: cmds.extend(cmdargs) - interface = interface_bootup( - command_lst=cmds, - connections=MpiExecInterface( + if use_srun: + connection_interface = SrunInterface( cwd=cwd, cores=cores, oversubscribe=oversubscribe, - ), + ) + else: + connection_interface = MpiExecInterface( + cwd=cwd, + cores=cores, + oversubscribe=oversubscribe, + ) + interface = interface_bootup( + command_lst=cmds, + connections=connection_interface), ) while True: task_dict = future_queue.get() @@ -65,6 +75,7 @@ def __init__( oversubscribe=False, working_directory=".", cmdargs=None, + use_srun=False, ): self.cores = cores self.working_directory = working_directory @@ -72,6 +83,7 @@ def __init__( self._process = None self._oversubscribe = oversubscribe self._cmdargs = cmdargs + self._use_srun = use_srun self._start_process() def _start_process(self): @@ -83,6 +95,7 @@ def _start_process(self): "cores": self.cores, "oversubscribe": self._oversubscribe, "cwd": self.working_directory, + "use_srun": self._use_srun, }, ) self._process.start() From fced60787c5006e1a46b521764d7909470c0d171 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 9 May 2024 00:22:32 -0500 Subject: [PATCH 2/8] Update ase.py --- pylammpsmpi/wrapper/ase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pylammpsmpi/wrapper/ase.py b/pylammpsmpi/wrapper/ase.py index 4bfa68b..9cdf9d9 100644 --- a/pylammpsmpi/wrapper/ase.py +++ b/pylammpsmpi/wrapper/ase.py @@ -22,6 +22,7 @@ def __init__( log_file=None, library=None, diable_log_file=True, + use_srun=False, ): self._logger = logger self._prism = None @@ -45,7 +46,7 @@ def __init__( ) else: self._interactive_library = LammpsBase( - cores=self._cores, working_directory=working_directory + cores=self._cores, working_directory=working_directory, use_srun=use_srun, ) def interactive_lib_command(self, command): From 6cf81d52b28144f63b0bb1c7910eaebbc45ce685 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 9 May 2024 00:23:08 -0500 Subject: [PATCH 3/8] Update extended.py --- pylammpsmpi/wrapper/extended.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pylammpsmpi/wrapper/extended.py b/pylammpsmpi/wrapper/extended.py index d9d5723..29a776d 100644 --- a/pylammpsmpi/wrapper/extended.py +++ b/pylammpsmpi/wrapper/extended.py @@ -248,6 +248,7 @@ def __init__( client=None, mode="local", cmdargs=None, + use_srun=False, ): self.cores = cores self.working_directory = working_directory @@ -259,6 +260,7 @@ def __init__( oversubscribe=self.oversubscribe, working_directory=self.working_directory, cmdargs=cmdargs, + use_srun=use_srun, ) def __getattr__(self, name): From 660df860ab4c1ae62098f95c7dc3a6825a08b5a8 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 9 May 2024 00:29:11 -0500 Subject: [PATCH 4/8] Update pylammpsmpi/wrapper/concurrent.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pylammpsmpi/wrapper/concurrent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pylammpsmpi/wrapper/concurrent.py b/pylammpsmpi/wrapper/concurrent.py index e93ccf4..e4bff12 100644 --- a/pylammpsmpi/wrapper/concurrent.py +++ b/pylammpsmpi/wrapper/concurrent.py @@ -56,6 +56,7 @@ def execute_async( interface = interface_bootup( command_lst=cmds, connections=connection_interface), + connections=connection_interface, ) while True: task_dict = future_queue.get() From 408ede16bb5df91969a7afdbddbbbac29273deea Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 9 May 2024 00:37:57 -0500 Subject: [PATCH 5/8] Update concurrent.py --- pylammpsmpi/wrapper/concurrent.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pylammpsmpi/wrapper/concurrent.py b/pylammpsmpi/wrapper/concurrent.py index e4bff12..2b5421e 100644 --- a/pylammpsmpi/wrapper/concurrent.py +++ b/pylammpsmpi/wrapper/concurrent.py @@ -55,7 +55,6 @@ def execute_async( ) interface = interface_bootup( command_lst=cmds, - connections=connection_interface), connections=connection_interface, ) while True: From cb1c7b4ff197649a5af9b0a959e9b2c3797e6fa8 Mon Sep 17 00:00:00 2001 From: pyiron-runner Date: Thu, 9 May 2024 05:38:52 +0000 Subject: [PATCH 6/8] Format black --- pylammpsmpi/wrapper/ase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylammpsmpi/wrapper/ase.py b/pylammpsmpi/wrapper/ase.py index 9cdf9d9..cee4e16 100644 --- a/pylammpsmpi/wrapper/ase.py +++ b/pylammpsmpi/wrapper/ase.py @@ -46,7 +46,9 @@ def __init__( ) else: self._interactive_library = LammpsBase( - cores=self._cores, working_directory=working_directory, use_srun=use_srun, + cores=self._cores, + working_directory=working_directory, + use_srun=use_srun, ) def interactive_lib_command(self, command): From 5c2b6fdd4bbab790f0e50cf900f74e947cad2ea6 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 11 May 2024 18:48:47 -0500 Subject: [PATCH 7/8] Update environment-old.yml --- .ci_support/environment-old.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci_support/environment-old.yml b/.ci_support/environment-old.yml index 60a88a1..47b6745 100644 --- a/.ci_support/environment-old.yml +++ b/.ci_support/environment-old.yml @@ -5,6 +5,6 @@ dependencies: - openmpi - numpy =1.23.5 - mpi4py =3.1.4 -- pympipool =0.7.0 +- pympipool =0.7.2 - ase =3.20.1 - scipy =1.9.3 From efa6c4e7f048578c1514d9e5ca207529b9029e34 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 11 May 2024 18:51:42 -0500 Subject: [PATCH 8/8] Update environment-old.yml --- .ci_support/environment-old.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci_support/environment-old.yml b/.ci_support/environment-old.yml index 47b6745..8c07315 100644 --- a/.ci_support/environment-old.yml +++ b/.ci_support/environment-old.yml @@ -4,7 +4,7 @@ dependencies: - lammps =2022.06.23 - openmpi - numpy =1.23.5 -- mpi4py =3.1.4 +- mpi4py =3.1.5 - pympipool =0.7.2 - ase =3.20.1 - scipy =1.9.3