Commit 4bbe8e64 authored by Shane Snyder's avatar Shane Snyder

add diff routines to remaining modules

parent b5bba287
......@@ -19,7 +19,7 @@
#include "darshan-logutils.h"
/* counter name strings for the POSIX module */
/* counter name strings for the BGQ module */
#define X(a) #a,
char *bgq_counter_names[] = {
BGQ_COUNTERS
......@@ -36,13 +36,16 @@ static int darshan_log_put_bgq_rec(darshan_fd fd, void* bgq_buf, int ver);
static void darshan_log_print_bgq_rec(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_bgq_description(void);
static void darshan_log_print_bgq_rec_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
struct darshan_mod_logutil_funcs bgq_logutils =
{
.log_get_record = &darshan_log_get_bgq_rec,
.log_put_record = &darshan_log_put_bgq_rec,
.log_print_record = &darshan_log_print_bgq_rec,
.log_print_description = &darshan_log_print_bgq_description
.log_print_description = &darshan_log_print_bgq_description,
.log_print_diff = &darshan_log_print_bgq_rec_diff
};
static int darshan_log_get_bgq_rec(darshan_fd fd, void* bgq_buf,
......@@ -131,6 +134,79 @@ static void darshan_log_print_bgq_description()
return;
}
static void darshan_log_print_bgq_rec_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_bgq_record *file1 = (struct darshan_bgq_record *)file_rec1;
struct darshan_bgq_record *file2 = (struct darshan_bgq_record *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<BGQ_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file1->rank, file1->f_id, bgq_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file2->rank, file2->f_id, bgq_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file1->rank, file1->f_id, bgq_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file2->rank, file2->f_id, bgq_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<BGQ_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file1->rank, file1->f_id, bgq_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file2->rank, file2->f_id, bgq_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file1->rank, file1->f_id, bgq_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_BGQ_MOD],
file2->rank, file2->f_id, bgq_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
......@@ -36,13 +36,16 @@ static int darshan_log_put_hdf5_file(darshan_fd fd, void* hdf5_buf, int ver);
static void darshan_log_print_hdf5_file(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_hdf5_description(void);
static void darshan_log_print_hdf5_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
struct darshan_mod_logutil_funcs hdf5_logutils =
{
.log_get_record = &darshan_log_get_hdf5_file,
.log_put_record = &darshan_log_put_hdf5_file,
.log_print_record = &darshan_log_print_hdf5_file,
.log_print_description = &darshan_log_print_hdf5_description
.log_print_description = &darshan_log_print_hdf5_description,
.log_print_diff = &darshan_log_print_hdf5_file_diff
};
static int darshan_log_get_hdf5_file(darshan_fd fd, void* hdf5_buf,
......@@ -126,6 +129,79 @@ static void darshan_log_print_hdf5_description()
return;
}
static void darshan_log_print_hdf5_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_hdf5_file *file1 = (struct darshan_hdf5_file *)file_rec1;
struct darshan_hdf5_file *file2 = (struct darshan_hdf5_file *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<HDF5_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file1->rank, file1->f_id, hdf5_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file2->rank, file2->f_id, hdf5_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file1->rank, file1->f_id, hdf5_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file2->rank, file2->f_id, hdf5_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<HDF5_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file1->rank, file1->f_id, hdf5_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file2->rank, file2->f_id, hdf5_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file1->rank, file1->f_id, hdf5_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_HDF5_MOD],
file2->rank, file2->f_id, hdf5_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
......@@ -36,13 +36,16 @@ static int darshan_log_put_mpiio_file(darshan_fd fd, void* mpiio_buf, int ver);
static void darshan_log_print_mpiio_file(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_mpiio_description(void);
static void darshan_log_print_mpiio_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
struct darshan_mod_logutil_funcs mpiio_logutils =
{
.log_get_record = &darshan_log_get_mpiio_file,
.log_put_record = &darshan_log_put_mpiio_file,
.log_print_record = &darshan_log_print_mpiio_file,
.log_print_description = &darshan_log_print_mpiio_description
.log_print_description = &darshan_log_print_mpiio_description,
.log_print_diff = &darshan_log_print_mpiio_file_diff
};
static int darshan_log_get_mpiio_file(darshan_fd fd, void* mpiio_buf,
......@@ -148,6 +151,79 @@ static void darshan_log_print_mpiio_description()
return;
}
static void darshan_log_print_mpiio_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_mpiio_file *file1 = (struct darshan_mpiio_file *)file_rec1;
struct darshan_mpiio_file *file2 = (struct darshan_mpiio_file *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<MPIIO_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file1->rank, file1->f_id, mpiio_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file2->rank, file2->f_id, mpiio_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file1->rank, file1->f_id, mpiio_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file2->rank, file2->f_id, mpiio_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<MPIIO_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file1->rank, file1->f_id, mpiio_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file2->rank, file2->f_id, mpiio_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file1->rank, file1->f_id, mpiio_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_MPIIO_MOD],
file2->rank, file2->f_id, mpiio_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
......@@ -38,6 +38,8 @@ static int darshan_log_put_null_record(darshan_fd fd, void* null_buf, int ver);
static void darshan_log_print_null_record(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_null_description(void);
static void darshan_log_print_null_record_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
/* structure storing each function needed for implementing the darshan
* logutil interface. these functions are used for reading, writing, and
......@@ -48,7 +50,8 @@ struct darshan_mod_logutil_funcs null_logutils =
.log_get_record = &darshan_log_get_null_record,
.log_put_record = &darshan_log_put_null_record,
.log_print_record = &darshan_log_print_null_record,
.log_print_description = &darshan_log_print_null_description
.log_print_description = &darshan_log_print_null_description,
.log_print_diff = &darshan_log_print_null_record_diff
};
/* retrieve a NULL record from log file descriptor 'fd', storing the
......@@ -148,6 +151,79 @@ static void darshan_log_print_null_description()
return;
}
static void darshan_log_print_null_record_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_null_record *file1 = (struct darshan_null_record *)file_rec1;
struct darshan_null_record *file2 = (struct darshan_null_record *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<NULL_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file1->rank, file1->f_id, null_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file2->rank, file2->f_id, null_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file1->rank, file1->f_id, null_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file2->rank, file2->f_id, null_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<NULL_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file1->rank, file1->f_id, null_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file2->rank, file2->f_id, null_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file1->rank, file1->f_id, null_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_NULL_MOD],
file2->rank, file2->f_id, null_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
......@@ -36,13 +36,16 @@ static int darshan_log_put_pnetcdf_file(darshan_fd fd, void* pnetcdf_buf, int ve
static void darshan_log_print_pnetcdf_file(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_pnetcdf_description(void);
static void darshan_log_print_pnetcdf_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
struct darshan_mod_logutil_funcs pnetcdf_logutils =
{
.log_get_record = &darshan_log_get_pnetcdf_file,
.log_put_record = &darshan_log_put_pnetcdf_file,
.log_print_record = &darshan_log_print_pnetcdf_file,
.log_print_description = &darshan_log_print_pnetcdf_description
.log_print_description = &darshan_log_print_pnetcdf_description,
.log_print_diff = &darshan_log_print_pnetcdf_file_diff
};
static int darshan_log_get_pnetcdf_file(darshan_fd fd, void* pnetcdf_buf,
......@@ -127,6 +130,78 @@ static void darshan_log_print_pnetcdf_description()
return;
}
static void darshan_log_print_pnetcdf_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_pnetcdf_file *file1 = (struct darshan_pnetcdf_file *)file_rec1;
struct darshan_pnetcdf_file *file2 = (struct darshan_pnetcdf_file *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<PNETCDF_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file1->rank, file1->f_id, pnetcdf_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file2->rank, file2->f_id, pnetcdf_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file1->rank, file1->f_id, pnetcdf_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file2->rank, file2->f_id, pnetcdf_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<PNETCDF_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file1->rank, file1->f_id, pnetcdf_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file2->rank, file2->f_id, pnetcdf_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file1->rank, file1->f_id, pnetcdf_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_PNETCDF_MOD],
file2->rank, file2->f_id, pnetcdf_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
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