Commit 9aa50edf authored by mubarak's avatar mubarak

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;
};
......
......@@ -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.
Finish editing this message first!
Please register or to comment