Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 00751417 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1443 Fix the test about program-wise dofs per numbering subset. Now there are...

#1443 Fix the test about program-wise dofs per numbering subset. Now there are some clean-ups to do (print to remove, comments to add, etc...).
parent a9c31c92
......@@ -205,6 +205,7 @@ namespace MoReFEM
// Assign correctly the processor-wise dof indexes.
ComputeProcessorWiseAndGhostDofIndex();
ComputeProcessorWiseAndGhostDofIndexPerNumberingSubset();
for (const auto& felt_space_ptr : felt_space_list)
{
......@@ -402,11 +403,15 @@ namespace MoReFEM
assert(std::is_sorted(ghosted_dof_list.cbegin(), ghosted_dof_list.cend(),
Utilities::PointerComparison::Less<Dof::shared_ptr>()));
}
}
// Now assign the processor-wise indexes within each numbering subset.
void GodOfDof::ComputeProcessorWiseAndGhostDofIndexPerNumberingSubset()
{
auto& node_bearer_list = GetNonCstProcessorWiseNodeBearerList();
auto& ghost_node_bearer_list = GetNonCstGhostNodeBearerList();
const auto& numbering_subset_list = GetNumberingSubsetList();
for (const auto& numbering_subset_ptr : numbering_subset_list)
{
assert(!(!numbering_subset_ptr));
......
......@@ -445,6 +445,9 @@ namespace MoReFEM
*/
void ComputeProcessorWiseAndGhostDofIndex();
// Make that more cleverly... or explain how it should be called!
void ComputeProcessorWiseAndGhostDofIndexPerNumberingSubset();
/*!
* \brief Reduce to processor-wise the finite elements in each finite element space, the mesh and computes
......
......@@ -119,7 +119,6 @@ namespace MoReFEM
const Dof::vector_shared_ptr& ghost_dof_list,
const NumberingSubset::vector_const_shared_ptr& numbering_subset_list)
{
std::cout << "DMLKF>Dfj;hlsjlkgjl;kgeklj" << std::endl;
for (const auto& numbering_subset_ptr : numbering_subset_list)
{
assert(!(!numbering_subset_ptr));
......@@ -147,6 +146,9 @@ namespace MoReFEM
it,
end);
std::cout << "CURRENT ITERATOR POS = " << (it - dof_index_list.cbegin()) << std::endl;
std::cout << "END ITERATOR POS = " << (end - dof_index_list.cbegin()) << std::endl;
assert(it == end && "The data in the prepartition data file should cover exactly the number of "
"reconstructed dofs in the numbering subset.");
}
......@@ -161,6 +163,7 @@ namespace MoReFEM
{
static_cast<void>(dof_index_end);
std::cout << "LS SIZE = " << dof_list.size() << std::endl;
for (const auto& dof_ptr : dof_list)
{
assert(!(!dof_ptr));
......@@ -168,6 +171,7 @@ namespace MoReFEM
if (dof.IsInNumberingSubset(numbering_subset))
{
std::cout << "DOES IT HAPPEN?" << std::endl;
assert(dof_index_it != dof_index_end);
dof.SetProgramWiseIndex(numbering_subset, *dof_index_it);
++dof_index_it;
......
......@@ -189,10 +189,7 @@ namespace MoReFEM::Internal::GodOfDofNS
{
assert(!(!dof_ptr));
if (dof_ptr->IsInNumberingSubset(numbering_subset))
{
std::cout << "==================== GenerateProgramWiseDofList " << std::endl;
out.push_back(dof_ptr->GetProgramWiseIndex(numbering_subset));
}
}
}
......@@ -202,24 +199,23 @@ namespace MoReFEM::Internal::GodOfDofNS
const NumberingSubset& numbering_subset)
{
std::vector<unsigned int> ret;
std::vector<unsigned int> dof_index_list;
const auto capacity_guess = god_of_dof.NprocessorWiseDof(numbering_subset) + 20ul; // arbitrary to avoid
// number of memory
// allocation steps.
dof_index_list.reserve(capacity_guess);
ret.reserve(capacity_guess);
{
GenerateProgramWiseDofList(numbering_subset,
god_of_dof.GetProcessorWiseDofList(),
dof_index_list);
ret);
GenerateProgramWiseDofList(numbering_subset,
god_of_dof.GetGhostedDofList(),
dof_index_list);
ret);
}
assert(dof_index_list.size() >= god_of_dof.NprocessorWiseDof(numbering_subset));
assert(ret.size() >= god_of_dof.NprocessorWiseDof(numbering_subset));
return ret;
}
......
......@@ -300,10 +300,7 @@ namespace MoReFEM
// ===============================================================================
decltype(auto) numbering_subset_list = GetNumberingSubsetList();
Internal::FEltSpaceNS::AssignNumberingSubsetDofIndexForPrepartitionedData::Do(god_of_dof_prepartitioned_data,
GetProcessorWiseDofList(),
GetGhostedDofList(),
numbering_subset_list);
std::cout << " *-********************* TWO STEPS 50" << std::endl;
// Compute the number of program- and processor- wise dofs.
using type = Internal::FEltSpaceNS::NdofHolder;
......@@ -314,8 +311,17 @@ namespace MoReFEM
GetMpi().GetRank<int>(),
std::make_optional(prepartitioned_data_file_content.Nprogram_wise_dof),
std::make_optional(prepartitioned_data_file_content.Nprogram_wise_dof_per_numbering_subset));
std::cout << " *-********************* TWO STEPS 70" << std::endl;
std::cout << " *-********************* TWO STEPS 80" << std::endl;
ComputeProcessorWiseAndGhostDofIndex();
Internal::FEltSpaceNS::AssignNumberingSubsetDofIndexForPrepartitionedData::Do(god_of_dof_prepartitioned_data,
GetProcessorWiseDofList(),
GetGhostedDofList(),
numbering_subset_list);
ComputeProcessorWiseAndGhostDofIndexPerNumberingSubset();
decltype(auto) felt_space_list = GetFEltSpaceList();
const auto dof_list_per_felt_space = Internal::FEltSpaceNS::ComputeDofIndexListPerFEltSpace(felt_space_list);
......
......@@ -92,7 +92,6 @@ namespace MoReFEM
unsigned int Dof::GetProgramWiseIndex(const NumberingSubset& numbering_subset) const
{
std::cout << " Dof::GetProgramWiseIndex" << std::endl;
return FindInStorage(GetProgramWiseIndexPerNumberingSubset(), numbering_subset);
}
......@@ -150,7 +149,6 @@ namespace MoReFEM
unsigned int FindInStorage(const std::vector<std::pair<unsigned int, unsigned int>>& storage,
const NumberingSubset& numbering_subset)
{
std::cout << "2 - N in program_wise_index_per_numbering_subset = " << storage.size() << std::endl;
auto it = Iterator(storage, numbering_subset);
assert(it != storage.cend());
return it->second;
......
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