Index: ../trunk-jpl/src/m/contrib/gravity/vfsa_mpi.cpp =================================================================== --- ../trunk-jpl/src/m/contrib/gravity/vfsa_mpi.cpp (revision 18478) +++ ../trunk-jpl/src/m/contrib/gravity/vfsa_mpi.cpp (revision 18479) @@ -146,7 +146,7 @@ MPI_Comm_rank(MPI_COMM_WORLD,&my_rank); /* Seed the random number generator {{{*/ - srand (time(NULL)); /*}}}*/ + srand (time(NULL)); /*}}}*/ /* Define the variables {{{*/ int dx = 500; /* prism dimension in x-direction */ @@ -443,7 +443,6 @@ /*GSL Matrices and vectors: */ int M,N; double chisq; - /*Get system size*/ A->GetSize(&M,&N); @@ -532,7 +531,6 @@ bool test=true; double *glocal=new double[n](); - double *gcalc=new double[n](); for(int c=my_rank;cGetValue(0,i)*xp->GetValue(0,i)+yp->GetValue(0,j)*yp->GetValue(0,j)+mesh->GetValue(a,k)*mesh->GetValue(a,k)); @@ -587,11 +585,7 @@ } } - MPI_Allreduce(glocal,gcalc,n,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); - if(!my_rank){for(int c=0;cSetValue(c,0,gcalc[c]); - } - } + MPI_Allreduce(glocal,g->GetPointer(),n,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); delete xp; delete yp; @@ -602,7 +596,6 @@ delete U1; delete U2; delete []glocal; - delete []gcalc; }/*}}}*/ void vec2gridsimple(Matrix *V,Matrix *V1,int nx, int ny){/*{{{*/ for(int i=0;i