Commit b51c463b authored by Glenn K. Lockwood's avatar Glenn K. Lockwood

working set of tools to parse darshan lustre-mod logfiles

parent 735fc530
......@@ -49,27 +49,45 @@ static int darshan_log_get_lustre_record(darshan_fd fd, void* lustre_buf,
int i;
int ret;
/* retrieve the fixed-size portion of the record */
ret = darshan_log_getmod(fd, DARSHAN_LUSTRE_MOD, lustre_buf,
sizeof(struct darshan_lustre_record));
if(ret < 0)
return(-1);
else if(ret < sizeof(struct darshan_lustre_record))
return(0);
else
rec = (struct darshan_lustre_record *)lustre_buf;
/* swap bytes if necessary */
if(fd->swap_flag)
{
rec = (struct darshan_lustre_record *)lustre_buf;
if(fd->swap_flag)
{
/* swap bytes if necessary */
DARSHAN_BSWAP64(&rec->rec_id);
DARSHAN_BSWAP64(&rec->rank);
for(i=0; i<LUSTRE_NUM_INDICES; i++)
DARSHAN_BSWAP64(&rec->counters[i]);
}
DARSHAN_BSWAP64(&rec->rec_id);
DARSHAN_BSWAP64(&rec->rank);
for(i=0; i<LUSTRE_NUM_INDICES; i++)
DARSHAN_BSWAP64(&rec->counters[i]);
}
*rec_id = rec->rec_id;
return(1);
/* now read the rest of the record */
if ( rec->counters[LUSTRE_STRIPE_WIDTH] > 1 ) {
ret = darshan_log_getmod(
fd,
DARSHAN_LUSTRE_MOD,
(void*)(&(rec->ost_ids[1])),
(rec->counters[LUSTRE_STRIPE_WIDTH] - 1)*sizeof(OST_ID)
);
if(ret < 0)
return(-1);
else if(ret < sizeof(struct darshan_lustre_record))
return(0);
/* swap bytes if necessary */
if ( fd->swap_flag )
for (i = 1; i < rec->counters[LUSTRE_STRIPE_WIDTH]; i++ )
DARSHAN_BSWAP64(&(rec->ost_ids[i]));
}
*rec_id = rec->rec_id;
return(1);
}
static int darshan_log_put_lustre_record(darshan_fd fd, void* lustre_buf, int ver)
......@@ -78,7 +96,7 @@ static int darshan_log_put_lustre_record(darshan_fd fd, void* lustre_buf, int ve
int ret;
ret = darshan_log_putmod(fd, DARSHAN_LUSTRE_MOD, rec,
sizeof(struct darshan_lustre_record), ver);
LUSTRE_RECORD_SIZE(rec->counters[LUSTRE_STRIPE_WIDTH]), ver);
if(ret < 0)
return(-1);
......@@ -99,6 +117,20 @@ static void darshan_log_print_lustre_record(void *rec, char *file_name,
lustre_rec->counters[i], file_name, mnt_pt, fs_type);
}
for (i = 0; i < lustre_rec->counters[LUSTRE_STRIPE_WIDTH]; i++ )
{
char strbuf[25];
snprintf( strbuf, 25, "LUSTRE_OST_ID_%d", i );
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
lustre_rec->rank,
lustre_rec->rec_id,
strbuf,
lustre_rec->ost_ids[i],
file_name,
mnt_pt,
fs_type);
}
return;
}
......@@ -110,7 +142,8 @@ static void darshan_log_print_lustre_description()
printf("# LUSTRE_MDTS: number of MDTs across the entire file system.\n");
printf("# LUSTRE_STRIPE_SIZE: stripe size for file in bytes.\n");
printf("# LUSTRE_STRIPE_WIDTH: number of OSTs over which file is striped.\n");
printf("# LUSTRE_STRIPE_OFFSET: OBD index of the file's first stripe.\n");
printf("# LUSTRE_STRIPE_OFFSET: OST ID offset specified when the file was created.\n");
printf("# LUSTRE_OST_ID_*: indices of OSTs over which the file is striped.\n");
DARSHAN_PRINT_HEADER();
......@@ -156,6 +189,36 @@ static void darshan_log_print_lustre_record_diff(void *rec1, char *file_name1,
}
}
/* would it be more or less useful to sort the OST IDs before comparing? */
if ( lustre_rec1->counters[LUSTRE_STRIPE_WIDTH] == lustre_rec2->counters[LUSTRE_STRIPE_WIDTH] ) {
for (i = 0; i < lustre_rec1->counters[LUSTRE_STRIPE_WIDTH]; i++ )
{
if (lustre_rec1->ost_ids[i] != lustre_rec2->ost_ids[i])
{
char strbuf[25];
snprintf( strbuf, 25, "LUSTRE_OST_ID_%d", i );
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
lustre_rec1->rank,
lustre_rec1->rec_id,
strbuf,
lustre_rec1->ost_ids[i],
file_name1,
"",
"");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
lustre_rec2->rank,
lustre_rec2->rec_id,
strbuf,
lustre_rec2->ost_ids[i],
file_name2,
"",
"");
}
}
}
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