Thanks a lot for the helpful advice.
If I pass a custom max_num_threads to the constructor of mpi_init, then I
get
the following behavior:
- Segmentation violation, when max_num_threads = 3, 4,
numbers::invalid_unsigned_int
- Normal execution, when max_num_threads = 1, 2, 5, 6, 7, 8, 9, 10
P.S.: My computer has a dual core CPU with hyper-threading, so in
/proc/cpuinfo
it shows 4 processors.
When running in GDB, all segmentation violation cases above give the same
message,
which points to the same position where the invalid read happens according
to valgrind:
Thread 1 "test" received signal SIGSEGV, Segmentation fault.
tbb::internal::generic_scheduler::allocate_task
(this=this@entry=0x7fffb8736600,
number_of_bytes=number_of_bytes@entry=8, parent=parent@entry=0x0,
context=context@entry=0x7ffff1e5c0a0 <tbb::internal::the_dummy_context>)
at ../../src/tbb/scheduler.cpp:315
315 ../../src/tbb/scheduler.cpp: No such file or directory.
On Friday, December 2, 2016 at 11:35:34 PM UTC+8, Wolfgang Bangerth wrote:
>
> On 12/02/2016 04:12 AM, JxW wrote:
> >
> > The following code reproduces this problem for me
> > (The CMakeLists.txt simply calls the DEAL_II_INVOKE_AUTOPILOT() macro):
> >
> > #include <iostream>
> > #include <deal.II/base/mpi.h>
> >
> > intmain (int argc, char *argv[]) {
> > dealii::Utilities::MPI::MPI_InitFinalize mpi_init (argc, argv);
> > std::cout << "Program runs normally." << std::endl;
> > return 0;
> > }
> >
> > Initially I suspected that the mpi_init object might be optimized away
> by the
> > compiler. But adding volatile to its
> > declaration does not fix this. Now I still do not know what is causing
> the
> > problem. Any help or suggestion is appreciated.
>
> Does this also happens with just a single processor? If you run this in a
> debugger, can you get a backtrace that shows where the problem happens?
>
> Best
> W.
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> <javascript:>
> www: http://www.math.colostate.edu/~bangerth/
>
>
--
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 the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.