Commit 30c7bc6b authored by Kevin Harms's avatar Kevin Harms
Browse files

Add diff support and remove spurious printfs

parent f3029863
......@@ -10,6 +10,15 @@
/* current AutoPerf Cray XC log format version */
#define DARSHAN_APXC_VER 1
#define DARSHAN_APXC_MAGIC ('A'*0x100000000000000+\
'U'*0x1000000000000+\
'T'*0x10000000000+\
'O'*0x100000000+\
'P'*0x1000000+\
'E'*0x10000+\
'R'*0x100+\
'F'*0x1)
#define APXC_PERF_COUNTERS \
/* non-PAPI counters first */\
X(AR_RTR_GROUP) \
......@@ -464,6 +473,7 @@ struct darshan_apxc_perf_record
struct darshan_apxc_header_record
{
struct darshan_base_record base_rec;
int64_t magic;
int nblades;
int nchassis;
int ngroups;
......
......@@ -41,7 +41,6 @@ static int get_memory_mode (int node)
sprintf(mcdram_str, "mcdram_cfg\\[%d\\]=", node);
search_hwinfo(mcdram_str, memory_mode);
printf("memory mode = %s\n", memory_mode);
if (strcmp(memory_mode, "flat") == 0)
{
return MM_FLAT;
......@@ -70,7 +69,6 @@ static int get_cluster_mode (int node)
sprintf(numa_str, "numa_cfg\\[%d\\]=", node);
search_hwinfo(numa_str, cluster_mode);
printf("cluster mode = %s\n", cluster_mode);
if (strcmp(cluster_mode, "a2a") == 0)
{
return CM_ALL2ALL;
......
......@@ -121,11 +121,9 @@ static void finalize_counters (void)
static void capture(struct darshan_apxc_perf_record *rec,
darshan_record_id rec_id)
{
printf("capturuning counters\n");
PAPI_stop(apxc_runtime->PAPI_event_set,
(long long*) &rec->counters[AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC0]);
PAPI_reset(apxc_runtime->PAPI_event_set);
printf("complete\n");
rec->counters[AR_RTR_GROUP] = apxc_runtime->group;
rec->counters[AR_RTR_CHASSIS] = apxc_runtime->chassis;
......@@ -202,6 +200,7 @@ void apxc_runtime_initialize()
}
apxc_runtime->header_record->base_rec.id = apxc_runtime->header_id;
apxc_runtime->header_record->base_rec.rank = my_rank;
apxc_runtime->header_record->magic = DARSHAN_APXC_MAGIC;
}
get_xc_coords(&apxc_runtime->group,
......
......@@ -25,6 +25,8 @@
char *apxc_counter_names[] = {
APXC_PERF_COUNTERS
};
char *mmodes[] = { APXC_MEMORY_MODES };
char *cmodes[] = { APXC_CLUSTER_MODES };
#undef X
static int darshan_log_get_apxc_rec(darshan_fd fd, void** buf_p);
......@@ -34,7 +36,6 @@ static void darshan_log_print_apxc_rec(void *file_rec,
static void darshan_log_print_apxc_description(int ver);
static void darshan_log_print_apxc_rec_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
static void darshan_log_agg_apxc_recs(void *rec, void *agg_rec, int init_flag);
struct darshan_mod_logutil_funcs apxc_logutils =
{
......@@ -43,7 +44,7 @@ struct darshan_mod_logutil_funcs apxc_logutils =
.log_print_record = &darshan_log_print_apxc_rec,
.log_print_description = &darshan_log_print_apxc_description,
.log_print_diff = &darshan_log_print_apxc_rec_diff,
.log_agg_records = &darshan_log_agg_apxc_recs
.log_agg_records = NULL
};
static int darshan_log_get_apxc_rec(darshan_fd fd, void** buf_p)
......@@ -176,19 +177,15 @@ static void darshan_log_print_apxc_rec(void *rec, char *file_name,
if (first_rec)
{
#define X(a) #a,
char *mmodes[] = { APXC_MEMORY_MODES };
char *cmodes[] = { APXC_CLUSTER_MODES };
#undef X
hdr_rec = rec;
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
"groups", hdr_rec->ngroups, "", "", "");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
"chassis", hdr_rec->nchassis, "", "", "");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
"blades", hdr_rec->nblades, "", "", "");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
......@@ -245,18 +242,203 @@ static void darshan_log_print_apxc_description(int ver)
static void darshan_log_print_apxc_rec_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
return;
}
struct darshan_apxc_header_record *hdr_rec1;
struct darshan_apxc_header_record *hdr_rec2;
struct darshan_apxc_perf_record *prf_rec1;
struct darshan_apxc_perf_record *prf_rec2;
hdr_rec1 = (struct darshan_apxc_header_record*) file_rec1;
hdr_rec2 = (struct darshan_apxc_header_record*) file_rec2;
prf_rec1 = (struct darshan_apxc_perf_record*) file_rec1;
prf_rec2 = (struct darshan_apxc_perf_record*) file_rec2;
static void darshan_log_agg_apxc_recs(void *rec, void *agg_rec, int init_flag)
{
int i;
if (hdr_rec1->magic == DARSHAN_APXC_MAGIC)
{
/* this is the header record */
if (!hdr_rec2)
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"groups", hdr_rec1->ngroups, "", "", "");
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"chassis", hdr_rec1->nchassis, "", "", "");
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"blades", hdr_rec1->nblades, "", "", "");
printf("- ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"memory_mode", mmodes[hdr_rec1->memory_mode & ~(1<<31)], "", "", "");
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"memory_mode_consistent", ((hdr_rec1->memory_mode & (1<<31)) == 0), "", "", "");
printf("- ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"cluster_mode", cmodes[hdr_rec1->cluster_mode & ~(1<<31)], "", "", "");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"cluster_mode_consistent", ((hdr_rec1->cluster_mode & (1<<31)) == 0), "", "", "");
if(init_flag)
}
else if (!hdr_rec1)
{
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"groups", hdr_rec2->ngroups, "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"chassis", hdr_rec2->nchassis, "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"blades", hdr_rec2->nblades, "", "", "");
printf("+ ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"memory_mode", mmodes[hdr_rec2->memory_mode & ~(1<<31)], "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"memory_mode_consistent", ((hdr_rec2->memory_mode & (1<<31)) == 0), "", "", "");
printf("+ ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"cluster_mode", cmodes[hdr_rec2->cluster_mode & ~(1<<31)], "", "", "");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"cluster_mode_consistent", ((hdr_rec2->cluster_mode & (1<<31)) == 0), "", "", "");
}
else
{
if (hdr_rec1->ngroups != hdr_rec2->ngroups)
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"groups", hdr_rec1->ngroups, "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"groups", hdr_rec2->ngroups, "", "", "");
}
if (hdr_rec1->nchassis != hdr_rec2->nchassis)
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"chassis", hdr_rec1->nchassis, "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"chassis", hdr_rec2->nchassis, "", "", "");
}
if (hdr_rec1->nblades != hdr_rec2->nblades)
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"blades", hdr_rec1->nblades, "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"blades", hdr_rec2->nblades, "", "", "");
}
if ((hdr_rec1->memory_mode & ~(1<<31)) !=
(hdr_rec2->memory_mode & ~(1<<31)))
{
printf("- ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"memory_mode", mmodes[hdr_rec1->memory_mode & ~(1<<31)], "", "", "");
printf("+ ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"memory_mode", mmodes[hdr_rec2->memory_mode & ~(1<<31)], "", "", "");
}
if ((hdr_rec1->memory_mode & (1<<31)) !=
(hdr_rec2->memory_mode & (1<<31)))
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"memory_mode_consistent", ((hdr_rec1->memory_mode & (1<<31)) == 0), "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"memory_mode_consistent", ((hdr_rec2->memory_mode & (1<<31)) == 0), "", "", "");
}
if ((hdr_rec1->cluster_mode & ~(1<<31)) !=
(hdr_rec2->cluster_mode & ~(1<<31)))
{
printf("- ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"cluster_mode", cmodes[hdr_rec1->cluster_mode & ~(1<<31)], "", "", "");
printf("+ ");
DARSHAN_S_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"cluster_mode", cmodes[hdr_rec2->cluster_mode & ~(1<<31)], "", "", "");
}
if ((hdr_rec1->cluster_mode & (1<<31)) !=
(hdr_rec2->cluster_mode & (1<<31)))
{
printf("- ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
"cluster_mode_consistent", ((hdr_rec1->cluster_mode & (1<<31)) == 0), "", "", "");
printf("+ ");
DARSHAN_I_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
"cluster_mode_consistent", ((hdr_rec2->cluster_mode & (1<<31)) == 0), "", "", "");
}
}
}
else
{
/* when initializing, just copy over the first record */
memcpy(agg_rec, rec, sizeof(struct darshan_apxc_header_record));
int i;
/* router tile record */
for(i = 0; i < APXC_PERF_NUM_INDICES; i++)
{
if (!prf_rec2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
apxc_counter_names[i], prf_rec1->counters[i],
"", "", "");
}
else if (!prf_rec1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
apxc_counter_names[i], prf_rec2->counters[i],
"", "", "");
}
else if (prf_rec1->counters[i] != prf_rec2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
apxc_counter_names[i], prf_rec1->counters[i],
"", "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_APXC_MOD],
prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
apxc_counter_names[i], prf_rec2->counters[i],
"", "", "");
}
}
}
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