Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sudheer Chunduri
darshan
Commits
79ec6b82
Commit
79ec6b82
authored
Jan 30, 2017
by
Shane Snyder
Browse files
allow mem env variables to be floats
this allows us to request memory allocations at smaller granularity than MiB
parent
7bebe64f
Changes
2
Hide whitespace changes
Inline
Side-by-side
darshan-runtime/lib/darshan-core.c
View file @
79ec6b82
...
...
@@ -156,8 +156,9 @@ void darshan_core_initialize(int argc, char **argv)
char
*
jobid_str
;
int
jobid
;
int
ret
;
int
tmpval
;
int
i
;
int
tmpval
;
double
tmpfloat
;
DARSHAN_MPI_CALL
(
PMPI_Comm_size
)(
MPI_COMM_WORLD
,
&
nprocs
);
DARSHAN_MPI_CALL
(
PMPI_Comm_rank
)(
MPI_COMM_WORLD
,
&
my_rank
);
...
...
@@ -219,11 +220,11 @@ void darshan_core_initialize(int argc, char **argv)
envstr
=
getenv
(
DARSHAN_MOD_MEM_OVERRIDE
);
if
(
envstr
)
{
ret
=
sscanf
(
envstr
,
"%
d
"
,
&
tmp
val
);
ret
=
sscanf
(
envstr
,
"%
lf
"
,
&
tmp
float
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmp
val
>
0
)
if
(
ret
==
1
&&
tmp
float
>
0
)
{
darshan_mod_mem_quota
=
tmp
val
*
1024
*
1024
;
/* convert from MiB */
darshan_mod_mem_quota
=
tmp
float
*
1024
*
1024
;
/* convert from MiB */
}
}
...
...
darshan-runtime/lib/darshan-dxt.c
View file @
79ec6b82
...
...
@@ -379,7 +379,8 @@ static void dxt_posix_runtime_initialize()
* over realloc'ing module memory as needed.
*/
int
dxt_psx_buf_size
=
0
;
int
ret
,
tmpval
;
int
ret
;
double
tmpfloat
;
char
*
envstr
;
/* register the DXT module with darshan core */
...
...
@@ -411,11 +412,11 @@ static void dxt_posix_runtime_initialize()
envstr
=
getenv
(
"ENABLE_DXT_IO_TRACE_MEM"
);
if
(
envstr
&&
dxt_mpiio_runtime
==
NULL
)
{
ret
=
sscanf
(
envstr
,
"%
d
"
,
&
tmp
val
);
ret
=
sscanf
(
envstr
,
"%
lf
"
,
&
tmp
float
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmp
val
>
0
)
if
(
ret
==
1
&&
tmp
float
>
0
)
{
dxt_mem_remaining
=
tmp
val
*
1024
*
1024
;
/* convert from MiB */
dxt_mem_remaining
=
tmp
float
*
1024
*
1024
;
/* convert from MiB */
}
}
DXT_UNLOCK
();
...
...
@@ -430,7 +431,8 @@ void dxt_mpiio_runtime_initialize()
* over realloc'ing module memory as needed.
*/
int
dxt_mpiio_buf_size
=
0
;
int
ret
,
tmpval
;
int
ret
;
double
tmpfloat
;
char
*
envstr
;
/* register the DXT module with darshan core */
...
...
@@ -462,11 +464,11 @@ void dxt_mpiio_runtime_initialize()
envstr
=
getenv
(
"ENABLE_DXT_IO_TRACE_MEM"
);
if
(
envstr
&&
dxt_posix_runtime
==
NULL
)
{
ret
=
sscanf
(
envstr
,
"%
d
"
,
&
tmp
val
);
ret
=
sscanf
(
envstr
,
"%
lf
"
,
&
tmp
float
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmp
val
>
0
)
if
(
ret
==
1
&&
tmp
float
>
0
)
{
dxt_mem_remaining
=
tmp
val
*
1024
*
1024
;
/* convert from MiB */
dxt_mem_remaining
=
tmp
float
*
1024
*
1024
;
/* convert from MiB */
}
}
DXT_UNLOCK
();
...
...
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