From c66a5a9504409418f5801ddb64849bd94a593450 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 31 Jul 2009 14:57:03 +0000 Subject: [PATCH] Add another test that just blasts the system with MPI_Sendrecv to myself commands of varying sizes This commit was SVN r21748. --- orte/test/mpi/Makefile | 2 +- orte/test/mpi/sendrecv_blaster.c | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 orte/test/mpi/sendrecv_blaster.c diff --git a/orte/test/mpi/Makefile b/orte/test/mpi/Makefile index d029400834..58f5da44a9 100644 --- a/orte/test/mpi/Makefile +++ b/orte/test/mpi/Makefile @@ -1,4 +1,4 @@ -PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn reduce-hang ziaprobe ziatest bcast_loop parallel_w8 parallel_w64 parallel_r8 parallel_r64 sio +PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn reduce-hang ziaprobe ziatest bcast_loop parallel_w8 parallel_w64 parallel_r8 parallel_r64 sio sendrecv_blaster all: $(PROGS) diff --git a/orte/test/mpi/sendrecv_blaster.c b/orte/test/mpi/sendrecv_blaster.c new file mode 100644 index 0000000000..80b74af603 --- /dev/null +++ b/orte/test/mpi/sendrecv_blaster.c @@ -0,0 +1,95 @@ +/* + */ + +#include +#include +#include "mpi.h" +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + MPI_Status status; /* MPI status */ + int mpierr; /* MPI function return code */ + int rank; /* Process rank within MPI_COMM_WORLD */ + int tag0=41; /* MPI message tag */ + + int n_bytes=1024*1024; + int n_loops=2; + unsigned char* send_buff; + unsigned char* recv_buff; + + int i, j, count; + + float fraction, randval; + struct timeval tp; + + if ( argc > 2 ) + { + n_loops = atoi(argv[2]); + n_loops = n_loops < 1 ? 10 : n_loops; + } + if ( argc > 1 ) + { + n_bytes = atoi(argv[1]); + n_bytes = n_bytes < 1 ? 32768 : n_bytes; + } + + send_buff = (unsigned char *) valloc(n_bytes); + recv_buff = (unsigned char *) valloc(n_bytes); + + /* seed the random number generator */ + gettimeofday (&tp, NULL); + srand (tp.tv_usec); + + for ( i=0; i