[Darshan-commits] [Git][darshan/darshan][autoperf-mod-update] cleanup darshan-core changes

Shane Snyder xgitlab at cels.anl.gov
Thu Mar 11 20:25:50 CST 2021



Shane Snyder pushed to branch autoperf-mod-update at darshan / darshan


Commits:
6a050b4a by Shane Snyder at 2021-03-12T02:25:10+00:00
cleanup darshan-core changes

- - - - -


2 changed files:

- darshan-runtime/Makefile.in
- darshan-runtime/lib/darshan-core.c


Changes:

=====================================
darshan-runtime/Makefile.in
=====================================
@@ -16,8 +16,6 @@ LD = @LD@
 DISABLE_STATIC_LIB = @DISABLE_STATIC_LIB@
 DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@
 ENABLE_MMAP_LOGS = @ENABLE_MMAP_LOGS@
-BUILD_APXC_MODULE = @BUILD_APXC_MODULE@
-BUILD_APMPI_MODULE = @BUILD_APMPI_MODULE@
 DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
 DARSHAN_VERSION = @DARSHAN_VERSION@
 
@@ -47,6 +45,7 @@ BUILD_BGQ_MODULE = @BUILD_BGQ_MODULE@
 BUILD_LUSTRE_MODULE = @BUILD_LUSTRE_MODULE@
 BUILD_MDHIM_MODULE = @BUILD_MDHIM_MODULE@
 BUILD_APMPI_MODULE = @BUILD_APMPI_MODULE@
+BUILD_APXC_MODULE = @BUILD_APXC_MODULE@
 
 DARSHAN_STATIC_MOD_OBJS =
 DARSHAN_DYNAMIC_MOD_OBJS =


=====================================
darshan-runtime/lib/darshan-core.c
=====================================
@@ -456,6 +456,7 @@ void darshan_core_shutdown()
     final_core = darshan_core;
     darshan_core = NULL;
     DARSHAN_CORE_UNLOCK();
+
     /* grab some initial timing information */
 #ifdef HAVE_MPI
     /* if using mpi, sync across procs first */
@@ -521,9 +522,7 @@ void darshan_core_shutdown()
 
         /* get a list of records which are shared across all processes */
         darshan_get_shared_records(final_core, &shared_recs, &shared_rec_cnt);
-#if 0
-        printf(" L 524 --- my_rank: %d shared_rec_cnt: %d\n", my_rank, shared_rec_cnt);
-#endif
+
         mod_shared_recs = malloc(shared_rec_cnt * sizeof(darshan_record_id));
         assert(mod_shared_recs);
     }
@@ -586,6 +585,7 @@ void darshan_core_shutdown()
             final_core->log_hdr_p->mod_map[i].len = 0;
             continue;
         }
+
         if(internal_timing_flag)
             mod1[i] = darshan_core_wtime();
 
@@ -594,9 +594,6 @@ void darshan_core_shutdown()
         {
             mod_buf = final_core->mod_array[i]->rec_buf_start;
             mod_buf_sz = final_core->mod_array[i]->rec_buf_p - mod_buf;
-#if 0
-            printf("l 596 --- MOD_ID: %d my_rank: %d mod_buf_sz: %d\n", i, my_rank, mod_buf_sz);
-#endif
 
 #ifdef HAVE_MPI
             if(using_mpi)
@@ -604,40 +601,27 @@ void darshan_core_shutdown()
                 struct darshan_core_name_record_ref *ref = NULL;
                 int mod_shared_rec_cnt = 0;
                 int j;
+
                 /* set the shared record list for this module */
                 for(j = 0; j < shared_rec_cnt; j++)
                 {
-                    
                     HASH_FIND(hlink, final_core->name_hash, &shared_recs[j],
                         sizeof(darshan_record_id), ref);
                     assert(ref);
-#if 0
-                    printf("l 611 --- MOD_ID: %d my_rank: %d j: %d ref->mod_flags: %d ref->global_mod_flags: %d \n", i, my_rank, j, ref->mod_flags, ref->global_mod_flags );
-#endif
+
                     if(DARSHAN_MOD_FLAG_ISSET(ref->global_mod_flags, i))
                     {
                         mod_shared_recs[mod_shared_rec_cnt++] = shared_recs[j];
                     }
                 }
-#if 0
-                printf("l 617 --- MOD_ID: %d my_rank: %d shared_rec_cnt:%d mod_shared_rec_cnt:%d\n", i, my_rank, shared_rec_cnt, mod_shared_rec_cnt);
-#endif
 
-                /*  int comm_size;
-                   MPI_Comm_size(final_core->mpi_comm, &comm_size);
-                   char name[MPI_MAX_OBJECT_NAME];
-                   int name_length;
-                   MPI_Comm_get_name(final_core->mpi_comm, name, &name_length);
-                */
-#if 0
-                printf("l 624 --- MOD_ID: %d my_rank: %d DARSHAN_DISABLE_SHARED_REDUCTION:%d \n", i, my_rank, getenv("DARSHAN_DISABLE_SHARED_REDUCTION"));
-#endif
                 /* allow the module an opportunity to reduce shared files */
                 if(this_mod->mod_funcs.mod_redux_func && (mod_shared_rec_cnt > 0) &&
-                   (!getenv("DARSHAN_DISABLE_SHARED_REDUCTION"))){
+                   (!getenv("DARSHAN_DISABLE_SHARED_REDUCTION")))
+                {
                     this_mod->mod_funcs.mod_redux_func(mod_buf, final_core->mpi_comm,
                         mod_shared_recs, mod_shared_rec_cnt);
-                    }
+                }
             }
 #endif
 
