diff --git a/darshan-runtime/lib/darshan-hdf5.c b/darshan-runtime/lib/darshan-hdf5.c index 941fa3004..8829fdbb7 100644 --- a/darshan-runtime/lib/darshan-hdf5.c +++ b/darshan-runtime/lib/darshan-hdf5.c @@ -169,7 +169,6 @@ static int my_rank = -1; darshan_record_id __rec_id; \ struct hdf5_file_record_ref *__rec_ref; \ char *__newpath; \ - extern struct darshanConnector dC; \ __newpath = darshan_clean_file_path(__path); \ if(!__newpath) __newpath = (char *)__path; \ __rec_id = darshan_core_gen_record_id(__newpath); \ @@ -190,6 +189,7 @@ static int my_rank = -1; darshan_add_record_ref(&(hdf5_file_runtime->hid_hash), &__ret, sizeof(hid_t), __rec_ref); \ if(__newpath != __path) free(__newpath); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.hdf5_enable_ldms)\ darshan_ldms_connector_send(__rec_ref->file_rec->base_rec.id, __rec_ref->file_rec->base_rec.rank,__rec_ref->file_rec->counters[H5F_OPENS], "open", -1, -1, -1, -1, __rec_ref->file_rec->counters[H5F_FLUSHES], __tm1, __tm2, __rec_ref->file_rec->fcounters[H5F_F_META_TIME], "H5F", "MET");\ @@ -417,14 +417,12 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id) &file_id, sizeof(hid_t)); #ifdef HAVE_LDMS - /* LDMS to publish runtime h5d tracing information to daemon*/ - extern struct darshanConnector dC; - if(!dC.hdf5_enable_ldms) - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->file_rec->counters[H5F_FLUSHES],rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP], rec_ref->file_rec->fcounters[H5F_F_CLOSE_END_TIMESTAMP], rec_ref->file_rec->fcounters[H5F_F_META_TIME], "H5F", "MOD"); + /* LDMS to publish runtime h5d tracing information to daemon*/ + extern struct darshanConnector dC; + if(!dC.hdf5_enable_ldms) + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->file_rec->counters[H5F_FLUSHES],rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP], rec_ref->file_rec->fcounters[H5F_F_CLOSE_END_TIMESTAMP], rec_ref->file_rec->fcounters[H5F_F_META_TIME], "H5F", "MOD"); #endif - } - H5F_POST_RECORD(); } @@ -465,7 +463,6 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id) ssize_t __req_name_len = DARSHAN_HDF5_MAX_NAME_LEN-1, __ret_name_len; \ darshan_record_id __rec_id, __file_rec_id = 0; \ struct hdf5_dataset_record_ref *__rec_ref; \ - extern struct darshanConnector dC;\ hsize_t __chunk_dims[H5D_MAX_NDIMS] = {0}; \ int __i, __n_chunk_dims = 0; \ /* get corresponding file name */\ @@ -516,6 +513,7 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id) __rec_ref->dataset_rec->file_rec_id = __file_rec_id; \ darshan_add_record_ref(&(hdf5_dataset_runtime->hid_hash), &__ret, sizeof(hid_t), __rec_ref); \ /* LDMS to publish runtime h5d tracing information to daemon*/ \ + extern struct darshanConnector dC;\ if(!dC.ldms_lib)\ if(!dC.hdf5_enable_ldms)\ darshan_ldms_connector_send(__rec_ref->dataset_rec->base_rec.id, __rec_ref->dataset_rec->base_rec.rank,__rec_ref->dataset_rec->counters[H5D_OPENS], "open", -1, -1, -1, -1, __rec_ref->dataset_rec->counters[H5D_FLUSHES], __tm1, __tm2, __rec_ref->dataset_rec->fcounters[H5D_F_META_TIME], "H5D", "MET");\ @@ -765,17 +763,18 @@ herr_t DARSHAN_DECL(H5Dread)(hid_t dataset_id, hid_t mem_type_id, hid_t mem_spac DARSHAN_TIMER_INC_NO_OVERLAP( rec_ref->dataset_rec->fcounters[H5D_F_READ_TIME], tm1, tm2, rec_ref->last_read_end); + #ifdef HAVE_LDMS - extern struct darshanConnector dC; - /* LDMS to publish runtime h5d tracing information to daemon*/ - if(!dC.hdf5_enable_ldms){ - dC.hdf5_data[0] = rec_ref->dataset_rec->counters[H5D_POINT_SELECTS]; - dC.hdf5_data[1] = rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS]; - dC.hdf5_data[2] = rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS]; - dC.hdf5_data[3] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NDIMS]; - dC.hdf5_data[4] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS]; - - darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, rec_ref->dataset_rec->counters[H5D_READS], "read", -1, rec_ref->dataset_rec->counters[H5D_MAX_READ_TIME_SIZE], -1, rec_ref->dataset_rec->counters[H5D_RW_SWITCHES], rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_READ_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_READ_TIME], "H5D", "MOD"); + extern struct darshanConnector dC; + /* LDMS to publish runtime h5d tracing information to daemon*/ + if(!dC.hdf5_enable_ldms){ + dC.hdf5_data[0] = rec_ref->dataset_rec->counters[H5D_POINT_SELECTS]; + dC.hdf5_data[1] = rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS]; + dC.hdf5_data[2] = rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS]; + dC.hdf5_data[3] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NDIMS]; + dC.hdf5_data[4] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS]; + + darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, rec_ref->dataset_rec->counters[H5D_READS], "read", -1, rec_ref->dataset_rec->counters[H5D_MAX_READ_TIME_SIZE], -1, rec_ref->dataset_rec->counters[H5D_RW_SWITCHES], rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_READ_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_READ_TIME], "H5D", "MOD"); } #endif } @@ -896,22 +895,19 @@ herr_t DARSHAN_DECL(H5Dwrite)(hid_t dataset_id, hid_t mem_type_id, hid_t mem_spa tm1, tm2, rec_ref->last_write_end); #ifdef HAVE_LDMS - /* LDMS to publish runtime h5d tracing information to daemon*/ - extern struct darshanConnector dC; - if(!dC.hdf5_enable_ldms){ - dC.hdf5_data[0] = rec_ref->dataset_rec->counters[H5D_POINT_SELECTS]; - dC.hdf5_data[1] = rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS]; - dC.hdf5_data[2] = rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS]; - dC.hdf5_data[3] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NDIMS]; - dC.hdf5_data[4] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS]; - - darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, rec_ref->dataset_rec->counters[H5D_WRITES], "write", -1, rec_ref->dataset_rec->counters[H5D_MAX_WRITE_TIME_SIZE], -1, rec_ref->dataset_rec->counters[H5D_RW_SWITCHES], rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_TIME], "H5D", "MOD"); - + /* LDMS to publish runtime h5d tracing information to daemon*/ + extern struct darshanConnector dC; + if(!dC.hdf5_enable_ldms){ + dC.hdf5_data[0] = rec_ref->dataset_rec->counters[H5D_POINT_SELECTS]; + dC.hdf5_data[1] = rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS]; + dC.hdf5_data[2] = rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS]; + dC.hdf5_data[3] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NDIMS]; + dC.hdf5_data[4] = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS]; + + darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, rec_ref->dataset_rec->counters[H5D_WRITES], "write", -1, rec_ref->dataset_rec->counters[H5D_MAX_WRITE_TIME_SIZE], -1, rec_ref->dataset_rec->counters[H5D_RW_SWITCHES], rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_WRITE_TIME], "H5D", "MOD"); } #endif - } - H5D_POST_RECORD(); } @@ -976,11 +972,12 @@ herr_t DARSHAN_DECL(H5Dclose)(hid_t dataset_id) DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->dataset_rec->fcounters[H5D_F_META_TIME], tm1, tm2, rec_ref->last_meta_end); darshan_delete_record_ref(&(hdf5_dataset_runtime->hid_hash), &dataset_id, sizeof(hid_t)); + #ifdef HAVE_LDMS - /* LDMS to publish runtime h5d tracing information to daemon*/ - extern struct darshanConnector dC; - if(!dC.hdf5_enable_ldms) - darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_META_TIME], "H5D", "MOD"); + /* LDMS to publish runtime h5d tracing information to daemon*/ + extern struct darshanConnector dC; + if(!dC.hdf5_enable_ldms) + darshan_ldms_connector_send(rec_ref->dataset_rec->base_rec.id, rec_ref->dataset_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->dataset_rec->counters[H5D_FLUSHES], rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_END_TIMESTAMP], rec_ref->dataset_rec->fcounters[H5D_F_META_TIME], "H5D", "MOD"); #endif } @@ -1595,9 +1592,8 @@ static void hdf5_dataset_record_reduction_op(void* inrec_v, void* inoutrec_v, tmp_dataset.counters[H5D_DATASPACE_NPOINTS] = inrec->counters[H5D_DATASPACE_NPOINTS]; tmp_dataset.counters[H5D_DATATYPE_SIZE] = inrec->counters[H5D_DATATYPE_SIZE]; - for(j=H5D_CHUNK_SIZE_D1; j<=H5D_CHUNK_SIZE_D5; j++){ + for(j=H5D_CHUNK_SIZE_D1; j<=H5D_CHUNK_SIZE_D5; j++) tmp_dataset.counters[j] = inrec->counters[j]; - } if(inoutrec->counters[H5D_USE_MPIIO_COLLECTIVE] == 1 || inrec->counters[H5D_USE_MPIIO_COLLECTIVE] == 1) @@ -1708,7 +1704,6 @@ static void hdf5_dataset_record_reduction_op(void* inrec_v, void* inoutrec_v, inoutrec->fcounters[H5D_F_SLOWEST_RANK_TIME]; } - /* update pointers */ *inoutrec = tmp_dataset; inoutrec++; @@ -1948,7 +1943,6 @@ static void hdf5_dataset_mpi_redux( rec_ref->dataset_rec->base_rec.rank = -1; } - /* sort the array of records so we get all of the shared records * (marked by rank -1) in a contiguous portion at end of the array */ diff --git a/darshan-runtime/lib/darshan-mpiio.c b/darshan-runtime/lib/darshan-mpiio.c index 93538228a..089716958 100644 --- a/darshan-runtime/lib/darshan-mpiio.c +++ b/darshan-runtime/lib/darshan-mpiio.c @@ -192,7 +192,7 @@ static int my_rank = -1; #define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex) #define MPIIO_WTIME() \ - __darshan_disabled ? 0 : darshan_core_wtime(); \ + __darshan_disabled ? 0 : darshan_core_wtime(); /* note that if the break condition is triggered in this macro, then it * will exit the do/while loop holding a lock that will be released in @@ -219,7 +219,6 @@ static int my_rank = -1; struct mpiio_file_record_ref *rec_ref; \ char *newpath; \ int comm_size; \ - extern struct darshanConnector dC;\ if(__ret != MPI_SUCCESS) break; \ newpath = darshan_clean_file_path(__path); \ if(!newpath) newpath = (char *)__path; \ @@ -245,11 +244,12 @@ static int my_rank = -1; DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], \ __tm1, __tm2, rec_ref->last_meta_end); \ darshan_add_record_ref(&(mpiio_runtime->fh_hash), &__fh, sizeof(MPI_File), rec_ref); \ - if(newpath != __path) free(newpath);\ + if(newpath != __path) free(newpath); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC;\ if(!dC.ldms_lib)\ if(!dC.mpiio_enable_ldms)\ - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[MPIIO_COLL_OPENS] + rec_ref->file_rec->counters[MPIIO_INDEP_OPENS], "open", -1, -1, -1, -1, -1, __tm1, __tm2, rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], "MPIIO", "MET");\ + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[MPIIO_COLL_OPENS] + rec_ref->file_rec->counters[MPIIO_INDEP_OPENS], "open", -1, -1, -1, -1, -1, __tm1, __tm2, rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], "MPIIO", "MET");\ } while(0) /* XXX: this check is needed to work around an OpenMPI bug that is triggered by @@ -269,7 +269,6 @@ static int get_byte_offset = 0; int64_t size_ll; \ struct darshan_common_val_counter *cvc; \ double __elapsed = __tm2-__tm1; \ - extern struct darshanConnector dC;\ if(__ret != MPI_SUCCESS) break; \ rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \ if(!rec_ref) break; \ @@ -305,6 +304,7 @@ static int get_byte_offset = 0; DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_READ_TIME], \ __tm1, __tm2, rec_ref->last_read_end); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC;\ if(!dC.ldms_lib)\ if(!dC.mpiio_enable_ldms)\ darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[__counter], "read", displacement, size, -1, rec_ref->file_rec->counters[MPIIO_RW_SWITCHES], -1, __tm1, __tm2, rec_ref->file_rec->fcounters[MPIIO_F_READ_TIME], "MPIIO", "MOD");\ @@ -317,7 +317,6 @@ static int get_byte_offset = 0; int64_t size_ll; \ struct darshan_common_val_counter *cvc; \ double __elapsed = __tm2-__tm1; \ - extern struct darshanConnector dC; \ if(__ret != MPI_SUCCESS) break; \ rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \ if(!rec_ref) break; \ @@ -353,6 +352,7 @@ static int get_byte_offset = 0; DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_WRITE_TIME], \ __tm1, __tm2, rec_ref->last_write_end); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.mpiio_enable_ldms)\ darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[__counter], "write", displacement, size, -1, rec_ref->file_rec->counters[MPIIO_RW_SWITCHES], -1, __tm1, __tm2, rec_ref->file_rec->fcounters[MPIIO_F_WRITE_TIME], "MPIIO", "MOD");\ @@ -372,6 +372,7 @@ int DARSHAN_DECL(MPI_File_open)(MPI_Comm comm, char *filename, int amode, MPI_In MPI_File tmp_fh; char* tmp; double tm1, tm2; + MAP_OR_FAIL(PMPI_File_open); tm1 = MPIIO_WTIME(); @@ -406,7 +407,6 @@ int DARSHAN_DECL(MPI_File_read)(MPI_File fh, void *buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read); @@ -435,7 +435,6 @@ int DARSHAN_DECL(MPI_File_write)(MPI_File fh, void *buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write); @@ -517,7 +516,6 @@ int DARSHAN_DECL(MPI_File_read_all)(MPI_File fh, void * buf, int count, MPI_Data { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read_all); @@ -545,7 +543,6 @@ int DARSHAN_DECL(MPI_File_write_all)(MPI_File fh, void * buf, int count, MPI_Dat { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write_all); @@ -631,7 +628,6 @@ int DARSHAN_DECL(MPI_File_read_shared)(MPI_File fh, void * buf, int count, MPI_D { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read_shared); @@ -659,7 +655,6 @@ int DARSHAN_DECL(MPI_File_write_shared)(MPI_File fh, void * buf, int count, MPI_ { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write_shared); @@ -690,7 +685,6 @@ int DARSHAN_DECL(MPI_File_read_ordered)(MPI_File fh, void * buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read_ordered); @@ -721,7 +715,6 @@ int DARSHAN_DECL(MPI_File_write_ordered)(MPI_File fh, void * buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write_ordered); @@ -752,7 +745,6 @@ int DARSHAN_DECL(MPI_File_read_all_begin)(MPI_File fh, void * buf, int count, MP { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read_all_begin); @@ -779,7 +771,6 @@ int DARSHAN_DECL(MPI_File_write_all_begin)(MPI_File fh, void * buf, int count, M { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write_all_begin); @@ -862,7 +853,6 @@ int DARSHAN_DECL(MPI_File_read_ordered_begin)(MPI_File fh, void * buf, int count { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_read_ordered_begin); @@ -890,7 +880,6 @@ int DARSHAN_DECL(MPI_File_write_ordered_begin)(MPI_File fh, void * buf, int coun { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_write_ordered_begin); @@ -919,7 +908,6 @@ int DARSHAN_DECL(MPI_File_iread)(MPI_File fh, void * buf, int count, MPI_Datatyp { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_iread); @@ -948,7 +936,6 @@ int DARSHAN_DECL(MPI_File_iwrite)(MPI_File fh, void * buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_iwrite); @@ -1036,7 +1023,6 @@ int DARSHAN_DECL(MPI_File_iread_shared)(MPI_File fh, void * buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_iread_shared); @@ -1067,7 +1053,6 @@ int DARSHAN_DECL(MPI_File_iwrite_shared)(MPI_File fh, void * buf, int count, { int ret; double tm1, tm2; - MPI_Offset offset; MAP_OR_FAIL(PMPI_File_iwrite_shared); @@ -1202,10 +1187,10 @@ int DARSHAN_DECL(MPI_File_close)(MPI_File *fh) &tmp_fh, sizeof(MPI_File)); #ifdef HAVE_LDMS - /* publish close information for mpiio */ - extern struct darshanConnector dC; - if(!dC.mpiio_enable_ldms) - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, -1, tm1, tm2, rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], "MPIIO", "MOD"); + /* publish close information for mpiio */ + extern struct darshanConnector dC; + if(!dC.mpiio_enable_ldms) + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, -1, tm1, tm2, rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], "MPIIO", "MOD"); #endif } @@ -1389,7 +1374,6 @@ static void mpiio_record_reduction_op(void* infile_v, void* inoutfile_v, &(tmp_file.counters[MPIIO_ACCESS1_ACCESS]), &(tmp_file.counters[MPIIO_ACCESS1_COUNT]), &inoutfile->counters[j], 1, inoutfile->counters[j+4], 1); - } /* min non-zero (if available) value */ @@ -1492,14 +1476,12 @@ static void mpiio_record_reduction_op(void* infile_v, void* inoutfile_v, inoutfile->fcounters[MPIIO_F_SLOWEST_RANK_TIME]; } - /* update pointers */ *inoutfile = tmp_file; inoutfile++; infile++; } - return; } diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c index 1db9ad917..5eb1f4ed3 100644 --- a/darshan-runtime/lib/darshan-posix.c +++ b/darshan-runtime/lib/darshan-posix.c @@ -208,7 +208,7 @@ static int darshan_mem_alignment = 1; #define POSIX_UNLOCK() pthread_mutex_unlock(&posix_runtime_mutex) #define POSIX_WTIME() \ - __darshan_disabled ? 0 : darshan_core_wtime();\ + __darshan_disabled ? 0 : darshan_core_wtime(); /* note that if the break condition is triggered in this macro, then it * will exit the do/while loop holding a lock that will be released in @@ -234,7 +234,6 @@ static int darshan_mem_alignment = 1; darshan_record_id __rec_id; \ struct posix_file_record_ref *__rec_ref; \ char *__newpath; \ - extern struct darshanConnector dC; \ if(__ret < 0) break; \ __newpath = darshan_clean_file_path(__path); \ if(!__newpath) __newpath = (char *)__path; \ @@ -249,9 +248,10 @@ static int darshan_mem_alignment = 1; darshan_instrument_fs_data(__rec_ref->fs_type, __newpath, __ret); \ if(__newpath != __path) free(__newpath); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.posix_enable_ldms)\ - darshan_ldms_connector_send(__rec_ref->file_rec->base_rec.id, __rec_ref->file_rec->base_rec.rank, __rec_ref->file_rec->counters[POSIX_OPENS], "open", -1, -1, -1, -1, -1, __tm1, __tm2, __rec_ref->file_rec->fcounters[POSIX_F_META_TIME], "POSIX", "MET");\ + darshan_ldms_connector_send(__rec_ref->file_rec->base_rec.id, __rec_ref->file_rec->base_rec.rank, __rec_ref->file_rec->counters[POSIX_OPENS], "open", -1, -1, -1, -1, -1, __tm1, __tm2, __rec_ref->file_rec->fcounters[POSIX_F_META_TIME], "POSIX", "MET");\ } while(0) #define POSIX_RECORD_REFOPEN(__ret, __rec_ref, __tm1, __tm2, __ref_counter) do { \ @@ -284,7 +284,6 @@ static int darshan_mem_alignment = 1; int64_t file_alignment; \ struct darshan_common_val_counter *cvc; \ double __elapsed = __tm2-__tm1; \ - extern struct darshanConnector dC; \ if(__ret < 0) break; \ rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &(__fd), sizeof(int)); \ if(!rec_ref) break; \ @@ -342,9 +341,10 @@ static int darshan_mem_alignment = 1; DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[POSIX_F_READ_TIME], \ __tm1, __tm2, rec_ref->last_read_end); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.posix_enable_ldms)\ - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[POSIX_READS], "read", this_offset, __ret, rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ],rec_ref->file_rec->counters[POSIX_RW_SWITCHES], -1, __tm1, __tm2, rec_ref->file_rec->fcounters[POSIX_F_READ_TIME], "POSIX", "MOD");\ + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[POSIX_READS], "read", this_offset, __ret, rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ],rec_ref->file_rec->counters[POSIX_RW_SWITCHES], -1, __tm1, __tm2, rec_ref->file_rec->fcounters[POSIX_F_READ_TIME], "POSIX", "MOD");\ } while(0) #define POSIX_RECORD_WRITE(__ret, __fd, __pwrite_flag, __pwrite_offset, __aligned, __tm1, __tm2) do { \ @@ -354,7 +354,6 @@ static int darshan_mem_alignment = 1; int64_t file_alignment; \ struct darshan_common_val_counter *cvc; \ double __elapsed = __tm2-__tm1; \ - extern struct darshanConnector dC; \ if(__ret < 0) break; \ rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &__fd, sizeof(int)); \ if(!rec_ref) break; \ @@ -412,6 +411,7 @@ static int darshan_mem_alignment = 1; DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[POSIX_F_WRITE_TIME], \ __tm1, __tm2, rec_ref->last_write_end); \ /* LDMS to publish realtime write tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.posix_enable_ldms)\ darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[POSIX_WRITES], "write", this_offset, __ret, rec_ref->file_rec->counters[POSIX_MAX_BYTE_WRITTEN], rec_ref->file_rec->counters[POSIX_RW_SWITCHES], -1, __tm1, __tm2, rec_ref->file_rec->fcounters[POSIX_F_WRITE_TIME], "POSIX", "MOD");\ @@ -1641,7 +1641,7 @@ int DARSHAN_DECL(close)(int fd) /* publish close information for posix */ extern struct darshanConnector dC; if(!dC.posix_enable_ldms) - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, -1, tm1, tm2, rec_ref->file_rec->fcounters[POSIX_F_META_TIME], "POSIX", "MOD"); + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, -1, tm1, tm2, rec_ref->file_rec->fcounters[POSIX_F_META_TIME], "POSIX", "MOD"); #endif } POSIX_POST_RECORD(); diff --git a/darshan-runtime/lib/darshan-stdio.c b/darshan-runtime/lib/darshan-stdio.c index 3b6eba989..ded7ab849 100644 --- a/darshan-runtime/lib/darshan-stdio.c +++ b/darshan-runtime/lib/darshan-stdio.c @@ -214,7 +214,6 @@ extern int __real_fileno(FILE *stream); #define STDIO_RECORD_OPEN(__ret, __path, __tm1, __tm2) do { \ darshan_record_id __rec_id; \ struct stdio_file_record_ref *__rec_ref; \ - extern struct darshanConnector dC; \ char *__newpath; \ int __fd; \ MAP_OR_FAIL(fileno); \ @@ -232,8 +231,9 @@ extern int __real_fileno(FILE *stream); _STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, 1, -1); \ __fd = __real_fileno(__ret); \ darshan_instrument_fs_data(__rec_ref->fs_type, __newpath, __fd); \ - if(__newpath != (char*)__path) free(__newpath);\ + if(__newpath != (char*)__path) free(__newpath); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.stdio_enable_ldms)\ darshan_ldms_connector_send(__rec_ref->file_rec->base_rec.id, __rec_ref->file_rec->base_rec.rank,__rec_ref->file_rec->counters[STDIO_OPENS], "open", -1, -1, -1, -1, -1, __tm1, __tm2, __rec_ref->file_rec->fcounters[STDIO_F_META_TIME], "STDIO", "MET");\ @@ -241,7 +241,7 @@ extern int __real_fileno(FILE *stream); #define STDIO_RECORD_REFOPEN(__ret, __rec_ref, __tm1, __tm2, __ref_counter) do { \ if(!ret || !rec_ref) break; \ - _STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, 0, __ref_counter); \ + _STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, 0, __ref_counter); \ } while(0) #define _STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, __reset_flag, __ref_counter) do { \ @@ -260,7 +260,6 @@ extern int __real_fileno(FILE *stream); #define STDIO_RECORD_READ(__fp, __bytes, __tm1, __tm2) do{ \ struct stdio_file_record_ref* rec_ref; \ int64_t this_offset; \ - extern struct darshanConnector dC; \ rec_ref = darshan_lookup_record_ref(stdio_runtime->stream_hash, &(__fp), sizeof(__fp)); \ if(!rec_ref) break; \ this_offset = rec_ref->offset; \ @@ -275,8 +274,9 @@ extern int __real_fileno(FILE *stream); rec_ref->file_rec->fcounters[STDIO_F_READ_START_TIMESTAMP] > __tm1) \ rec_ref->file_rec->fcounters[STDIO_F_READ_START_TIMESTAMP] = __tm1; \ rec_ref->file_rec->fcounters[STDIO_F_READ_END_TIMESTAMP] = __tm2; \ - DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[STDIO_F_READ_TIME], __tm1, __tm2, rec_ref->last_read_end);\ + DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[STDIO_F_READ_TIME], __tm1, __tm2, rec_ref->last_read_end); \ /* LDMS to publish realtime read tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.stdio_enable_ldms) \ darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[STDIO_READS], "read", this_offset, __bytes, rec_ref->file_rec->counters[STDIO_MAX_BYTE_READ], -1, -1, __tm1, __tm2, rec_ref->file_rec->fcounters[STDIO_F_READ_TIME],"STDIO", "MOD"); \ @@ -285,7 +285,6 @@ extern int __real_fileno(FILE *stream); #define STDIO_RECORD_WRITE(__fp, __bytes, __tm1, __tm2, __fflush_flag) do{ \ struct stdio_file_record_ref* rec_ref; \ int64_t this_offset; \ - extern struct darshanConnector dC; \ rec_ref = darshan_lookup_record_ref(stdio_runtime->stream_hash, &(__fp), sizeof(__fp)); \ if(!rec_ref) break; \ this_offset = rec_ref->offset; \ @@ -304,6 +303,8 @@ extern int __real_fileno(FILE *stream); rec_ref->file_rec->fcounters[STDIO_F_WRITE_START_TIMESTAMP] = __tm1; \ rec_ref->file_rec->fcounters[STDIO_F_WRITE_END_TIMESTAMP] = __tm2; \ DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[STDIO_F_WRITE_TIME], __tm1, __tm2, rec_ref->last_write_end); \ + /* LDMS to publish realtime write tracing information to daemon*/ \ + extern struct darshanConnector dC; \ if(!dC.ldms_lib)\ if(!dC.stdio_enable_ldms)\ darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, rec_ref->file_rec->counters[STDIO_WRITES], "write", this_offset, __bytes, rec_ref->file_rec->counters[STDIO_MAX_BYTE_WRITTEN], -1, rec_ref->file_rec->counters[STDIO_FLUSHES], __tm1, __tm2, rec_ref->file_rec->fcounters[STDIO_F_WRITE_TIME], "STDIO", "MOD"); \ @@ -462,13 +463,12 @@ int DARSHAN_DECL(fclose)(FILE *fp) #ifdef HAVE_LDMS /* LDMS to publish runtime tracing information to daemon*/ - extern struct darshanConnector dC; - if(!dC.stdio_enable_ldms) - darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->file_rec->counters[STDIO_FLUSHES], tm1, tm2, rec_ref->file_rec->fcounters[STDIO_F_META_TIME], "STDIO", "MOD"); + extern struct darshanConnector dC; + if(!dC.stdio_enable_ldms) + darshan_ldms_connector_send(rec_ref->file_rec->base_rec.id, rec_ref->file_rec->base_rec.rank, -1, "close", -1, -1, -1, -1, rec_ref->file_rec->counters[STDIO_FLUSHES], tm1, tm2, rec_ref->file_rec->fcounters[STDIO_F_META_TIME], "STDIO", "MOD"); #endif } - STDIO_POST_RECORD(); return(ret);