Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

Problems running a Fortran code using an Intel compiler

hemanth_mandanna
Beginner
605 Views
Hi,

call mpi_allreduce(dtm ,dt ,1,MPI_REAL8,MPI_MIN, MPI_COMM_WORLD,ierr)

The above global reduction gives me a wrong value of dt even though each processor bears a correct value of dtm.

The variable dt in which the output of the global reduction is stored is defined in a common block in a .txt fileand "Include"ed in the routine which has the above lines of the code.

If I change the code to store the output in a local variable dt1(defined inthe routine itself) MPI_ALL_reduce gives me the correct value. Is there anyparticular reason you can think of for this behavior? I have no such problem while using a Mipspro(f90) compiler, its only while using ifc that things are messed up.

Hemanth

0 Kudos
2 Replies
TimP
Honored Contributor III
605 Views
If I understand you correctly, you have the same variable in the argument list and in COMMON in the calling subroutine. I believe this produces undefined behavior.
0 Kudos
hemanth_mandanna
Beginner
605 Views
Hi,
The only argument I am passing is the rank of the processor. I have defined and "Included" a.txt file in the called and calling subroutines which has all the variable definitions and the common blocks.
0 Kudos
Reply