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
73
Issues
73
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
03e86bd8
Commit
03e86bd8
authored
Oct 21, 2016
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorganize dxt & posix module interactions
parent
56a61bac
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
160 additions
and
176 deletions
+160
-176
darshan-runtime/lib/darshan-dxt.c
darshan-runtime/lib/darshan-dxt.c
+144
-147
darshan-runtime/lib/darshan-posix.c
darshan-runtime/lib/darshan-posix.c
+16
-29
No files found.
darshan-runtime/lib/darshan-dxt.c
View file @
03e86bd8
This diff is collapsed.
Click to expand it.
darshan-runtime/lib/darshan-posix.c
View file @
03e86bd8
...
...
@@ -157,22 +157,18 @@ static void posix_shutdown(
MPI_Comm
mod_comm
,
darshan_record_id
*
shared_recs
,
int
shared_rec_count
,
void
**
posix_buf
,
int
*
posix_buf_sz
);
/* DXT */
extern
void
dxt_posix_runtime_initialize
();
extern
void
dxt_posix_track_new_file_record
(
darshan_record_id
rec_id
,
const
char
*
path
);
extern
void
dxt_posix_add_record_ref
(
darshan_record_id
rec_id
,
int
fd
);
extern
void
dxt_posix_write
(
int
fd
,
int64_t
offset
,
int64_t
length
,
double
start_time
,
double
end_time
);
extern
void
dxt_posix_read
(
int
fd
,
int64_t
offset
,
int64_t
length
,
double
start_time
,
double
end_time
);
/* extern DXT function defs */
extern
void
dxt_posix_write
(
darshan_record_id
rec_id
,
int64_t
offset
,
int64_t
length
,
double
start_time
,
double
end_time
);
extern
void
dxt_posix_read
(
darshan_record_id
rec_id
,
int64_t
offset
,
int64_t
length
,
double
start_time
,
double
end_time
);
static
struct
posix_runtime
*
posix_runtime
=
NULL
;
static
pthread_mutex_t
posix_runtime_mutex
=
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
;
static
int
instrumentation_disabled
=
0
;
static
int
my_rank
=
-
1
;
static
int
darshan_mem_alignment
=
1
;
static
int
enable_dxt_io_trace
=
0
;
#define POSIX_LOCK() pthread_mutex_lock(&posix_runtime_mutex)
#define POSIX_UNLOCK() pthread_mutex_unlock(&posix_runtime_mutex)
...
...
@@ -182,10 +178,6 @@ static int darshan_mem_alignment = 1;
if(!instrumentation_disabled) { \
if(!posix_runtime) { \
posix_runtime_initialize(); \
/* DXT */
\
if (getenv("ENABLE_DXT_IO_TRACE")) { \
dxt_posix_runtime_initialize(); \
} \
} \
if(posix_runtime) break; \
} \
...
...
@@ -210,13 +202,7 @@ static int darshan_mem_alignment = 1;
} \
rec_id = darshan_core_gen_record_id(newpath); \
rec_ref = darshan_lookup_record_ref(posix_runtime->rec_id_hash, &rec_id, sizeof(darshan_record_id)); \
if(!rec_ref) { \
rec_ref = posix_track_new_file_record(rec_id, newpath); \
/* DXT */
\
if (getenv("ENABLE_DXT_IO_TRACE")) { \
dxt_posix_track_new_file_record(rec_id, newpath); \
} \
} \
if(!rec_ref) rec_ref = posix_track_new_file_record(rec_id, newpath); \
if(!rec_ref) { \
if(newpath != __path) free(newpath); \
break; \
...
...
@@ -236,10 +222,6 @@ static int darshan_mem_alignment = 1;
darshan_add_record_ref(&(posix_runtime->fd_hash), &__ret, sizeof(int), rec_ref); \
darshan_instrument_fs_data(rec_ref->fs_type, newpath, __ret); \
if(newpath != __path) free(newpath); \
/* DXT */
\
if (getenv("ENABLE_DXT_IO_TRACE")) { \
dxt_posix_add_record_ref(rec_id, __ret); \
} \
} while(0)
#define POSIX_RECORD_READ(__ret, __fd, __pread_flag, __pread_offset, __aligned, __tm1, __tm2) do { \
...
...
@@ -256,8 +238,8 @@ static int darshan_mem_alignment = 1;
else \
this_offset = rec_ref->offset; \
/* DXT to record detailed read tracing information */
\
if
(getenv("ENABLE_DXT_IO_TRACE")
) { \
dxt_posix_read(
__f
d, this_offset, __ret, __tm1, __tm2); \
if
(enable_dxt_io_trace
) { \
dxt_posix_read(
rec_ref->file_rec->base_rec.i
d, this_offset, __ret, __tm1, __tm2); \
} \
if(this_offset > rec_ref->last_byte_read) \
rec_ref->file_rec->counters[POSIX_SEQ_READS] += 1; \
...
...
@@ -314,8 +296,8 @@ static int darshan_mem_alignment = 1;
else \
this_offset = rec_ref->offset; \
/* DXT to record detailed write tracing information */
\
if
(getenv("ENABLE_DXT_IO_TRACE")
) { \
dxt_posix_write(
__f
d, this_offset, __ret, __tm1, __tm2); \
if
(enable_dxt_io_trace
) { \
dxt_posix_write(
rec_ref->file_rec->base_rec.i
d, this_offset, __ret, __tm1, __tm2); \
} \
if(this_offset > rec_ref->last_byte_written) \
rec_ref->file_rec->counters[POSIX_SEQ_WRITES] += 1; \
...
...
@@ -1292,6 +1274,11 @@ static void posix_runtime_initialize()
}
memset
(
posix_runtime
,
0
,
sizeof
(
*
posix_runtime
));
/* check if DXT (Darshan extended tracing) should be enabled */
if
(
getenv
(
"ENABLE_DXT_IO_TRACE"
))
{
enable_dxt_io_trace
=
1
;
}
return
;
}
...
...
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