Commit 233ba41e authored by Sudheer Chunduri's avatar Sudheer Chunduri
Browse files

include node name instead of node id in perf record

parent 99c82c1f
......@@ -6,7 +6,9 @@
#ifndef __APMPI_LOG_FORMAT_H
#define __APMPI_LOG_FORMAT_H
#ifndef MPI_MAX_PROCESSOR_NAME
#define MPI_MAX_PROCESSOR_NAME 128
#endif
/* current AutoPerf MPI log format version */
#define APMPI_VER 1
......@@ -226,12 +228,11 @@ enum apmpi_f_mpi_global_indices
struct darshan_apmpi_perf_record
{
struct darshan_base_record base_rec;
/* nodeid is system dependent */
uint32_t nodeid;
uint64_t counters[APMPI_NUM_INDICES];
double fcounters[APMPI_F_MPIOP_TOTALTIME_NUM_INDICES];
double fsynccounters[APMPI_F_MPIOP_SYNCTIME_NUM_INDICES];
double fglobalcounters[APMPI_F_MPI_GLOBAL_NUM_INDICES];
char node_name[MPI_MAX_PROCESSOR_NAME];
};
struct darshan_apmpi_header_record
{
......
......@@ -15,9 +15,6 @@
#include <assert.h>
#include <papi.h>
/* for node id - Cray PMI specific */
#include "pmi_cray_ext.h"
#include "uthash.h"
#include "darshan.h"
#include "darshan-dynamic.h"
......@@ -29,6 +26,8 @@ typedef long long ap_bytes_t;
#define MAX(x,y) ((x>y)?x:y)
#define MIN(x,y) ((x==0.0)?y:((x<y)?x:y))
#ifdef __APMPI_COLL_SYNC
#define TIME_SYNC(FUNC) \
double tm1, tm2, tm3, tdiff, tsync;\
int ret; \
......@@ -39,7 +38,18 @@ typedef long long ap_bytes_t;
tm3 = darshan_core_wtime(); \
tdiff = tm3-tm2; \
tsync = tm2-tm1
#else
#define TIME_SYNC(FUNC) \
double tm1, tm2, tdiff, tsync;\
int ret; \
tm1 = darshan_core_wtime(); \
ret = FUNC; \
tm2 = darshan_core_wtime(); \
tdiff = tm2-tm1; \
tsync = -1
#endif
#define TIME(FUNC) \
double tm1, tm2, tdiff;\
int ret; \
......@@ -322,7 +332,8 @@ static void capture(struct darshan_apmpi_perf_record *rec,
{
rec->base_rec.id = rec_id;
rec->base_rec.rank = my_rank;
PMI_CNOS_Get_nid(my_rank, &rec->nodeid);
int name_len;
MPI_Get_processor_name(rec->node_name, &name_len);
return;
}
......
......@@ -9,11 +9,11 @@ structdefs = '''
struct darshan_apmpi_perf_record
{
struct darshan_base_record base_rec;
uint32_t nodeid;
uint64_t counters[364];
double fcounters[168];
double fsynccounters[16];
double fglobalcounters[2];
char node_name[128];
};
struct darshan_apmpi_header_record
{
......@@ -59,6 +59,14 @@ def log_get_apmpi_record(log, dtype='dict'):
rec['variance_total_mpitime'] = hdr[0].apmpi_f_variance_total_mpitime
rec['variance_total_mpisynctime'] = hdr[0].apmpi_f_variance_total_mpisynctime
else:
buf = ffi.new("char[]", 128)
get_node_name(prf[0].node_name, buf, len(buf))
print(ffi.string(buf))
#print(prf[0].node_name)
#print(type(prf[0].node_name))
#print(ffi.string(prf[0].node_name))
#print(prf[0])
rec['node_name'] = ffi.string(buf).decode("utf-8")
lst = []
for i in range(0, len(prf[0].counters)):
......
......@@ -70,6 +70,7 @@ struct darshan_mod_logutil_funcs apmpi_logutils =
.log_agg_records = NULL
};
static int darshan_log_get_apmpi_rec(darshan_fd fd, void** buf_p)
{
struct darshan_apmpi_header_record *hdr_rec;
......@@ -140,7 +141,6 @@ static int darshan_log_get_apmpi_rec(darshan_fd fd, void** buf_p)
else
{
prf_rec = (struct darshan_apmpi_perf_record*)buffer;
DARSHAN_BSWAP32(&(prf_rec->nodeid));
DARSHAN_BSWAP64(&(prf_rec->base_rec.id));
DARSHAN_BSWAP64(&(prf_rec->base_rec.rank));
for (i = 0; i < APMPI_NUM_INDICES; i++)
......@@ -225,9 +225,9 @@ static void darshan_log_print_apmpi_rec(void *rec, char *file_name,
{
prf_rec = rec;
DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
prf_rec->base_rec.rank, prf_rec->base_rec.id,
"nodeid", prf_rec->nodeid,
"nodeid", prf_rec->node_name,
"", "", "");
for(i = 0; i < APMPI_NUM_INDICES; i++)
......@@ -348,30 +348,30 @@ static void darshan_log_print_apmpi_rec_diff(void *file_rec1, char *file_name1,
if(!prf_rec2)
{
printf("- ");
DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
"nodeid", prf_rec1->nodeid,
"nodeid", prf_rec1->node_name,
"", "", "");
}
else if (!prf_rec1)
{
printf("+ ");
DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
"nodeid", prf_rec2->nodeid,
"nodeid", prf_rec2->node_name,
"", "", "");
}
else if (prf_rec1->nodeid != prf_rec2->nodeid)
else if (prf_rec1->node_name != prf_rec2->node_name)
{
printf("- ");
DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
"nodeid", prf_rec1->nodeid,
"nodeid", prf_rec1->node_name,
"", "", "");
printf("+ ");
DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
"nodeid", prf_rec2->nodeid,
"nodeid", prf_rec2->node_name,
"", "", "");
}
int i;
......
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