[Darshan-commits] [Git][darshan/darshan][master] long->size_t for memory sizes

Philip Carns xgitlab at cels.anl.gov
Mon Feb 22 09:38:29 CST 2021



Philip Carns pushed to branch master at darshan / darshan


Commits:
f860e676 by Phil Carns at 2021-02-22T10:38:07-05:00
long->size_t for memory sizes

- - - - -


13 changed files:

- darshan-runtime/darshan-core.h
- darshan-runtime/darshan.h
- darshan-runtime/lib/darshan-bgq.c
- darshan-runtime/lib/darshan-core.c
- darshan-runtime/lib/darshan-dxt.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


Changes:

=====================================
darshan-runtime/darshan-core.h
=====================================
@@ -82,7 +82,7 @@ struct darshan_core_module
 {
     void *rec_buf_start;
     void *rec_buf_p;
-    long rec_mem_avail;
+    size_t rec_mem_avail;
     darshan_module_funcs mod_funcs;
 };
 
@@ -107,9 +107,9 @@ struct darshan_core_runtime
 
     /* darshan-core internal data structures */
     struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
-    long mod_mem_used;
+    size_t mod_mem_used;
     struct darshan_core_name_record_ref *name_hash;
-    long name_mem_used;
+    size_t name_mem_used;
     double wtime_offset;
     char *comp_buf;
 #ifdef __DARSHAN_ENABLE_MMAP_LOGS


