Question about multiple runtimes on MPI for MCNP6

  • Thread starter Thread starter Alexander Camargo
  • Start date Start date
  • Tags Tags
    Nodes Simulation
Click For Summary
SUMMARY

The discussion centers on the behavior of MCNP6 when run in MPI mode using the command srun -N 3 mpirun -np 48 mcnp6.mpich i=input. Users reported generating multiple runtpe files and outputs corresponding to the number of nodes utilized, which is confirmed as normal behavior for MCNP6 in MPI mode. The conversation highlights the distinction between using srun and mpirun, with suggestions that srun may replace mpirun in a SLURM environment. Understanding the configuration of MPI and SLURM is essential for optimizing simulation performance and managing output files effectively.

PREREQUISITES
  • Familiarity with MCNP6 and its MPI version
  • Understanding of SLURM as a cluster system scheduler
  • Knowledge of MPI commands and their usage
  • Basic concepts of parallel computing and node utilization
NEXT STEPS
  • Research the differences between srun and mpirun commands in SLURM environments
  • Learn about configuring MCNP6 for optimal performance in MPI mode
  • Explore the implications of multiple runtpe files in MCNP6 simulations
  • Study parallel computing principles to enhance understanding of node and CPU management
USEFUL FOR

This discussion is beneficial for computational physicists, simulation engineers, and researchers using MCNP6 for Monte Carlo simulations, particularly those working in parallel computing environments with SLURM and MPI.

Alexander Camargo
Messages
37
Reaction score
10
When I increase the number of nodes in the simulation (e.g., -N 3), the number of runtpe files and outputs generated equals the number of nodes; in this case, three runtpe files and three outputs appear. Each output has a different simulation time, and sometimes even different results. Is this normal when running MCNP in MPI mode? The command I'm using is:

srun -N 3 mpirun -np 48 mcnp6.mpich i=input
 
Engineering news on Phys.org
what you’re experiencing is normal behavior for MCNP running in MPI mode, but understanding the reasons behind the variations can help you manage and interpret the outputs more effectively
 
pete94857 said:
what you’re experiencing is normal behavior for MCNP running in MPI mode, but understanding the reasons behind the variations can help you manage and interpret the outputs more effectively
Hi Pete94857.

Thank you for the help. I've seen some MPI script examples similar to mine, but they didn't generate this many runtpe files. I thought I might be doing something wrong or missing a command.
 
  • Like
Likes   Reactions: pete94857
@pete94857, careful with that and have a read of the rules.
[Mentor Note: The post by Pete that Alex is referring to has been deleted]

@Alexander Camargo, are you sure you need srun AND mpirun in the command? I don't know if it will make a difference but I think srun may just replace mpirun. What is srun, is it slurm and if so what is slurm?
 
Last edited by a moderator:
  • Like
Likes   Reactions: berkeman
Alex A said:
@pete94857, careful with that and have a read of the rules.

@Alexander Camargo, are you sure you need srun AND mpirun in the command? I don't know if it will make a difference but I think srun may just replace mpirun. What is srun, is it slurm and if so what is slurm?
The srun is the cluster system scheduler, used to configure the number of nodes and CPUs to be used. The MCNP manual states that the command to use multiple CPUs is 'mpirun -np X', where X is the number of CPUs, followed by mcnp6.mpi (MCNP6 compiled for MPI) and input/output file parameters. I have 3 nodes, each with 16 CPUs.

It's working; I can utilize nodes and CPUs. However, it always creates a separate simulation for each node used. If I use only 1 node, it runs faster than using 3 (since processing is divided when using 3), generating 3 runtpe and 3 output files.

My question is: is this normal behavior for MCNP6 MPI version or do I need to configure something better?
 
I've never tried to make MPI work before so this is a bit of a guess. If you are getting multiple output files, that seems unhelpful. OMP generates multiple threads in a shared memory system, MPI runs a separate copy of the whole program and problem in each node.

I have read that srun replaces the mpirun command in a slurm system so I wonder if by feeding srun with an MPI split, but still running mpirun without MPI (srun -N 3 mpirun -np 48) into mcnp that also isn't being told to use MPI, creates 3 separate MCNP instances that don't know about the others.

I don't really know what a slurm system is or that you are using one. I'm drawing from this document. The example command for OMP+MPI is,
Code:
srun –n X mcnp6.mpi i=athena1_hex.txt tasks 36
That is for one MPI manager and X-1 MPI worker nodes with 36 threads per worker node. X must be 3 or more.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
1K
  • · Replies 20 ·
Replies
20
Views
19K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
17
Views
5K
Replies
1
Views
4K