Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cristian Simarro
darshan
Commits
7bebe64f
Commit
7bebe64f
authored
Jan 30, 2017
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make dxt mem usage runtime configurable
parent
a4a77ada
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
darshan-runtime/lib/darshan-dxt.c
darshan-runtime/lib/darshan-dxt.c
+39
-1
darshan-runtime/lib/darshan-mpiio.c
darshan-runtime/lib/darshan-mpiio.c
+1
-1
darshan-runtime/lib/darshan-posix.c
darshan-runtime/lib/darshan-posix.c
+1
-1
No files found.
darshan-runtime/lib/darshan-dxt.c
View file @
7bebe64f
...
@@ -35,7 +35,11 @@ typedef int64_t off64_t;
...
@@ -35,7 +35,11 @@ typedef int64_t off64_t;
#endif
#endif
/* maximum amount of memory to use for storing DXT records */
/* maximum amount of memory to use for storing DXT records */
#define DXT_IO_TRACE_MEM_MAX (4 * 1024 * 1024)
/* 4 MiB */
#ifdef __DARSHAN_MOD_MEM_MAX
#define DXT_IO_TRACE_MEM_MAX (__DARSHAN_MOD_MEM_MAX * 1024 * 1024)
#else
#define DXT_IO_TRACE_MEM_MAX (4 * 1024 * 1024)
/* 4 MiB default */
#endif
/* initial size of read/write trace buffer (in number of segments) */
/* initial size of read/write trace buffer (in number of segments) */
/* NOTE: when this size is exceeded, the buffer size is doubled */
/* NOTE: when this size is exceeded, the buffer size is doubled */
...
@@ -375,6 +379,8 @@ static void dxt_posix_runtime_initialize()
...
@@ -375,6 +379,8 @@ static void dxt_posix_runtime_initialize()
* over realloc'ing module memory as needed.
* over realloc'ing module memory as needed.
*/
*/
int
dxt_psx_buf_size
=
0
;
int
dxt_psx_buf_size
=
0
;
int
ret
,
tmpval
;
char
*
envstr
;
/* register the DXT module with darshan core */
/* register the DXT module with darshan core */
darshan_core_register_module
(
darshan_core_register_module
(
...
@@ -391,14 +397,29 @@ static void dxt_posix_runtime_initialize()
...
@@ -391,14 +397,29 @@ static void dxt_posix_runtime_initialize()
return
;
return
;
}
}
DXT_LOCK
();
dxt_posix_runtime
=
malloc
(
sizeof
(
*
dxt_posix_runtime
));
dxt_posix_runtime
=
malloc
(
sizeof
(
*
dxt_posix_runtime
));
if
(
!
dxt_posix_runtime
)
if
(
!
dxt_posix_runtime
)
{
{
darshan_core_unregister_module
(
DXT_POSIX_MOD
);
darshan_core_unregister_module
(
DXT_POSIX_MOD
);
DXT_UNLOCK
();
return
;
return
;
}
}
memset
(
dxt_posix_runtime
,
0
,
sizeof
(
*
dxt_posix_runtime
));
memset
(
dxt_posix_runtime
,
0
,
sizeof
(
*
dxt_posix_runtime
));
/* set the memory quota for DXT, if it has not been initialized */
envstr
=
getenv
(
"ENABLE_DXT_IO_TRACE_MEM"
);
if
(
envstr
&&
dxt_mpiio_runtime
==
NULL
)
{
ret
=
sscanf
(
envstr
,
"%d"
,
&
tmpval
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmpval
>
0
)
{
dxt_mem_remaining
=
tmpval
*
1024
*
1024
;
/* convert from MiB */
}
}
DXT_UNLOCK
();
return
;
return
;
}
}
...
@@ -409,6 +430,8 @@ void dxt_mpiio_runtime_initialize()
...
@@ -409,6 +430,8 @@ void dxt_mpiio_runtime_initialize()
* over realloc'ing module memory as needed.
* over realloc'ing module memory as needed.
*/
*/
int
dxt_mpiio_buf_size
=
0
;
int
dxt_mpiio_buf_size
=
0
;
int
ret
,
tmpval
;
char
*
envstr
;
/* register the DXT module with darshan core */
/* register the DXT module with darshan core */
darshan_core_register_module
(
darshan_core_register_module
(
...
@@ -425,14 +448,29 @@ void dxt_mpiio_runtime_initialize()
...
@@ -425,14 +448,29 @@ void dxt_mpiio_runtime_initialize()
return
;
return
;
}
}
DXT_LOCK
();
dxt_mpiio_runtime
=
malloc
(
sizeof
(
*
dxt_mpiio_runtime
));
dxt_mpiio_runtime
=
malloc
(
sizeof
(
*
dxt_mpiio_runtime
));
if
(
!
dxt_mpiio_runtime
)
if
(
!
dxt_mpiio_runtime
)
{
{
darshan_core_unregister_module
(
DXT_MPIIO_MOD
);
darshan_core_unregister_module
(
DXT_MPIIO_MOD
);
DXT_UNLOCK
();
return
;
return
;
}
}
memset
(
dxt_mpiio_runtime
,
0
,
sizeof
(
*
dxt_mpiio_runtime
));
memset
(
dxt_mpiio_runtime
,
0
,
sizeof
(
*
dxt_mpiio_runtime
));
/* set the memory quota for DXT, if it has not been initialized */
envstr
=
getenv
(
"ENABLE_DXT_IO_TRACE_MEM"
);
if
(
envstr
&&
dxt_posix_runtime
==
NULL
)
{
ret
=
sscanf
(
envstr
,
"%d"
,
&
tmpval
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmpval
>
0
)
{
dxt_mem_remaining
=
tmpval
*
1024
*
1024
;
/* convert from MiB */
}
}
DXT_UNLOCK
();
return
;
return
;
}
}
...
...
darshan-runtime/lib/darshan-mpiio.c
View file @
7bebe64f
...
@@ -862,7 +862,7 @@ static void mpiio_runtime_initialize()
...
@@ -862,7 +862,7 @@ static void mpiio_runtime_initialize()
memset
(
mpiio_runtime
,
0
,
sizeof
(
*
mpiio_runtime
));
memset
(
mpiio_runtime
,
0
,
sizeof
(
*
mpiio_runtime
));
/* check if DXT (Darshan extended tracing) should be enabled */
/* check if DXT (Darshan extended tracing) should be enabled */
if
(
getenv
(
"ENABLE_DXT_IO_TRACE"
))
{
if
(
getenv
(
"ENABLE_DXT_IO_TRACE
_MEM
"
))
{
enable_dxt_io_trace
=
1
;
enable_dxt_io_trace
=
1
;
}
}
...
...
darshan-runtime/lib/darshan-posix.c
View file @
7bebe64f
...
@@ -1291,7 +1291,7 @@ static void posix_runtime_initialize()
...
@@ -1291,7 +1291,7 @@ static void posix_runtime_initialize()
memset
(
posix_runtime
,
0
,
sizeof
(
*
posix_runtime
));
memset
(
posix_runtime
,
0
,
sizeof
(
*
posix_runtime
));
/* check if DXT (Darshan extended tracing) should be enabled */
/* check if DXT (Darshan extended tracing) should be enabled */
if
(
getenv
(
"ENABLE_DXT_IO_TRACE"
))
{
if
(
getenv
(
"ENABLE_DXT_IO_TRACE
_MEM
"
))
{
enable_dxt_io_trace
=
1
;
enable_dxt_io_trace
=
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment