/* * Driver for demonstrating MPI_Reduce_scatter performance problems on two * racks of BG/P. * * Please contact Jack Poulson at for more information. */ #include "mpi.h" #include "mpix.h" #include const int num_tests = 20; int MPIX_Get_last_algorithm(MPI_Comm comm, int *lastalgorithm); /* Test from 100 doubles to 3000 doubles contributions in multiples of 100 */ void TestReduceScatter( MPI_Comm comm, char* comm_name ) { int num_doubles; int comm_size, comm_rank, world_rank; int* rcs; double* send_buffer; double* recv_buffer; int result; /* Extract the communicator properties and our world rank */ MPI_Comm_size( comm, &comm_size ); MPI_Comm_rank( comm, &comm_rank ); MPI_Comm_rank( MPI_COMM_WORLD, &world_rank ); rcs = (int*)malloc(comm_size*sizeof(int)); /* Loop over local contribution sizes */ if( world_rank == 0 ) { printf("Testing over %s\n", comm_name); printf("Local contribution Megabits/second Algorithm\n"); printf("------------------------------------------------\n"); } for( num_doubles=100; num_doubles<=2000; num_doubles+=100 ) { int test; int rank; double megabits, megabits_per_second; double start_time, end_time, average_time; int last; megabits = num_doubles*comm_size*sizeof(double)*8/1.e6; for( rank=0; rank