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
Shane Snyder
darshan
Commits
08438176
Commit
08438176
authored
Sep 29, 2014
by
Shane Snyder
Browse files
slight update to code structure/naming
parent
bd6ef308
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
darshan-runtime/darshan-core.h
View file @
08438176
...
...
@@ -37,4 +37,6 @@ void darshan_core_lookup_id(
int
printable_flag
,
darshan_file_id
*
id
);
double
darshan_core_wtime
(
void
);
#endif
/* __DARSHAN_CORE_H */
darshan-runtime/lib/darshan-core.c
View file @
08438176
...
...
@@ -26,8 +26,8 @@ static void darshan_shutdown(void);
static
char
*
darshan_get_exe_and_mounts
(
int
rank
);
static
void
darshan_get_exe_and_mounts_root
(
char
*
trailing_data
,
int
space_left
);
/* internal variables */
static
struct
darshan_job_runtime
*
darshan_global_job
=
NULL
;
static
int
darshan_mem_alignment
=
1
;
#define CP_MAX_MNTS 64
#define CP_MAX_MNT_PATH 256
...
...
@@ -90,12 +90,9 @@ static void darshan_initialize(int *argc, char ***argv)
int
rank
;
int
internal_timing_flag
=
0
;
double
init_start
,
init_time
,
init_max
;
char
*
mem_align
;
char
*
truncate_string
=
"<TRUNCATED>"
;
int
truncate_offset
;
int
chars_left
=
0
;
int
ret
;
int
tmpval
;
DARSHAN_MPI_CALL
(
PMPI_Comm_size
)(
MPI_COMM_WORLD
,
&
nprocs
);
DARSHAN_MPI_CALL
(
PMPI_Comm_rank
)(
MPI_COMM_WORLD
,
&
rank
);
...
...
@@ -109,30 +106,6 @@ static void darshan_initialize(int *argc, char ***argv)
/* setup darshan runtime if darshan is enabled and hasn't been initialized already */
if
(
!
getenv
(
"DARSHAN_DISABLE"
)
&&
!
darshan_global_job
)
{
#if (__CP_MEM_ALIGNMENT < 1)
#error Darshan must be configured with a positive value for --with-mem-align
#endif
mem_align
=
getenv
(
"DARSHAN_MEMALIGN"
);
if
(
mem_align
)
{
ret
=
sscanf
(
mem_align
,
"%d"
,
&
tmpval
);
/* silently ignore if the env variable is set poorly */
if
(
ret
==
1
&&
tmpval
>
0
)
{
darshan_mem_alignment
=
tmpval
;
}
}
else
{
darshan_mem_alignment
==
__CP_MEM_ALIGNMENT
;
}
/* avoid floating point errors on faulty input */
if
(
darshan_mem_alignment
<
1
)
{
darshan_mem_alignment
=
1
;
}
/* allocate structure to track darshan_global_job information */
darshan_global_job
=
malloc
(
sizeof
(
*
darshan_global_job
));
if
(
darshan_global_job
)
...
...
@@ -144,13 +117,6 @@ static void darshan_initialize(int *argc, char ***argv)
darshan_global_job
->
flags
|=
CP_FLAG_NOTIMING
;
}
/* set up file records */
for
(
i
=
0
;
i
<
CP_MAX_FILES
;
i
++
)
{
darshan_global_job
->
file_runtime_array
[
i
].
log_file
=
&
darshan_global_job
->
file_array
[
i
];
}
strcpy
(
darshan_global_job
->
log_job
.
version_string
,
CP_VERSION
);
darshan_global_job
->
log_job
.
magic_nr
=
CP_MAGIC_NR
;
darshan_global_job
->
log_job
.
uid
=
getuid
();
...
...
@@ -424,6 +390,15 @@ void darshan_core_lookup_id(
return
;
}
double
darshan_core_wtime
()
{
if
(
!
darshan_global_job
||
darshan_global_job
->
flags
&
CP_FLAG_NOTIMING
)
{
return
(
0
);
}
return
DARSHAN_MPI_CALL
(
PMPI_Wtime
)();
}
/*
* Local variables:
...
...
darshan-runtime/lib/darshan-posix.c
View file @
08438176
This diff is collapsed.
Click to expand it.
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