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

APMPI module updates

parent 54fe59d5
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
DARSHAN_STATIC_MOD_OBJS += lib/darshan-apmpi.o DARSHAN_STATIC_MOD_OBJS += lib/darshan-apmpi.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-apmpi.po DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-apmpi.po
VPATH += :$(srcdir)/../modules/autoperf/crayxc VPATH += :$(srcdir)/../modules/autoperf/apmpi
CFLAGS += \ CFLAGS += \
-DDARSHAN_USE_apmpi \ -DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/crayxc -I$(srcdir)/../modules/autoperf/apmpi
CFLAGS_SHARED += \ CFLAGS_SHARED += \
-DDARSHAN_USE_apmpi \ -DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/crayxc -I$(srcdir)/../modules/autoperf/apmpi
lib/darshan-apmpi.o: lib/darshan-apmpi.c lib/darshan-apmpi-utils.h darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) darshan-apmpi-log-format.h | lib lib/darshan-apmpi.o: lib/darshan-apmpi.c lib/darshan-apmpi-utils.h darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) darshan-apmpi-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
......
This diff is collapsed.
#ifndef __DARSHAN_APXC_UTILS_H__ #ifndef __DARSHAN_APMPI_UTILS_H__
#define __DARSHAN_APXC_UTILS_H__ #define __DARSHAN_APMPI_UTILS_H__
#include <regex.h> #include <regex.h>
...@@ -33,99 +33,7 @@ static void search_hwinfo(const char * mstr, char *mode) ...@@ -33,99 +33,7 @@ static void search_hwinfo(const char * mstr, char *mode)
return; return;
} }
static int get_memory_mode (int node)
{
char memory_mode[64];
char mcdram_str[64];
sprintf(mcdram_str, "mcdram_cfg\\[%d\\]=", node);
search_hwinfo(mcdram_str, memory_mode);
if (strcmp(memory_mode, "flat") == 0)
{
return MM_FLAT;
}
else if (strcmp(memory_mode, "cache") == 0)
{
return MM_CACHE;
}
else if (strcmp(memory_mode, "split") == 0)
{
return MM_SPLIT;
}
else if (strcmp(memory_mode, "equal") == 0)
{
return MM_EQUAL;
}
return MM_UNKNOWN;
}
static int get_cluster_mode (int node)
{
char cluster_mode[64];
char numa_str[64];
sprintf(numa_str, "numa_cfg\\[%d\\]=", node);
search_hwinfo(numa_str, cluster_mode);
if (strcmp(cluster_mode, "a2a") == 0)
{
return CM_ALL2ALL;
}
else if (strcmp(cluster_mode, "quad") == 0)
{
return CM_QUAD;
}
else if (strcmp(cluster_mode, "hemi") == 0)
{
return CM_HEMI;
}
else if (strcmp(cluster_mode, "snc4") == 0)
{
return CM_SNC4;
}
else if (strcmp(cluster_mode, "snc2") == 0)
{
return CM_SNC2;
}
return CM_UNKNOWN;
}
static void get_xc_coords (int *group,
int *chassis,
int *blade,
int *node)
{
FILE *f = fopen("/proc/cray_xt/cname","r");
if (f != NULL)
{
char a, b, c, d;
int racki, rackj, cchassis, sblade, nic;
/* format example: c1-0c1s2n1 c3-0c2s15n3 */
fscanf(f, "%c%d-%d%c%d%c%d%c%d",
&a, &racki, &rackj, &b, &cchassis, &c, &sblade, &d, &nic);
fclose(f);
*group = racki/2 + rackj*6;
*chassis = (racki%2) * 3 + cchassis;
*blade = sblade;
*node = nic;
}
else
{
*group = -1;
*chassis = -1;
*blade = -1;
*node = -1;
}
return;
}
static unsigned int count_bits(unsigned int *bitvec, int cnt) static unsigned int count_bits(unsigned int *bitvec, int cnt)
{ {
......
This diff is collapsed.
...@@ -10,12 +10,12 @@ DARSHAN_STATIC_MOD_OBJS += darshan-apmpi-logutils.o ...@@ -10,12 +10,12 @@ DARSHAN_STATIC_MOD_OBJS += darshan-apmpi-logutils.o
DARSHAN_DYNAMIC_MOD_OBJS += darshan-apmpi-logutils.po DARSHAN_DYNAMIC_MOD_OBJS += darshan-apmpi-logutils.po
CFLAGS += \ CFLAGS += \
-DDARSHAN_USE_apmpi \ -DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/apmpi \ -I$(srcdir)/../modules/autoperf/apmpi \
-I$(srcdir)/../modules/autoperf/apmpi/util -I$(srcdir)/../modules/autoperf/apmpi/util
CFLAGS_SHARED += \ CFLAGS_SHARED += \
-DDARSHAN_USE_apmpi \ -DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/apmpi \ -I$(srcdir)/../modules/autoperf/apmpi \
-I$(srcdir)/../modules/autoperf/apmpi/util -I$(srcdir)/../modules/autoperf/apmpi/util
......
This diff is collapsed.
...@@ -72,13 +72,13 @@ static int my_rank = -1; ...@@ -72,13 +72,13 @@ static int my_rank = -1;
void apxc_runtime_initialize(void); void apxc_runtime_initialize(void);
/* forward declaration for shutdown function needed to interface with darshan-core */ /* forward declaration for shutdown function needed to interface with darshan-core */
#ifdef HAVE_MPI //#ifdef HAVE_MPI
static void apxc_mpi_redux( static void apxc_mpi_redux(
void *buffer, void *buffer,
MPI_Comm mod_comm, MPI_Comm mod_comm,
darshan_record_id *shared_recs, darshan_record_id *shared_recs,
int shared_rec_count); int shared_rec_count);
#endif //#endif
static void apxc_shutdown( static void apxc_shutdown(
void **buffer, void **buffer,
int *size); int *size);
...@@ -151,9 +151,9 @@ void apxc_runtime_initialize() ...@@ -151,9 +151,9 @@ void apxc_runtime_initialize()
char rtr_rec_name[128]; char rtr_rec_name[128];
darshan_module_funcs mod_funcs = { darshan_module_funcs mod_funcs = {
#ifdef HAVE_MPI //#ifdef HAVE_MPI
.mod_redux_func = &apxc_mpi_redux, .mod_redux_func = &apxc_mpi_redux,
#endif //#endif
.mod_shutdown_func = &apxc_shutdown .mod_shutdown_func = &apxc_shutdown
}; };
...@@ -178,7 +178,6 @@ void apxc_runtime_initialize() ...@@ -178,7 +178,6 @@ void apxc_runtime_initialize()
&apxc_buf_size, &apxc_buf_size,
&my_rank, &my_rank,
NULL); NULL);
/* not enough memory to fit crayxc module record */ /* not enough memory to fit crayxc module record */
if(apxc_buf_size < sizeof(struct darshan_apxc_header_record) + sizeof(struct darshan_apxc_perf_record)) if(apxc_buf_size < sizeof(struct darshan_apxc_header_record) + sizeof(struct darshan_apxc_perf_record))
{ {
...@@ -204,7 +203,8 @@ void apxc_runtime_initialize() ...@@ -204,7 +203,8 @@ void apxc_runtime_initialize()
/* register the crayxc file record with darshan-core */ /* register the crayxc file record with darshan-core */
apxc_runtime->header_record = darshan_core_register_record( apxc_runtime->header_record = darshan_core_register_record(
apxc_runtime->header_id, apxc_runtime->header_id,
NULL, //NULL,
"APXC",
DARSHAN_APXC_MOD, DARSHAN_APXC_MOD,
sizeof(struct darshan_apxc_header_record), sizeof(struct darshan_apxc_header_record),
NULL); NULL);
...@@ -228,12 +228,12 @@ void apxc_runtime_initialize() ...@@ -228,12 +228,12 @@ void apxc_runtime_initialize()
sprintf(rtr_rec_name, "darshan-crayxc-rtr-%d-%d-%d", sprintf(rtr_rec_name, "darshan-crayxc-rtr-%d-%d-%d",
apxc_runtime->group, apxc_runtime->chassis, apxc_runtime->blade); apxc_runtime->group, apxc_runtime->chassis, apxc_runtime->blade);
apxc_runtime->rtr_id = darshan_core_gen_record_id(rtr_rec_name); apxc_runtime->rtr_id = darshan_core_gen_record_id(rtr_rec_name);
apxc_runtime->perf_record = darshan_core_register_record( apxc_runtime->perf_record = darshan_core_register_record(
apxc_runtime->rtr_id, apxc_runtime->rtr_id,
NULL, //NULL,
"APXC",
DARSHAN_APXC_MOD, DARSHAN_APXC_MOD,
sizeof(struct darshan_apxc_perf_record), sizeof(struct darshan_apxc_perf_record),
NULL); NULL);
...@@ -247,7 +247,6 @@ void apxc_runtime_initialize() ...@@ -247,7 +247,6 @@ void apxc_runtime_initialize()
} }
initialize_counters(); initialize_counters();
APXC_UNLOCK(); APXC_UNLOCK();
return; return;
...@@ -407,7 +406,6 @@ static void apxc_mpi_redux( ...@@ -407,7 +406,6 @@ static void apxc_mpi_redux(
} }
apxc_runtime->perf_record->marked = -1; apxc_runtime->perf_record->marked = -1;
} }
PMPI_Comm_free(&router_comm); PMPI_Comm_free(&router_comm);
APXC_UNLOCK(); APXC_UNLOCK();
...@@ -434,7 +432,6 @@ static void apxc_shutdown( ...@@ -434,7 +432,6 @@ static void apxc_shutdown(
{ {
*apxc_buf_sz += sizeof( *apxc_runtime->perf_record); *apxc_buf_sz += sizeof( *apxc_runtime->perf_record);
} }
finalize_counters(); finalize_counters();
free(apxc_runtime); free(apxc_runtime);
apxc_runtime = NULL; apxc_runtime = NULL;
......
...@@ -138,14 +138,14 @@ static int darshan_log_get_apxc_rec(darshan_fd fd, void** buf_p) ...@@ -138,14 +138,14 @@ static int darshan_log_get_apxc_rec(darshan_fd fd, void** buf_p)
} }
else if (ret < 0) else if (ret < 0)
{ {
*buf_p = NULL; // *buf_p = NULL;
if (buffer) free(buffer); // if (buffer) free(buffer);
return(-1); return(-1);
} }
else else
{ {
*buf_p = NULL; // *buf_p = NULL;
if (buffer) free(buffer); // if (buffer) free(buffer);
return(0); return(0);
} }
} }
......
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