MPI and DataOut error

47 views
Skip to first unread message

Aiden Huffman

unread,
Jul 29, 2024, 11:35:56 AM7/29/24
to deal.II User Group
Hi Everyone,

I am trying to debug an error with my output function. I have an Trilinos::MPI::BlockVector and I am using a relatively simple output function

template <int dim> void ChannelDropletSolver<dim>::output_solution(uint index) {
  std::vector<DataComponentInterpretation::DataComponentInterpretation>
      data_interp(dim,
                  DataComponentInterpretation::component_is_part_of_vector);
  data_interp.push_back(DataComponentInterpretation::component_is_scalar);
  data_interp.push_back(DataComponentInterpretation::component_is_scalar);
  data_interp.push_back(DataComponentInterpretation::component_is_scalar);

  std::vector<std::string> component_names(dim, "velocity");
  component_names.emplace_back("pressure");
  component_names.emplace_back("concentration_A");
  component_names.emplace_back("concentration_B");

  DataOut<dim> data_out;
  data_out.attach_dof_handler(this->system_handler.dof_handler);
  data_out.add_data_vector(this->system_handler.dof_handler,
                           this->system_handler.solution, component_names,
                           data_interp);

  data_out.build_patches();

  data_out.write_vtu_with_pvtu_record("data/", "solution", index, mpi_comm, 3);
}

but it produces a strange error I've never seen before

An error occurred in line <441> of file </home/ahuffman/dealii-candi/tmp/unpack/deal.II-v9.5.1/source/base/mpi_compute_index_owner_internal.cc> in function
    void dealii::Utilities::MPI::internal::ComputeIndexOwner::Dictionary::partition(const dealii::IndexSet&, MPI_Comm)
The violated condition was:
    size > 0
Additional information:
    You are trying to use functionality in deal.II that is currently not
    implemented. In many cases, this indicates that there simply didn't
    appear much of a need for it, or that the author of the original code
    did not have the time to implement a particular case. If you hit this
    exception, it is therefore worth the time to look into the code to
    find out whether you may be able to implement the missing
    functionality. If you do, please consider providing a patch to the
    deal.II development sources (see the deal.II website on how to
    contribute).

Has anyone run into this before using MPI with Trilinos vectors and the DataOut object? I've included the stack trace, I am trying to come up with a minimal reproducible example now.
stacktrace.txt

Aiden Huffman

unread,
Jul 29, 2024, 3:27:24 PM7/29/24
to deal.II User Group
After digging into the source file, it looks like the error arises when the owned DoFs of a partition is empty.

Some more digging looks like I had an off by one error while constructing the linear system which introduced an extra partitioning with range [0, 0) tacked on the end. This partition contained no DoFs and led to the later error. I am not sure if the error message could be more clear. I suspect it was a series of silly events that led me here.

-Aiden
Reply all
Reply to author
Forward
0 new messages