Commit 9aa50edf authored by mubarak's avatar mubarak
Browse files

updates to codes-dumpi plugins: added safety checks + minor bug fixes

parent 2ecbc4bf
......@@ -10,14 +10,12 @@
#include "ross.h"
#define MAX_NAME_LENGTH 512
//#define MAX_REQUESTS 128
/* struct to hold the actual data from a single MPI event*/
typedef struct mpi_event_list mpi_event_list;
typedef struct scala_trace_params scala_trace_params;
#ifdef USE_DUMPI
typedef struct dumpi_trace_params dumpi_trace_params;
#endif
struct scala_trace_params
{
......@@ -25,12 +23,10 @@ struct scala_trace_params
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
{
......@@ -42,10 +38,12 @@ enum NW_WORKLOADS
};
enum mpi_workload_type
{
/* terminator; there are no more operations for this rank */
CODES_NW_END = 1,
/* sleep/delay to simulate computation or other activity */
CODES_NW_DELAY,
CODES_NW_DELAY = 1,
/* MPI wait all operation */
CODES_NW_WAITALL,
/* terminator; there are no more operations for this rank */
CODES_NW_END,
/* MPI blocking send operation */
CODES_NW_SEND,
/* MPI blocking recv operation */
......@@ -68,8 +66,12 @@ enum mpi_workload_type
CODES_NW_REDUCE,
/* MPI Allreduce operation */
CODES_NW_ALLREDUCE,
/* MPI test all operation */
CODES_NW_TESTALL,
/* MPI test operation */
CODES_NW_TEST,
/* Generic collective operation */
CODES_NW_COL
CODES_NW_COL,
};
/* data structure for holding data from a MPI event (coming through scala-trace)
......@@ -93,20 +95,36 @@ struct mpi_event_list
{
int source_rank;/* source 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 num_bytes; /* number of bytes to be transferred over the network */
short data_type; /* MPI data type to be matched with the recv */
int count; /* number of elements to be received */
int tag; /* tag of the message */
int32_t request;
} send;
struct
{
int source_rank;/* source 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*/
} recv;
int num_bytes; /* number of bytes to be transferred over the network */
short data_type; /* MPI data type to be matched with the send */
int count; /* number of elements to be sent */
int tag; /* tag of the message */
int32_t request;
} recv;
struct
{
int num_bytes;
} collective;
/*struct
{
int count;
int requests[MAX_REQUESTS];
} wait_all;*/
struct
{
int32_t request;
int flag;
} test;
}u;
};
......
......@@ -104,16 +104,17 @@ static void dumpi_insert_next_op(void *mpi_op_array, struct mpi_event_list *mpi_
static void dumpi_finalize_mpi_op_data(void *mpi_op_array)
{
struct dumpi_op_data_array* array = (struct dumpi_op_data_array*)mpi_op_array;
array->op_arr_cnt = array->op_arr_ndx;
array->op_arr_ndx = 0;
}
/* removes the next operation from the dynamic array */
/* removes the next operation from the array */
static void dumpi_remove_next_op(void *mpi_op_array, struct mpi_event_list *mpi_op,
double last_op_time)
{
dumpi_op_data_array *array = (dumpi_op_data_array*)mpi_op_array;
//printf("\n op array index %d array count %d ", array->op_arr_ndx, array->op_arr_cnt);
if (array->op_arr_ndx == array->op_arr_cnt)
{
mpi_op->op_type = CODES_NW_END;
......@@ -137,18 +138,14 @@ void update_compute_time(const dumpi_time* time, rank_mpi_context* my_ctx)
{
if((time->start.nsec - my_ctx->last_op_time) > DUMPI_IGNORE_DELAY)
{
struct mpi_event_list* wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank->op_type = CODES_NW_DELAY;
wrkld_per_rank->start_time = my_ctx->last_op_time;
wrkld_per_rank->end_time = time->start.nsec;
wrkld_per_rank->u.delay.nsecs = time->start.nsec - my_ctx->last_op_time;
wrkld_per_rank.op_type = CODES_NW_DELAY;
wrkld_per_rank.start_time = my_ctx->last_op_time;
wrkld_per_rank.end_time = time->start.nsec;
wrkld_per_rank.u.delay.nsecs = time->start.nsec - my_ctx->last_op_time;
my_ctx->last_op_time = time->stop.nsec;
dumpi_insert_next_op(my_ctx->dumpi_mpi_array, wrkld_per_rank);
dumpi_insert_next_op(my_ctx->dumpi_mpi_array, &wrkld_per_rank);
}
}
......@@ -165,18 +162,20 @@ int handleDUMPIISend(const dumpi_isend *prm, uint16_t thread, const dumpi_time *
{
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct mpi_event_list * wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank->op_type = CODES_NW_ISEND;
wrkld_per_rank->u.send.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->u.send.dest_rank = prm->dest;
wrkld_per_rank->u.send.source_rank = -1;
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_ISEND;
wrkld_per_rank.u.send.tag = prm->tag;
wrkld_per_rank.u.send.count = prm->count;
wrkld_per_rank.u.send.data_type = prm->datatype;
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.u.send.dest_rank = prm->dest;
wrkld_per_rank.u.send.source_rank = myctx->my_rank;
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
assert(wrkld_per_rank.u.send.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
......@@ -186,19 +185,19 @@ int handleDUMPIIRecv(const dumpi_irecv *prm, uint16_t thread, const dumpi_time *
{
//printf("\n irecv source %d count %d data type %d", prm->source, prm->count, prm->datatype);
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
struct mpi_event_list* wrkld_per_rank = malloc(sizeof(mpi_event_list));
wrkld_per_rank->op_type = CODES_NW_IRECV;
wrkld_per_rank->u.recv.data_type = prm->datatype;
wrkld_per_rank->u.recv.count = prm->count;
wrkld_per_rank->u.recv.tag = prm->tag;
wrkld_per_rank->u.recv.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->u.recv.source_rank = prm->source;
wrkld_per_rank->u.recv.dest_rank = -1;
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
assert(wrkld_per_rank->u.recv.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
update_compute_time(cpu, myctx);
......@@ -210,20 +209,22 @@ int handleDUMPISend(const dumpi_send *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank->op_type = CODES_NW_SEND;
wrkld_per_rank->u.send.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->u.send.dest_rank = prm->dest;
wrkld_per_rank->u.send.source_rank = -1;
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_SEND;
wrkld_per_rank.u.send.tag = prm->tag;
wrkld_per_rank.u.send.count = prm->count;
wrkld_per_rank.u.send.data_type = prm->datatype;
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.u.send.dest_rank = prm->dest;
wrkld_per_rank.u.send.source_rank = myctx->my_rank;
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
if(wrkld_per_rank.u.send.num_bytes < 0)
printf("\n Number of bytes %d count %d data type %d num_bytes %d", prm->count * get_num_bytes(prm->datatype), prm->count, prm->datatype, get_num_bytes(prm->datatype));
assert(wrkld_per_rank.u.send.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -232,21 +233,19 @@ int handleDUMPIRecv(const dumpi_recv *prm, uint16_t thread,
const dumpi_time *cpu, const dumpi_time *wall,
const dumpi_perfinfo *perf, void *uarg)
{
//printf("\n irecv source %d count %d data type %d", prm->source, prm->count, prm->datatype);
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank->op_type = CODES_NW_RECV;
wrkld_per_rank->u.recv.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->u.recv.source_rank = prm->source;
wrkld_per_rank->u.recv.dest_rank = -1;
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_RECV;
wrkld_per_rank.u.recv.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.u.recv.source_rank = prm->source;
wrkld_per_rank.u.recv.dest_rank = -1;
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.recv.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
......@@ -257,18 +256,15 @@ int handleDUMPIBcast(const dumpi_bcast *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank.op_type = CODES_NW_BCAST;
wrkld_per_rank.u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
wrkld_per_rank->op_type = CODES_NW_BCAST;
wrkld_per_rank->u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -278,18 +274,15 @@ int handleDUMPIAllgather(const dumpi_allgather *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank->op_type = CODES_NW_ALLGATHER;
wrkld_per_rank->u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_ALLGATHER;
wrkld_per_rank.u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -299,18 +292,15 @@ int handleDUMPIAllgatherv(const dumpi_allgatherv *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank->op_type = CODES_NW_ALLGATHERV;
wrkld_per_rank->u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_ALLGATHERV;
wrkld_per_rank.u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -320,18 +310,15 @@ int handleDUMPIAlltoall(const dumpi_alltoall *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank.op_type = CODES_NW_ALLTOALL;
wrkld_per_rank.u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
wrkld_per_rank->op_type = CODES_NW_ALLTOALL;
wrkld_per_rank->u.collective.num_bytes = prm->sendcount * get_num_bytes(prm->sendtype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -341,18 +328,15 @@ int handleDUMPIAlltoallv(const dumpi_alltoallv *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank->op_type = CODES_NW_ALLTOALLV;
wrkld_per_rank->u.collective.num_bytes = prm->sendcounts[0] * get_num_bytes(prm->sendtype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_ALLTOALLV;
wrkld_per_rank.u.collective.num_bytes = prm->sendcounts[0] * get_num_bytes(prm->sendtype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -362,18 +346,15 @@ int handleDUMPIReduce(const dumpi_reduce *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank->op_type = CODES_NW_REDUCE;
wrkld_per_rank->u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_REDUCE;
wrkld_per_rank.u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -383,18 +364,15 @@ int handleDUMPIAllreduce(const dumpi_allreduce *prm, uint16_t thread,
const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
wrkld_per_rank.op_type = CODES_NW_ALLREDUCE;
wrkld_per_rank.u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
wrkld_per_rank->op_type = CODES_NW_ALLREDUCE;
wrkld_per_rank->u.collective.num_bytes = prm->count * get_num_bytes(prm->datatype);
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
assert(wrkld_per_rank.u.collective.num_bytes > 0);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
......@@ -403,17 +381,13 @@ int handleDUMPIAllreduce(const dumpi_allreduce *prm, uint16_t thread,
int handleDUMPIFinalize(const dumpi_finalize *prm, uint16_t thread, const dumpi_time *cpu, const dumpi_time *wall, const dumpi_perfinfo *perf, void *uarg)
{
rank_mpi_context* myctx = (rank_mpi_context*)uarg;
struct mpi_event_list * wrkld_per_rank = NULL;
wrkld_per_rank = malloc(sizeof(*wrkld_per_rank));
if(!wrkld_per_rank)
return -1;
struct mpi_event_list wrkld_per_rank;
wrkld_per_rank->op_type = CODES_NW_END;
wrkld_per_rank->start_time = cpu->start.nsec;
wrkld_per_rank->end_time = cpu->stop.nsec;
wrkld_per_rank.op_type = CODES_NW_END;
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
dumpi_insert_next_op(myctx->dumpi_mpi_array, wrkld_per_rank);
dumpi_insert_next_op(myctx->dumpi_mpi_array, &wrkld_per_rank);
update_compute_time(cpu, myctx);
return 0;
}
......@@ -475,7 +449,7 @@ int dumpi_trace_nw_workload_load(const char* params, int rank)
callbacks.on_isend = (dumpi_isend_call)handleDUMPIISend;
callbacks.on_irecv = (dumpi_irecv_call)handleDUMPIIRecv;
callbacks.on_allreduce = (dumpi_allreduce_call)handleDUMPIAllreduce;
callbacks.on_bcast = (dumpi_bcast_call)handleDUMPIBcast;
callbacks.on_bcast = (dumpi_bcast_call)handleDUMPIBcast;
callbacks.on_get_count = (dumpi_get_count_call)handleDUMPIGeneric;
callbacks.on_bsend = (dumpi_bsend_call)handleDUMPIGeneric;
callbacks.on_ssend = (dumpi_ssend_call)handleDUMPIGeneric;
......
......@@ -14,7 +14,9 @@
* could make generators optional via autoconf tests etc. if needed
*/
extern struct codes_nw_workload_method scala_trace_workload_method;
#ifdef USE_DUMPI
extern struct codes_nw_workload_method dumpi_trace_workload_method;
#endif
static struct codes_nw_workload_method *method_array[] =
{
......@@ -122,7 +124,7 @@ void codes_nw_workload_get_next(int wkld_id, int rank, struct mpi_event_list *op
}
/* ask generator for the next operation */
//printf("codes_workload_get_next issuing new operation.\n");
//printf("codes_workload_get_next issuing new operation rank %d %d.\n", rank, wkld_id);
method_array[wkld_id]->codes_nw_workload_get_next(rank, op);
return;
......@@ -157,26 +159,26 @@ void codes_nw_workload_print_op(FILE *f, struct mpi_event_list *op, int rank){
fprintf(f, "op: rank:%d type:end\n", rank);
break;
case CODES_NW_DELAY:
fprintf(f, "op: rank:%d type:delay seconds:%f \n",
fprintf(f, "op: rank:%d type:delay nsecs:%f \n",
rank, op->u.delay.nsecs);
break;
case CODES_NW_SEND:
case CODES_NW_ISEND:
fprintf(f, "op: rank:%d type:send "
"sender: %d receiver: %d blocking: %d number of bytes: %d "
"sender: %d receiver: %d number of bytes: %d "
"start time: %f end time: %f \n",
rank, op->u.send.source_rank, op->u.send.dest_rank,
op->u.send.blocking, op->u.send.num_bytes,
op->u.send.num_bytes,
op->start_time, op->end_time);
break;
case CODES_NW_RECV:
case CODES_NW_IRECV:
fprintf(f, "op: rank:%d type:recv "
"sender: %d receiver: %d blocking: %d number of bytes: %d "
"start time: %f end time: %f \n",
"sender: %d receiver: %d number of bytes: %d "
"start time: %f end time: %f request ID: %d \n",
rank, op->u.recv.source_rank, op->u.recv.dest_rank,
op->u.recv.blocking, op->u.recv.num_bytes,
op->start_time, op->end_time);
op->u.recv.num_bytes,
op->start_time, op->end_time, (int)op->u.recv.request);
break;
case CODES_NW_COL:
case CODES_NW_BCAST:
......@@ -189,7 +191,21 @@ void codes_nw_workload_print_op(FILE *f, struct mpi_event_list *op, int rank){
fprintf(f, "op: rank:%d type:collective "
"count: %d \n",
rank, op->u.collective.num_bytes);
break;
break;
case CODES_NW_TEST:
fprintf(f, "op: rank:%d type:test "
"request ID: %d flag: %d "
"start time: %f end time: %f \n",
rank, (int)op->u.test.request, op->u.test.flag,
op->start_time, op->end_time);
break;
/*case CODES_NW_WAITALL:
fprintf(f, "op: rank:%d type:waitall "
"count: %d "
"start time: %f end time: %f \n",
rank, op->u.wait_all.count,
op->start_time, op->end_time);
break;*/
}
}
......
......@@ -106,28 +106,28 @@ void scala_trace_nw_workload_get_next(int rank, struct mpi_event_list *op)
op->op_type = CODES_NW_SEND;
op->u.send.source_rank = temp_data.source_rank;
op->u.send.dest_rank = temp_data.dest_rank;
op->u.send.blocking = 0; /* non-blocking operation */
//op->u.send.blocking = 0; /* non-blocking operation */
}
else if(strcmp( temp_data.mpi_type, "MPI_Irecv") == 0)
{
op->op_type = CODES_NW_RECV;
op->u.recv.source_rank = temp_data.source_rank;
op->u.recv.dest_rank = temp_data.dest_rank;
op->u.recv.blocking = 0; /* non-blocking recv operation */
//op->u.recv.blocking = 0; /* non-blocking recv operation */
}
else if(strcmp( temp_data.mpi_type, "MPI_Send") == 0)
{
op->op_type = CODES_NW_SEND;
op->u.send.source_rank = temp_data.source_rank;
op->u.send.dest_rank = temp_data.dest_rank;
op->u.send.blocking = 1; /* blocking send operation */
//op->u.send.blocking = 1; /* blocking send operation */
}
else if(strcmp( temp_data.mpi_type, "MPI_Recv") == 0)
{
op->op_type = CODES_NW_RECV;
op->u.recv.source_rank = temp_data.source_rank;
op->u.recv.dest_rank = temp_data.dest_rank;
op->u.recv.blocking = 1; /* blocking recv operation */
//op->u.recv.blocking = 1; /* blocking recv operation */
}
/* increment current counter */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.