Skip to content

Commit

Permalink
Rename ReduceCceWorldtube to PreprocessCceWorldtube
Browse files Browse the repository at this point in the history
  • Loading branch information
knelli2 committed Dec 13, 2024
1 parent f962837 commit 2fad23b
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 82 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/DeployStaticExecutables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,26 @@ jobs:
- name: Copy CCE executables from the container
run: >
mkdir CceExecutables;
mkdir ./CceExecutables/ReduceCceWorldtube;
mkdir ./CceExecutables/PreprocessCceWorldtube;
mkdir ./CceExecutables/Tests;
cp ./tests/InputFiles/Cce/CharacteristicExtract.yaml
./CceExecutables/CharacteristicExtract.yaml
cp ./tests/InputFiles/ReduceCceWorldtube/ReduceCceWorldtube.yaml
./CceExecutables/ReduceCceWorldtube/ReduceCceWorldtube.yaml
cp
./tests/InputFiles/PreprocessCceWorldtube/PreprocessCceWorldtube.yaml
./CceExecutables/PreprocessCceWorldtube/PreprocessCceWorldtube.yaml
docker cp
static-execs:/work/spectre/build/bin/CharacteristicExtract
./CceExecutables/
docker cp static-execs:/work/spectre/build/bin/ReduceCceWorldtube
./CceExecutables/ReduceCceWorldtube/
docker cp static-execs:/work/spectre/build/bin/PreprocessCceWorldtube
./CceExecutables/PreprocessCceWorldtube/
docker cp
static-execs:/work/spectre/build/bin/WriteCceWorldtubeCoordsToFile
./CceExecutables/ReduceCceWorldtube/
./CceExecutables/PreprocessCceWorldtube/
- name: Test CCE executable outside of container
run: |
mv BondiSachsCceR0200.h5 ./CceExecutables/Tests/
Expand Down
2 changes: 1 addition & 1 deletion cmake/AddInputFileTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,6 @@ configure_file(
# These paths should be relative to the input file directory passed to
# `add_input_file_tests`
set(INPUT_FILE_WHITELIST
"ReduceCceWorldtube/ReduceCceWorldtube.yaml")
"PreprocessCceWorldtube/PreprocessCceWorldtube.yaml")

