- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page