=====================================
darshan-runtime/darshan.h
=====================================
@@ -155,7 +155,7 @@ void darshan_instrument_fs_data(
 void darshan_core_register_module(
     darshan_module_id mod_id,
     darshan_module_funcs mod_funcs,
-    int *inout_mod_buf_size,
+    size_t *inout_mod_buf_size,
     int *rank,
     int *sys_mem_alignment);
 


=====================================
darshan-runtime/lib/darshan-bgq.c
=====================================
@@ -107,7 +107,7 @@ static void capture(struct darshan_bgq_record *rec, darshan_record_id rec_id)
 
 void bgq_runtime_initialize()
 {
-    int bgq_buf_size;
+    size_t bgq_buf_size;
     darshan_record_id rec_id;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI


=====================================
darshan-runtime/lib/darshan-core.c
=====================================
@@ -54,7 +54,7 @@ static int using_mpi = 0;
 static int my_rank = 0;
 static int nprocs = 1;
 static int darshan_mem_alignment = 1;
-static long darshan_mod_mem_quota = DARSHAN_MOD_MEM_MAX;
+static size_t darshan_mod_mem_quota = DARSHAN_MOD_MEM_MAX;
 
 static struct darshan_core_mnt_data mnt_data_array[DARSHAN_MAX_MNTS];
 static int mnt_data_count = 0;
@@ -741,7 +741,7 @@ static void *darshan_init_mmap_log(struct darshan_core_runtime* core, int jobid)
 {
     int ret;
     int mmap_fd;
-    int mmap_size;
+    size_t mmap_size;
     int sys_page_size;
     char cuser[L_cuserid] = {0};
     uint64_t hlevel;
@@ -2147,13 +2147,13 @@ void darshan_shutdown_bench(int argc, char **argv)
 void darshan_core_register_module(
     darshan_module_id mod_id,
     darshan_module_funcs mod_funcs,
-    int *inout_mod_buf_size,
+    size_t *inout_mod_buf_size,
     int *rank,
     int *sys_mem_alignment)
 {
     struct darshan_core_module* mod;
-    long mod_mem_req = *inout_mod_buf_size;
-    long mod_mem_avail;
+    size_t mod_mem_req = *inout_mod_buf_size;
+    size_t mod_mem_avail;
 
     *inout_mod_buf_size = 0;
 


=====================================
darshan-runtime/lib/darshan-dxt.c
=====================================
@@ -166,8 +166,8 @@ static pthread_mutex_t dxt_runtime_mutex =
             PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
 static int dxt_my_rank = -1;
-static long dxt_total_mem = DXT_IO_TRACE_MEM_MAX;
-static long dxt_mem_remaining = 0;
+static size_t dxt_total_mem = DXT_IO_TRACE_MEM_MAX;
+static size_t dxt_mem_remaining = 0;
 
 #define MAX_DXT_TRIGGERS 20
 static int num_dxt_triggers = 0;
@@ -273,7 +273,7 @@ void dxt_posix_runtime_initialize()
      * and passed back to darshan-core at shutdown time to allow DXT more control
      * over realloc'ing module memory as needed.
      */
-    int dxt_psx_buf_size = 0;
+    size_t dxt_psx_buf_size = 0;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = NULL,
@@ -338,7 +338,7 @@ void dxt_mpiio_runtime_initialize()
      * and passed back to darshan-core at shutdown time to allow DXT more control
      * over realloc'ing module memory as needed.
      */
-    int dxt_mpiio_buf_size = 0;
+    size_t dxt_mpiio_buf_size = 0;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = NULL,


=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -914,7 +914,7 @@ herr_t DARSHAN_DECL(H5Dclose)(hid_t dataset_id)
 /* initialize internal HDF5 module data strucutres and register with darshan-core */
 static void hdf5_file_runtime_initialize()
 {
-    int hdf5_buf_size;
+    size_t hdf5_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = &hdf5_file_mpi_redux,


=====================================
darshan-runtime/lib/darshan-lustre.c
=====================================
@@ -181,7 +181,7 @@ void darshan_instrument_lustre_file(const char* filepath, int fd)
 
 static void lustre_runtime_initialize()
 {
-    int lustre_buf_size;
+    size_t lustre_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
         .mod_redux_func = &lustre_mpi_redux,


=====================================
darshan-runtime/lib/darshan-mdhim.c
=====================================
@@ -307,7 +307,7 @@ mdhim_grm_t * DARSHAN_DECL(mdhimGet)(mdhim_t *md,
  * darshan-core. */
 static void mdhim_runtime_initialize()
 {
-    int mdhim_buf_size;
+    size_t mdhim_buf_size;
     darshan_module_funcs mod_funcs = {
     .mod_redux_func = &mdhim_mpi_redux,
     .mod_shutdown_func = &mdhim_shutdown


=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
@@ -1155,7 +1155,7 @@ DARSHAN_WRAPPER_MAP(PMPI_File_close, int, (MPI_File *fh), MPI_File_close)
 /* initialize data structures and register with darshan-core component */
 static void mpiio_runtime_initialize()
 {
-    int mpiio_buf_size;
+    size_t mpiio_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = &mpiio_mpi_redux,


=====================================
darshan-runtime/lib/darshan-null.c
=====================================
@@ -197,7 +197,7 @@ int DARSHAN_DECL(foo)(const char* name, int arg1)
 /* Initialize internal NULL module data structures and register with darshan-core. */
 static void null_runtime_initialize()
 {
-    int null_buf_size;
+    size_t null_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     /* NOTE: the redux function can be used to run collective operations prior to


=====================================
darshan-runtime/lib/darshan-pnetcdf.c
=====================================
@@ -212,7 +212,7 @@ int DARSHAN_DECL(ncmpi_close)(int ncid)
 /* initialize internal PNETCDF module data strucutres and register with darshan-core */
 static void pnetcdf_runtime_initialize()
 {
-    int pnetcdf_buf_size;
+    size_t pnetcdf_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = &pnetcdf_mpi_redux,


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
@@ -1864,7 +1864,7 @@ int DARSHAN_DECL(rename)(const char *oldpath, const char *newpath)
 /* initialize internal POSIX module data structures and register with darshan-core */
 static void posix_runtime_initialize()
 {
-    int psx_buf_size;
+    size_t psx_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
         .mod_redux_func = &posix_mpi_redux,


=====================================
darshan-runtime/lib/darshan-stdio.c
=====================================
@@ -999,7 +999,7 @@ int DARSHAN_DECL(fsetpos64)(FILE *stream, const fpos64_t *pos)
 /* initialize internal STDIO module data structures and register with darshan-core */
 static void stdio_runtime_initialize()
 {
-    int stdio_buf_size;
+    size_t stdio_buf_size;
     darshan_module_funcs mod_funcs = {
 #ifdef HAVE_MPI
     .mod_redux_func = &stdio_mpi_redux,



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

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/f860e676ae6138fcea73cc8345ed19a52ce1c4e3
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/20210222/b4c6dacd/attachment-0001.html>


More information about the Darshan-commits mailing list