[Darshan-commits] [Git][darshan/darshan][master] 2 commits: add darshan-config --log-path option

Shane Snyder xgitlab at cels.anl.gov
Sun Apr 26 21:12:14 CDT 2020



Shane Snyder pushed to branch master at darshan / darshan


Commits:
4a3f37d9 by Philip Carns at 2020-04-26T21:12:10-05:00
add darshan-config --log-path option

closes #244

- - - - -
73972e98 by Shane Snyder at 2020-04-26T21:12:10-05:00
Merge branch 'carns/issue-244-show-log-path' into 'master'

add darshan-config --log-path option

Closes #244

See merge request darshan/darshan!52
- - - - -


5 changed files:

- ChangeLog
- darshan-runtime/configure
- darshan-runtime/configure.in
- darshan-runtime/darshan-config.in
- darshan-runtime/doc/darshan-runtime.txt


Changes:

=====================================
ChangeLog
=====================================
@@ -5,6 +5,8 @@ Darshan Release Change Log
 Darshan-3.2.0-pre2
 =============
 * silence stdout from darshan-job-summary.pl and remove --summary option
+* added `darshan-config --log-path` command option to display the log path(s)
+  configured for use with Darshan
 
 Darshan-3.2.0-pre1
 =============


=====================================
darshan-runtime/configure
=====================================
@@ -643,6 +643,7 @@ DARSHAN_VERSION
 ENABLE_MMAP_LOGS
 DISABLE_LDPRELOAD
 DISABLE_STATIC_LIB
+__DARSHAN_LOG_ENV
 __DARSHAN_LOG_PATH
 darshan_share_path
 darshan_lib_path
@@ -4892,6 +4893,7 @@ DARSHAN_VERSION="3.2.0-pre1"
 
 
 
+
 
 
 ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-config share/craype-1.x/darshan-module share/craype-2.x/darshan-module lib/pkgconfig/darshan-runtime.pc share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf share/mpi-profile/darshan-cc-static.conf share/mpi-profile/darshan-cxx-static.conf share/mpi-profile/darshan-f-static.conf share/ld-opts/darshan-base-ld-opts share/ld-opts/darshan-stdio-ld-opts"


=====================================
darshan-runtime/configure.in
=====================================
@@ -500,6 +500,7 @@ AC_SUBST(darshan_lib_path)
 AC_SUBST(darshan_share_path)
 AC_SUBST(LDFLAGS)
 AC_SUBST(__DARSHAN_LOG_PATH)
+AC_SUBST(__DARSHAN_LOG_ENV)
 AC_SUBST(DISABLE_STATIC_LIB)
 AC_SUBST(DISABLE_LDPRELOAD)
 AC_SUBST(ENABLE_MMAP_LOGS)


=====================================
darshan-runtime/darshan-config.in
=====================================
@@ -3,6 +3,8 @@
 DARSHAN_LIB_PATH="@darshan_lib_path@"
 DARSHAN_SHARE_PATH="@darshan_share_path@"
 DARSHAN_LD_FLAGS="@LDFLAGS@"
+DARSHAN_LOG_PATH="@__DARSHAN_LOG_PATH@"
+DARSHAN_LOG_ENV="@__DARSHAN_LOG_ENV@"
 
 # NOTE:
 # - we deliberately list libdarshan twice in the link command when
@@ -20,8 +22,27 @@ POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan -lz -lrt -lpthread"
 #   order.  We also set no-as-needed for linkers that may not identify
 DYN_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -Wl,-rpath=$DARSHAN_LIB_PATH -Wl,-no-as-needed -ldarshan"
 
+# NOTE:
+# - construct complete list of log path options, separated by commas.
+#   LOG_ENV takes precedent over LOG_PATH, but both could be specified.  The
+#   LOG_ENV may already be a comma saparated list, but we insert '$'
+#   characters to denote that these are environment variables.
+if [ "$DARSHAN_LOG_ENV" ]; then
+    DARSHAN_LOG_ENV=`echo $DARSHAN_LOG_ENV | sed -e 's/^/\$/g'`
+    DARSHAN_LOG_ENV=`echo $DARSHAN_LOG_ENV | sed -e 's/,/,\$/g'`
+fi
+
+# figure out if we need a comma separator to construct env and path list
+if [ "$DARSHAN_LOG_ENV" -a "$DARSHAN_LOG_PATH" ]; then
+    DARSHAN_LOG_ALL="$DARSHAN_LOG_ENV,$DARSHAN_LOG_PATH"
+elif [ "$DARSHAN_LOG_ENV" ]; then
+    DARSHAN_LOG_ALL=$DARSHAN_LOG_ENV
+else
+    DARSHAN_LOG_ALL=$DARSHAN_LOG_PATH
+fi
+
 usage="\
-Usage: darshan-config [--pre-ld-flags] [--post-ld-flags] [--dyn-ld-flags]"
+Usage: darshan-config [--pre-ld-flags] [--post-ld-flags] [--dyn-ld-flags] [--log-path]"
 
 if test $# -eq 0; then
       echo "${usage}" 1>&2
@@ -44,6 +65,9 @@ while test $# -gt 0; do
     --dyn-ld-flags)
       echo $DYN_LD_FLAGS
       ;;
+    --log-path)
+      echo $DARSHAN_LOG_ALL
+      ;;
     *)
       echo "${usage}" 1>&2
       exit 1


=====================================
darshan-runtime/doc/darshan-runtime.txt
=====================================
@@ -84,6 +84,7 @@ specified environment variable is not set.
 * `--with-log-path=` (this, or `--with-log-path-by-env`, is mandatory): This
 specifies the parent directory for the directory tree where Darshan logs
 will be placed.
+** NOTE: after installation, any user can display the configured path with the `darshan-config --log-path` command
 * `--with-log-path-by-env=`: specifies an environment variable to use to
 determine the log path at run time.
 * `--with-log-hints=`: specifies hints to use when writing the Darshan log
@@ -129,6 +130,15 @@ as root.
 darshan-mk-log-dirs.pl
 ----
 
+.A note about finding log paths after installation
+[NOTE]
+====
+Regardless of whether a Darshan installation is using the --with-log-path or
+--with-log-path-by-env option, end users can display the path (and/or
+environment variables) at any time by running `darshan-config --log-path`
+on the command line.
+====
+
 .A note about log directory permissions
 [NOTE]
 ====
@@ -583,6 +593,9 @@ behavior at runtime:
 
 In cases where Darshan is not generating a log file for an application, some common things to check are:
 
+* Make sure you are looking in the correct place for logs.  Confirm the
+  location with the `darshan-config --log-path` command.
+
 * Check stderr to ensure Darshan isn't indicating any internal errors (e.g., invalid log file path)
 
 For statically linked executables:



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/c54a8a42158d2354e2ab5e527087d81a39bc2597...73972e987fc8fc6f5046a88d27250587b290268f

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/c54a8a42158d2354e2ab5e527087d81a39bc2597...73972e987fc8fc6f5046a88d27250587b290268f
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/20200426/a0d23e74/attachment-0001.html>


More information about the Darshan-commits mailing list