Commit 8b9f247e authored by Sudheer Chunduri's avatar Sudheer Chunduri
Browse files

autoperf mpi create

parent e2b599de
#
# AutoPerf Make rules for Darshan
#
DARSHAN_STATIC_MOD_OBJS += lib/darshan-apxc.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-apxc.po
VPATH += :$(srcdir)/../modules/autoperf/crayxc
CFLAGS += \
-DDARSHAN_USE_APXC \
-I$(srcdir)/../modules/autoperf/crayxc
CFLAGS_SHARED += \
-DDARSHAN_USE_APXC \
-I$(srcdir)/../modules/autoperf/crayxc
lib/darshan-apxc.o: lib/darshan-apxc.c lib/darshan-apxc-utils.h darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) darshan-apxc-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-apxc.po: lib/darshan-apxc.c lib/darshan-apxc-utils.h darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) darshan-apxc-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
/*
* Copyright (C) 2017 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef __DARSHAN_APXC_LOG_FORMAT_H
#define __DARSHAN_APXC_LOG_FORMAT_H
/* 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 \
/* PAPI counters */\
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_0_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_0_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_1_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_1_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_2_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_2_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_3_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_3_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_4_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_4_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_5_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_5_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_6_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_6_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_0_7_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_0_7_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_0_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_0_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_1_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_1_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_2_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_2_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_3_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_3_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_4_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_4_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_5_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_5_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_6_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_6_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_1_7_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_1_7_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_0_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_0_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_1_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_1_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_2_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_2_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_3_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_3_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_4_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_4_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_5_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_5_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_6_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_6_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_2_7_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_2_7_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_0_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_0_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_1_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_1_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_2_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_2_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_3_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_3_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_4_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_4_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_5_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_5_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_6_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_6_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_3_7_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_3_7_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_0_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_0_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_1_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_1_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_2_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_2_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_3_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_3_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_4_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_4_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_5_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_5_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_6_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_6_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC1) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC2) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC3) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC5) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC6) \
X(AR_RTR_4_7_INQ_PRF_INCOMING_FLIT_VC7) \
X(AR_RTR_4_7_INQ_PRF_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_0_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_0_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_0_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_0_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_1_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_1_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_1_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_1_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_2_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_2_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_2_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_2_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_3_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_3_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_3_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_3_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_4_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_4_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_4_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_4_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_5_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_5_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_5_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_5_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_6_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_6_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_6_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_6_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_7_INQ_PRF_INCOMING_FLIT_VC0) \
X(AR_RTR_PT_5_7_INQ_PRF_INCOMING_FLIT_VC4) \
X(AR_RTR_PT_5_7_INQ_PRF_REQ_ROWBUS_STALL_CNT) \
X(AR_RTR_PT_5_7_INQ_PRF_RSP_ROWBUS_STALL_CNT) \
/* end of counters */\
X(APXC_NUM_INDICES)
#define APXC_MEMORY_MODES \
X(MM_UNKNOWN) \
X(MM_FLAT) \
X(MM_EQUAL) \
X(MM_SPLIT) \
X(MM_CACHE) \
X(MM_NUM_INDICES)
#define APXC_CLUSTER_MODES \
X(CM_UNKNOWN) \
X(CM_ALL2ALL) \
X(CM_QUAD) \
X(CM_HEMI) \
X(CM_SNC4) \
X(CM_SNC2) \
X(CM_NUM_INDICIES)
#define X(a) a,
/* integer counters for the "BGQ" example module */
enum darshan_apxc_perf_indices
{
APXC_PERF_COUNTERS
};
enum apxc_memory_modes
{
APXC_MEMORY_MODES
};
enum apxc_cluster_modes
{
APXC_CLUSTER_MODES
};
#undef X
/* the darshan_apxc_router_record structure encompasses the data/counters
* which would actually be logged to file by Darshan for the AP Cray XC
* module. This example implementation logs the following data for each
* record:
* - a darshan_base_record structure, which contains the record id & rank
* - integer I/O counters
* - floating point I/O counters
*/
struct darshan_apxc_perf_record
{
struct darshan_base_record base_rec;
int group;
int chassis;
int blade;
int node;
int marked;
uint64_t counters[APXC_NUM_INDICES];
};
struct darshan_apxc_header_record
{
struct darshan_base_record base_rec;
int64_t magic;
int nblades;
int nchassis;
int ngroups;
int memory_mode;
int cluster_mode;
uint64_t appid;
};
#endif /* __DARSHAN_APXC_LOG_FORMAT_H */
#ifndef __DARSHAN_APXC_UTILS_H__
#define __DARSHAN_APXC_UTILS_H__
#include <regex.h>
static void search_hwinfo(const char * mstr, char *mode)
{
FILE *f;
int r;
char *fdata;
long len;
regex_t preg;
regmatch_t mreg[1];
r = regcomp(&preg, mstr, 0);
f = fopen ("/.hwinfo.cray", "rb");
fseek(f, 0, SEEK_END);
len = ftell(f);
fdata = malloc(len);
fseek(f, 0, SEEK_SET);
fread(fdata, sizeof(char), len, f);
fclose(f);
r = regexec(&preg, fdata, 1, mreg, 0);
if ((r == 0) && (mreg[0].rm_so > -1))
{
sscanf(fdata+mreg[0].rm_so+strlen(mstr)-2, "%s", mode);
}
regfree(&preg);
free(fdata);
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;