[Darshan-commits] [Git][darshan/darshan][carns/issue-284-incomplete-warning] bug fix in setting of partial flag

Shane Snyder xgitlab at cels.anl.gov
Tue Mar 16 13:22:36 CDT 2021



Shane Snyder pushed to branch carns/issue-284-incomplete-warning at darshan / darshan


Commits:
396e37dc by Shane Snyder at 2021-03-16T13:21:27-05:00
bug fix in setting of partial flag

Modules that requested memory from Darshan core but did not
get enough for a single record were not properly setting the
partial flag.

- - - - -


10 changed files:

- darshan-runtime/lib/darshan-bgq.c
- darshan-runtime/lib/darshan-hdf5.c
- darshan-runtime/lib/darshan-lustre.c
- darshan-runtime/lib/darshan-mdhim.c
- darshan-runtime/lib/darshan-mpiio.c
- darshan-runtime/lib/darshan-null.c
- darshan-runtime/lib/darshan-pnetcdf.c
- darshan-runtime/lib/darshan-posix.c
- darshan-runtime/lib/darshan-stdio.c
- darshan-util/darshan-parser.c


Changes:

=====================================
darshan-runtime/lib/darshan-bgq.c
=====================================
@@ -136,14 +136,6 @@ void bgq_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* not enough memory to fit bgq module record */
-    if(bgq_buf_size < sizeof(struct darshan_bgq_record))
-    {
-        darshan_core_unregister_module(DARSHAN_BGQ_MOD);
-        BGQ_UNLOCK();
-        return;
-    }
-
     /* initialize module's global state */
     bgq_runtime = malloc(sizeof(*bgq_runtime));
     if(!bgq_runtime)


=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -933,13 +933,6 @@ static void hdf5_file_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(hdf5_buf_size < sizeof(struct darshan_hdf5_file))
-    {
-        darshan_core_unregister_module(DARSHAN_H5F_MOD);
-        return;
-    }
-
     hdf5_file_runtime = malloc(sizeof(*hdf5_file_runtime));
     if(!hdf5_file_runtime)
     {
@@ -972,13 +965,6 @@ static void hdf5_dataset_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(hdf5_buf_size < sizeof(struct darshan_hdf5_dataset))
-    {
-        darshan_core_unregister_module(DARSHAN_H5D_MOD);
-        return;
-    }
-
     hdf5_dataset_runtime = malloc(sizeof(*hdf5_dataset_runtime));
     if(!hdf5_dataset_runtime)
     {


=====================================
darshan-runtime/lib/darshan-lustre.c
=====================================
@@ -203,15 +203,6 @@ static void lustre_runtime_initialize()
         &my_rank,
         NULL);
 
-    if(lustre_buf_size < LUSTRE_RECORD_SIZE(1))
-    {
-        /* unregister module if we aren't allocated enough space for
-         * the smallest possible record
-         */
-        darshan_core_unregister_module(DARSHAN_LUSTRE_MOD);
-        return;
-    }
-
     lustre_runtime = malloc(sizeof(*lustre_runtime));
     if(!lustre_runtime)
     {


=====================================
darshan-runtime/lib/darshan-mdhim.c
=====================================
@@ -325,14 +325,6 @@ static void mdhim_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory for at 
-     * least one MDHIM record
-     */
-    if(mdhim_buf_size < sizeof(struct darshan_mdhim_record))
-    {
-        darshan_core_unregister_module(DARSHAN_MDHIM_MOD);
-        return;
-    }
 
     /* initialize module's global state */
     mdhim_runtime = calloc(1, sizeof(*mdhim_runtime));


=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
@@ -1174,13 +1174,6 @@ static void mpiio_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(mpiio_buf_size < sizeof(struct darshan_mpiio_file))
-    {
-        darshan_core_unregister_module(DARSHAN_MPIIO_MOD);
-        return;
-    }
-
     mpiio_runtime = malloc(sizeof(*mpiio_runtime));
     if(!mpiio_runtime)
     {


=====================================
darshan-runtime/lib/darshan-null.c
=====================================
@@ -224,15 +224,6 @@ static void null_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory for at 
-     * least one NULL record
-     */
-    if(null_buf_size < sizeof(struct darshan_null_record))
-    {
-        darshan_core_unregister_module(DARSHAN_NULL_MOD);
-        return;
-    }
-
     /* initialize module's global state */
     null_runtime = malloc(sizeof(*null_runtime));
     if(!null_runtime)


=====================================
darshan-runtime/lib/darshan-pnetcdf.c
=====================================
@@ -231,13 +231,6 @@ static void pnetcdf_runtime_initialize()
         &my_rank,
         NULL);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(pnetcdf_buf_size < sizeof(struct darshan_pnetcdf_file))
-    {
-        darshan_core_unregister_module(DARSHAN_PNETCDF_MOD);
-        return;
-    }
-
     pnetcdf_runtime = malloc(sizeof(*pnetcdf_runtime));
     if(!pnetcdf_runtime)
     {


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
@@ -1883,13 +1883,6 @@ static void posix_runtime_initialize()
         &my_rank,
         &darshan_mem_alignment);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(psx_buf_size < sizeof(struct darshan_posix_file))
-    {
-        darshan_core_unregister_module(DARSHAN_POSIX_MOD);
-        return;
-    }
-
     posix_runtime = malloc(sizeof(*posix_runtime));
     if(!posix_runtime)
     {


=====================================
darshan-runtime/lib/darshan-stdio.c
=====================================
@@ -1018,13 +1018,6 @@ static void stdio_runtime_initialize()
         &my_rank,
         &darshan_mem_alignment);
 
-    /* return if darshan-core does not provide enough module memory */
-    if(stdio_buf_size < sizeof(struct darshan_stdio_file))
-    {
-        darshan_core_unregister_module(DARSHAN_STDIO_MOD);
-        return;
-    }
-
     stdio_runtime = malloc(sizeof(*stdio_runtime));
     if(!stdio_runtime)
     {


=====================================
darshan-util/darshan-parser.c
=====================================
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
     printf("# record table: %zu bytes (compressed)\n", fd->name_map.len);
     for(i=0; i<DARSHAN_MAX_MODS; i++)
     {
-        if(fd->mod_map[i].len)
+        if(fd->mod_map[i].len || DARSHAN_MOD_FLAG_ISSET(fd->partial_flag, i))
         {
             printf("# %s module: %zu bytes (compressed), ver=%d\n",
                 darshan_module_names[i], fd->mod_map[i].len, fd->mod_ver[i]);
@@ -390,7 +390,8 @@ int main(int argc, char **argv)
         if(fd->mod_map[i].len == 0)
         {
             empty_mods++;
-            continue;
+            if(!DARSHAN_MOD_FLAG_ISSET(fd->partial_flag, i))
+                continue;
         }
         /* skip modules with no logutil definitions */
         else if(!mod_logutils[i])
@@ -431,6 +432,8 @@ int main(int argc, char **argv)
                        "# documentation and consider setting the\n"
                        "# DARSHAN_EXCLUDE_DIRS environment variable to prevent\n"
                        "# Darshan from instrumenting unecessary files.\n");
+                if(fd->mod_map[i].len == 0)
+                    continue; // no data to parse
             }
             else
             {



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/396e37dc2a983f4f035616a0ddd700e124ff7974

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/396e37dc2a983f4f035616a0ddd700e124ff7974
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/20210316/0988f7a5/attachment-0001.html>


More information about the Darshan-commits mailing list