/* --------------------------------------------------------------- * MPI - MPI point-to-point communication benchmark. * FILE: timing.c * DESCRIPTION: this program performs the point-to-point blocking message * passing calls on a variety of message sizes. * * AUTHOR: George Gusciora: Maui High Performance Computing Center * --------------------------------------------------------------- */ #include "mpi.h" #include #define NUM_SIZES 22 #define NUMBER_REPS 10 #ifdef USE_RTC double rtc(void); #endif #ifdef USE_READREALTIME #include #include #endif int main(argc,argv) int argc; char *argv[]; { char *inmsg, *outmsg; int repnum, msize, numtasks, taskid, rc, dst, src, type, MESSAGE_SIZE; double StartTime, EndTime; double round_trips[NUM_SIZES][NUMBER_REPS]; double avg_round_trip[NUM_SIZES]; double min_round_trip[NUM_SIZES]; MPI_Status Stat; float speed; #ifdef USE_READREALTIME timebasestruct_t *StartTime_rrt, *EndTime_rrt; size_t size_of_timebasestruct_t; StartTime_rrt = (timebasestruct_t *) malloc(sizeof(timebasestruct_t)); EndTime_rrt = (timebasestruct_t *) malloc(sizeof(timebasestruct_t)); #endif MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numtasks); MPI_Comm_rank(MPI_COMM_WORLD,&taskid); type = 1; MESSAGE_SIZE=4; for(msize=0;msizetb_high - StartTime_rrt->tb_high) + ((EndTime_rrt->tb_low - StartTime_rrt->tb_low)/1e9); #endif } } else if (taskid == 1) { dst = 0; src = 0; for (repnum=0;repnum