[Darshan-commits] [Git][darshan/darshan][dev-no-mpi] 2 commits: updated generated configure script

Philip Carns xgitlab at cels.anl.gov
Tue Jul 30 11:12:10 CDT 2019



Philip Carns pushed to branch dev-no-mpi at darshan / darshan


Commits:
ea5ed00a by Phil Carns at 2019-07-30T16:05:34Z
updated generated configure script

- - - - -
c866a0af by Phil Carns at 2019-07-30T16:05:53Z
add darshan_core_wtime_absolute() helper

- works for both mpi and non-mpi builds
- unlike darshan_core_time(), it does not compute relative timestamp and
  thus doesn't require darshan core to be initialized

- - - - -


3 changed files:

- darshan-runtime/configure
- darshan-runtime/darshan-runtime-config.h.in
- darshan-runtime/lib/darshan-core.c


Changes:

=====================================
darshan-runtime/configure
=====================================
@@ -623,6 +623,15 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 DARSHAN_MDHIM_LD_OPTS
 BUILD_MDHIM_MODULE
+BUILD_DXT_MODULE
+DARSHAN_STDIO_LD_OPTS
+BUILD_STDIO_MODULE
+DARSHAN_PNETCDF_LD_OPTS
+BUILD_PNETCDF_MODULE
+DARSHAN_MPIIO_LD_OPTS
+BUILD_MPIIO_MODULE
+DARSHAN_POSIX_LD_OPTS
+BUILD_POSIX_MODULE
 DARSHAN_HDF5_LD_OPTS
 BUILD_HDF5_MODULE
 DARSHAN_USE_LUSTRE
@@ -690,10 +699,16 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_mpi
 with_zlib
 enable_ld_preload
 enable_cuserid
 enable_group_readable_logs
+enable_posix_mod
+enable_mpiio_mod
+enable_stdio_mod
+enable_pnetcdf_mod
+enable_dxt_mod
 enable_bgq_mod
 enable_lustre_mod
 enable_mmap_logs
@@ -1340,6 +1355,13 @@ Optional Features:
   --disable-cuserid       Disables attempted use of cuserid() at run time
   --enable-group-readable-logs
                           Set log files to be group readable
+  --disable-posix-mod     Disables compilation and use of POSIX module
+  --disable-mpiio-mod     Disables compilation and use of MPI-IO module
+                          (requires MPI)
+  --disable-stdio-mod     Disables compilation and use of STDIO module
+  --disable-pnetcdf-mod   Disables compilation and use of PnetCDF module
+                          (requires MPI)
+  --disable-dxt-mod       Disables compilation and use of DXT module
   --disable-bgq-mod       Disables compilation and use of BG/Q module (for BG/Q systems)
   --disable-lustre-mod    Disables compilation and use of the Lustre module
   --enable-mmap-logs      Enables ability to mmap I/O data to log file
@@ -1352,6 +1374,7 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --without-mpi           Build without support for MPI
   --with-zlib=DIR root directory path of zlib installation defaults to
                     /usr/local or /usr if not found in /usr/local
   --without-zlib to disable zlib usage completely
@@ -2173,6 +2196,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
+
 ac_config_headers="$ac_config_headers darshan-runtime-config.h"
 
 
@@ -2270,8 +2294,22 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the mpicc compiler works" >&5
-$as_echo_n "checking whether the mpicc compiler works... " >&6; }
+ENABLE_MPI=1
+
+# Check whether --with-mpi was given.
+if test "${with_mpi+set}" = set; then :
+  withval=$with_mpi;
+fi
+
+if test "x$with_mpi" = "xno"; then :
+  ENABLE_MPI=
+else
+
+$as_echo "#define HAVE_MPI /**/" >>confdefs.h
+
+fi
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3062,7 +3100,10 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "x$ENABLE_MPI" = "x1"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the mpicc compiler works" >&5
+$as_echo_n "checking whether the mpicc compiler works... " >&6; }
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <mpi.h>
 int
@@ -3079,10 +3120,13 @@ $as_echo "yes" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-    as_fn_error $? "CC doesn't appear to be a valid MPI compiler.  See INSTALL document or try adding CC=mpicc to your configure command line." "$LINENO" 5
-
+                      as_fn_error $? "CC doesn't appear to be a valid MPI compiler.  See INSTALL document or try adding CC=mpicc to your configure command line." "$LINENO" 5
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: not checking whether the mpicc compiler works" >&5
+$as_echo "$as_me: not checking whether the mpicc compiler works" >&6;}
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -3593,6 +3637,72 @@ fi
 fi
 
 
