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

APMPI module updates

parent 54fe59d5
......@@ -4,14 +4,14 @@
DARSHAN_STATIC_MOD_OBJS += lib/darshan-apmpi.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-apmpi.po
VPATH += :$(srcdir)/../modules/autoperf/crayxc
VPATH += :$(srcdir)/../modules/autoperf/apmpi
CFLAGS += \
-DDARSHAN_USE_apmpi \
-I$(srcdir)/../modules/autoperf/crayxc
-DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/apmpi
CFLAGS_SHARED += \
-DDARSHAN_USE_apmpi \
-I$(srcdir)/../modules/autoperf/crayxc
-DDARSHAN_USE_APMPI \
-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
$(CC) $(CFLAGS) -c $< -o $@
......
This diff is collapsed.
#ifndef __DARSHAN_APXC_UTILS_H__
#define __DARSHAN_APXC_UTILS_H__
#ifndef __DARSHAN_APMPI_UTILS_H__
#define __DARSHAN_APMPI_UTILS_H__
#include <regex.h>
......@@ -33,99 +33,7 @@ static void search_hwinfo(const char * mstr, char *mode)
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)
{
......
This diff is collapsed.
......@@ -10,12 +10,12 @@ DARSHAN_STATIC_MOD_OBJS += darshan-apmpi-logutils.o
DARSHAN_DYNAMIC_MOD_OBJS += darshan-apmpi-logutils.po
CFLAGS += \
-DDARSHAN_USE_apmpi \
-DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/apmpi \
-I$(srcdir)/../modules/autoperf/apmpi/util
CFLAGS_SHARED += \
-DDARSHAN_USE_apmpi \
-DDARSHAN_USE_APMPI \
-I$(srcdir)/../modules/autoperf/apmpi \
-I$(srcdir)/../modules/autoperf/apmpi/util
......
This diff is collapsed.
......@@ -72,13 +72,13 @@ static int my_rank = -1;
void apxc_runtime_initialize(void);
/* forward declaration for shutdown function needed to interface with darshan-core */
#ifdef HAVE_MPI
//#ifdef HAVE_MPI
static void apxc_mpi_redux(
void *buffer,
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count);
#endif
//#endif
static void apxc_shutdown(
void **buffer,
int *size);
......@@ -151,9 +151,9 @@ void apxc_runtime_initialize()
char rtr_rec_name[128];
darshan_module_funcs mod_funcs = {
#ifdef HAVE_MPI
//#ifdef HAVE_MPI
.mod_redux_func = &apxc_mpi_redux,
#endif
//#endif
.mod_shutdown_func = &apxc_shutdown
};
......@@ -178,7 +178,6 @@ void apxc_runtime_initialize()
&apxc_buf_size,
&my_rank,
NULL);
/* not enough memory to fit crayxc module 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()
/* register the crayxc file record with darshan-core */
apxc_runtime->header_record = darshan_core_register_record(
apxc_runtime->header_id,
NULL,
//NULL,
"APXC",
DARSHAN_APXC_MOD,
sizeof(struct darshan_apxc_header_record),
NULL);
......@@ -228,12 +228,12 @@ void apxc_runtime_initialize()
sprintf(rtr_rec_name, "darshan-crayxc-rtr-%d-%d-%d",
apxc_runtime->group, apxc_runtime->chassis, apxc_runtime->blade);
apxc_runtime->rtr_id = darshan_core_gen_record_id(rtr_rec_name);
apxc_runtime->perf_record = darshan_core_register_record(
apxc_runtime->rtr_id,
NULL,
//NULL,
"APXC",
DARSHAN_APXC_MOD,
sizeof(struct darshan_apxc_perf_record),
NULL);
......@@ -247,7 +247,6 @@ void apxc_runtime_initialize()
}
initialize_counters();
APXC_UNLOCK();
return;
......@@ -407,7 +406,6 @@ static void apxc_mpi_redux(
}
apxc_runtime->perf_record->marked = -1;
}
PMPI_Comm_free(&router_comm);
APXC_UNLOCK();
......@@ -434,7 +432,6 @@ static void apxc_shutdown(
{
*apxc_buf_sz += sizeof( *apxc_runtime->perf_record);
}
finalize_counters();
free(apxc_runtime);
apxc_runtime = NULL;
......
......@@ -138,14 +138,14 @@ static int darshan_log_get_apxc_rec(darshan_fd fd, void** buf_p)
}
else if (ret < 0)
{
*buf_p = NULL;
if (buffer) free(buffer);
// *buf_p = NULL;
// if (buffer) free(buffer);
return(-1);
}
else
{
*buf_p = NULL;
if (buffer) free(buffer);
// *buf_p = NULL;
// if (buffer) free(buffer);
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