Skip to content

Commit e96efa4

Browse files
committed
Add timer to interpolation
1 parent 2f4dd88 commit e96efa4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

inputs/z4c/spectre_bbh/z4c_spectre_bbh.athinput

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ basename = bbh # problem ID: basename of output filenames
66

77
<problem>
88
pgen_name = z4c_spectre_bbh
9-
id_filename_glob = BbhVolume*.h5
9+
id_filename_glob = /home/nilsvu/2024-09-bbh-athenak/ID/BbhVolume*.h5
1010
id_subfile_name = VolumeData
1111
id_observation_step = -1
1212

src/pgen/z4c_spectre_bbh.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <algorithm>
1111
#include <cmath>
1212
#include <iostream>
13+
#include <Kokkos_Timer.hpp>
1314
#include <sstream>
1415
#include <string>
1516
#include <vector>
@@ -135,6 +136,7 @@ void LoadSpectreInitialData(MeshBlockPack *pmbp, const std::string &filename_glo
135136
x[2].resize(sz);
136137

137138
int nmb = pmbp->nmb_thispack;
139+
Kokkos::Timer timer{};
138140
for (int m = 0; m < nmb; ++m) {
139141
// Get the coordinates for this meshblock
140142
Real &x1min = size.h_view(m).x1min;
@@ -155,8 +157,9 @@ void LoadSpectreInitialData(MeshBlockPack *pmbp, const std::string &filename_glo
155157
}
156158

157159
// Interpolate data to the coordinates
160+
timer.reset();
158161
std::cout << "Interpolating initial data for meshblock " << m << "/"
159-
<< nmb - 1 << " with " << sz << " points " << std::endl;
162+
<< nmb - 1 << " with " << sz << " points..." << std::endl;
160163
const auto data = spectre::Exporter::interpolate_to_points<3>(
161164
filename_glob, subfile_name, spectre::Exporter::ObservationStep{observation_step},
162165
{"SpatialMetric_xx", "SpatialMetric_yx", "SpatialMetric_yy",
@@ -165,6 +168,8 @@ void LoadSpectreInitialData(MeshBlockPack *pmbp, const std::string &filename_glo
165168
"ExtrinsicCurvature_zx", "ExtrinsicCurvature_zy", "ExtrinsicCurvature_zz"},
166169
/* target_points */ x,
167170
/* extrapolate_into_excisions */ true);
171+
std::cout << " done in " << timer.seconds() << " seconds." << std::endl;
172+
168173
const auto &gxx = data[0];
169174
const auto &gyx = data[1];
170175
const auto &gyy = data[2];

0 commit comments

Comments
 (0)