#include #include #include #include #include #include #include #include #include #include #define MSG_NTEST (50000) #define MSG_BEG_SIZE 1 #define MSG_END_SIZE 2097152 #define MSG_INCR_FAC 2 #define MSG_TARG_TIME 5.0 #define MEGA_BYTE 1048576 #define TRUTH(rank,i) (char)(((rank + 1)*i) % 256) #define INDEX_T int #define DATA_T char #define MPIDATA_T MPI_BYTE #define swap_vector(a,b) {swap_buf = a; a = b; b = swap_buf;} #define VERBOSE (1<<0) #define DOERR (1<<1) #define DOBUF (1<<2) #define STRIDE (1<<3) #define DOMAX (1<<4) #define DOAVG (1<<5) #define DOMEM (1<<6) #define BSBR1 (1<<7) #define ISBR1 (1<<8) #define BSIR1 (1<<9) #define ISIR1 (1<<10) #define BSBR2 (1<<11) #define ISBR2 (1<<12) #define BSIR2 (1<<13) #define ISIR2 (1<<14) #define IRIS2 (1<<15) #define IRIS1 (1<<16) #define SHIF1 (1<<17) #define DENSE (1<<18) #define USERP (1<<19) #define STRID (1<<20) #define VECTR (1<<21) #define WORST (1<<22) long int flags=0; double *swap_buf; int print_mach_info(); double p2p(char *tag, int nmsg, int msglen, int me, int you, int dpat, int cpat, int stride_pad, int stride_block); int main(int argc, char *argv[]) { int me, you, size, *perm, flags=0; INDEX_T i,j, msglen, nmsg, nmsg_test=MSG_NTEST; INDEX_T stride_pad, stride_block ; double t_test; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &me); MPI_Comm_size(MPI_COMM_WORLD, &size); if(size%2) { printf("MPI_Comm_size must be an even integer (%d)\n",size); MPI_Finalize(); exit(1); } if(!me) print_mach_info(); if(argc==-1) { printf("\n"); printf("usage: p2p [options] [size]\n"); printf(" -v verbose output\n"); printf(" -mem report memory usage\n"); printf(" -late report latency\n"); printf(" -stride pad,[block] data is block(default 1) elements\n"); printf(" then skipping pad elements\n"); printf(" -oa alternating task order\n"); printf(" -ow wrapped task order\n"); printf(" -or random task order\n"); } /* parse commandline args */ perm = (int *)malloc((size_t)size*sizeof(int)); for(i=0;i