Skip to content

Commit d89991e

Browse files
committed
Timings fixed/added
1 parent f89a03f commit d89991e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/pmpo_MPMesh.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ bool getAnyIsMigrating(MaterialPoints* p_MPs, bool isMigrating) {
323323
}
324324

325325
void MPMesh::push_ahead(){
326+
Kokkos::Timer timer;
326327
//Latitude Longitude increment at mesh vertices and interpolate to particle position
327328
p_mesh->computeRotLatLonIncr();
328329
sphericalInterpolation<MeshF_RotLatLonIncr>(*this);
@@ -333,14 +334,17 @@ void MPMesh::push_ahead(){
333334
sphericalInterpolation<MeshF_OnSurfVeloIncr>(*this);
334335
//Push the MPs
335336
p_MPs->updateRotLatLonAndXYZ2Tgt(p_mesh->getSphereRadius());
337+
pumipic::RecordTime("PolyMPO_interpolateAndPush", timer.seconds());
336338
}
337339

338340
bool MPMesh::push1P(){
341+
Kokkos::Timer timer;
339342
//Given target location find the new element or the last element in a partioned mesh
340343
//and the process it belongs to so that migration can be checked
341344
CVTTrackingElmCenterBased();
342345
//From the above two inputs find if any particle needs to be migrated
343346
bool anyIsMigrating = getAnyIsMigrating(p_MPs, p_MPs->check_migrate());
347+
pumipic::RecordTime("PolyMPO_trackAndCheckMigrate", timer.seconds());
344348
return anyIsMigrating;
345349
}
346350

src/pmpo_c.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ void polympo_setAppIDFunc_f(MPMesh_ptr p_mpmesh, IntVoidFunc getNext, void* appI
254254
void polympo_getMPTgtElmID_f(MPMesh_ptr p_mpmesh,
255255
const int numMPs,
256256
int* elmIDs){
257+
Kokkos::Timer timer;
257258
checkMPMeshValid(p_mpmesh);
258259
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
259260
PMT_ALWAYS_ASSERT(numMPs >= p_MPs->getCount());
@@ -272,7 +273,7 @@ void polympo_getMPTgtElmID_f(MPMesh_ptr p_mpmesh,
272273
};
273274
p_MPs->parallel_for(setTgtElmId, "set mpTgtElmID");
274275
Kokkos::deep_copy( arrayHost, mpTgtElmIDCopy);
275-
276+
pumipic::RecordTime("PolyMPO_getMPTgtElmID", timer.seconds());
276277
}
277278

278279
void polympo_getMPCurElmID_f(MPMesh_ptr p_mpmesh,
@@ -396,13 +397,14 @@ void polympo_setMPTgtPositions_f(MPMesh_ptr p_mpmesh,
396397
}
397398
};
398399
p_MPs->parallel_for(setPos, "setMPPositions");
399-
pumipic::RecordTime("PolyMPO_setMPPositions", timer.seconds());
400+
pumipic::RecordTime("PolyMPO_setMPTgtPositions", timer.seconds());
400401
}
401402

402403
void polympo_getMPTgtPositions_f(MPMesh_ptr p_mpmesh,
403404
const int nComps,
404405
const int numMPs,
405406
double* mpPositionsHost){
407+
Kokkos::Timer timer;
406408
checkMPMeshValid(p_mpmesh);
407409
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
408410
PMT_ALWAYS_ASSERT(nComps == vec3d_nEntries);
@@ -422,13 +424,15 @@ void polympo_getMPTgtPositions_f(MPMesh_ptr p_mpmesh,
422424
p_MPs->parallel_for(getPos, "getMPPositions");
423425
kkDbl2dViewHostU arrayHost(mpPositionsHost,nComps,numMPs);
424426
Kokkos::deep_copy(arrayHost, mpPositionsCopy);
427+
pumipic::RecordTime("PolyMPO_getMPTgtPositions", timer.seconds());
425428
}
426429

427430

428431
void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh,
429432
const int nComps,
430433
const int numMPs,
431434
const double* mpRotLatLonIn){
435+
Kokkos::Timer timer;
432436
static int callCount = 0;
433437
PMT_ALWAYS_ASSERT(callCount == 0);
434438
checkMPMeshValid(p_mpmesh);
@@ -450,6 +454,7 @@ void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh,
450454
};
451455
p_MPs->parallel_for(setPos, "setMPRotLatLon");
452456
callCount++;
457+
pumipic::RecordTime("PolyMPO_setMPRotLatLon", timer.seconds());
453458
}
454459

455460
void polympo_getMPRotLatLon_f(MPMesh_ptr p_mpmesh,
@@ -481,6 +486,7 @@ void polympo_setMPTgtRotLatLon_f(MPMesh_ptr p_mpmesh,
481486
const int nComps,
482487
const int numMPs,
483488
const double* mpRotLatLonIn){
489+
Kokkos::Timer timer;
484490
checkMPMeshValid(p_mpmesh);
485491
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
486492
PMT_ALWAYS_ASSERT(nComps == vec2d_nEntries);
@@ -498,13 +504,15 @@ void polympo_setMPTgtRotLatLon_f(MPMesh_ptr p_mpmesh,
498504
mpRotLatLon(mp,1) = mpRotLatLonIn_d(1, mpAppID(mp));
499505
}
500506
};
501-
p_MPs->parallel_for(setPos, "setMPRotLatLon");
507+
p_MPs->parallel_for(setPos, "setMPTgtRotLatLon");
508+
pumipic::RecordTime("PolyMPO_setMPTgtRotLatLon", timer.seconds());
502509
}
503510

504511
void polympo_getMPTgtRotLatLon_f(MPMesh_ptr p_mpmesh,
505512
const int nComps,
506513
const int numMPs,
507514
double* mpRotLatLonHost){
515+
Kokkos::Timer timer;
508516
checkMPMeshValid(p_mpmesh);
509517
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
510518
PMT_ALWAYS_ASSERT(nComps == vec2d_nEntries);
@@ -523,6 +531,7 @@ void polympo_getMPTgtRotLatLon_f(MPMesh_ptr p_mpmesh,
523531
p_MPs->parallel_for(getPos, "getMPRotLatLon");
524532
kkDbl2dViewHostU arrayHost(mpRotLatLonHost,nComps,numMPs);
525533
Kokkos::deep_copy(arrayHost, mpRotLatLonCopy);
534+
pumipic::RecordTime("PolyMPO_getMPTgtRotLatLon", timer.seconds());
526535
}
527536

528537

0 commit comments

Comments
 (0)