How do I set the -np and OMP_NUM_THREADS values for MPI?

Asked 2 years ago, Updated 2 years ago, 93 views

How do I set the -np and OMP_NUM_THREADS values for MPI?
Does the value depend on the PC?

fortran mpi

2022-09-30 21:34

1 Answers

The maximum number of parallels is determined for each PC.

The easiest way to find out how many parallels you can have on that PC is

Linux

$top

Press 1 as it is

Enter a description of the image here

In this case, 8 parallels are possible.

Windows

Right-click > Task Manager > Performance Tab > CPU Tab > Right-click > Modify Graph > Logical Processor

in the taskbar

Enter a description of the image here

In this case, 8 parallels are possible.

If the execution binary of a properly written Fortran program in MPI is a.out and the number of parallels is 8,

mpirun-np8./a.out

will be

In addition, OMP_NUM_THREADS is an environment variable for the number of parallels when using OpenMP.It's similar to MPI, so first of all, if you look at whether you're trying to run an MPI or OpenMP program, you'll get a quick resolution.


2022-09-30 21:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.