Commit fa4b9fb4 authored by GILLES Sebastien's avatar GILLES Sebastien

#1443 Add safeties to prevent use of...

#1443 Add safeties to prevent use of DofProgramWiseIndexListPerVertexCoordIndexList when running from prepartitioned data (we're better off taking the result of the VertexMatching inter[olation matrix directly than the elements to recopute it).
parent 182e6715
......@@ -531,10 +531,11 @@ namespace MoReFEM
* processor-wise are performed. The typical example here is data required by non conform interpolator, which
* involves several GodOfDofs and can't therefore be handled solely by the clever Petsc mpi communications.
*
* \copydoc doxygen_hide_input_data_arg
* \copydoc doxygen_hide_morefem_data_param
*/
template<class InputDataT>
void Init2(const InputDataT& input_data);
template<class MoReFEMDataT>
void Init2(const MoReFEMDataT& morefem_data);
/*!
......
......@@ -165,20 +165,26 @@ namespace MoReFEM
Init1(dof_list_per_felt_space);
Init2(morefem_data.GetInputData());
Init2(morefem_data);
Init3(do_consider_proc_wise_local_2_global, dof_list_per_felt_space, morefem_data.GetParallelismPtr());
}
// \todo #1443 Ignored in first approach, but make sure to call it as well once first draft works.
template<class InputDataT>
void GodOfDof::Init2(const InputDataT& input_data)
template<class MoReFEMDataT>
void GodOfDof::Init2(const MoReFEMDataT& morefem_data)
{
const auto parallelism = morefem_data.GetParallelismPtr();
const auto strategy = parallelism == nullptr
? Advanced::parallelism_strategy::none
: parallelism->GetParallelismStrategy();
auto& manager = Internal::FEltSpaceNS::DofProgramWiseIndexListPerVertexCoordIndexListManager
::CreateOrGetInstance(__FILE__, __LINE__);
Advanced::SetFromInputData<>(input_data, manager, *this);
::CreateOrGetInstance(__FILE__, __LINE__, strategy);
Advanced::SetFromInputData<>(morefem_data.GetInputData(), manager, *this);
}
......
......@@ -38,7 +38,7 @@ namespace MoReFEM
: unique_id_parent(unique_id),
felt_space_(felt_space),
numbering_subset_(numbering_subset)
{
{
const auto& local_felt_space_storage = felt_space.GetLocalFEltSpacePerRefLocalFEltSpace();
unsigned int Ndof = 0u;
......
......@@ -23,6 +23,8 @@
# include "Utilities/Containers/UnorderedMap.hpp"
# include "Utilities/UniqueId/UniqueId.hpp"
# include "Core/MoReFEMData/Advanced/ParallelismStrategy.hpp"
namespace MoReFEM
{
......@@ -132,7 +134,7 @@ namespace MoReFEM
>;
public:
private:
/// \name Special members.
///@{
......@@ -148,6 +150,8 @@ namespace MoReFEM
const FEltSpace& felt_space,
const NumberingSubset& numbering_subset);
public:
//! Destructor.
~DofProgramWiseIndexListPerVertexCoordIndexList() = default;
......
......@@ -28,6 +28,27 @@ namespace MoReFEM
{
DofProgramWiseIndexListPerVertexCoordIndexListManager
::DofProgramWiseIndexListPerVertexCoordIndexListManager(Advanced::parallelism_strategy strategy)
{
switch(strategy)
{
case Advanced::parallelism_strategy::none:
case Advanced::parallelism_strategy::parallel:
case Advanced::parallelism_strategy::precompute:
case Advanced::parallelism_strategy::parallel_no_write:
break;
case Advanced::parallelism_strategy::run_from_preprocessed:
{
assert(false && "This class has no business being called in this mode; you should instead "
"add in your Model the storage in parallelism directory of the VertexMatching "
"interpolation matrix.");
exit(EXIT_FAILURE);
}
}
}
DofProgramWiseIndexListPerVertexCoordIndexListManager
::~DofProgramWiseIndexListPerVertexCoordIndexListManager() = default;
......
......@@ -134,8 +134,15 @@ namespace MoReFEM
//! \name Singleton requirements.
///@{
//! Constructor.
DofProgramWiseIndexListPerVertexCoordIndexListManager() = default;
/*!
* \brief Constructor.
*
* \param[in] strategy This one is just there to signal an issue if current class is attempted to run in a run from
* prepartitioned data: current class is EXTREMELY specific and can't be initialised from prepartitioned data (it could, but this would involve
* storing loads of data... whereas it's cheaper to store for instance the \a VertexMatching interpolation matrix that current class helps to
* compute).
*/
DofProgramWiseIndexListPerVertexCoordIndexListManager(Advanced::parallelism_strategy strategy);
//! Destructor.
virtual ~DofProgramWiseIndexListPerVertexCoordIndexListManager() override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment