On Saturday, December 3, 2016 at 8:17:24 PM UTC+8, Wolfgang Bangerth wrote:
>
> On 12/02/2016 08:48 PM, JxW wrote: 
> > 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 
>
> That is bizarre. I have never seen anything like this. 
>
> Is this using the TBB that comes with your operating system, or the one 
> that 
> is bundled with deal.II? You can see this in the summary statement that is 
> produced at the end of the cmake run. 
>

 I believe it is using the TBB that come with the GCC 6.2.1. Although I 
didn't find
 it in cmake output, the executable links to libtbb.so.2 under gcc's 
directory.
$: ldd test | grep tbb

libtbb.so.2 => 
/home/xywei/spack/opt/spack/linux-arch-x86_64/gcc-6.2.1/tbb-4.4.4-c3xgursmdjopb3jywpcowiv74hap3bpp/lib/libtbb.so.2
 (0x00007f6a2de29000)
libtbbmalloc.so.2 => 
/home/xywei/spack/opt/spack/linux-arch-x86_64/gcc-6.2.1/tbb-4.4.4-c3xgursmdjopb3jywpcowiv74hap3bpp/lib/libtbbmalloc.so.2
 (0x00007f69fe376000)

 

>  


> > 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. 
>
> But what is the backtrace? Where is this function called from? You should 
> be 
> able to see this in a debugger. 
>

 The backtrace is nothing different from what valgrind produces:
 

#0  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
#1  0x00007ffff1c4375b in tbb::internal::generic_scheduler::generic_scheduler (
    this=this@entry=0x7fffb8736600, m=...) at ../../src/tbb/scheduler.cpp:100
#2  0x00007ffff1c45208 in 
tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::custom_scheduler
 (m=..., this=0x7fffb8736600) at ../../src/tbb/custom_scheduler.h:59
#3  
tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::allocate_scheduler
 (
    m=...) at ../../src/tbb/custom_scheduler.h:115
#4  0x00007ffff1c44052 in tbb::internal::allocate_scheduler (m=...)
    at ../../src/tbb/scheduler.cpp:42
#5  tbb::internal::generic_scheduler::create_master (a=0x7fffb873ed00)
    at ../../src/tbb/scheduler.cpp:1032
#6  0x00007ffff1c3eb54 in tbb::internal::governor::init_scheduler (
    num_threads=num_threads@entry=4, stack_size=stack_size@entry=0, 
    auto_init=auto_init@entry=false) at ../../src/tbb/governor.cpp:206
#7  0x00007ffff1c3ec0c in tbb::task_scheduler_init::initialize (
    this=0x7ffff7dccd88 <dealii::MultithreadInfo::set_thread_limit(unsigned 
int)::dummy>, 
    number_of_threads=4, thread_stack_size=0) at ../../src/tbb/governor.cpp:349
#8  0x00007ffff67cf6c3 in dealii::MultithreadInfo::set_thread_limit(unsigned 
int) ()
   from 
/home/xywei/spack/opt/spack/linux-arch-x86_64/gcc-6.2.1/dealii-develop-e5t4qkpvvpzbbomgfymanf2z5ja2yxfr/lib/libdeal_II.so.8.5.0-pre
#9  0x00007ffff67c9d0c in 
dealii::Utilities::MPI::MPI_InitFinalize::MPI_InitFinalize(int&, char**&, 
unsigned int) ()
   from 
/home/xywei/spack/opt/spack/linux-arch-x86_64/gcc-6.2.1/dealii-develop-e5t4qkpvvpzbbomgfymanf2z5ja2yxfr/lib/libdeal_II.so.8.5.0-pre
#10 0x000000000040a164 in main ()



> 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.

Reply via email to