+#
+# Check for specific module enable/disable options
+#
+# POSIX module
+BUILD_POSIX_MODULE=1
+DARSHAN_POSIX_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-posix-ld-opts"
+# Check whether --enable-posix-mod was given.
+if test "${enable_posix_mod+set}" = set; then :
+  enableval=$enable_posix_mod;
+fi
+
+if test "x$enable_posix_mod" = "xno"; then :
+  BUILD_POSIX_MODULE=
+      DARSHAN_POSIX_LD_OPTS=
+fi
+
+# MPI-IO module
+BUILD_MPIIO_MODULE=1
+DARSHAN_MPIIO_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-mpiio-ld-opts"
+# Check whether --enable-mpiio-mod was given.
+if test "${enable_mpiio_mod+set}" = set; then :
+  enableval=$enable_mpiio_mod;
+fi
+
+if test "x$enable_mpiio_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
+  BUILD_MPIIO_MODULE=
+      DARSHAN_MPIIO_LD_OPTS=
+fi
+
+# STDIO module
+BUILD_STDIO_MODULE=1
+DARSHAN_STDIO_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-stdio-ld-opts"
+# Check whether --enable-stdio-mod was given.
+if test "${enable_stdio_mod+set}" = set; then :
+  enableval=$enable_stdio_mod;
+fi
+
+if test "x$enable_stdio_mod" = "xno"; then :
+  BUILD_STDIO_MODULE=
+      DARSHAN_STDIO_LD_OPTS=
+fi
+
+# PNETCDF module
+BUILD_PNETCDF_MODULE=1
+DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
+# Check whether --enable-pnetcdf-mod was given.
+if test "${enable_pnetcdf_mod+set}" = set; then :
+  enableval=$enable_pnetcdf_mod;
+fi
+
+if test "x$enable_pnetcdf_mod" = "xno"; then :
+  BUILD_PNETCDF_MODULE=
+      DARSHAN_PNETCDF_LD_OPTS=
+fi
+
+# DXT module
+BUILD_DXT_MODULE=1
+# Check whether --enable-dxt-mod was given.
+if test "${enable_dxt_mod+set}" = set; then :
+  enableval=$enable_dxt_mod;
+fi
+
+if test "x$enable_dxt_mod" = "xno"; then :
+  BUILD_DXT_MODULE=
+fi
+
 # Check whether --enable-bgq-mod was given.
 if test "${enable_bgq_mod+set}" = set; then :
   enableval=$enable_bgq_mod;
@@ -4266,6 +4376,12 @@ done
 
 fi
 
+#
+# Begin tests for MPI-enabled builds
+#
+
+if test "x$ENABLE_MPI" = "x1"; then :
+
 
 # determine if the MPI library includes MPI-IO functions or not
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI-IO support in MPI" >&5
@@ -4282,8 +4398,7 @@ main ()
     int amode;
     MPI_Info info;
     MPI_File fh;
-    MPI_File_open(comm, filename, amode, info, &fh);
-
+            MPI_File_open(comm, filename, amode, info, &fh);
   ;
   return 0;
 }
@@ -4293,7 +4408,6 @@ if ac_fn_c_try_link "$LINENO"; then :
 $as_echo "yes" >&6; }
 else
   as_fn_error $? "Darshan requires a version of MPI with MPI-IO support" "$LINENO" 5
-
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -4432,6 +4546,12 @@ else
   MPICH_LIB_OLD=0
 fi
 
+
+fi
+#
+# End of MPI-only checks
+#
+
 DARSHAN_VERSION="3.1.7"
 
 
@@ -4444,6 +4564,15 @@ DARSHAN_VERSION="3.1.7"
 
 
 
+
+
+
+
+
+
+
+
+
 
 
 
@@ -5744,3 +5873,75 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Building Darshan with the following features:" >&5
+$as_echo "$as_me: Building Darshan with the following features:" >&6;}
+if test "x$BUILD_POSIX_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: POSIX module support:   no" >&5
+$as_echo "$as_me: POSIX module support:   no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: POSIX module support:   yes" >&5
+$as_echo "$as_me: POSIX module support:   yes" >&6;}
+fi
+if test "x$BUILD_MPIIO_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: MPIIO module support:   no" >&5
+$as_echo "$as_me: MPIIO module support:   no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: MPIIO module support:   yes" >&5
+$as_echo "$as_me: MPIIO module support:   yes" >&6;}
+fi
+if test "x$BUILD_STDIO_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: STDIO module support:   no" >&5
+$as_echo "$as_me: STDIO module support:   no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: STDIO module support:   yes" >&5
+$as_echo "$as_me: STDIO module support:   yes" >&6;}
+fi
+if test "x$BUILD_PNETCDF_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: no" >&5
+$as_echo "$as_me: PnetCDF module support: no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: yes" >&5
+$as_echo "$as_me: PnetCDF module support: yes" >&6;}
+fi
+if test "x$BUILD_HDF5_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    no" >&5
+$as_echo "$as_me: HDF5 module support:    no" >&6;}
+elif if test "x$BUILD_HDF5_PRE110" = "x1"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    1.10+" >&5
+$as_echo "$as_me: HDF5 module support:    1.10+" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    pre-1.10" >&5
+$as_echo "$as_me: HDF5 module support:    pre-1.10" >&6;}
+
+fi; then :
+
+fi
+if test "x$BUILD_DXT_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: DXT module support:     no" >&5
+$as_echo "$as_me: DXT module support:     no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: DXT module support:     yes" >&5
+$as_echo "$as_me: DXT module support:     yes" >&6;}
+fi
+if test "x$DARSHAN_USE_MDHIM" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: MDHIM module support:   no" >&5
+$as_echo "$as_me: MDHIM module support:   no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: MDHIM module support:   yes" >&5
+$as_echo "$as_me: MDHIM module support:   yes" >&6;}
+fi
+if test "x$DARSHAN_USE_LUSTRE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Lustre module support:  no" >&5
+$as_echo "$as_me: Lustre module support:  no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Lustre module support:  yes" >&5
+$as_echo "$as_me: Lustre module support:  yes" >&6;}
+fi
+if test "x$DARSHAN_USE_BGQ" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: BG/Q module support:    no" >&5
+$as_echo "$as_me: BG/Q module support:    no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: BG/Q module support:    yes" >&5
+$as_echo "$as_me: BG/Q module support:    yes" >&6;}
+fi


