Hello everyone,
I’m using LAMMPS version 17 Apr 2024 on a linux machine with Python 3.12.3. I’m writing a script that takes ranges from a user and initiates simulations with random values - this is what I intend to pass to the LAMMPS object.
I’m a beginner to MPI programming, so I’m looking for a general direction here to get started with my search.
I have a python script that splits MPI.Comm into individual communicators for each MPI process I have, with one instance of LAMMPS initialised for every slave process.
rank = MPI.COMM_WORLD.Get_rank()
comm = MPI.COMM_WORLD
status=MPI.Status()
if rank == 0 : color = MPI.UNDEFINED
else: color = rank
print(f"Colour of process {rank} is {color}")
com_split = comm.Split(color, key=rank)
With a call to the LAMMPS function done on slave ranks as
obj_recv = comm.recv(source = 0, tag=MPI.ANY_TAG, status=status)
return_values = Child_init(position=obj_recv[1], file_path=obj_recv[2], comm = com_split, kwargs=discrete_dict)
I have a fundamental question on splitting communicators and passing information to individual groups.
I would like to group the slave processes and pass them to LAMMPS so that I can run each simulation on multiple processes (let’s say 4). I have no troubling passing the groups to LAMMPS as a communicator and getting it to initialise. (In this case I’m communicating the information as detailed above, only to ‘process 0’ in each group). However, when the initiated LAMMPS instance tries to read a file, it freezes.
My question is, how would I have to go about setting up the communicator to pass this information to the LAMMPS instances. Should I create groups and create multiple intercommunicator to pass the object to each group? Where can I find guidance on dealing with MPI communicators?
Thank you