Commit 87cbb32b authored by mubarak's avatar mubarak
Browse files

Updating network workloads: adding dumpi reader

parent c551f247
...@@ -47,3 +47,9 @@ if USE_RECORDER ...@@ -47,3 +47,9 @@ if USE_RECORDER
AM_CPPFLAGS += ${RECORDER_CPPFLAGS} AM_CPPFLAGS += ${RECORDER_CPPFLAGS}
src_libcodes_base_a_SOURCES += src/workload/codes-recorder-io-wrkld.c src_libcodes_base_a_SOURCES += src/workload/codes-recorder-io-wrkld.c
endif endif
if USE_DUMPI
AM_CPPFLAGS += ${DUMPI_CFLAGS} -DUSE_DUMPI=1
src_libcodes_base_a_SOURCES += src/network-workload/codes-dumpi-trace-nw-wrkld.c
AM_LIBS += ${DUMPI_LIBS}
endif
...@@ -9,21 +9,35 @@ ...@@ -9,21 +9,35 @@
#include "ross.h" #include "ross.h"
#define MAX_NAME_LENGTH 256 #define MAX_NAME_LENGTH 512
/* struct to hold the actual data from a single MPI event*/ /* struct to hold the actual data from a single MPI event*/
typedef struct mpi_event_list mpi_event_list; typedef struct mpi_event_list mpi_event_list;
typedef struct scala_trace_params scala_trace_params; typedef struct scala_trace_params scala_trace_params;
#ifdef USE_DUMPI
typedef struct dumpi_trace_params dumpi_trace_params;
#endif
struct scala_trace_params struct scala_trace_params
{ {
char offset_file_name[MAX_NAME_LENGTH]; char offset_file_name[MAX_NAME_LENGTH];
char nw_wrkld_file_name[MAX_NAME_LENGTH]; char nw_wrkld_file_name[MAX_NAME_LENGTH];
}; };
#ifdef USE_DUMPI
struct dumpi_trace_params
{
char file_name[MAX_NAME_LENGTH];
};
#endif
enum NW_WORKLOADS enum NW_WORKLOADS
{ {
SCALA_TRACE = 1, SCALA_TRACE = 1,
#ifdef USE_DUMPI
DUMPI,
#endif
OTHERS, /* add the names of other workload generators here */ OTHERS, /* add the names of other workload generators here */
}; };
enum mpi_workload_type enum mpi_workload_type
...@@ -32,10 +46,30 @@ enum mpi_workload_type ...@@ -32,10 +46,30 @@ enum mpi_workload_type
CODES_NW_END = 1, CODES_NW_END = 1,
/* sleep/delay to simulate computation or other activity */ /* sleep/delay to simulate computation or other activity */
CODES_NW_DELAY, CODES_NW_DELAY,
/* MPI send operation */ /* MPI blocking send operation */
CODES_NW_SEND, CODES_NW_SEND,
/* MPI recv operation */ /* MPI blocking recv operation */
CODES_NW_RECV CODES_NW_RECV,
/* MPI non-blocking send operation */
CODES_NW_ISEND,
/* MPI non-blocking receive operation */
CODES_NW_IRECV,
/* MPI broadcast operation */
CODES_NW_BCAST,
/* MPI Allgather operation */
CODES_NW_ALLGATHER,
/* MPI Allgatherv operation */
CODES_NW_ALLGATHERV,
/* MPI Alltoall operation */
CODES_NW_ALLTOALL,
/* MPI Alltoallv operation */
CODES_NW_ALLTOALLV,
/* MPI Reduce operation */
CODES_NW_REDUCE,
/* MPI Allreduce operation */
CODES_NW_ALLREDUCE,
/* Generic collective operation */
CODES_NW_COL
}; };
/* data structure for holding data from a MPI event (coming through scala-trace) /* data structure for holding data from a MPI event (coming through scala-trace)
...@@ -44,26 +78,35 @@ struct mpi_event_list ...@@ -44,26 +78,35 @@ struct mpi_event_list
{ {
/* what type of operation this is */ /* what type of operation this is */
enum mpi_workload_type op_type; enum mpi_workload_type op_type;
double start_time;
double end_time;
/* parameters for each operation type */ /* parameters for each operation type */
union union
{ {
struct struct
{ {
long seconds; double nsecs;
double seconds;
} delay; } delay;
struct struct
{ {
int source_rank;/* source rank of MPI send message */ int source_rank;/* source rank of MPI send message */
int dest_rank; /* dest rank of MPI send message */ int dest_rank; /* dest rank of MPI send message */
int num_bytes;
int blocking; /* boolean value to indicate if message is blocking or non-blocking*/ int blocking; /* boolean value to indicate if message is blocking or non-blocking*/
} send; } send;
struct struct
{ {
int source_rank;/* source rank of MPI recv message */ int source_rank;/* source rank of MPI recv message */
int dest_rank;/* dest rank of MPI recv message */ int dest_rank;/* dest rank of MPI recv message */
int num_bytes;
int blocking;/* boolean value to indicate if message is blocking or non-blocking*/ int blocking;/* boolean value to indicate if message is blocking or non-blocking*/
} recv; } recv;
struct
{
int num_bytes;
} collective;
}u; }u;
}; };
......
...@@ -112,6 +112,24 @@ AM_CONDITIONAL(USE_RECORDER, true) ...@@ -112,6 +112,24 @@ AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1" RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
AC_SUBST(RECORDER_CPPFLAGS) AC_SUBST(RECORDER_CPPFLAGS)
#check for Dumpi
AC_ARG_WITH([dumpi],[AS_HELP_STRING([--with-dumpi@<:@=DIR@:>@],
[location of Dumpi installation])])
if test "x${with_dumpi}" != "x" ; then
AC_CHECK_FILE([${with_dumpi}/lib/libundumpi.la],
AM_CONDITIONAL(USE_DUMPI, true),
AC_MSG_ERROR(Could not find libundumpi.la))
DUMPI_CFLAGS="-I${with_dumpi}/include"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/common"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libdumpi"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libundumpi"
DUMPI_LIBS="-L${with_dumpi}/lib/ -ldumpi -lundumpi"
AC_SUBST(DUMPI_LIBS)
AC_SUBST(DUMPI_CFLAGS)
else
AM_CONDITIONAL(USE_DUMPI, false)
fi
dnl ====================================================================== dnl ======================================================================
dnl Try harder to be valgrind safe dnl Try harder to be valgrind safe
dnl ====================================================================== dnl ======================================================================
......
...@@ -108,7 +108,8 @@ src_libcodes_base_a_SOURCES = \ ...@@ -108,7 +108,8 @@ src_libcodes_base_a_SOURCES = \
codes/codes-nw-workload.h \ codes/codes-nw-workload.h \
src/network-workload/codes-nw-workload.c \ src/network-workload/codes-nw-workload.c \
src/network-workload/codes-nw-workload-method.h \ src/network-workload/codes-nw-workload-method.h \
src/network-workload/codes-scala-trace-nw-wrkld.c src/network-workload/codes-scala-trace-nw-wrkld.c \
src/network-workload/codes-dumpi-trace-nw-wrkld.c
# stealth testing of the template code (actual test is not run, just compiled as # stealth testing of the template code (actual test is not run, just compiled as
# a program - Make error signifies test failure) # a program - Make error signifies test failure)
...@@ -133,6 +134,13 @@ bin_PROGRAMS += src/network-workload/codes-nw-test ...@@ -133,6 +134,13 @@ bin_PROGRAMS += src/network-workload/codes-nw-test
src_network_workload_codes_nw_test_SOURCES = \ src_network_workload_codes_nw_test_SOURCES = \
src/network-workload/codes-nw-test.c src/network-workload/codes-nw-test.c
src_network_workload_codes_nw_test_LDADD = $(testlib) ${ROSS_LIBS} src_network_workload_codes_nw_test_LDADD = $(testlib) ${ROSS_LIBS} ${DUMPI_LIBS}
src_network_workload_codes_nw_test_LDFLAGS = ${ROSS_LDFLAGS} src_network_workload_codes_nw_test_LDFLAGS = ${ROSS_LDFLAGS}
#bin_PROGRAMS += src/network-workload/codes-dumpi-wrkld
#src_network_workload_codes_dumpi_wrkld_SOURCES = \
src/network-workload/codes-dumpi-wrkld.c
#src_network_workload_codes_dumpi_wrkld_LDADD = $(testlib) ${ROSS_LIBS} ${DUMPI_LIBS}
#src_network_workload_codes_dumpi_wrkld_LDFLAGS = ${ROSS_LDFLAGS}
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
char workload_file[8192]; char workload_file[8192];
char offset_file[8192]; char offset_file[8192];
static int total_nw_lps = 16; static int total_nw_lps = 8;
static int nlp_per_pe; static int nlp_per_pe;
static int wrkld_id; static int wrkld_id;
...@@ -36,10 +36,12 @@ tw_peid nw_test_map(tw_lpid gid) ...@@ -36,10 +36,12 @@ tw_peid nw_test_map(tw_lpid gid)
void nw_test_init(nw_state* s, tw_lp* lp) void nw_test_init(nw_state* s, tw_lp* lp)
{ {
/* initialize the LP's and load the data */ /* initialize the LP's and load the data */
scala_trace_params params; //scala_trace_params params;
strcpy(params.offset_file_name, offset_file); //strcpy(params.offset_file_name, offset_file);
strcpy(params.nw_wrkld_file_name, workload_file); //strcpy(params.nw_wrkld_file_name, workload_file);
wrkld_id = codes_nw_workload_load("scala-trace-workload", (char*)&params, (int)lp->gid); dumpi_trace_params params;
strcpy(params.file_name, workload_file);
wrkld_id = codes_nw_workload_load("dumpi-trace-workload", (char*)&params, (int)lp->gid);
tw_event *e; tw_event *e;
tw_stime kickoff_time; tw_stime kickoff_time;
...@@ -108,10 +110,10 @@ int main( int argc, char** argv ) ...@@ -108,10 +110,10 @@ int main( int argc, char** argv )
tw_opt_add(app_opt); tw_opt_add(app_opt);
tw_init(&argc, &argv); tw_init(&argc, &argv);
if(strlen(offset_file) == 0 || strlen(workload_file) == 0 || total_nw_lps == 0) if(strlen(workload_file) == 0 || total_nw_lps == 0)
{ {
if(tw_ismaster()) if(tw_ismaster())
printf("\n Usage: mpirun -np n ./codes-nw-test --sync=1/2/3 --total_nw_lps=n --workload_file=workload-file-name --offset_file=offset-file-name "); printf("\n Usage: mpirun -np n ./codes-nw-test --sync=1/2/3 --total_nw_lps=n --workload_file=workload-file-name");
tw_end(); tw_end();
return -1; return -1;
} }
......
...@@ -14,10 +14,14 @@ ...@@ -14,10 +14,14 @@
* could make generators optional via autoconf tests etc. if needed * could make generators optional via autoconf tests etc. if needed
*/ */
extern struct codes_nw_workload_method scala_trace_workload_method; extern struct codes_nw_workload_method scala_trace_workload_method;
extern struct codes_nw_workload_method dumpi_trace_workload_method;
static struct codes_nw_workload_method *method_array[] = static struct codes_nw_workload_method *method_array[] =
{ {
&scala_trace_workload_method, &scala_trace_workload_method,
#ifdef USE_DUMPI
&dumpi_trace_workload_method,
#endif
NULL}; NULL};
/* This shim layer is responsible for queueing up reversed operations and /* This shim layer is responsible for queueing up reversed operations and
...@@ -153,20 +157,38 @@ void codes_nw_workload_print_op(FILE *f, struct mpi_event_list *op, int rank){ ...@@ -153,20 +157,38 @@ void codes_nw_workload_print_op(FILE *f, struct mpi_event_list *op, int rank){
fprintf(f, "op: rank:%d type:end\n", rank); fprintf(f, "op: rank:%d type:end\n", rank);
break; break;
case CODES_NW_DELAY: case CODES_NW_DELAY:
fprintf(f, "op: rank:%d type:delay seconds:%ld\n", fprintf(f, "op: rank:%d type:delay seconds:%f \n",
rank, op->u.delay.seconds); rank, op->u.delay.nsecs);
break; break;
case CODES_NW_SEND: case CODES_NW_SEND:
case CODES_NW_ISEND:
fprintf(f, "op: rank:%d type:send " fprintf(f, "op: rank:%d type:send "
"sender: %d receiver: %d blocking: %d \n", "sender: %d receiver: %d blocking: %d number of bytes: %d "
"start time: %f end time: %f \n",
rank, op->u.send.source_rank, op->u.send.dest_rank, rank, op->u.send.source_rank, op->u.send.dest_rank,
op->u.send.blocking); op->u.send.blocking, op->u.send.num_bytes,
op->start_time, op->end_time);
break; break;
case CODES_NW_RECV: case CODES_NW_RECV:
case CODES_NW_IRECV:
fprintf(f, "op: rank:%d type:recv " fprintf(f, "op: rank:%d type:recv "
"sender: %d receiver: %d blocking: %d \n", "sender: %d receiver: %d blocking: %d number of bytes: %d "
"start time: %f end time: %f \n",
rank, op->u.recv.source_rank, op->u.recv.dest_rank, rank, op->u.recv.source_rank, op->u.recv.dest_rank,
op->u.recv.blocking); op->u.recv.blocking, op->u.recv.num_bytes,
op->start_time, op->end_time);
break;
case CODES_NW_COL:
case CODES_NW_BCAST:
case CODES_NW_ALLGATHER:
case CODES_NW_ALLGATHERV:
case CODES_NW_ALLTOALL:
case CODES_NW_ALLTOALLV:
case CODES_NW_REDUCE:
case CODES_NW_ALLREDUCE:
fprintf(f, "op: rank:%d type:collective "
"count: %d \n",
rank, op->u.collective.num_bytes);
break; break;
} }
} }
......
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