[Darshan-commits] [Git][darshan/darshan][master] 2 commits: properly ifdef wrap MPI logic in HDF5 module

Shane Snyder xgitlab at cels.anl.gov
Mon Oct 19 15:06:17 CDT 2020



Shane Snyder pushed to branch master at darshan / darshan


Commits:
560a8324 by Shane Snyder at 2020-10-19T15:03:51-05:00
properly ifdef wrap MPI logic in HDF5 module

Fixes 287

- - - - -
1e11e8f5 by Shane Snyder at 2020-10-19T15:06:15-05:00
Merge branch 'dev-hdf5-mpi-issue287' into 'master'

Fix improper MPI ifdef wrapping in HDF5 module

See merge request darshan/darshan!63
- - - - -


1 changed file:

- darshan-runtime/lib/darshan-hdf5.c


Changes:

=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -168,14 +168,20 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
     char* tmp;
     double tm1, tm2;
     unsigned majnum, minnum, relnum;
+    int tmp_rank = my_rank;
 
     H5get_libversion(&majnum, &minnum, &relnum);
 #ifdef DARSHAN_HDF5_VERS_1_10_PLUS
     if((majnum == 1) && (minnum < 10))
     {
-        if(my_rank < 0)
-            MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-        if(my_rank == 0)
+        if(tmp_rank < 0)
+#ifdef HAVE_MPI
+            MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank);
+#else
+            tmp_rank = 0;
+#endif
+
+        if(tmp_rank == 0)
         {
             darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version (%d.%d) incompatible with Darshan module (1.10+).\n", majnum, minnum);
         }
@@ -184,9 +190,14 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
 #else
     if((majnum > 1) || (minnum >= 10))
     {
-        if(my_rank < 0)
-            MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-        if(my_rank == 0)
+        if(tmp_rank < 0)
+#ifdef HAVE_MPI
+            MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank);
+#else
+            tmp_rank = 0;
+#endif
+
+        if(tmp_rank == 0)
         {
             darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version (%d.%d) incompatible with Darshan module (1.10-).\n", majnum, minnum);
         }
@@ -227,14 +238,20 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
     char* tmp;
     double tm1, tm2;
     unsigned majnum, minnum, relnum;
+    int tmp_rank = my_rank;
 
     H5get_libversion(&majnum, &minnum, &relnum);
 #ifdef DARSHAN_HDF5_VERS_1_10_PLUS
     if((majnum == 1) && (minnum < 10))
     {
-        if(my_rank < 0)
-            MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-        if(my_rank == 0)
+        if(tmp_rank < 0)
+#ifdef HAVE_MPI
+            MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank);
+#else
+            tmp_rank = 0;
+#endif
+
+        if(tmp_rank == 0)
         {
             darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version (%d.%d) incompatible with Darshan module (1.10+).\n", majnum, minnum);
         }
@@ -243,9 +260,14 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
 #else
     if((majnum > 1) || (minnum >= 10))
     {
-        if(my_rank < 0)
-            MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-        if(my_rank == 0)
+        if(tmp_rank < 0)
+#ifdef HAVE_MPI
+            MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank);
+#else
+            tmp_rank = 0;
+#endif
+
+        if(tmp_rank == 0)
         {
             darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version (%d.%d) incompatible with Darshan module (1.10-).\n", majnum, minnum);
         }



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/01f3672e3b08bbbceecbb19be33f56404e15f92c...1e11e8f5ff996aea13720ad9d1288139e883a749

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/01f3672e3b08bbbceecbb19be33f56404e15f92c...1e11e8f5ff996aea13720ad9d1288139e883a749
You're receiving this email because of your account on xgitlab.cels.anl.gov.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20201019/5f413cac/attachment-0001.html>


More information about the Darshan-commits mailing list