@@ -1236,9 +1220,7 @@ static int darshan_add_name_record_ref(struct darshan_core_runtime *core,
     ref->name_record->id = rec_id;
     strcpy(ref->name_record->name, name);
     DARSHAN_MOD_FLAG_SET(ref->mod_flags, mod_id);
-#if 0
-printf(" L 1230 ---- my_rank:%d mod_id: %d name: %s ref->mod_flags: %d ref->global_mod_flags:%d \n", my_rank, mod_id, name, ref->mod_flags, ref->global_mod_flags);
-#endif
+
     /* add the record to the hash table */
     HASH_ADD(hlink, core->name_hash, name_record->id,
         sizeof(darshan_record_id), ref);
@@ -1302,9 +1284,7 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
 
     /* broadcast root's number of records to all other processes */
     PMPI_Bcast(&tmp_cnt, 1, MPI_INT, 0, core->mpi_comm);
-#if 0
-    printf("L 1294 --- my_rank: %d core->name_hash: %lu tmp_cnt: %d\n", my_rank, core->name_hash, tmp_cnt);
-#endif
+
     /* use root record count to allocate data structures */
     id_array = malloc(tmp_cnt * sizeof(darshan_record_id));
     mod_flags = malloc(tmp_cnt * sizeof(uint64_t));
@@ -1339,9 +1319,6 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
             /* we opened that record too, save the mod_flags */
             mod_flags[i] = ref->mod_flags;
         }
-#if 0
-        printf(" --- L 1329 my_rank: %d mod_flags[%d]: %d \n", my_rank, i, mod_flags[i]);
-#endif
     }
 
     /* now allreduce so everyone agrees which records are shared and
@@ -1349,13 +1326,10 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
      */
     PMPI_Allreduce(mod_flags, global_mod_flags, tmp_cnt,
         MPI_UINT64_T, MPI_BAND, core->mpi_comm);
-    
+
     j = 0;
     for(i=0; i<tmp_cnt; i++)
     {
-#if 0
-        printf(" --- L 1341 my_rank: %d mod_flags[%d]: %d global_mod_flags[%d]: %d\n", my_rank, i, mod_flags[i], i, global_mod_flags[i]);
-#endif
         if(global_mod_flags[i] != 0)
         {
             (*shared_recs)[j++] = id_array[i];
@@ -1367,9 +1341,6 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
             HASH_FIND(hlink, core->name_hash, &id_array[i], sizeof(darshan_record_id), ref);
             assert(ref);
             ref->global_mod_flags = global_mod_flags[i];
-#if 0
-            printf(" L 1351 --- i: %d ref->mod_flags: %d ref->global_mod_flags: %d\n", i, ref->mod_flags, ref->global_mod_flags);
-#endif
         }
     }
     *shared_rec_cnt = j;
@@ -2213,7 +2184,7 @@ void darshan_core_register_module(
         DARSHAN_CORE_UNLOCK();
         return;
     }
-    
+
     mod = malloc(sizeof(*mod));
     if(!mod)
     {
@@ -2305,10 +2276,7 @@ void *darshan_core_register_record(
         DARSHAN_CORE_UNLOCK();
         return(NULL);
     }
-#if 0
-    printf("L 2289 --- my_rank: %d mod_id: %d name: %s \n\n\n\n\n\n\n\n\n\n\n", my_rank, mod_id, name);
-    printf("L 2286 --- my_rank: %d mod_id: %d darshan_core->mod_array[mod_id]->rec_mem_avail: %d rec_len:%d \n", my_rank, mod_id, darshan_core->mod_array[mod_id]->rec_mem_avail, rec_len);
-#endif
+
     /* check to see if this module has enough space to store a new record */
     if(darshan_core->mod_array[mod_id]->rec_mem_avail < rec_len)
     {
@@ -2325,14 +2293,8 @@ void *darshan_core_register_record(
          */
         HASH_FIND(hlink, darshan_core->name_hash, &rec_id,
             sizeof(darshan_record_id), ref);
-#if 0
-        printf("L 2303 --- my_rank: %d rec_id: %d ref: %d darshan_core->name_hash: %d \n", my_rank, rec_id, ref, darshan_core->name_hash);
-#endif
         if(!ref)
         {
-#if 0
-            printf(" 2306 --- my_rank:%d mod_id: %d, rec_id: %lu name: %s \n", my_rank, mod_id, rec_id, name );
-#endif
             ret = darshan_add_name_record_ref(darshan_core, rec_id, name, mod_id);
             if(ret == 0)
             {
@@ -2340,16 +2302,13 @@ void *darshan_core_register_record(
                 DARSHAN_CORE_UNLOCK();
                 return(NULL);
             }
-#if 0
-            printf(" 2314 --- my_rank: %d mod_id: %d ret: %d\n", my_rank, mod_id, ret);
-#endif
         }
         else
         {
             DARSHAN_MOD_FLAG_SET(ref->mod_flags, mod_id);
         }
     }
-    
+
     rec_buf = darshan_core->mod_array[mod_id]->rec_buf_p;
     darshan_core->mod_array[mod_id]->rec_buf_p += rec_len;
     darshan_core->mod_array[mod_id]->rec_mem_avail -= rec_len;



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/6a050b4a86f1d956897b49fdf86ca9ab221eb498

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/6a050b4a86f1d956897b49fdf86ca9ab221eb498
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/20210311/d11c9915/attachment-0001.html>


More information about the Darshan-commits mailing list