Skip to content
Snippets Groups Projects
Commit 8554c2a0 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Remove useless parameters

parent 03b129ca
No related branches found
No related tags found
1 merge request!199Integrate checkpointing
...@@ -314,9 +314,6 @@ MeshModule::registerCheckpointResume() const ...@@ -314,9 +314,6 @@ MeshModule::registerCheckpointResume() const
HighFive::Group& symbol_table_group) { HighFive::Group& symbol_table_group) {
writeMesh(symbol_name, embedded_data, file, checkpoint_group, symbol_table_group); writeMesh(symbol_name, embedded_data, file, checkpoint_group, symbol_table_group);
}), }),
std::function([](const HighFive::File& file, const HighFive::Group& checkpoint_group, std::function([](const std::string& symbol_name, const HighFive::Group& symbol_table_group)
const std::string& symbol_name, -> EmbeddedData { return readMesh(symbol_name, symbol_table_group); }));
const HighFive::Group& symbol_table_group) -> EmbeddedData {
return readMesh(file, checkpoint_group, symbol_name, symbol_table_group);
}));
} }
...@@ -24,16 +24,14 @@ CheckpointResumeRepository::checkpoint(const ASTNodeDataType& data_type, ...@@ -24,16 +24,14 @@ CheckpointResumeRepository::checkpoint(const ASTNodeDataType& data_type,
} }
EmbeddedData EmbeddedData
CheckpointResumeRepository::resume(const HighFive::File& file, CheckpointResumeRepository::resume(const ASTNodeDataType& data_type,
const HighFive::Group& checkpoint_group,
const ASTNodeDataType& data_type,
const std::string& symbol_name, const std::string& symbol_name,
const HighFive::Group& symbol_table_group) const const HighFive::Group& symbol_table_group) const
{ {
std::string data_type_name = dataTypeName(data_type); std::string data_type_name = dataTypeName(data_type);
if (auto i_dt_function = m_data_type_resuming.find(data_type_name); i_dt_function != m_data_type_resuming.end()) { if (auto i_dt_function = m_data_type_resuming.find(data_type_name); i_dt_function != m_data_type_resuming.end()) {
const ResumeFunction& function = i_dt_function->second; const ResumeFunction& function = i_dt_function->second;
return function(file, checkpoint_group, symbol_name, symbol_table_group); return function(symbol_name, symbol_table_group);
} else { } else {
std::ostringstream error_msg; std::ostringstream error_msg;
error_msg << "cannot find resuming function for type '" << rang::fgB::yellow << data_type_name << rang::fg::reset error_msg << "cannot find resuming function for type '" << rang::fgB::yellow << data_type_name << rang::fg::reset
......
...@@ -19,10 +19,8 @@ class CheckpointResumeRepository ...@@ -19,10 +19,8 @@ class CheckpointResumeRepository
HighFive::Group& checkpoint_group, HighFive::Group& checkpoint_group,
HighFive::Group& symbol_table_group)>; HighFive::Group& symbol_table_group)>;
using ResumeFunction = std::function<EmbeddedData(const HighFive::File& symbol, using ResumeFunction =
const HighFive::Group& file, std::function<EmbeddedData(const std::string& symbol_name, const HighFive::Group& symbol_table_group)>;
const std::string& symbol_name,
const HighFive::Group& symbol_table_group)>;
private: private:
std::unordered_map<std::string, CheckpointFunction> m_data_type_checkpointing; std::unordered_map<std::string, CheckpointFunction> m_data_type_checkpointing;
...@@ -59,9 +57,7 @@ class CheckpointResumeRepository ...@@ -59,9 +57,7 @@ class CheckpointResumeRepository
HighFive::Group& checkpoint_group, HighFive::Group& checkpoint_group,
HighFive::Group& symbol_table_group) const; HighFive::Group& symbol_table_group) const;
EmbeddedData resume(const HighFive::File& file, EmbeddedData resume(const ASTNodeDataType& data_type,
const HighFive::Group& checkpoint_group,
const ASTNodeDataType& data_type,
const std::string& symbol_name, const std::string& symbol_name,
const HighFive::Group& symbol_table_group) const; const HighFive::Group& symbol_table_group) const;
......
...@@ -234,16 +234,15 @@ resume() ...@@ -234,16 +234,15 @@ resume()
for (size_t i_component = 0; i_component < number_of_components; ++i_component) { for (size_t i_component = 0; i_component < number_of_components; ++i_component) {
embedded_tuple[i_component] = embedded_tuple[i_component] =
CheckpointResumeRepository::instance().resume(file, checkpoint, CheckpointResumeRepository::instance().resume(p_symbol->attributes().dataType().contentType(),
p_symbol->attributes().dataType().contentType(),
p_symbol->name() + "/" + std::to_string(i_component), p_symbol->name() + "/" + std::to_string(i_component),
saved_symbol_table); saved_symbol_table);
} }
p_symbol->attributes().value() = embedded_tuple; p_symbol->attributes().value() = embedded_tuple;
} else { } else {
p_symbol->attributes().value() = p_symbol->attributes().value() =
CheckpointResumeRepository::instance().resume(file, checkpoint, p_symbol->attributes().dataType(), CheckpointResumeRepository::instance().resume(p_symbol->attributes().dataType(), p_symbol->name(),
p_symbol->name(), saved_symbol_table); saved_symbol_table);
} }
} }
} }
......
...@@ -5,10 +5,7 @@ ...@@ -5,10 +5,7 @@
#include <utils/checkpointing/ResumingData.hpp> #include <utils/checkpointing/ResumingData.hpp>
EmbeddedData EmbeddedData
readMesh([[maybe_unused]] const HighFive::File& file, readMesh(const std::string& symbol_name, const HighFive::Group& symbol_table_group)
[[maybe_unused]] const HighFive::Group& checkpoint_group,
const std::string& symbol_name,
const HighFive::Group& symbol_table_group)
{ {
const HighFive::Group mesh_group = symbol_table_group.getGroup("embedded/" + symbol_name); const HighFive::Group mesh_group = symbol_table_group.getGroup("embedded/" + symbol_name);
......
...@@ -28,9 +28,6 @@ read(const HighFive::Group& group, const std::string& name) ...@@ -28,9 +28,6 @@ read(const HighFive::Group& group, const std::string& name)
return array; return array;
} }
EmbeddedData readMesh(const HighFive::File& file, EmbeddedData readMesh(const std::string& symbol_name, const HighFive::Group& symbol_table_group);
const HighFive::Group& checkpoint_group,
const std::string& symbol_name,
const HighFive::Group& symbol_table_group);
#endif // RESUME_UTILS_HPP #endif // RESUME_UTILS_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment