Error when applying initial values to MPI::Vector in multiple dimensions

100 views
Skip to first unread message

Maxi Miller

unread,
Oct 13, 2017, 5:05:01 AM10/13/17
to deal.II User Group
I try to apply initial values to a vector defined as LinearAlgebraTrilinos::MPI::Vector using 
VectorTools::project (dof_handler, hanging_node_constraints,
 
QGauss<dim>(fe.degree+1),
 
InitialValues<dim>(),
 local_solution
);


When initializing the variable fe (as FESystem<dim>) with one or two components, it works fine. For more than two components I get the error
--------------------------------------------------------
An error occurred in line <1366> of file <~/Downloads/dealii/include/deal.II/numerics/vector_tools.templates.h> in function
   
void dealii::VectorTools::{anonymous}::project(const dealii::Mapping<dim>&, const dealii::DoFHandler<dim>&, const dealii::ConstraintMatrix&, const dealii::Quadrature<dim>&, const dealii::Function<dim, typename VectorType::value_type>&, VectorType&, bool, const dealii
::Quadrature<(dim - 1)>&, bool) [with VectorType = dealii::TrilinosWrappers::MPI::Vector; int dim = 2; typename VectorType::value_type = double]
The violated condition was:  
   
(dynamic_cast<const parallel::Triangulation<dim>* > (&(dof.get_triangulation()))==nullptr)
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 contri
bute).
 
Stacktrace:
-----------
#0  /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre:  
#1  /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre: void dealii::VectorTools::project<2, dealii::TrilinosWrappers::MPI::Vector, 2>(dealii::DoFHandler<2, 2> const&, dealii::ConstraintMatrix const&, dealii::Quadrature<2> const&, dealii::Function<2, dealii::TrilinosWrappers::MPI
::Vector::value_type> const&, dealii::TrilinosWrappers::MPI::Vector&, bool, dealii::Quadrature<(2)-(1)> const&, bool)
#2  ./main: Step15::MinimalSurfaceProblem<2>::run()
#3  ./main: main
--------------------------------------------------------
 
[linux-lb8c:15830] *** Process received signal ***
[linux-lb8c:15830] Signal: Aborted (6)
[linux-lb8c:15830] Signal code:  (-6)
[linux-lb8c:15830] [ 0] /lib64/libpthread.so.0(+0x12270)[0x7f294a477270]
[linux-lb8c:15830] [ 1] /lib64/libc.so.6(gsignal+0x110)[0x7f2946c1f0d0]
[linux-lb8c:15830] [ 2] /lib64/libc.so.6(abort+0x151)[0x7f2946c206b1]
[linux-lb8c:15830] [ 3] /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre(+0x6b9e5d1)[0x7f295b49e5d1]
[linux-lb8c:15830] [ 4] /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre(_ZN6dealii18deal_II_exceptions9internals5abortERKNS_13ExceptionBaseE+0x1a)[0x7f295b49edaf]
[linux-lb8c:15830] [ 5] /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre(_ZN6dealii18deal_II_exceptions9internals11issue_errorINS_18StandardExceptions17ExcNotImplementedEEEvNS1_17ExceptionHandlingEPKciS7_S7_S7_T_+0x98)[0x7f2957373ea1]
[linux-lb8c:15830] [ 6] /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre(+0x3f38e23)[0x7f2958838e23]
[linux-lb8c:15830] [ 7] /opt/dealII/lib/libdeal_II.g.so.9.0.0-pre(_ZN6dealii11VectorTools7projectILi2ENS_16TrilinosWrappers3MPI6VectorELi2EEEvRKNS_10DoFHandlerIXT_EXT1_EEERKNS_16ConstraintMatrixERKNS_10QuadratureIXT_EEERKNS_8FunctionIXT1_ENT0_10value_typeEEERSH_bRKNSC_IX
miT_Li1EEEEb+0x2f)[0x7f295894906e]
[linux-lb8c:15830] [ 8] ./main(_ZN6Step1521MinimalSurfaceProblemILi2EE3runEv+0xc08)[0x420d08]
[linux-lb8c:15830] [ 9] ./main(main+0x3c)[0x414ad0]
[linux-lb8c:15830] [10] /lib64/libc.so.6(__libc_start_main+0xea)[0x7f2946c09f4a]
[linux-lb8c:15830] [11] ./main(_start+0x2a)[0x41477a]
[linux-lb8c:15830] *** End of error message ***
Abgebrochen (Speicherabzug geschrieben)

when running in debug mode. It runs fine in release mode. Why does that happen for more than two components, and how can I fix/circumvent that? Or did I (again) forget something?
My minimal example is attached, the behaviour happens when setting NUM_COMPONENTS via 
#define NUM_COMPONENTS 100

to a value larger than 2.

Thank you!

main.cpp

Maxi Miller

unread,
Oct 13, 2017, 5:56:58 AM10/13/17
to deal.II User Group
Additional: Even though it compiles in release mode, as soon as I run it with multiple nodes, I get a segfault at that place:
mpirun noticed that process rank 0 with PID 0 on node linux-lb8c exited on signal 11 (Segmentation fault).



Daniel Arndt

unread,
Oct 13, 2017, 6:15:35 AM10/13/17
to deal.II User Group
Maxi,

I try to apply initial values to a vector defined as LinearAlgebraTrilinos::MPI::Vector using 
VectorTools::project (dof_handler, hanging_node_constraints,
 
QGauss<dim>(fe.degree+1),
 
InitialValues<dim>(),
 local_solution
);

When initializing the variable fe (as FESystem<dim>) with one or two components, it works fine. For more than two components I get the error
--------------------------------------------------------
An error occurred in line <1366> of file <~/Downloads/dealii/include/deal.II/numerics/vector_tools.templates.h> in function
   
void dealii::VectorTools::{anonymous}::project(const dealii::Mapping<dim>&, const dealii::DoFHandler<dim>&, const dealii::ConstraintMatrix&, const dealii::Quadrature<dim>&, const dealii::Function<dim, typename VectorType::value_type>&, VectorType&, bool, const dealii
::Quadrature<(dim - 1)>&, bool) [with VectorType = dealii::TrilinosWrappers::MPI::Vector; int dim = 2; typename VectorType::value_type = double]
The violated condition was:  
   
(dynamic_cast<const parallel::Triangulation<dim>* > (&(dof.get_triangulation()))==nullptr)
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 contri
bute).
[...]

when running in debug mode.
VectorTools::project is at the moment only implemented for parallel::distributed::Triangulations if the number of components is not larger than 4 (and the FiniteElement is supported by the MatrixFree framework).
More precisely, the fallback implementation does not support parallel::distributed::Triangulations. This behavior is also documented [1].
The technical reason for this is that the MatrixFree implementation requires the number of components at compile time (as template argument) and we only explicitly instantiate these templates for not more than 4 components.
 
Why does that happen for more than two components, and how can I fix/circumvent that? Or did I (again) forget something? 
To circumvent this restriction, you would have to call project_matrix_free [2] for a LinearAlgebra::distributed::Vector<Number> vector and than copy it to the vector you need using the code in project_matrix_free_copy_vector [3].

Best,
Daniel

[1] https://dealii.org/developer/doxygen/deal.II/namespaceVectorTools.html#af282602c17b8eb6afe47ef56fc417ecb
[2] https://github.com/dealii/dealii/blob/19dc10a4c0e54196c88d5afde2495d90a32f5df3/include/deal.II/numerics/vector_tools.templates.h#L1018
[3] https://github.com/dealii/dealii/blob/19dc10a4c0e54196c88d5afde2495d90a32f5df3/include/deal.II/numerics/vector_tools.templates.h#L1185

Mark Ma

unread,
Oct 15, 2017, 5:08:22 PM10/15/17
to deal.II User Group
Dear Maxi,

For projecting initial values in MPI (project function may fail using PETsc or Trilinos), it is more convenient by direct solving the equation:
Mass_matrix*Solution =(InitialvaluesFunc,phi)
this part in MPI is not hard, you could do it very quickly I think.

Best,
Mark


在 2017年10月13日星期五 UTC+2上午11:05:01,Maxi Miller写道:

Denis Davydov

unread,
Oct 16, 2017, 2:54:02 AM10/16/17
to deal.II User Group

Maxi Miller

unread,
Oct 16, 2017, 3:44:27 PM10/16/17
to deal.II User Group
Yes, .interpolate() works fine. But what is the difference between interpolate() and project()?

Denis Davydov

unread,
Oct 16, 2017, 3:47:05 PM10/16/17
to dea...@googlegroups.com
interpoalate just evaluates the function at support points of FE basis (assuming that you have one with support points)
and sets those values to DoFs,
whereas project (as the name implies) does L2 projection. Thus as others have mentioned you are solving
Mx = U 
where M is the mass matrix.

Regards,
Denis.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/4YoJZ8d2-XM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages