From 8df0093827ce3b91ca6abcf8c1d6196e60a63180 Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Fri, 11 Apr 2014 13:25:14 +0200 Subject: [PATCH] Allreduce_b optimized --- src/ampi.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/ampi.c b/src/ampi.c index b6e9888..10817ca 100644 --- a/src/ampi.c +++ b/src/ampi.c @@ -451,13 +451,10 @@ int AMPI_Allreduce_f(double *sendbuf, double *recvbuf, int count, MPI_Datatype d int AMPI_Allreduce_b(double *sendbuf, double *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int i=0; - int j=0; int myid=0; int numprocs=0; int idx=0; - double **recvbuf_tmp = 0; double *minmaxbuf_tmp = 0; - MPI_Request *requests = 0; double *s = 0; double *s_d = 0; double *r = 0; @@ -470,31 +467,7 @@ int AMPI_Allreduce_b(double *sendbuf, double *recvbuf, int count, MPI_Datatype d } #endif if(op == MPI_PROD || op == MPI_SUM) { - if(myid==0) { - requests = (MPI_Request*) malloc(sizeof(MPI_Request)*(numprocs-1)); - recvbuf_tmp = (double**) malloc(sizeof(double*)*numprocs); - recvbuf_tmp[0] = recvbuf; - for(i=1;i