Commit 56a61bac authored by Shane Snyder's avatar Shane Snyder

make DXT module request 0 memory from darshan-core

parent 5db2a039
......@@ -663,6 +663,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
......@@ -746,6 +747,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
......@@ -998,6 +1000,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
......@@ -1135,7 +1146,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
......@@ -1288,6 +1299,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
......
......@@ -38,12 +38,11 @@
#define DARSHAN_DEF_MMAP_LOG_PATH "/tmp"
#endif
/* DXT */
/* Maximum amount of memory per instrumentation module in MiB */
#ifdef __DARSHAN_MOD_MEM_MAX
#define DARSHAN_MOD_MEM_MAX (__DARSHAN_MOD_MEM_MAX * 1024 * 1024)
#else
#define DARSHAN_MOD_MEM_MAX (4 * 1024 * 1024) /* 4 MiB default */
#define DARSHAN_MOD_MEM_MAX (2 * 1024 * 1024) /* 2 MiB default */
#endif
/* default name record buf can store 2048 records of size 100 bytes */
......
......@@ -280,21 +280,22 @@ void dxt_mpiio_read(MPI_File fh, int64_t length,
/* initialize internal DXT module data structures and register with darshan-core */
void dxt_posix_runtime_initialize()
{
int psx_buf_size;
/* try and store a default number of records for this module */
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxt_file_record);
/* DXT modules request 0 memory -- buffers will be managed internally by DXT
* 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;
/* register the DXT module with darshan core */
darshan_core_register_module(
DXT_POSIX_MOD,
&dxt_posix_shutdown,
&psx_buf_size,
&dxt_psx_buf_size,
&posix_my_rank,
&darshan_mem_alignment);
/* return if darshan-core does not provide enough module memory */
if(psx_buf_size < sizeof(struct dxt_file_record))
/* return if darshan-core allocates an unexpected amount of memory */
if(dxt_psx_buf_size != 0)
{
darshan_core_unregister_module(DXT_POSIX_MOD);
return;
......@@ -313,21 +314,22 @@ void dxt_posix_runtime_initialize()
void dxt_mpiio_runtime_initialize()
{
int psx_buf_size;
/* try and store a default number of records for this module */
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxt_file_record);
/* DXT modules request 0 memory -- buffers will be managed internally by DXT
* 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;
/* register the DXT module with darshan core */
darshan_core_register_module(
DXT_MPIIO_MOD,
&dxt_mpiio_shutdown,
&psx_buf_size,
&dxt_mpiio_buf_size,
&mpiio_my_rank,
&darshan_mem_alignment);
/* return if darshan-core does not provide enough module memory */
if(psx_buf_size < sizeof(struct dxt_file_record))
/* return if darshan-core allocates an unexpected amount of memory */
if(dxt_mpiio_buf_size != 0)
{
darshan_core_unregister_module(DXT_MPIIO_MOD);
return;
......
......@@ -661,6 +661,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
......@@ -734,6 +735,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
......@@ -986,6 +988,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
......@@ -1123,7 +1134,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
......@@ -1276,6 +1287,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment