MPAS-Dev / MPAS

Repository for private MPAS development prior to the MPAS v6.0 release.
Other
4 stars 0 forks source link

stream manager needs 'use mpi' #1489

Closed mark-petersen closed 6 years ago

mark-petersen commented 6 years ago

The code has a bug in mpas_stream_manager.F, wherein compiling with USE_PIO2=true gives an error that MPI_COMM_SELF is not defined. We had to add the ‘use mpi’ statement to get it to compile.

mark-petersen commented 6 years ago

Here is the diff that fixed it. Thanks to @harinitya for the details. I don't have time to fix today, will need to go on my to-do list.

diff --git a/src/framework/mpas_stream_manager.F b/src/framework/mpas_stream_manager.F
index cc96e77..292dc4d 100644
--- a/src/framework/mpas_stream_manager.F
+++ b/src/framework/mpas_stream_manager.F
@@ -1,5 +1,12 @@
 module mpas_stream_manager

+!Added by Nitya - it gave an error of MPI_COMM_SELF not found without it
+#ifdef _MPI
+#ifndef NOMPIMOD
+   use mpi
+#endif
+#endif
+
 #define COMMA ,
 #define STREAM_DEBUG_WRITE(M) ! call mpas_log_write(M)
 #define STREAM_WARNING_WRITE(M) call mpas_log_write( M , messageType=MPAS_LOG_WARN)
mgduda commented 6 years ago

It looks like the only routine in mpas_stream_manager.F that references MPI_COMM_SELF is MPAS_stream_mgr_block_write, where we had added this line:

        use mpas_dmpar, only : MPI_COMM_SELF

To ensure that the mpas_dmpar module would always have MPI_COMM_SELF defined, we have these lines:

#ifdef _MPI
   public :: MPI_COMM_SELF
#else
   integer, parameter, public :: MPI_COMM_SELF = 0
#endif

Which branch or version of the code is @harinitya working with?

harinitya commented 6 years ago

Hi,

I am working with git hash gb5b733a, MPAS v5.1, so I guess it’s pretty old?

Thanks

Nitya

mark-petersen commented 6 years ago

@harinitya I can't find this hash using git log. Can you try: git log --graph --oneline -n 8 and show us the output?

mgduda commented 6 years ago

@harinitya The changes that I mentioned were introduced in MPAS v5.2, so that may explain why you're seeing issues with MPI_COMM_SELF in your branch.

harinitya commented 6 years ago

@mark-petersen - Sorry the git hash is b5b733a. Here's the output


@mgduda - Thanks, that explains it.

mgduda commented 6 years ago

@mark-petersen and @harinitya Since this issue no longer exists in the current develop branch, shall we close this issue?

harinitya commented 6 years ago

@mgduda - Yes please thanks.