Commit 657de0d7 authored by Rob Latham's avatar Rob Latham
Browse files

Add "extra info" field to the records

parent 2becd2dc
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#define DXT_POSIX_VER 1 #define DXT_POSIX_VER 1
#define DXT_MPIIO_VER 1 #define DXT_MPIIO_VER 1
#define EXTRA_INFO_LEN 64
#define HOSTNAME_SIZE 64 #define HOSTNAME_SIZE 64
/* /*
...@@ -21,6 +22,7 @@ typedef struct segment_info { ...@@ -21,6 +22,7 @@ typedef struct segment_info {
int64_t length; int64_t length;
double start_time; double start_time;
double end_time; double end_time;
char extra_info[EXTRA_INFO_LEN];
} segment_info; } segment_info;
#define X(a) a, #define X(a) a,
......
...@@ -223,6 +223,7 @@ void dxt_posix_write(darshan_record_id rec_id, int64_t offset, ...@@ -223,6 +223,7 @@ void dxt_posix_write(darshan_record_id rec_id, int64_t offset,
{ {
struct dxt_file_record_ref* rec_ref = NULL; struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec; struct dxt_file_record *file_rec;
char *s;
/* make sure dxt posix runtime is initialized properly */ /* make sure dxt posix runtime is initialized properly */
if(!dxt_posix_runtime) if(!dxt_posix_runtime)
...@@ -253,6 +254,14 @@ void dxt_posix_write(darshan_record_id rec_id, int64_t offset, ...@@ -253,6 +254,14 @@ void dxt_posix_write(darshan_record_id rec_id, int64_t offset,
rec_ref->write_traces[file_rec->write_count].length = length; rec_ref->write_traces[file_rec->write_count].length = length;
rec_ref->write_traces[file_rec->write_count].start_time = start_time; rec_ref->write_traces[file_rec->write_count].start_time = start_time;
rec_ref->write_traces[file_rec->write_count].end_time = end_time; rec_ref->write_traces[file_rec->write_count].end_time = end_time;
s = getenv("DARSHAN_DXT_EXTRA_INFO");
if (s != NULL) {
strncpy(rec_ref->write_traces[file_rec->write_count].extra_info, s,
EXTRA_INFO_LEN-1);
} else {
rec_ref->write_traces[file_rec->write_count].extra_info[0] = '\0';
}
file_rec->write_count += 1; file_rec->write_count += 1;
} }
...@@ -261,6 +270,7 @@ void dxt_posix_read(darshan_record_id rec_id, int64_t offset, ...@@ -261,6 +270,7 @@ void dxt_posix_read(darshan_record_id rec_id, int64_t offset,
{ {
struct dxt_file_record_ref* rec_ref = NULL; struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec; struct dxt_file_record *file_rec;
char *s;
/* make sure dxt posix runtime is initialized properly */ /* make sure dxt posix runtime is initialized properly */
if(!dxt_posix_runtime) if(!dxt_posix_runtime)
...@@ -290,6 +300,14 @@ void dxt_posix_read(darshan_record_id rec_id, int64_t offset, ...@@ -290,6 +300,14 @@ void dxt_posix_read(darshan_record_id rec_id, int64_t offset,
rec_ref->read_traces[file_rec->read_count].length = length; rec_ref->read_traces[file_rec->read_count].length = length;
rec_ref->read_traces[file_rec->read_count].start_time = start_time; rec_ref->read_traces[file_rec->read_count].start_time = start_time;
rec_ref->read_traces[file_rec->read_count].end_time = end_time; rec_ref->read_traces[file_rec->read_count].end_time = end_time;
s = getenv("DARSHAN_DXT_EXTRA_INFO");
if (s != NULL) {
strncpy(rec_ref->read_traces[file_rec->read_count].extra_info, s,
EXTRA_INFO_LEN-1);
} else {
rec_ref->write_traces[file_rec->write_count].extra_info[0] = '\0';
}
file_rec->read_count += 1; file_rec->read_count += 1;
} }
...@@ -298,6 +316,7 @@ void dxt_mpiio_write(darshan_record_id rec_id, int64_t length, ...@@ -298,6 +316,7 @@ void dxt_mpiio_write(darshan_record_id rec_id, int64_t length,
{ {
struct dxt_file_record_ref* rec_ref = NULL; struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec; struct dxt_file_record *file_rec;
char *s;
/* make sure dxt mpiio runtime is initialized properly */ /* make sure dxt mpiio runtime is initialized properly */
if(!dxt_mpiio_runtime) if(!dxt_mpiio_runtime)
...@@ -327,6 +346,13 @@ void dxt_mpiio_write(darshan_record_id rec_id, int64_t length, ...@@ -327,6 +346,13 @@ void dxt_mpiio_write(darshan_record_id rec_id, int64_t length,
rec_ref->write_traces[file_rec->write_count].length = length; rec_ref->write_traces[file_rec->write_count].length = length;
rec_ref->write_traces[file_rec->write_count].start_time = start_time; rec_ref->write_traces[file_rec->write_count].start_time = start_time;
rec_ref->write_traces[file_rec->write_count].end_time = end_time; rec_ref->write_traces[file_rec->write_count].end_time = end_time;
s = getenv("DARSHAN_DXT_EXTRA_INFO");
if (s != NULL) {
strncpy(rec_ref->write_traces[file_rec->write_count].extra_info, s,
EXTRA_INFO_LEN-1);
} else {
rec_ref->write_traces[file_rec->write_count].extra_info[0] = '\0';
}
file_rec->write_count += 1; file_rec->write_count += 1;
} }
...@@ -335,6 +361,7 @@ void dxt_mpiio_read(darshan_record_id rec_id, int64_t length, ...@@ -335,6 +361,7 @@ void dxt_mpiio_read(darshan_record_id rec_id, int64_t length,
{ {
struct dxt_file_record_ref* rec_ref = NULL; struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec; struct dxt_file_record *file_rec;
char *s;
/* make sure dxt mpiio runtime is initialized properly */ /* make sure dxt mpiio runtime is initialized properly */
if(!dxt_mpiio_runtime) if(!dxt_mpiio_runtime)
...@@ -364,6 +391,13 @@ void dxt_mpiio_read(darshan_record_id rec_id, int64_t length, ...@@ -364,6 +391,13 @@ void dxt_mpiio_read(darshan_record_id rec_id, int64_t length,
rec_ref->read_traces[file_rec->read_count].length = length; rec_ref->read_traces[file_rec->read_count].length = length;
rec_ref->read_traces[file_rec->read_count].start_time = start_time; rec_ref->read_traces[file_rec->read_count].start_time = start_time;
rec_ref->read_traces[file_rec->read_count].end_time = end_time; rec_ref->read_traces[file_rec->read_count].end_time = end_time;
s = getenv("DARSHAN_DXT_EXTRA_INFO");
if (s != NULL) {
strncpy(rec_ref->read_traces[file_rec->read_count].extra_info, s,
EXTRA_INFO_LEN-1);
} else {
rec_ref->write_traces[file_rec->write_count].extra_info[0] = '\0';
}
file_rec->read_count += 1; file_rec->read_count += 1;
} }
......
...@@ -265,6 +265,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name, ...@@ -265,6 +265,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
int64_t length; int64_t length;
double start_time; double start_time;
double end_time; double end_time;
char *extra_info;
int i; int i;
darshan_record_id f_id = file_rec->base_rec.id; darshan_record_id f_id = file_rec->base_rec.id;
...@@ -323,8 +324,10 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name, ...@@ -323,8 +324,10 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
length = io_trace[i].length; length = io_trace[i].length;
start_time = io_trace[i].start_time; start_time = io_trace[i].start_time;
end_time = io_trace[i].end_time; end_time = io_trace[i].end_time;
extra_info = io_trace[i].extra_info;
if (*extra_info == '\0') *extra_info = "";
printf("%8s%8d%7s%9lld%16lld%13lld%12.4f%12.4f", "X_POSIX", rank, "write", i, offset, length, start_time, end_time); printf("%8s%8d%7s%9lld%16lld%13lld%12.4f%12.4f %s", "X_POSIX", rank, "write", i, offset, length, start_time, end_time, extra_info);
if (lustreFS) { if (lustreFS) {
cur_offset = offset; cur_offset = offset;
...@@ -351,8 +354,10 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name, ...@@ -351,8 +354,10 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
length = io_trace[i].length; length = io_trace[i].length;
start_time = io_trace[i].start_time; start_time = io_trace[i].start_time;
end_time = io_trace[i].end_time; end_time = io_trace[i].end_time;
extra_info = io_trace[i].extra_info;
if (extra_info == NULL) extra_info = "";
printf("%8s%8d%7s%9lld%16lld%13lld%12.4f%12.4f", "X_POSIX", rank, "read", i - write_count, offset, length, start_time, end_time); printf("%8s%8d%7s%9lld%16lld%13lld%12.4f%12.4f %s", "X_POSIX", rank, "read", i - write_count, offset, length, start_time, end_time, extra_info);
if (lustreFS) { if (lustreFS) {
cur_offset = offset; cur_offset = offset;
...@@ -386,6 +391,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name, ...@@ -386,6 +391,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name,
int64_t length; int64_t length;
double start_time; double start_time;
double end_time; double end_time;
char * extra_info;
int i; int i;
darshan_record_id f_id = file_rec->base_rec.id; darshan_record_id f_id = file_rec->base_rec.id;
...@@ -414,8 +420,10 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name, ...@@ -414,8 +420,10 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name,
length = io_trace[i].length; length = io_trace[i].length;
start_time = io_trace[i].start_time; start_time = io_trace[i].start_time;
end_time = io_trace[i].end_time; end_time = io_trace[i].end_time;
extra_info = io_trace[i].extra_info;
if (extra_info == NULL) extra_info = "";
printf("%8s%8d%7s%9lld%13lld%12.4f%12.4f\n", "X_MPIIO", rank, "write", i, length, start_time, end_time); printf("%8s%8d%7s%9lld%13lld%12.4f%12.4f %s\n", "X_MPIIO", rank, "write", i, length, start_time, end_time, extra_info);
} }
for (i = write_count; i < write_count + read_count; i++) { for (i = write_count; i < write_count + read_count; i++) {
...@@ -424,7 +432,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name, ...@@ -424,7 +432,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name,
start_time = io_trace[i].start_time; start_time = io_trace[i].start_time;
end_time = io_trace[i].end_time; end_time = io_trace[i].end_time;
printf("%8s%8d%7s%9lld%13lld%12.4f%12.4f\n", "X_MPIIO", rank, "read", i - write_count, length, start_time, end_time); printf("%8s%8d%7s%9lld%13lld%12.4f%12.4f %s\n", "X_MPIIO", rank, "read", i - write_count, length, start_time, end_time, extra_info);
} }
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment