/* --------------------------------------------------------------- * MPI - MPI_Scatter() communication benchmark. * FILE: scatter.c * DESCRIPTION: this program performs the MPI_Scatter() communication call * on a variety of message sizes. * * AUTHOR: George Gusciora: Maui High Performance Computing Center * --------------------------------------------------------------- */ #include "mpi.h" #include #define NUM_SIZES 15 #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, source, MESSAGE_SIZE; double StartTime, EndTime; double round_trips[NUM_SIZES][NUMBER_REPS]; double avg_round_trip[NUM_SIZES]; double min_round_trip[NUM_SIZES]; #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); if (taskid == 0) printf("Running scatter() test on %d nodes\n", numtasks); MESSAGE_SIZE=1024; for(msize=0;msizetb_high - StartTime_rrt->tb_high) + ((EndTime_rrt->tb_low - StartTime_rrt->tb_low)/1e9); #endif } MESSAGE_SIZE*=2; } if (taskid == 0) { MESSAGE_SIZE=1024; for(msize=0;msize