Commit edb38976 authored by Sudheer Chunduri's avatar Sudheer Chunduri
Browse files

apmpi: make processor name as a constant instead of relying on MPI for the value.

Different MPI implementations has the MPI_PROCESSOR_NAME_MAX as different values which can cause inconsistencies
parent 41d8e67a
...@@ -6,9 +6,8 @@ ...@@ -6,9 +6,8 @@
#ifndef __APMPI_LOG_FORMAT_H #ifndef __APMPI_LOG_FORMAT_H
#define __APMPI_LOG_FORMAT_H #define __APMPI_LOG_FORMAT_H
#ifndef MPI_MAX_PROCESSOR_NAME #define AP_PROCESSOR_NAME_MAX 128
#define MPI_MAX_PROCESSOR_NAME 128
#endif
/* current AutoPerf MPI log format version */ /* current AutoPerf MPI log format version */
#define APMPI_VER 1 #define APMPI_VER 1
...@@ -232,7 +231,7 @@ struct darshan_apmpi_perf_record ...@@ -232,7 +231,7 @@ struct darshan_apmpi_perf_record
double fcounters[APMPI_F_MPIOP_TOTALTIME_NUM_INDICES]; double fcounters[APMPI_F_MPIOP_TOTALTIME_NUM_INDICES];
double fsynccounters[APMPI_F_MPIOP_SYNCTIME_NUM_INDICES]; double fsynccounters[APMPI_F_MPIOP_SYNCTIME_NUM_INDICES];
double fglobalcounters[APMPI_F_MPI_GLOBAL_NUM_INDICES]; double fglobalcounters[APMPI_F_MPI_GLOBAL_NUM_INDICES];
char node_name[MPI_MAX_PROCESSOR_NAME]; char node_name[AP_PROCESSOR_NAME_MAX];
}; };
struct darshan_apmpi_header_record struct darshan_apmpi_header_record
{ {
......
...@@ -330,7 +330,9 @@ static void capture(struct darshan_apmpi_perf_record *rec, ...@@ -330,7 +330,9 @@ static void capture(struct darshan_apmpi_perf_record *rec,
rec->base_rec.id = rec_id; rec->base_rec.id = rec_id;
rec->base_rec.rank = my_rank; rec->base_rec.rank = my_rank;
int name_len; int name_len;
MPI_Get_processor_name(rec->node_name, &name_len); char name[MPI_MAX_PROCESSOR_NAME];
MPI_Get_processor_name(name, &name_len);
strncpy(rec->node_name, name, (name_len < AP_PROCESSOR_NAME_MAX)? name_len : AP_PROCESSOR_NAME_MAX);
return; 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