[gmx-developers] rvec structure

Nathan Moore nmoore at physics.umn.edu
Thu Jul 7 17:00:30 CEST 2005


Thanks so much Berk!  I feel like an idiot for trying to reinvent the wheel.

I'll try today, but would you guess v1.8 of mvxvf.c would interfere with
v3.2 of the rest of the source?

Nathan

> Hi,
>
> You don't need a temp array.
>
> My test code is in CVS revision 1.8 of mvxvf.c:
>
>  >   static int *recvcounts=NULL,*displs;
>  >   int i;
>  >
>  >   if (recvcounts == NULL) {
>  >     snew(recvcounts,nsb->nprocs);
>  >     snew(displs,nsb->nprocs);
>  >     for(i=0; i<nsb->nprocs; i++) {
>  >       recvcounts[i] = nsb->homenr[i]*sizeof(x[0]);
>  >       displs[i]     = nsb->index[i]*sizeof(x[0]);
>  >     }
>  >   }
>  >   MPI_Allgatherv(arrayp(x[nsb->index[nsb->pid]],nsb->homenr[nsb->pid]),
>  >                MPI_BYTE,x,recvcounts,displs,MPI_BYTE,MPI_COMM_WORLD);
>
> It also contains the force summing, just one like is enough for this:
> MPI_Allreduce(f,f,nsb->natoms*DIM,mpi_type,MPI_SUM,MPI_COMM_WORLD);
>
> Berk.
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
>




More information about the gromacs.org_gmx-developers mailing list