Commit faa23f57 authored by Cong Xu's avatar Cong Xu
Browse files

Add hostname information to DXT


Signed-off-by: Cong Xu's avatarCong Xu <cong.xu@intel.com>
parent 7a09fdee
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#define DXT_POSIX_VER 1 #define DXT_POSIX_VER 1
#define DXT_MPIIO_VER 1 #define DXT_MPIIO_VER 1
#define HOSTNAME_SIZE 64
/* /*
* DXT, the segment_info structure maintains detailed Segment IO tracing * DXT, the segment_info structure maintains detailed Segment IO tracing
* information * information
...@@ -34,6 +36,7 @@ typedef struct segment_info { ...@@ -34,6 +36,7 @@ typedef struct segment_info {
struct dxt_file_record { struct dxt_file_record {
struct darshan_base_record base_rec; struct darshan_base_record base_rec;
int64_t shared_record; /* -1 means it is a shared file record */ int64_t shared_record; /* -1 means it is a shared file record */
char hostname[HOSTNAME_SIZE];
int64_t write_count; int64_t write_count;
int64_t read_count; int64_t read_count;
......
...@@ -464,6 +464,7 @@ static struct dxt_file_record_ref *dxt_posix_track_new_file_record( ...@@ -464,6 +464,7 @@ static struct dxt_file_record_ref *dxt_posix_track_new_file_record(
/* initialize record and record reference fields */ /* initialize record and record reference fields */
file_rec->base_rec.id = rec_id; file_rec->base_rec.id = rec_id;
file_rec->base_rec.rank = posix_my_rank; file_rec->base_rec.rank = posix_my_rank;
gethostname(file_rec->hostname, HOSTNAME_SIZE);
rec_ref->file_rec = file_rec; rec_ref->file_rec = file_rec;
dxt_posix_runtime->file_rec_count++; dxt_posix_runtime->file_rec_count++;
...@@ -520,6 +521,7 @@ static struct dxt_file_record_ref *dxt_mpiio_track_new_file_record( ...@@ -520,6 +521,7 @@ static struct dxt_file_record_ref *dxt_mpiio_track_new_file_record(
/* initialize record and record reference fields */ /* initialize record and record reference fields */
file_rec->base_rec.id = rec_id; file_rec->base_rec.id = rec_id;
file_rec->base_rec.rank = mpiio_my_rank; file_rec->base_rec.rank = mpiio_my_rank;
gethostname(file_rec->hostname, HOSTNAME_SIZE);
rec_ref->file_rec = file_rec; rec_ref->file_rec = file_rec;
dxt_mpiio_runtime->file_rec_count++; dxt_mpiio_runtime->file_rec_count++;
...@@ -612,34 +614,37 @@ static void dxt_serialize_posix_records(void *rec_ref_p) ...@@ -612,34 +614,37 @@ static void dxt_serialize_posix_records(void *rec_ref_p)
#if 0 #if 0
int i; int i;
int64_t rank;
char *hostname;
int64_t offset; int64_t offset;
int64_t length; int64_t length;
int64_t rank;
double start_time; double start_time;
double end_time; double end_time;
printf("DXT, record_id: %" PRIu64 "\n", rec_ref->file_rec->base_rec.id); rank = file_rec->base_rec.rank;
printf("DXT, write_count is: %d read_count is: %d\n", hostname = file_rec->hostname;
printf("X_POSIX, record_id: %" PRIu64 "\n", rec_ref->file_rec->base_rec.id);
printf("X_POSIX, write_count is: %d read_count is: %d\n",
file_rec->write_count, file_rec->read_count); file_rec->write_count, file_rec->read_count);
printf("X_POSIX, rank: %d hostname: %s\n", rank, hostname);
for (i = 0; i < file_rec->write_count; i++) { for (i = 0; i < file_rec->write_count; i++) {
rank = file_rec->base_rec.rank;
offset = rec_ref->write_traces[i].offset; offset = rec_ref->write_traces[i].offset;
length = rec_ref->write_traces[i].length; length = rec_ref->write_traces[i].length;
start_time = rec_ref->write_traces[i].start_time; start_time = rec_ref->write_traces[i].start_time;
end_time = rec_ref->write_traces[i].end_time; end_time = rec_ref->write_traces[i].end_time;
printf("DXT, rank %d writes segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time); printf("X_POSIX, rank %d writes segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time);
} }
for (i = 0; i < file_rec->read_count; i++) { for (i = 0; i < file_rec->read_count; i++) {
rank = file_rec->base_rec.rank;
offset = rec_ref->read_traces[i].offset; offset = rec_ref->read_traces[i].offset;
length = rec_ref->read_traces[i].length; length = rec_ref->read_traces[i].length;
start_time = rec_ref->read_traces[i].start_time; start_time = rec_ref->read_traces[i].start_time;
end_time = rec_ref->read_traces[i].end_time; end_time = rec_ref->read_traces[i].end_time;
printf("DXT, rank %d reads segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time); printf("X_POSIX, rank %d reads segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time);
} }
#endif #endif
} }
...@@ -725,34 +730,34 @@ static void dxt_serialize_mpiio_records(void *rec_ref_p) ...@@ -725,34 +730,34 @@ static void dxt_serialize_mpiio_records(void *rec_ref_p)
#if 0 #if 0
int i; int i;
int64_t offset;
int64_t length;
int64_t rank; int64_t rank;
char *hostname;
int64_t length;
double start_time; double start_time;
double end_time; double end_time;
printf("Cong, record_id: %" PRIu64 "\n", rec_ref->file_rec->base_rec.id); rank = file_rec->base_rec.rank;
printf("DXT, file_rec->write_count is: %d\n", hostname = file_rec->hostname;
file_rec->write_count);
printf("X_MPIIO, record_id: %" PRIu64 "\n", rec_ref->file_rec->base_rec.id);
printf("X_MPIIO, write_count is: %d read_count is: %d\n",
file_rec->write_count, file_rec->read_count);
printf("X_MPIIO, rank: %d hostname: %s\n", rank, hostname);
for (i = 0; i < file_rec->write_count; i++) { for (i = 0; i < file_rec->write_count; i++) {
rank = file_rec->base_rec.rank;
offset = rec_ref->write_traces[i].offset;
length = rec_ref->write_traces[i].length; length = rec_ref->write_traces[i].length;
start_time = rec_ref->write_traces[i].start_time; start_time = rec_ref->write_traces[i].start_time;
end_time = rec_ref->write_traces[i].end_time; end_time = rec_ref->write_traces[i].end_time;
printf("DXT, rank %d writes segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time); printf("X_MPIIO, rank %d writes segment %lld [length: %lld start_time: %fs end_time: %fs]\n", rank, i, length, start_time, end_time);
} }
for (i = 0; i < file_rec->read_count; i++) { for (i = 0; i < file_rec->read_count; i++) {
rank = file_rec->base_rec.rank;
offset = rec_ref->read_traces[i].offset;
length = rec_ref->read_traces[i].length; length = rec_ref->read_traces[i].length;
start_time = rec_ref->read_traces[i].start_time; start_time = rec_ref->read_traces[i].start_time;
end_time = rec_ref->read_traces[i].end_time; end_time = rec_ref->read_traces[i].end_time;
printf("DXT, rank %d reads segment %lld [offset: %lld length: %lld start_time: %fs end_time: %fs]\n", rank, i, offset, length, start_time, end_time); printf("X_MPIIO, rank %d reads segment %lld [length: %lld start_time: %fs end_time: %fs]\n", rank, i, length, start_time, end_time);
} }
#endif #endif
} }
......
...@@ -47,7 +47,6 @@ struct darshan_mod_logutil_funcs dxt_posix_logutils = ...@@ -47,7 +47,6 @@ struct darshan_mod_logutil_funcs dxt_posix_logutils =
.log_get_record = &dxt_log_get_posix_file, .log_get_record = &dxt_log_get_posix_file,
.log_put_record = &dxt_log_put_posix_file, .log_put_record = &dxt_log_put_posix_file,
.log_print_record = &dxt_log_print_file, .log_print_record = &dxt_log_print_file,
// .log_print_description = &dxt_log_print_posix_description,
.log_print_diff = &dxt_log_print_posix_file_diff, .log_print_diff = &dxt_log_print_posix_file_diff,
.log_agg_records = &dxt_log_agg_posix_files, .log_agg_records = &dxt_log_agg_posix_files,
}; };
...@@ -57,17 +56,22 @@ struct darshan_mod_logutil_funcs dxt_mpiio_logutils = ...@@ -57,17 +56,22 @@ struct darshan_mod_logutil_funcs dxt_mpiio_logutils =
.log_get_record = &dxt_log_get_mpiio_file, .log_get_record = &dxt_log_get_mpiio_file,
.log_put_record = &dxt_log_put_mpiio_file, .log_put_record = &dxt_log_put_mpiio_file,
.log_print_record = &dxt_log_print_file, .log_print_record = &dxt_log_print_file,
// .log_print_description = &dxt_log_print_mpiio_description,
.log_print_diff = &dxt_log_print_mpiio_file_diff, .log_print_diff = &dxt_log_print_mpiio_file_diff,
.log_agg_records = &dxt_log_agg_mpiio_files, .log_agg_records = &dxt_log_agg_mpiio_files,
}; };
void dxt_swap_file_record(struct dxt_file_record *file_rec) void dxt_swap_file_record(struct dxt_file_record *file_rec)
{ {
int i;
DARSHAN_BSWAP64(&file_rec->base_rec.id); DARSHAN_BSWAP64(&file_rec->base_rec.id);
DARSHAN_BSWAP64(&file_rec->base_rec.rank); DARSHAN_BSWAP64(&file_rec->base_rec.rank);
DARSHAN_BSWAP64(&file_rec->shared_record); DARSHAN_BSWAP64(&file_rec->shared_record);
for (i = 0; i < HOSTNAME_SIZE; i++) {
DARSHAN_BSWAP64(&file_rec->hostname[i]);
}
DARSHAN_BSWAP64(&file_rec->write_count); DARSHAN_BSWAP64(&file_rec->write_count);
DARSHAN_BSWAP64(&file_rec->read_count); DARSHAN_BSWAP64(&file_rec->read_count);
} }
...@@ -217,6 +221,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name, ...@@ -217,6 +221,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
darshan_record_id f_id = file_rec->base_rec.id; darshan_record_id f_id = file_rec->base_rec.id;
int64_t rank = file_rec->base_rec.rank; int64_t rank = file_rec->base_rec.rank;
char *hostname = file_rec->hostname;
int64_t write_count = file_rec->write_count; int64_t write_count = file_rec->write_count;
int64_t read_count = file_rec->read_count; int64_t read_count = file_rec->read_count;
...@@ -235,8 +240,9 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name, ...@@ -235,8 +240,9 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
} }
printf("\n# DXT, file_id: %" PRIu64 ", file_name: %s\n", f_id, file_name); printf("\n# DXT, file_id: %" PRIu64 ", file_name: %s\n", f_id, file_name);
printf("# DXT, rank: %d, write_count: %d, read_count: %d\n", printf("# DXT, rank: %d, hostname: %s\n", rank, hostname);
rank, write_count, read_count); printf("# DXT, write_count: %d, read_count: %d\n",
write_count, read_count);
if (lustreFS) { if (lustreFS) {
stripe_size = ref->counters[LUSTRE_STRIPE_SIZE]; stripe_size = ref->counters[LUSTRE_STRIPE_SIZE];
...@@ -330,6 +336,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name, ...@@ -330,6 +336,7 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name,
darshan_record_id f_id = file_rec->base_rec.id; darshan_record_id f_id = file_rec->base_rec.id;
int64_t rank = file_rec->base_rec.rank; int64_t rank = file_rec->base_rec.rank;
char *hostname = file_rec->hostname;
int64_t write_count = file_rec->write_count; int64_t write_count = file_rec->write_count;
int64_t read_count = file_rec->read_count; int64_t read_count = file_rec->read_count;
...@@ -337,8 +344,9 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name, ...@@ -337,8 +344,9 @@ void dxt_log_print_mpiio_file(void *mpiio_file_rec, char *file_name,
segment_info *io_trace = (segment_info *)parser_buf; segment_info *io_trace = (segment_info *)parser_buf;
printf("\n# DXT, file_id: %" PRIu64 ", file_name: %s\n", f_id, file_name); printf("\n# DXT, file_id: %" PRIu64 ", file_name: %s\n", f_id, file_name);
printf("# DXT, rank: %d, write_count: %d, read_count: %d\n", printf("# DXT, rank: %d, hostname: %s\n", rank, hostname);
rank, write_count, read_count); printf("# DXT, write_count: %d, read_count: %d\n",
write_count, read_count);
printf("# DXT, mnt_pt: %s, fs_type: %s\n", mnt_pt, fs_type); printf("# DXT, mnt_pt: %s, fs_type: %s\n", mnt_pt, fs_type);
......
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