[Darshan-users] Problem with DARSHAN_CHECK_ERR

François Trahay francois.trahay at telecom-sudparis.eu
Tue Jan 7 10:18:15 CST 2020


Hi,

Due to a missing environment variable, I got the following message when 
running an application with darshan:

darshan_library_warning: unable to create log file .


This incomplete message is due to the DARSHAN_CHECK_ERR macro in 
darshan-runtime/lib/darshan-core.c that only prints the message format, 
but does not the variadic arguments. The attached patch fixes the problem.

Regards.

François

-------------- next part --------------
diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c
index 2d7bc42..332e69e 100644
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -171,7 +171,7 @@ static double darshan_core_wtime_absolute(void);
         PMPI_Allreduce(MPI_IN_PLACE, &__ret, 1, MPI_INT, MPI_LOR, final_core->mpi_comm); \
     if(__ret != 0) { \
         if(my_rank == 0) { \
-            DARSHAN_WARN(__err_str); \
+            DARSHAN_WARN(__err_str, ## __VA_ARGS__); \
             if(log_created) \
                 unlink(logfile_name); \
         } \
@@ -184,7 +184,7 @@ static double darshan_core_wtime_absolute(void);
 /* Non-MPI variant of darshan logging helpers */
 #define DARSHAN_CHECK_ERR(__ret, __err_str, ...) do { \
     if(__ret != 0) { \
-        DARSHAN_WARN(__err_str); \
+        DARSHAN_WARN(__err_str, ## __VA_ARGS__);	\
         if(log_created) \
             unlink(logfile_name); \
         goto exit; \


More information about the Darshan-users mailing list