=====================================
darshan-runtime/darshan-runtime-config.h.in
=====================================
@@ -21,6 +21,9 @@
 /* Define to 1 if you have the <mntent.h> header file. */
 #undef HAVE_MNTENT_H
 
+/* Define if build is MPI-enabled */
+#undef HAVE_MPI
+
 /* Define if MPI-IO prototypes use const qualifier */
 #undef HAVE_MPIIO_CONST
 


=====================================
darshan-runtime/lib/darshan-core.c
=====================================
@@ -149,6 +149,7 @@ static int darshan_deflate_buffer(
     int *comp_buf_length);
 static void darshan_core_cleanup(
     struct darshan_core_runtime* core);
+static double darshan_core_wtime_absolute(void);
 
 #define DARSHAN_CORE_LOCK() pthread_mutex_lock(&darshan_core_mutex)
 #define DARSHAN_CORE_UNLOCK() pthread_mutex_unlock(&darshan_core_mutex)
@@ -284,7 +285,10 @@ void darshan_core_initialize(int argc, char **argv)
         if(init_core)
         {
             memset(init_core, 0, sizeof(*init_core));
-            init_core->wtime_offset = PMPI_Wtime();
+            /* record absolute start time at startup so that we can later
+             * generate relative times with this as a reference point.
+             */
+            init_core->wtime_offset = darshan_core_wtime_absolute();
 
         /* TODO: do we alloc new memory as we go or just do everything up front? */
 
@@ -718,7 +722,7 @@ static void *darshan_init_mmap_log(struct darshan_core_runtime* core, int jobid)
      */
     if(my_rank == 0)
     {
-        hlevel=PMPI_Wtime() * 1000000;
+        hlevel = darshan_core_wtime_absolute() * 1000000;
         (void)gethostname(hname, sizeof(hname));
         logmod = darshan_hash((void*)hname,strlen(hname),hlevel);
     }
@@ -1834,7 +1838,7 @@ void darshan_log_finalize(char *logfile_name, double start_log_time)
         if(new_logfile_name)
         {
             new_logfile_name[0] = '\0';
-            end_log_time = PMPI_Wtime();
+            end_log_time = darshan_core_wtime_absolute();
             strcat(new_logfile_name, logfile_name);
             tmp_index = strstr(new_logfile_name, ".darshan_partial");
             sprintf(tmp_index, "_%d.darshan", (int)(end_log_time-start_log_time+1));
@@ -2242,26 +2246,37 @@ void darshan_instrument_fs_data(int fs_type, const char *path, int fd)
     return;
 }
 
+/* retrieve the wtime relative to execution start time */
 double darshan_core_wtime()
 {
+    double wtime_offset;
+
     DARSHAN_CORE_LOCK();
     if(!darshan_core)
     {
         DARSHAN_CORE_UNLOCK();
         return(0);
     }
+    else
+    {
+        wtime_offset = darshan_core->wtime_offset;
+    }
     DARSHAN_CORE_UNLOCK();
 
+    return(darshan_core_wtime_absolute() - wtime_offset);
+}
+
+/* retrieve absolute wtime */
+static double darshan_core_wtime_absolute(void)
+{
 #ifdef HAVE_MPI
     if(using_mpi)
-        return(PMPI_Wtime() - darshan_core->wtime_offset);
-#endif
-
+        return(PMPI_Wtime());
+#else
     struct timeval tval;
-    double secs;
     gettimeofday(&tval, NULL);
-    secs = tval.tv_sec + (tval.tv_usec / 1000000.0);
-    return(secs - darshan_core->wtime_offset);
+    return(tval.tv_sec + (tval.tv_usec / 1000000.0));
+#endif
 }
 
 #ifdef DARSHAN_PRELOAD



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/54bd3e2d470459f616869b062d9853da18f75be8...c866a0af581236c0991845d5f236bf618b0e79e9

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/54bd3e2d470459f616869b062d9853da18f75be8...c866a0af581236c0991845d5f236bf618b0e79e9
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/20190730/c8ce166d/attachment-0001.html>


More information about the Darshan-commits mailing list