Commit 95148bd5 authored by Xin Wang's avatar Xin Wang

merge with router counters

parents bd9e1a97 8ba18b12
......@@ -60,28 +60,17 @@ src_libcodes_la_SOURCES += src/workload/methods/codes-recorder-io-wrkld.c
endif
if USE_ONLINE
AM_CPPFLAGS += ${ARGOBOTS_CFLAGS} ${SWM_CFLAGS} -DUSE_ONLINE=1
AM_CPPFLAGS += ${ARGOBOTS_CFLAGS} -DUSE_ONLINE=1
LDADD += ${ARGOBOTS_LIBS}
if USE_SWM
AM_CPPFLAGS += -DUSE_SWM=1
AM_CPPFLAGS += ${SWM_CFLAGS} -DUSE_SWM=1
LDADD += ${SWM_LIBS}
src_libcodes_la_SOURCES += src/workload/methods/codes-online-comm-wrkld.C
endif
if USE_CONC
if USE_COWG
src_libcodes_la_SOURCES += src/workload/methods/codes-conc-online-comm-wrkld.C
AM_CPPFLAGS += ${CONCEPTUAL_CFLAGS} -DUSE_CONC=1
LDADD += ${CONCEPTUAL_LIBS}
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/alltoallv.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/bcast.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/allreduce.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/cosmo.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/jacobi2d.C
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/jacobi3d.C
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/jacobi4d.C
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/stencil14pt.C
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/pingpong.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/ring.c
src_libcodes_la_SOURCES += src/workload/conceputal-skeleton-apps/namdcomm.C
AM_CPPFLAGS += ${COWG_CFLAGS} ${SWM_CFLAGS} -DUSE_COWG=1
LDADD += ${COWG_LIBS} ${SWM_LIBS}
endif
endif
......
/*
* Copyright (C) 2017 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef CODES_CONC_ADDON_H
#define CODES_CONC_ADDON_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef USE_CONC
#include <ncptl/ncptl.h>
#endif
#include <mpi.h>
#define MAX_CONC_ARGV 128
typedef struct conc_bench_param conc_bench_param;
struct conc_bench_param {
char conc_program[MAX_CONC_ARGV];
int conc_argc;
char config_in[MAX_CONC_ARGV][MAX_CONC_ARGV];
char *conc_argv[MAX_CONC_ARGV];
};
int codes_conc_bench_load(
const char* program,
int argc,
char *argv[]);
void CODES_MPI_Comm_size (MPI_Comm comm, int *size);
void CODES_MPI_Comm_rank( MPI_Comm comm, int *rank );
void CODES_MPI_Finalize();
void CODES_Compute(long cycle_count);
void CODES_MPI_Send(const void *buf,
int count,
MPI_Datatype datatype,
int dest,
int tag,
MPI_Comm comm);
void CODES_MPI_Recv(void *buf,
int count,
MPI_Datatype datatype,
int source,
int tag,
MPI_Comm comm,
MPI_Status *status);
void CODES_MPI_Sendrecv(const void *sendbuf,
int sendcount,
MPI_Datatype sendtype,
int dest,
int sendtag,
void *recvbuf,
int recvcount,
MPI_Datatype recvtype,
int source,
int recvtag,
MPI_Comm comm,
MPI_Status *status);
void CODES_MPI_Barrier(MPI_Comm comm);
void CODES_MPI_Isend(const void *buf,
int count,
MPI_Datatype datatype,
int dest,
int tag,
MPI_Comm comm,
MPI_Request *request);
void CODES_MPI_Irecv(void *buf,
int count,
MPI_Datatype datatype,
int source,
int tag,
MPI_Comm comm,
MPI_Request *request);
void CODES_MPI_Wait(MPI_Request *request,
MPI_Status *status);
void CODES_MPI_Waitall(int count,
MPI_Request array_of_requests[],
MPI_Status array_of_statuses[]);
void CODES_MPI_Reduce(const void *sendbuf,
void *recvbuf,
int count,
MPI_Datatype datatype,
MPI_Op op,
int root,
MPI_Comm comm);
void CODES_MPI_Allreduce(const void *sendbuf,
void *recvbuf,
int count,
MPI_Datatype datatype,
MPI_Op op,
MPI_Comm comm);
void CODES_MPI_Bcast(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPI_Comm comm);
void CODES_MPI_Alltoall(const void *sendbuf,
int sendcount,
MPI_Datatype sendtype,
void *recvbuf,
int recvcount,
MPI_Datatype recvtype,
MPI_Comm comm);
void CODES_MPI_Alltoallv(const void *sendbuf,
const int *sendcounts,
const int *sdispls,
MPI_Datatype sendtype,
void *recvbuf,
const int *recvcounts,
const int *rdispls,
MPI_Datatype recvtype,
MPI_Comm comm);
/* implementation structure */
struct codes_conceptual_bench {
char *program_name; /* name of the conceptual program */
int (*conceptual_main)(int argc, char *argv[]);
};
void codes_conceptual_add_bench(struct codes_conceptual_bench const * method);
#ifdef __cplusplus
}
#endif
#endif /* CODES_CONC_ADDON_H */
......@@ -126,8 +126,6 @@ if test "x${with_online}" != "x" ; then
AM_CONDITIONAL(USE_ONLINE, true)
PKG_CHECK_MODULES_STATIC([ARGOBOTS], [argobots], [],
[AC_MSG_ERROR([Could not find working argobots installation via pkg-config])])
AC_DEFINE_UNQUOTED([ONLINE_CONFIGDIR], ["$with_online"], [if using json data files,
specify config directory])
else
AM_CONDITIONAL(USE_ONLINE, false)
fi
......@@ -147,22 +145,26 @@ else
AM_CONDITIONAL(USE_SWM, false)
fi
#check for Conceptual
AC_ARG_WITH([conceptual],[AS_HELP_STRING([--with-conceptual@<:@=DIR@:>@],
[location of Conceptual installation])])
if test "x${with_conceptual}" != "x" ; then
AC_CHECK_FILES([${with_conceptual}/lib/libncptl.a],
AM_CONDITIONAL(USE_CONC, true),
AC_MSG_ERROR(Could not find Conceptual libraries libncptl.a))
CONCEPTUAL_CFLAGS="-I${with_conceptual}/include"
CONCEPTUAL_LIBS="-L${with_conceptual}/lib/ -lncptl"
AC_SUBST(CONCEPTUAL_LIBS)
AC_SUBST(CONCEPTUAL_CFLAGS)
#check for COWG
AC_ARG_WITH([cowg],[AS_HELP_STRING([--with-cowg@<:@=DIR@:>@],
[location of COWG installation])])
if test "x${with_cowg}" != "x" ; then
AM_CONDITIONAL(USE_COWG, true)
PKG_CHECK_MODULES_STATIC([COWG], [cowg], [],
[AC_MSG_ERROR([Could not find working cowg installation via pkg-config])])
PKG_CHECK_VAR([COWG_DATADIR], [cowg], [datarootdir], [],
[AC_MSG_ERROR[Could not find shared directory in COWG]])
AC_DEFINE_UNQUOTED([COWG_DATADIR], ["$COWG_DATADIR"], [if using json data files])
PKG_CHECK_MODULES_STATIC([SWM], [swm], [],
[AC_MSG_ERROR([Could not find working swm installation via pkg-config])])
PKG_CHECK_VAR([SWM_DATAROOTDIR], [swm], [datarootdir], [],
[AC_MSG_ERROR[Could not find shared directory in SWM]])
AC_DEFINE_UNQUOTED([SWM_DATAROOTDIR], ["$SWM_DATAROOTDIR"], [if using json
data files])
else
AM_CONDITIONAL(USE_CONC, false)
AM_CONDITIONAL(USE_COWG, false)
fi
# check for Recorder
AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
......
......@@ -19,6 +19,9 @@ argobots_cflags=@ARGOBOTS_CFLAGS@
swm_libs=@SWM_LIBS@
swm_cflags=@SWM_CFLAGS@
swm_datarootdir=@SWM_DATAROOTDIR@
cowg_libs=@COWG_LIBS@
cowg_cflags=@COWG_CFLAGS@
cowg_datadir=@COWG_DATADIR@
conceptual_libs=@CONCEPTUAL_LIBS@
conceptual_cflags=@CONCEPTUAL_CFLAGS@
......@@ -27,5 +30,5 @@ Description: Base functionality for CODES storage simulation
Version: @PACKAGE_VERSION@
URL: http://trac.mcs.anl.gov/projects/CODES
Requires:
Libs: -L${libdir} -lcodes ${ross_libs} ${argobots_libs} ${swm_libs} ${darshan_libs} ${dumpi_libs} ${cortex_libs}
Cflags: -I${includedir} -I${swm_datarootdir} ${ross_cflags} ${darshan_cflags} ${swm_cflags} ${argobots_cflags} ${dumpi_cflags} ${cortex_cflags}
Libs: -L${libdir} -lcodes ${ross_libs} ${argobots_libs} ${swm_libs} ${cowg_libs} ${darshan_libs} ${dumpi_libs} ${cortex_libs}
Cflags: -I${includedir} -I${swm_datarootdir} -I{cowg_datadir} ${ross_cflags} ${darshan_cflags} ${swm_cflags} ${cowg_cflags} ${argobots_cflags} ${dumpi_cflags} ${cortex_cflags}
......@@ -21,9 +21,9 @@ class Params(object):
self.num_routers_per_group = int((radix + 1)/2) #a = (radix + 1)/2
self.num_hosts_per_router = int(self.num_routers_per_group // 2)
self.num_gc_per_router = int(self.num_routers_per_group // 2)
# self.num_gc_per_router = int(self.num_routers_per_group // 2)
self.num_gc_per_router = 8
self.num_gc_per_group = self.num_gc_per_router * self.num_routers_per_group
num_gc_per_group = self.num_gc_per_router * self.num_routers_per_group
self.num_groups = int((num_gc_per_group / self.num_conn_between_groups)) + 1
self.total_routers = self.num_routers_per_group * self.num_groups
......@@ -117,7 +117,7 @@ def writeIntra(params,fd):
for di in range(params.num_routers_per_group):
if si is not di:
fd.write(struct.pack("3i",si,di,0)) #we don't care about the 'color', set third int (color) to 0
# print("INTRA %d %d"%(si,di))
print("INTRA %d %d"%(si,di))
for gi in range(params.num_groups): #loop over all groups becasue the intra only iterates over a single group
src_gid = getRouterGID(si, gi, params.num_routers_per_group)
......@@ -145,7 +145,7 @@ def writeInter(params ,fd):
dest_rtr_gid = getRouterGID(dest_rtr_local_id, dest_gi, params.num_routers_per_group)
fd.write(struct.pack("2i",src_rtr_gid, dest_rtr_gid))
# print("INTER %d %d"%(src_rtr_gid, dest_rtr_gid))
print("INTER %d %d"%(src_rtr_gid, dest_rtr_gid))
A[src_rtr_gid,dest_rtr_gid] += 1
......
......@@ -105,8 +105,7 @@ nobase_include_HEADERS = \
codes/net/express-mesh.h \
codes/net/torus.h \
codes/codes-mpi-replay.h \
codes/configfile.h \
codes/codes-conc-addon.h
codes/configfile.h
#codes/codes-nw-workload.h
......@@ -152,7 +151,6 @@ src_libcodes_la_SOURCES = \
src/util/codes-mapping-context.c \
src/util/codes-comm.c \
src/workload/codes-workload.c \
src/workload/codes-conc-addon.c \
src/workload/methods/codes-iolang-wrkld.c \
src/workload/methods/codes-checkpoint-wrkld.c \
src/workload/methods/test-workload-method.c \
......
......@@ -34,11 +34,11 @@ PARAMS
#buffer size in bytes for compute node virtual channels
cn_vc_size="32768";
#bandwidth in GiB/s for local channels
local_bandwidth="2.0";
local_bandwidth="25";
# bandwidth in GiB/s for global channels
global_bandwidth="2.0";
global_bandwidth="25";
# bandwidth in GiB/s for compute node-router channels
cn_bandwidth="2.0";
cn_bandwidth="25";
# Number of row channels
num_row_chans="1";
# Number of column channels
......
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#include <assert.h>
#include <ross.h>
#include <codes/codes.h>
#include <codes/codes-conc-addon.h>
#ifdef USE_CONC
/* list of available benchmarks begin */
extern struct codes_conceptual_bench alltoallv_bench;
extern struct codes_conceptual_bench bcast_bench;
extern struct codes_conceptual_bench allreduce_bench;
extern struct codes_conceptual_bench cosmo_bench;
extern struct codes_conceptual_bench jacobi2d_bench;
extern struct codes_conceptual_bench jacobi3d_bench;
extern struct codes_conceptual_bench jacobi4d_bench;
extern struct codes_conceptual_bench stencil14pt_bench;
extern struct codes_conceptual_bench pingpong_bench;
extern struct codes_conceptual_bench ring_bench;
extern struct codes_conceptual_bench namdcomm_bench;
/* list of available benchmarks end */
#endif
static struct codes_conceptual_bench const * bench_array_default[] =
{
#ifdef USE_CONC
/* default benchmarks begin */
&alltoallv_bench,
&bcast_bench,
&allreduce_bench,
&cosmo_bench,
&jacobi2d_bench,
&jacobi3d_bench,
&jacobi4d_bench,
&stencil14pt_bench,
&pingpong_bench,
&ring_bench,
&namdcomm_bench,
/* default benchmarks end */
#endif
NULL
};
// once initialized, adding a bench generator is an error
static int is_bench_init = 0;
static int num_user_benchs = 0;
static struct codes_conceptual_bench const ** bench_array = NULL;
// only call this once
static void init_bench_methods(void)
{
if (is_bench_init)
return;
if (bench_array == NULL)
bench_array = bench_array_default;
else {
// note - includes null char
int num_default_benchs =
(sizeof(bench_array_default) / sizeof(bench_array_default[0]));
printf("\n Num default methods %d ", num_default_benchs);
bench_array = realloc(bench_array,
(num_default_benchs + num_user_benchs + 1) *
sizeof(*bench_array));
memcpy(bench_array+num_user_benchs, bench_array_default,
num_default_benchs * sizeof(*bench_array_default));
}
is_bench_init = 1;
}
int codes_conc_bench_load(
const char *program,
int argc,
char *argv[])
{
init_bench_methods();
int i;
int ret;
for(i=0; bench_array[i] != NULL; i++)
{
if(strcmp(bench_array[i]->program_name, program) == 0)
{
/* load appropriate workload generator */
ret = bench_array[i]->conceptual_main(argc, argv);
if(ret < 0)
{
return(-1);
}
return(i);
}
}
fprintf(stderr, "Error: failed to find benchmark program %s\n", program);
return(-1);
}
void codes_conceptual_add_bench(struct codes_conceptual_bench const * bench)
{
static int bench_array_cap = 10;
if (is_bench_init)
tw_error(TW_LOC,
"adding a conceptual benchmark method after initialization is forbidden");
else if (bench_array == NULL){
bench_array = malloc(bench_array_cap * sizeof(*bench_array));
assert(bench_array);
}
if (num_user_benchs == bench_array_cap) {
bench_array_cap *= 2;
bench_array = realloc(bench_array,
bench_array_cap * sizeof(*bench_array));
assert(bench_array);
}
bench_array[num_user_benchs++] = bench;
}
......@@ -38,7 +38,7 @@ extern struct codes_workload_method recorder_io_workload_method;
#ifdef USE_SWM
extern struct codes_workload_method swm_online_comm_workload_method;
#endif
#ifdef USE_CONC
#ifdef USE_COWG
extern struct codes_workload_method conc_online_comm_workload_method;
#endif
......@@ -66,7 +66,7 @@ static struct codes_workload_method const * method_array_default[] =
#ifdef USE_SWM
&swm_online_comm_workload_method,
#endif
#ifdef USE_CONC
#ifdef USE_COWG
&conc_online_comm_workload_method,
#endif
#ifdef USE_RECORDER
......
......@@ -35,17 +35,17 @@ using namespace std;
static struct qhash_table *rank_tbl = NULL;
static int rank_tbl_pop = 0;
static int total_rank_cnt = 0;
ABT_thread global_prod_thread = NULL;
ABT_xstream self_es;
double cpu_freq = 1.0;
long num_allreduce = 0;
long num_isends = 0;
long num_irecvs = 0;
long num_barriers = 0;
long num_sends = 0;
long num_recvs = 0;
long num_sendrecv = 0;
long num_waitalls = 0;
static ABT_thread global_prod_thread = NULL;
static ABT_xstream self_es;
static double cpu_freq = 1.0;
static long num_allreduce = 0;
static long num_isends = 0;
static long num_irecvs = 0;
static long num_barriers = 0;
static long num_sends = 0;
static long num_recvs = 0;
static long num_sendrecv = 0;
static long num_waitalls = 0;
//std::map<int64_t, int> send_count;
//std::map<int64_t, int> isend_count;
......
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