[OMPI users] Printing in a fortran MPI/OpenMP environment

2023-01-31 Thread Vahid Askarpour via users
Hi,

I am running a fortran code (Perturbo) compiled in hybrid openmp/openmpi. The 
code runs on 2 nodes (128 processors) with 32 MPI processes and 4 threads/MPI 
process. I am attempting to verify that a variable involved in the calculations 
in all the MPI processes and threads has the same value. So I would like to 
print this variable with the thread #  for all the 32 MPI processes. Would a 
simple print statement do the job or would such a print statement only print 
the information for the processes on the master node and not both nodes? Is it 
possible to print this variable for all 64 threads on node 1 and all 64 threads 
on node 2 separately?

Thank you,
Vahid

Re: [OMPI users] Printing in a fortran MPI/OpenMP environment

2023-01-31 Thread Bernstein, Noam CIV USN NRL (6393) Washington DC (USA) via users
Stdout from every process is gathered by mpirun and shown on in stdout of the 
shell where mpirun started.  There's a command line option for mpirun to label 
lines by the MPI task, "--tag-output" I think.  There's some OpenMP function 
you can use to determine the current OpenMP thread number which you could add 
to the print statement.


Re: [OMPI users] Printing in a fortran MPI/OpenMP environment

2023-01-31 Thread Benson Muite via users
On 2/1/23 00:50, Vahid Askarpour via users wrote:
> Hi,
> 
> I am running a fortran code (Perturbo) compiled in hybrid openmp/openmpi. The 
> code runs on 2 nodes (128 processors) with 32 MPI processes and 4 threads/MPI 
> process. I am attempting to verify that a variable involved in the 
> calculations in all the MPI processes and threads has the same value. So I 
> would like to print this variable with the thread #  for all the 32 MPI 
> processes. Would a simple print statement do the job or would such a print 
> statement only print the information for the processes on the master node and 
> not both nodes? Is it possible to print this variable for all 64 threads on 
> node 1 and all 64 threads on node 2 separately?
> 
> Thank you,
> Vahid
Print statement should work, though maybe messy. You might look at
collective operations like min/max or sum.  Perhaps do a local check
first using OpenMP, then a collective operation using MPI.