@@ -215,6 +215,7 @@ void MPMesh::subAssemblyCoeffs(int dim1, int dim2, double* m11, double* m12, dou
215215 double * m33, double * m34,
216216 double * m44){
217217
218+ Kokkos::Timer timer;
218219 // Material Points Information
219220 MPI_Comm comm = p_MPs->getMPIComm ();
220221 int comm_rank;
@@ -241,16 +242,6 @@ void MPMesh::subAssemblyCoeffs(int dim1, int dim2, double* m11, double* m12, dou
241242 if (p_mesh->getGeomType () == geom_spherical_surf)
242243 radius=p_mesh->getSphereRadius ();
243244
244- kkDbl2dViewHostU m11_h (m11, dim1, dim2);
245- kkDbl2dViewHostU m12_h (m12, dim1, dim2);
246- kkDbl2dViewHostU m13_h (m13, dim1, dim2);
247- kkDbl2dViewHostU m14_h (m14, dim1, dim2);
248- kkDbl2dViewHostU m22_h (m22, dim1, dim2);
249- kkDbl2dViewHostU m23_h (m23, dim1, dim2);
250- kkDbl2dViewHostU m24_h (m24, dim1, dim2);
251- kkDbl2dViewHostU m33_h (m33, dim1, dim2);
252- kkDbl2dViewHostU m34_h (m34, dim1, dim2);
253- kkDbl2dViewHostU m44_h (m44, dim1, dim2);
254245 Kokkos::View<double **> m11_d (" m11" , dim1, dim2);
255246 Kokkos::View<double **> m12_d (" m12" , dim1, dim2);
256247 Kokkos::View<double **> m13_d (" m13" , dim1, dim2);
@@ -285,7 +276,20 @@ void MPMesh::subAssemblyCoeffs(int dim1, int dim2, double* m11, double* m12, dou
285276 }
286277 };
287278 p_MPs->parallel_for (sub_assemble, " sub_assembly" );
279+ pumipic::RecordTime (" VtxSubAssemblyComputeCoeff" , timer.seconds ());
288280
281+ Kokkos::Timer timer2;
282+ kkDbl2dViewHostU m11_h (m11, dim1, dim2);
283+ kkDbl2dViewHostU m12_h (m12, dim1, dim2);
284+ kkDbl2dViewHostU m13_h (m13, dim1, dim2);
285+ kkDbl2dViewHostU m14_h (m14, dim1, dim2);
286+ kkDbl2dViewHostU m22_h (m22, dim1, dim2);
287+ kkDbl2dViewHostU m23_h (m23, dim1, dim2);
288+ kkDbl2dViewHostU m24_h (m24, dim1, dim2);
289+ kkDbl2dViewHostU m33_h (m33, dim1, dim2);
290+ kkDbl2dViewHostU m34_h (m34, dim1, dim2);
291+ kkDbl2dViewHostU m44_h (m44, dim1, dim2);
292+
289293 Kokkos::deep_copy (m11_h, m11_d);
290294 Kokkos::deep_copy (m12_h, m12_d);
291295 Kokkos::deep_copy (m13_h, m13_d);
@@ -296,6 +300,7 @@ void MPMesh::subAssemblyCoeffs(int dim1, int dim2, double* m11, double* m12, dou
296300 Kokkos::deep_copy (m33_h, m33_d);
297301 Kokkos::deep_copy (m34_h, m34_d);
298302 Kokkos::deep_copy (m44_h, m44_d);
303+ pumipic::RecordTime (" VtxSubAssemblyGetCoeff" , timer2.seconds ());
299304
300305}
301306
@@ -305,8 +310,7 @@ void MPMesh::solveMatrixAndRegularize(int dim1, double* m11, double* m12, double
305310 double * m33, double * m34,
306311 double * m44){
307312
308- auto dual_triangle_area=p_mesh->getMeshField <MeshF_DualTriangleArea>();
309-
313+ Kokkos::Timer timer;
310314 kkViewHostU<const double *> m11_h (m11, dim1);
311315 kkViewHostU<const double *> m12_h (m12, dim1);
312316 kkViewHostU<const double *> m13_h (m13, dim1);
@@ -339,7 +343,10 @@ void MPMesh::solveMatrixAndRegularize(int dim1, double* m11, double* m12, double
339343 Kokkos::deep_copy (m33_d, m33_h);
340344 Kokkos::deep_copy (m34_d, m34_h);
341345 Kokkos::deep_copy (m44_d, m44_h);
346+ pumipic::RecordTime (" polyMPOsolveMatrixCoeffSet" , timer.seconds ());
342347
348+ Kokkos::Timer timer2;
349+ auto dual_triangle_area=p_mesh->getMeshField <MeshF_DualTriangleArea>();
343350 Kokkos::View<double *[vec4d_nEntries]> VtxCoeffs (" VtxCoeffs" , dim1);
344351 double radius=p_mesh->getSphereRadius ();
345352 Kokkos::parallel_for (" fill" , dim1, KOKKOS_LAMBDA (const int vtx){
@@ -365,6 +372,7 @@ void MPMesh::solveMatrixAndRegularize(int dim1, double* m11, double* m12, double
365372 VtxCoeffs (vtx,i)=coeff[i];
366373 });
367374 this ->precomputedVtxCoeffs = VtxCoeffs;
375+ pumipic::RecordTime (" polyMPOsolveMatrixCoeffCompute" , timer2.seconds ());
368376
369377}
370378
@@ -394,9 +402,7 @@ void MPMesh::subAssemblyVtx1(int size1, int size2, double* array, int comp) {
394402
395403 double radius=p_mesh->getSphereRadius ();
396404
397- kkDbl2dViewHostU arrayHost (array, size1, size2);
398405 Kokkos::View<double **> array_d (" reconstructedIceArea" , size1, size2);
399-
400406 auto sub_assemble = PS_LAMBDA (const int & elm, const int & mp, const int & mask) {
401407 if (mask && (elm2Process (elm)==comm_rank)) {
402408 int nVtxE = elm2VtxConn (elm,0 ); // number of vertices bounding the element
@@ -417,9 +423,12 @@ void MPMesh::subAssemblyVtx1(int size1, int size2, double* array, int comp) {
417423 }
418424 };
419425 p_MPs->parallel_for (sub_assemble, " sub_assembly" );
426+ pumipic::RecordTime (" polyMPOsubAssemblyFieldCompute" , timer.seconds ());
420427
428+ Kokkos::Timer timer2;
429+ kkDbl2dViewHostU arrayHost (array, size1, size2);
421430 Kokkos::deep_copy (arrayHost, array_d);
422- pumipic::RecordTime (" PolyMPO_subAssembly " , timer .seconds ());
431+ pumipic::RecordTime (" PolyMPOsubAssemblyFieldGet " , timer2 .seconds ());
423432}
424433
425434// Method 1
0 commit comments