@@ -28,6 +28,7 @@ DoubleView MPMesh::assemblyV0(){
2828template <MeshFieldIndex meshFieldIndex>
2929void MPMesh::assemblyVtx0 (){
3030 Kokkos::Timer timer;
31+
3132 constexpr MaterialPointSlice mpfIndex = meshFieldIndexToMPSlice<meshFieldIndex>;
3233 auto elm2VtxConn = p_mesh->getElm2VtxConn ();
3334 auto mpData = p_MPs->getData <mpfIndex>();
@@ -94,7 +95,8 @@ void MPMesh::assemblyElm0() {
9495 pumipic::RecordTime (" PolyMPO_Reconstruct_Elm0" , timer.seconds ());
9596}
9697
97- void MPMesh::reconstruct_coeff_full (){
98+ void MPMesh::reconstruct_coeff_full (){
99+ std::cout<<__FUNCTION__<<std::endl;
98100 Kokkos::Timer timer;
99101 int self, numProcsTot;
100102 MPI_Comm comm = p_MPs->getMPIComm ();
@@ -142,7 +144,7 @@ void MPMesh::reconstruct_coeff_full(){
142144 Kokkos::atomic_add (&vtxMatrices (vID,6 ), w_vtx*(-vtxCoords (vID,0 )+mpPos (mp,0 ))*(-vtxCoords (vID,2 )+mpPos (mp,2 ))/(radius*radius));
143145 Kokkos::atomic_add (&vtxMatrices (vID,7 ), w_vtx*(-vtxCoords (vID,1 )+mpPos (mp,1 ))*(-vtxCoords (vID,1 )+mpPos (mp,1 ))/(radius*radius));
144146 Kokkos::atomic_add (&vtxMatrices (vID,8 ), w_vtx*(-vtxCoords (vID,1 )+mpPos (mp,1 ))*(-vtxCoords (vID,2 )+mpPos (mp,2 ))/(radius*radius));
145- Kokkos::atomic_add (&vtxMatrices (vID,9 ), w_vtx*(-vtxCoords (vID,2 )+mpPos (mp,2 ))*(-vtxCoords (vID,2 )+mpPos (mp,2 ))/(radius*radius));
147+ Kokkos::atomic_add (&vtxMatrices (vID,9 ), w_vtx*(-vtxCoords (vID,2 )+mpPos (mp,2 ))*(-vtxCoords (vID,2 )+mpPos (mp,2 ))/(radius*radius));
146148 }
147149 }
148150 };
@@ -278,9 +280,9 @@ void MPMesh::invertMatrix(const Kokkos::View<double**>& vtxMatrices, const doubl
278280 VtxCoeffs (vtx, 0 , 2 ) = temp[1 ];
279281 VtxCoeffs (vtx, 0 , 3 ) = temp[2 ];
280282
281- // Debugging
283+ // Debugging
282284 /*
283- if(vtx == 2630 ){
285+ if(vtx == 10 ){
284286 printf("Matrices %d vtx \n", vtx);
285287 printf("[ %.15e %.15e %.15e %.15e ]\n", vtxMatrices(vtx,0), vtxMatrices(vtx,1), vtxMatrices(vtx,2), vtxMatrices(vtx,3));
286288 printf("[ %.15e %.15e %.15e %.15e ]\n", vtxMatrices(vtx,1), vtxMatrices(vtx,4), vtxMatrices(vtx,5), vtxMatrices(vtx,6));
@@ -306,6 +308,7 @@ void MPMesh::invertMatrix(const Kokkos::View<double**>& vtxMatrices, const doubl
306308
307309template <MeshFieldIndex meshFieldIndex>
308310void MPMesh::assemblyVtx1 () {
311+ std::cout<<__FUNCTION__<<std::endl;
309312 Kokkos::Timer timer;
310313
311314 int self, numProcsTot;
@@ -368,22 +371,23 @@ void MPMesh::assemblyVtx1() {
368371 communicate_and_take_halo_contributions (meshField, numVertices, numEntries, 0 , 0 );
369372 pumipic::RecordTime (" Communicate Field Values" + std::to_string (self), timer.seconds ());
370373
371- // Debug
372- // Kokkos::fence();
373- // assert(cudaDeviceSynchronize() == cudaSuccess);
374+ // Debugging
375+ /*
376+ assert(cudaDeviceSynchronize() == cudaSuccess);
374377 Kokkos::parallel_for("printSymmetricBlock", numVertices, KOKKOS_LAMBDA(const int vtx){
375378 if (vtx >= 10 && vtx <= 10) {
376379 printf("Field in %d: ", vtx);
377380 for (int k=0; k<numEntries; k++)
378381 printf(" %.15e ", meshField(vtx, k));
379382 printf("\n");
380383 }
381- });
384+ });
385+ */
382386}
383387
384388// Start Communication routine
385389void MPMesh::startCommunication (){
386-
390+ std::cout<<__FUNCTION__<<std::endl;
387391 Kokkos::Timer timer;
388392 int self, numProcsTot;
389393 MPI_Comm comm = p_MPs->getMPIComm ();
@@ -431,7 +435,7 @@ void MPMesh::startCommunication(){
431435 ent2global);
432436
433437 // Do Map of Global To Local ID
434- // TODO make ordered map; which faster?
438+ // Check unordered vs ordered map; which faster?
435439 std::map<int , int > global2local;
436440 // std::unordered_map<int, int> global2local;
437441 for (int iEnt = 0 ; iEnt < numEntities; iEnt++) {
@@ -527,12 +531,7 @@ void MPMesh::startCommunication(){
527531
528532 pumipic::RecordTime (" Start Communication" + std::to_string (self), timer.seconds ());
529533
530- bool isRotated = p_mesh->getRotatedFlag ();
531- p_mesh->setGnomonicProjection (isRotated);
532-
533534 /*
534- if (p_MPs->getOpMode() != polyMPO::MP_DEBUG)
535- return;
536535 printf("Rank %d Owners %d Halos %d Total %d \n", self, numOwnersTot, numHalosTot, numEntities);
537536 for (int i=0; i<numProcsTot; i++){
538537 printf("Rank %d has %d halos which are owners in other rank %d \n", self, numOwnersOnOtherProcs[i], i);
@@ -757,8 +756,6 @@ void MPMesh::communicateFields(const std::vector<std::vector<double>>& fieldData
757756 MPI_Waitall (requests.size (), requests.data (), MPI_STATUSES_IGNORE);
758757
759758 /*
760- if (p_MPs->getOpMode() != polyMPO::MP_DEBUG)
761- return;
762759 static int count_deb=0;
763760 if(self==0) std::cout<<"====================="<<count_deb<<"========================"<<std::endl;
764761 count_deb++;
0 commit comments