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
72
Issues
72
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
acc05e4a
Commit
acc05e4a
authored
Mar 06, 2015
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve minor TODO items
parent
75eee950
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
223 additions
and
152 deletions
+223
-152
darshan-runtime/Makefile.in
darshan-runtime/Makefile.in
+0
-4
darshan-runtime/darshan-core.h
darshan-runtime/darshan-core.h
+18
-9
darshan-runtime/darshan.h
darshan-runtime/darshan.h
+13
-8
darshan-runtime/lib/darshan-core.c
darshan-runtime/lib/darshan-core.c
+184
-124
darshan-runtime/lib/darshan-posix.c
darshan-runtime/lib/darshan-posix.c
+8
-7
No files found.
darshan-runtime/Makefile.in
View file @
acc05e4a
...
...
@@ -28,14 +28,11 @@ CFLAGS = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I ../ -I $(srcdir
#
CFLAGS_SHARED
=
-DDARSHAN_CONFIG_H
=
\"
darshan-runtime-config.h
\"
-I
.
-I
$(srcdir)
-I
$(srcdir)
/../ @CFLAGS@ @CPPFLAGS@
-D_LARGEFILE64_SOURCE
-shared
-fpic
-DPIC
-DDARSHAN_PRELOAD
# TODO: BZ2?
LIBS
=
-lz
@LIBBZ2@
lib
::
@
mkdir
-p
$@
# TODO make sure the headers are right in these prereqs
lib/darshan-core.o
:
lib/darshan-core.c darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
$(CC)
$(CFLAGS)
-c
$<
-o
$@
...
...
@@ -66,7 +63,6 @@ lib/lookup8.o: lib/lookup8.c
lib/lookup8.po
:
lib/lookup8.c
$(CC)
$(CFLAGS_SHARED)
-c
$<
-o
$@
# TODO: huh?
#%.i: %.c
# $(CC) -E $(CFLAGS) -c $< -o $@
...
...
darshan-runtime/darshan-core.h
View file @
acc05e4a
...
...
@@ -12,18 +12,20 @@
#include "darshan.h"
/* TODO: enforce this when handing out ids */
/* TODO: this goes where ? -- shared libs */
#define DARSHAN_MPI_CALL(func) func
#define DARSHAN_CORE_MAX_RECORDS 1024
/* default compression buffer size of 2 MiB */
/* TODO: revisit this default size if we change memory per module */
#define DARSHAN_COMP_BUF_SIZE (2 * 1024 * 1024)
#define DARSHAN_CO
RE_CO
MP_BUF_SIZE (2 * 1024 * 1024)
struct
darshan_core_module
{
darshan_module_id
id
;
struct
darshan_module_funcs
mod_funcs
;
};
#define DARSHAN_CORE_MOD_SET(flags, id) (flags | (1 << id))
#define DARSHAN_CORE_MOD_UNSET(flags, id) (flags & ~(1 << id))
#define DARSHAN_CORE_MOD_ISSET(flags, id) (flags & (1 << id))
/* in memory structure to keep up with job level data */
struct
darshan_core_runtime
...
...
@@ -31,12 +33,19 @@ struct darshan_core_runtime
struct
darshan_job
log_job
;
char
exe
[
DARSHAN_EXE_LEN
+
1
];
struct
darshan_core_record_ref
*
rec_hash
;
int
rec_count
;
struct
darshan_core_module
*
mod_array
[
DARSHAN_MAX_MODS
];
char
comp_buf
[
DARSHAN_COMP_BUF_SIZE
];
char
comp_buf
[
DARSHAN_CO
RE_CO
MP_BUF_SIZE
];
double
wtime_offset
;
char
*
trailing_data
;
};
struct
darshan_core_module
{
darshan_module_id
id
;
struct
darshan_module_funcs
mod_funcs
;
};
struct
darshan_core_record_ref
{
struct
darshan_record
rec
;
...
...
darshan-runtime/darshan.h
View file @
acc05e4a
...
...
@@ -25,20 +25,21 @@
/* Environment variable to override __CP_MEM_ALIGNMENT */
#define CP_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"
/* module developers provide the following functions to darshan-core */
struct
darshan_module_funcs
{
/* disable futher instrumentation within a module */
void
(
*
disable_instrumentation
)(
void
);
/*
TODO:
*/
/*
perform any necessary steps prior to reducing
*/
void
(
*
prepare_for_reduction
)(
darshan_record_id
*
shared_recs
,
darshan_record_id
*
shared_recs
,
/* input list of shared records */
int
*
shared_rec_count
,
/* in/out shared record count */
void
**
send_buf
,
void
**
recv_buf
,
int
*
rec_size
void
**
send_buf
,
/* send buffer for shared file reduction */
void
**
recv_buf
,
/* recv buffer for shared file reduction (root only) */
int
*
rec_size
/* size of records being stored for this module */
);
/*
TODO:
*/
void
(
*
reduce_record
)(
/*
reduce records which are shared globally across this module
*/
void
(
*
reduce_record
s
)(
void
*
infile_v
,
void
*
inoutfile_v
,
int
*
len
,
...
...
@@ -62,13 +63,17 @@ void darshan_core_register_module(
struct
darshan_module_funcs
*
funcs
,
int
*
runtime_mem_limit
);
void
darshan_core_
lookup_record_i
d
(
void
darshan_core_
register_recor
d
(
void
*
name
,
int
len
,
int
printable_flag
,
darshan_module_id
mod_id
,
darshan_record_id
*
id
);
void
darshan_core_unregister_record
(
darshan_record_id
rec_id
,
darshan_module_id
mod_id
);
double
darshan_core_wtime
(
void
);
/***********************************************
...
...
darshan-runtime/lib/darshan-core.c
View file @
acc05e4a
This diff is collapsed.
Click to expand it.
darshan-runtime/lib/darshan-posix.c
View file @
acc05e4a
...
...
@@ -127,7 +127,7 @@ static void posix_file_close_fd(int fd);
static
void
posix_disable_instrumentation
(
void
);
static
void
posix_prepare_for_reduction
(
darshan_record_id
*
shared_recs
,
int
*
shared_rec_count
,
void
**
send_buf
,
void
**
recv_buf
,
int
*
rec_size
);
static
void
posix_reduce_record
(
void
*
infile_v
,
void
*
inoutfile_v
,
static
void
posix_reduce_record
s
(
void
*
infile_v
,
void
*
inoutfile_v
,
int
*
len
,
MPI_Datatype
*
datatype
);
static
void
posix_get_output_data
(
void
**
buffer
,
int
*
size
);
static
void
posix_shutdown
(
void
);
...
...
@@ -306,7 +306,7 @@ static void posix_runtime_initialize()
{
.
disable_instrumentation
=
&
posix_disable_instrumentation
,
.
prepare_for_reduction
=
&
posix_prepare_for_reduction
,
.
reduce_record
=
&
posix_reduce_record
,
.
reduce_record
s
=
&
posix_reduce_records
,
.
get_output_data
=
&
posix_get_output_data
,
.
shutdown
=
&
posix_shutdown
};
...
...
@@ -350,7 +350,8 @@ static void posix_runtime_initialize()
memset
(
posix_runtime
->
file_record_array
,
0
,
posix_runtime
->
file_array_size
*
sizeof
(
struct
darshan_posix_file
));
DARSHAN_MPI_CALL
(
PMPI_Comm_rank
)(
MPI_COMM_WORLD
,
&
my_rank
);
/* TODO: can we move this out of here? */
/* TODO: can we move this out of here? perhaps register_module returns rank? */
DARSHAN_MPI_CALL
(
PMPI_Comm_rank
)(
MPI_COMM_WORLD
,
&
my_rank
);
return
;
}
...
...
@@ -369,7 +370,7 @@ static struct posix_runtime_file* posix_file_by_name(const char *name)
newname
=
(
char
*
)
name
;
/* get a unique id for this file from darshan core */
darshan_core_
lookup_record_i
d
(
darshan_core_
register_recor
d
(
(
void
*
)
newname
,
strlen
(
newname
),
1
,
...
...
@@ -548,7 +549,7 @@ static void posix_prepare_for_reduction(
*
rec_size
=
sizeof
(
struct
darshan_posix_file
);
/* TODO:
HACK-Y -- how can we do this in a cleaner way?
? */
/* TODO:
cleaner way to do this
? */
if
(
my_rank
==
0
)
posix_runtime
->
red_buf
=
*
recv_buf
;
posix_runtime
->
shared_rec_count
=
*
shared_rec_count
;
...
...
@@ -556,7 +557,7 @@ static void posix_prepare_for_reduction(
return
;
}
static
void
posix_reduce_record
(
static
void
posix_reduce_record
s
(
void
*
infile_v
,
void
*
inoutfile_v
,
int
*
len
,
...
...
@@ -605,7 +606,7 @@ static void posix_get_output_data(
{
assert
(
posix_runtime
);
/* TODO:
HACK-Y -- how can we do this in a cleaner way?
? */
/* TODO:
cleaner way to do this
? */
/* clean up reduction state */
if
(
my_rank
==
0
)
{
...
...
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