Skip to content

Commit

Permalink
fix:fix LAMMPS MPI tests with mpi4py 4.0.0 (deepmodeling#4032)
Browse files Browse the repository at this point in the history
The previous code works with mpi4py<4 but fails with mpi4py 4.0.0. I
don't know what breaking change was made.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Optimized potential energy calculation in the LAMMPS simulation by
restricting evaluation to the master process, reducing unnecessary
computations.

- **Chores**
- Improved control flow for better performance in parallel execution
contexts.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 1e72236)
  • Loading branch information
njzjz committed Nov 15, 2024
1 parent aef3532 commit 0ba7fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/lmp/tests/run_mpi_pair_deepmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
)
lammps.pair_coeff("* *")
lammps.run(0)
pe = lammps.eval("pe")
if rank == 0:
pe = lammps.eval("pe")
arr = [pe]
np.savetxt(output, np.array(arr))
MPI.Finalize()

0 comments on commit 0ba7fed

Please sign in to comment.