add_input_file_tests("${CMAKE_SOURCE_DIR}/tests/InputFiles/" ${INPUT_FILE_WHITELIST})
2 changes: 1 addition & 1 deletion containers/Dockerfile.buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,6 @@ RUN if [ ${UBUNTU_VERSION} != 18.04 ] && [ "$TARGETARCH" != "amd64" ]; then \
-D BUILD_DOCS=OFF \
-D USE_CCACHE=OFF \
.. \
&& make ${PARALLEL_MAKE_ARG} CharacteristicExtract ReduceCceWorldtube \
&& make ${PARALLEL_MAKE_ARG} CharacteristicExtract PreprocessCceWorldtube \
WriteCceWorldtubeCoordsToFile \
&& ctest -LE unit -R CharacteristicExtract
18 changes: 9 additions & 9 deletions docs/Tutorials/CCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ release). Inside this tarball is
- an example set of Bondi-Sachs worldtube data in the `Tests/` directory (see
[Input worldtube data formats](#input_worldtube_data_format) section)
- example output from CCE in the `Tests/` directory
- a `ReduceCceWorldtube` executable and YAML file for converting between
- a `PreprocessCceWorldtube` executable and YAML file for converting between
[worldtube data formats](#input_worldtube_data_format) in the
`ReduceCceWorldtube/` diretory
`PreprocessCceWorldtube/` diretory
- a `WriteCceWorldtubeCoordsToFile` executable that writes
[grid points on a sphere](#spherical_nodes) to a text file in the
`ReduceCceWorldtube/` directory
`PreprocessCceWorldtube/` directory
- a python script `CheckCceOutput.py` (meant to be run from the root of the
tarball and after you run the example YAML input file also in the root of the
tarball) that will check if the example output is correct
Expand Down Expand Up @@ -156,7 +156,7 @@ for compatibility with worldtube data from the SXS Collaboration's SpEC code.
Unless you are using worldtube data that was generated from SpECTRE (or SpEC),
it's possible that your worldtube data is not in the correct format. We allow
conversion into our data format from a few other data formats using the
[`ReduceCceWorldtube` executable provided](#acquiring_the_cce_module). These are
[`PreprocessCceWorldtube` executable provided](#acquiring_the_cce_module). These are

- Nodal cartesian metric data (which we refer to as "metric nodal")
- Modal cartesian metric data (which we refer to as "metric modal")
Expand Down Expand Up @@ -256,23 +256,23 @@ If you already have data in the
[required "bondi modal" format](#required_h5_worldtube_data_format), then
nothing needs to be done.

#### Running the ReduceCceWorldtube executable
#### Running the PreprocessCceWorldtube executable

The `ReduceCceWorldtube` executable should be run on any of the
The `PreprocessCceWorldtube` executable should be run on any of the
[allowed input formats](#converting_worldtube_data), and will produce a
corresponding Bondi-Sachs worldtube file that can be read in by CCE. This
executable works similarly to our other executables by accepting a YAML input
file:

```
ReduceCceWorldtube --input-file ReduceCceWorldtube.yaml
PreprocessCceWorldtube --input-file PreprocessCceWorldtube.yaml
```

with a YAML file

\snippet ReduceCceWorldtube.yaml reduce_cce_worldtube_yaml_doxygen_example
\snippet PreprocessCceWorldtube.yaml preprocess_cce_worldtube_yaml_doxygen_example

In addition to converting worldtube data formats, `ReduceCceWorldtube` also
In addition to converting worldtube data formats, `PreprocessCceWorldtube` also
accepts multiple input worldtube H5 files that have sequential times (e.g. from
different checkpoints) and will combine the times from all H5 files alongside
converting the worldtube data format. If there are duplicate or overlapping
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/OptionTags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ struct H5WorldtubeBoundaryDataManager : db::SimpleTag {
"\nDEPRECATION WARNING: Reading worldtube H5 files that are in the "
"Metric data format (i.e. cartesian components of the metric and "
"derivs expressed in modal coefficients) is deprecated. Convert your "
"data to the Bondi modal format using the 'ReduceCceWorldtube' "
"data to the Bondi modal format using the 'PreprocessCceWorldtube' "
"executable. See https://spectre-code.org/tutorial_cce.html for "
"details. Support for reading the Metric data format will be "
"dropped in January 2025.\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/WorldtubeBufferUpdater.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class KleinGordonWorldtubeH5BufferUpdater;
/*!
* \brief Abstract base class for utilities that are able to perform the buffer
* updating procedure needed by the `WorldtubeDataManager` or by the
* `ReduceCceWorldtube` executable.
* `PreprocessCceWorldtube` executable.
*
* \details The methods that are required to be overridden in the derived
* classes are:
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/WorldtubeDataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ bool BondiWorldtubeDataManager::populate_hypersurface_boundary_data(
du_r / bondi_r;

// there's only a couple of tags desired by the core computation that aren't
// stored in the 'reduced' format, so we perform the remaining computation
// stored in the bondi format, so we perform the remaining computation
// in-line here.
const auto& du_bondi_j = get(get<Tags::BoundaryValue<Tags::Du<Tags::BondiJ>>>(
*boundary_data_variables));
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/WorldtubeDataManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class MetricWorldtubeDataManager
};

/*!
* \brief Manages the 'reduced' cached buffer dataset associated with a CCE
* \brief Manages the bondi cached buffer dataset associated with a CCE
* worldtube and interpolates to requested time points to provide worldtube
* boundary data to the main evolution routines.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Executables/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ add_subdirectory(ExportEquationOfStateForRotNS)
add_subdirectory(Examples)
add_subdirectory(ExportCoordinates)
add_subdirectory(ParallelInfo)
add_subdirectory(ReduceCceWorldtube)
add_subdirectory(PreprocessCceWorldtube)
add_subdirectory(TimeStepperSummary)
add_subdirectory(WriteCceWorldtubeCoordsToFile)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Distributed under the MIT License.
# See LICENSE.txt for details.

set(EXECUTABLE ReduceCceWorldtube)
set(EXECUTABLE PreprocessCceWorldtube)

add_spectre_executable(
${EXECUTABLE}
EXCLUDE_FROM_ALL
ReduceCceWorldtube.cpp
PreprocessCceWorldtube.cpp
)

target_link_libraries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ int main(int argc, char** argv) {
ERROR_NO_TRACE(
"Only a single input H5 file was supplied and the input data "
"format is BondiModal. This means that no combination needs to be "
"done and running ReduceCceWorldtube is unnecessary.");
"done and running PreprocessCceWorldtube is unnecessary.");
}

if (tuples::get<ReduceCceTags::FixSpecNormalization>(inputs) and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Distributed under the MIT License.
# See LICENSE.txt for details.

# [reduce_cce_worldtube_yaml_doxygen_example]
# [preprocess_cce_worldtube_yaml_doxygen_example]
InputH5File: InputFilename.h5
OutputH5File: ReducedWorldtubeR0292.h5
InputDataFormat: MetricModal
ExtractionRadius: 292
FixSpecNormalization: False
BufferDepth: Auto
LMaxFactor: 3
# [reduce_cce_worldtube_yaml_doxygen_example]
# [preprocess_cce_worldtube_yaml_doxygen_example]
79 changes: 38 additions & 41 deletions tests/Unit/Evolution/Systems/Cce/Test_WorldtubeData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class DummyBufferUpdater // NOLINT
};

template <typename T>
class ReducedDummyBufferUpdater
class BondiBufferUpdater
: public WorldtubeBufferUpdater<tmpl::conditional_t<
std::is_same_v<T, ComplexModalVector>,
Tags::worldtube_boundary_tags_for_writing<
Expand All @@ -247,13 +247,13 @@ class ReducedDummyBufferUpdater
Spectral::Swsh::Tags::SwshTransform>,
Tags::worldtube_boundary_tags_for_writing<Tags::BoundaryValue>>;

ReducedDummyBufferUpdater() = default;
ReducedDummyBufferUpdater(DataVector time_buffer,
const gr::Solutions::KerrSchild& solution,
const std::optional<double> extraction_radius,
const double coordinate_amplitude,
const double coordinate_frequency,
const size_t l_max, const bool /*unused*/ = false)
BondiBufferUpdater() = default;
BondiBufferUpdater(DataVector time_buffer,
const gr::Solutions::KerrSchild& solution,
const std::optional<double> extraction_radius,
const double coordinate_amplitude,
const double coordinate_frequency, const size_t l_max,
const bool /*unused*/ = false)
: time_buffer_{std::move(time_buffer)},
solution_{solution},
extraction_radius_{extraction_radius},
Expand All @@ -263,9 +263,9 @@ class ReducedDummyBufferUpdater

// NOLINTNEXTLINE
WRAPPED_PUPable_decl_base_template(WorldtubeBufferUpdater<tags_for_writing>,
ReducedDummyBufferUpdater);
BondiBufferUpdater);

explicit ReducedDummyBufferUpdater(CkMigrateMessage* /*unused*/) {}
explicit BondiBufferUpdater(CkMigrateMessage* /*unused*/) {}

double update_buffers_for_time(
const gsl::not_null<Variables<tags_for_writing>*> buffers,
Expand Down Expand Up @@ -358,7 +358,7 @@ class ReducedDummyBufferUpdater
}
std::unique_ptr<WorldtubeBufferUpdater<tags_for_writing>> get_clone()
const override {
return std::make_unique<ReducedDummyBufferUpdater>(*this);
return std::make_unique<BondiBufferUpdater>(*this);
}

bool time_is_outside_range(const double time) const override {
Expand Down Expand Up @@ -413,16 +413,16 @@ class ReducedDummyBufferUpdater
template <typename T>
PUP::able::PUP_ID Cce::DummyBufferUpdater<T>::my_PUP_ID = 0; // NOLINT
template <typename T>
PUP::able::PUP_ID Cce::ReducedDummyBufferUpdater<T>::my_PUP_ID = 0; // NOLINT
PUP::able::PUP_ID Cce::BondiBufferUpdater<T>::my_PUP_ID = 0; // NOLINT

template class Cce::DummyBufferUpdater<ComplexModalVector>;
template class Cce::DummyBufferUpdater<DataVector>;
template class Cce::ReducedDummyBufferUpdater<ComplexModalVector>;
template class Cce::BondiBufferUpdater<ComplexModalVector>;

namespace {

template <typename DataManager, typename DummyUpdater, typename Generator>
void test_data_manager_with_dummy_buffer_updater(
void test_data_manager_with_bondi_buffer_updater(
const gsl::not_null<Generator*> gen,
const bool apply_normalization_bug = false, const bool is_spec_input = true,
const std::optional<double> extraction_radius = std::nullopt) {
Expand Down Expand Up @@ -545,7 +545,7 @@ void test_data_manager_with_dummy_buffer_updater(
}

template <typename T, typename Generator>
void test_spec_worldtube_buffer_updater_impl(
void test_metric_worldtube_buffer_updater_impl(
const gsl::not_null<Generator*> gen,
const bool extraction_radius_in_filename, const bool time_varies_fastest) {
constexpr bool is_modal = std::is_same_v<T, ComplexModalVector>;
Expand Down Expand Up @@ -659,10 +659,10 @@ void test_spec_worldtube_buffer_updater_impl(
approx(target_time - 1.5 + 0.1 * i));
}

const DummyBufferUpdater<T> dummy_buffer_updater = serialize_and_deserialize(
const DummyBufferUpdater<T> bondi_buffer_updater = serialize_and_deserialize(
DummyBufferUpdater<T>{time_buffer, solution, extraction_radius, amplitude,
frequency, computation_l_max});
dummy_buffer_updater.update_buffers_for_time(
bondi_buffer_updater.update_buffers_for_time(
make_not_null(&expected_coefficients_buffers),
make_not_null(&time_span_start), make_not_null(&time_span_end),
target_time, computation_l_max, interpolator_length, buffer_size,
Expand All @@ -685,7 +685,7 @@ void test_spec_worldtube_buffer_updater_impl(
}

template <typename T, typename Generator>
void test_reduced_spec_worldtube_buffer_updater_impl(
void test_bondi_worldtube_buffer_updater_impl(
const gsl::not_null<Generator*> gen,
const bool extraction_radius_in_filename, const bool time_varies_fastest) {
constexpr bool is_modal = std::is_same_v<T, ComplexModalVector>;
Expand Down Expand Up @@ -863,11 +863,10 @@ void test_reduced_spec_worldtube_buffer_updater_impl(
approx(target_time - 0.1 + 0.01 * i));
}

const ReducedDummyBufferUpdater<T> dummy_buffer_updater =
serialize_and_deserialize(ReducedDummyBufferUpdater<T>{
time_buffer, solution, extraction_radius, amplitude, frequency,
computation_l_max});
dummy_buffer_updater.update_buffers_for_time(
const BondiBufferUpdater<T> bondi_buffer_updater = serialize_and_deserialize(
BondiBufferUpdater<T>{time_buffer, solution, extraction_radius, amplitude,
frequency, computation_l_max});
bondi_buffer_updater.update_buffers_for_time(
make_not_null(&expected_coefficients_buffers),
make_not_null(&time_span_start), make_not_null(&time_span_end),
target_time, computation_l_max, interpolator_length, buffer_size,
Expand Down Expand Up @@ -900,26 +899,25 @@ void test_reduced_spec_worldtube_buffer_updater_impl(
}

template <typename Generator>
void test_spec_worldtube_buffer_updater(const gsl::not_null<Generator*> gen) {
void test_metric_worldtube_buffer_updater(const gsl::not_null<Generator*> gen) {
INFO("SpEC worldtube (aka metric)");
for (const auto& [extraction_radius_in_filename, time_varies_fastest] :
cartesian_product(std::array{true, false}, std::array{true, false})) {
test_spec_worldtube_buffer_updater_impl<ComplexModalVector>(
test_metric_worldtube_buffer_updater_impl<ComplexModalVector>(
gen, extraction_radius_in_filename, time_varies_fastest);
test_spec_worldtube_buffer_updater_impl<DataVector>(
test_metric_worldtube_buffer_updater_impl<DataVector>(
gen, extraction_radius_in_filename, time_varies_fastest);
}
}

template <typename Generator>
void test_reduced_spec_worldtube_buffer_updater(
const gsl::not_null<Generator*> gen) {
void test_bondi_worldtube_buffer_updater(const gsl::not_null<Generator*> gen) {
INFO("Reduced SpEC worldtube (aka Bondi)");
for (const auto& [extraction_radius_in_filename, time_varies_fastest] :
cartesian_product(std::array{true, false}, std::array{true, false})) {
test_reduced_spec_worldtube_buffer_updater_impl<ComplexModalVector>(
test_bondi_worldtube_buffer_updater_impl<ComplexModalVector>(
gen, extraction_radius_in_filename, time_varies_fastest);
test_reduced_spec_worldtube_buffer_updater_impl<ComplexDataVector>(
test_bondi_worldtube_buffer_updater_impl<ComplexDataVector>(
gen, extraction_radius_in_filename, time_varies_fastest);
}
}
Expand All @@ -943,33 +941,32 @@ SPECTRE_TEST_CASE("Unit.Evolution.Systems.Cce.ReadBoundaryDataH5",
MAKE_GENERATOR(gen);
{
INFO("Testing buffer updaters");
test_spec_worldtube_buffer_updater(make_not_null(&gen));
test_reduced_spec_worldtube_buffer_updater(make_not_null(&gen));
test_metric_worldtube_buffer_updater(make_not_null(&gen));
test_bondi_worldtube_buffer_updater(make_not_null(&gen));
}
{
INFO("Testing data managers");
using DummyBufferUpdater = DummyBufferUpdater<ComplexModalVector>;
using ReducedDummyBufferUpdater =
ReducedDummyBufferUpdater<ComplexModalVector>;
test_data_manager_with_dummy_buffer_updater<MetricWorldtubeDataManager,
using BondiBufferUpdater = BondiBufferUpdater<ComplexModalVector>;
test_data_manager_with_bondi_buffer_updater<MetricWorldtubeDataManager,
DummyBufferUpdater>(
make_not_null(&gen));
// with normalization bug applied:
test_data_manager_with_dummy_buffer_updater<MetricWorldtubeDataManager,
test_data_manager_with_bondi_buffer_updater<MetricWorldtubeDataManager,
DummyBufferUpdater>(
make_not_null(&gen), true, true);
test_data_manager_with_dummy_buffer_updater<MetricWorldtubeDataManager,
test_data_manager_with_bondi_buffer_updater<MetricWorldtubeDataManager,
DummyBufferUpdater>(
make_not_null(&gen), false, true);
test_data_manager_with_dummy_buffer_updater<MetricWorldtubeDataManager,
test_data_manager_with_bondi_buffer_updater<MetricWorldtubeDataManager,
DummyBufferUpdater>(
make_not_null(&gen), false, false);
// check the case for an explicitly provided extraction radius.
test_data_manager_with_dummy_buffer_updater<MetricWorldtubeDataManager,
test_data_manager_with_bondi_buffer_updater<MetricWorldtubeDataManager,
DummyBufferUpdater>(
make_not_null(&gen), false, false, 200.0);
test_data_manager_with_dummy_buffer_updater<BondiWorldtubeDataManager,
ReducedDummyBufferUpdater>(
test_data_manager_with_bondi_buffer_updater<BondiWorldtubeDataManager,
BondiBufferUpdater>(
make_not_null(&gen));
}
}
Expand Down
Loading

0 comments on commit 2fad23b

Please sign in to comment.