ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/math/AlphaHull.cpp
(Generate patch)

Comparing trunk/src/math/AlphaHull.cpp (file contents):
Revision 1938 by gezelter, Thu Oct 31 15:32:17 2013 UTC vs.
Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC

# Line 112 | Line 112 | void AlphaHull::computeHull(vector<StuntDouble*> bodyd
112   #ifdef IS_MPI
113    //If we are doing the mpi version, set up some vectors for data communication
114    
115 <  int nproc = MPI::COMM_WORLD.Get_size();
116 <  int myrank = MPI::COMM_WORLD.Get_rank();
115 >  int nproc;
116 >  int myrank;
117 >  MPI_Comm_size( MPI_COMM_WORLD, &nproc);
118 >  MPI_Comm_rank( MPI_COMM_WORLD, &myrank);
119 >
120    int localHullSites = 0;
121  
122    vector<int> hullSitesOnProc(nproc, 0);
# Line 147 | Line 150 | void AlphaHull::computeHull(vector<StuntDouble*> bodyd
150      masses.push_back(sd->getMass());
151    }
152  
153 <  MPI::COMM_WORLD.Allgather(&localHullSites, 1, MPI::INT, &hullSitesOnProc[0],
154 <                            1, MPI::INT);
153 >  MPI_Allgather(&localHullSites, 1, MPI_INT, &hullSitesOnProc[0],
154 >                1, MPI_INT, MPI_COMM_WORLD);
155  
156    int globalHullSites = 0;
157    for (int iproc = 0; iproc < nproc; iproc++){
# Line 170 | Line 173 | void AlphaHull::computeHull(vector<StuntDouble*> bodyd
173  
174    int count = coordsOnProc[myrank];
175    
176 <  MPI::COMM_WORLD.Allgatherv(&coords[0], count, MPI::DOUBLE, &globalCoords[0],
177 <                             &coordsOnProc[0], &vectorDisplacements[0],
178 <                             MPI::DOUBLE);
179 <
180 <  MPI::COMM_WORLD.Allgatherv(&vels[0], count, MPI::DOUBLE, &globalVels[0],
181 <                             &coordsOnProc[0], &vectorDisplacements[0],
182 <                             MPI::DOUBLE);
183 <
184 <  MPI::COMM_WORLD.Allgatherv(&masses[0], localHullSites, MPI::DOUBLE,
185 <                             &globalMasses[0], &hullSitesOnProc[0],
186 <                             &displacements[0], MPI::DOUBLE);
187 <
176 >  MPI_Allgatherv(&coords[0], count, MPI_DOUBLE, &globalCoords[0],
177 >                 &coordsOnProc[0], &vectorDisplacements[0],
178 >                 MPI_DOUBLE, MPI_COMM_WORLD);
179 >  
180 >  MPI_Allgatherv(&vels[0], count, MPI_DOUBLE, &globalVels[0],
181 >                 &coordsOnProc[0], &vectorDisplacements[0],
182 >                 MPI_DOUBLE, MPI_COMM_WORLD);
183 >  
184 >  MPI_Allgatherv(&masses[0], localHullSites, MPI_DOUBLE,
185 >                 &globalMasses[0], &hullSitesOnProc[0],
186 >                 &displacements[0], MPI_DOUBLE, MPI_COMM_WORLD);
187 >  
188    // Free previous hull
189    qh_freeqhull(!qh_ALL);
190    qh_memfreeshort(&curlong, &totlong);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines