Hello to all, unfortunately, I have no admin rights and can not re-compile the library with -DDEAL_II_WITH_TBB=OFF.
But I did export DEAL_II_NUM_THREADS=1 to make sure that nothing like a race condition is involved. However, my program is not parallelized explicitedly by myself. If there is multi-threading, then just because I call dealii functions which are multi-threaded per default. Anyway, with DEAL_II_NUM_THREADS=1, valgrind does not produce any error messages anymore (see valgrind.txt), but my issue is still there. To give you a better insight, I attached the output of my program once with the print statement in my assembly routine (output_print_NOT_outcommented.txt) and without the print statement ( output_print_outcommented.txt). As you can see, the RHS of my linear system after convergence is different at some load steps. And as I said, these differences sum up in repeating calls to my program and, clearly, should not be there -- regardless how small they are. What I did is to run my program with the address and undefined behavior sanitizer of clang by passing some flags to cmake: cmake -DCAMKE_CXX_FLAGS="-fsanitize=undefined" -DCMAKE_EXE_LINKER_FLAGS ="-fsanitize=undefined" -DCAMKE_CXX_FLAGS="-fsanitize=address" -DCMAKE_EXE_LINKER_FLAGS ="-fsanitize=address" -DCAMKE_CXX_FLAGS="-fno-optimize-sibling-calls" . At the very end of my program (probably when the destructor is called or even later), the sanitizers reported some errors (see address_sanitizer.txt), but this may be some false positives. In particular, no error is reported during the relevant part of my program. These errors occur with and without the print statement, and also in debug mode. If there is a bug in my program, this bug seems to be a tough one (at least for me). If someone of you (Wolfgang, Bruno, Daniel,...) were willed to have a look at my code, I would reduce the issue to a minimal working example and upload all source files here or sent it do you directly. I would highly appreciate that since I do not want to extend my code further with that bug in it. Best Simon <https://mail.google.com/mail/u/0?ui=2&ik=4a4452916d&attid=0.2&permmsgid=msg-a:r8629661344512179658&view=att&disp=safe&realattid=f_lfwmt5ix1> Am Fr., 31. März 2023 um 15:06 Uhr schrieb Bruno Turcksin < bruno.turck...@gmail.com>: > Simon, > > Le ven. 31 mars 2023 à 08:58, Simon Wiesheier <simon.wieshe...@gmail.com> > a écrit : > >> >> >> Given that it works fine in debug mode, there are likely no out-of-bound >> violations. I just use std::vector and Vector<double> as data structures >> which would be detected in debug mode. >> >> That's optimistic :) It's not because you are in debug mode that > std::vector checks the bounds. The bounds are only checked when using at() > > >> How can I run my program without TBB enabled? >> > > Reconfigure and recompile deal.II with -D DEAL_II_WITH_TBB=OFF > > Best, > > Bruno > > > -- > 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 dealii+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/CAGVt9eP2PDbJ%2BBFLGJ8qV4Gm54FY_DGcnMw7gyRcXuWHoYUVnQ%40mail.gmail.com > <https://groups.google.com/d/msgid/dealii/CAGVt9eP2PDbJ%2BBFLGJ8qV4Gm54FY_DGcnMw7gyRcXuWHoYUVnQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAM50jEug4DCxMKPHz%2Bk4ZFXzXHJj4V4XcBGkx-HdarERqeq3PQ%40mail.gmail.com.
==3313580== Memcheck, a memory error detector ==3313580== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==3313580== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info ==3313580== Command: ./NeoHooke ==3313580== Parent PID: 3063539 ==3313580== ==3313580== ==3313580== HEAP SUMMARY: ==3313580== in use at exit: 206,618 bytes in 1,302 blocks ==3313580== total heap usage: 277,987 allocs, 276,685 frees, 17,751,468 bytes allocated ==3313580== ==3313580== LEAK SUMMARY: ==3313580== definitely lost: 0 bytes in 0 blocks ==3313580== indirectly lost: 0 bytes in 0 blocks ==3313580== possibly lost: 0 bytes in 0 blocks ==3313580== still reachable: 206,618 bytes in 1,302 blocks ==3313580== suppressed: 0 bytes in 0 blocks ==3313580== Reachable blocks (those to which a pointer was found) are not shown. ==3313580== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==3313580== ==3313580== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Step 1 out of 10 load steps with current strain: 0.1*0.5 = 0.05 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 94 3.117e-07 1.000e+00 1 CST Assemble System SLV | 106 1.639e-09 7.998e-03 2 CST Assemble System SLV | 88 8.825e-10 2.862e-03 3 CST Assemble System SLV | 55 1.063e-10 1.500e-03 4 CST Assemble System SLV | 49 2.614e-11 1.620e-04 5 CST Assemble System SLV | 47 1.482e-12 8.528e-06 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 8.514e-07 Step 2 out of 10 load steps with current strain: 2.000e-01*5.000e-01 = 1.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 7.570e-09 1.000e+00 1 CST Assemble System SLV | 48 1.903e-11 4.958e-03 2 CST Assemble System SLV | 47 1.557e-13 1.588e-05 3 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 3.845e-09 Step 3 out of 10 load steps with current strain: 3.000e-01*5.000e-01 = 1.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 8.877e-09 1.000e+00 1 CST Assemble System SLV | 46 4.508e-11 1.108e-02 2 CST Assemble System SLV | 45 2.651e-11 3.337e-03 3 CST Assemble System SLV | 47 1.457e-14 1.514e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.072e-10 Step 4 out of 10 load steps with current strain: 4.000e-01*5.000e-01 = 2.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 7.301e-09 1.000e+00 1 CST Assemble System SLV | 45 9.118e-11 1.256e-02 2 CST Assemble System SLV | 45 9.937e-13 2.392e-04 3 CST Assemble System SLV | 45 2.209e-16 6.772e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.197e-13 Step 5 out of 10 load steps with current strain: 5.000e-01*5.000e-01 = 2.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 45 8.062e-09 1.000e+00 1 CST Assemble System SLV | 42 1.700e-10 2.016e-02 2 CST Assemble System SLV | 42 1.503e-12 3.099e-04 3 CST Assemble System SLV | 42 2.674e-16 3.797e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 4.070e-14 Step 6 out of 10 load steps with current strain: 6.000e-01*5.000e-01 = 3.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 42 4.447e-09 1.000e+00 1 CST Assemble System SLV | 41 1.542e-10 1.687e-02 2 CST Assemble System SLV | 41 2.336e-12 2.577e-04 3 CST Assemble System SLV | 41 3.422e-16 6.428e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 6.266e-14 Step 7 out of 10 load steps with current strain: 7.000e-01*5.000e-01 = 3.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 4.724e-09 1.000e+00 1 CST Assemble System SLV | 41 1.992e-10 5.067e-02 2 CST Assemble System SLV | 40 1.822e-11 1.629e-03 3 CST Assemble System SLV | 40 2.862e-14 2.663e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.076e-10 Step 8 out of 10 load steps with current strain: 8.000e-01*5.000e-01 = 4.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 4.576e-09 1.000e+00 1 CST Assemble System SLV | 41 8.941e-11 2.600e-02 2 CST Assemble System SLV | 41 4.956e-12 1.182e-03 3 CST Assemble System SLV | 40 8.339e-15 1.543e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 3.259e-11 Step 9 out of 10 load steps with current strain: 9.000e-01*5.000e-01 = 4.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 5.086e-09 1.000e+00 1 CST Assemble System SLV | 40 3.146e-10 8.407e-02 2 CST Assemble System SLV | 44 2.057e-09 5.927e-01 3 CST Assemble System SLV | 44 2.247e-10 4.182e-02 4 CST Assemble System SLV | 45 7.281e-12 1.281e-03 5 CST Assemble System SLV | 45 1.375e-14 3.519e-06 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.762e-10 Step 10 out of 10 load steps with current strain: 1.000e+00*5.000e-01 = 5.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 45 1.195e-08 1.000e+00 1 CST Assemble System SLV | 46 1.584e-08 2.264e+00 2 CST Assemble System SLV | 45 2.853e-09 3.281e-01 3 CST Assemble System SLV | 46 9.998e-11 1.797e-02 4 CST Assemble System SLV | 46 1.287e-12 1.043e-04 5 CST Assemble System SLV | 46 3.305e-16 4.150e-08 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 2.039e-13
Step 1 out of 10 load steps with current strain: 0.1*0.5 = 0.05 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 94 3.117e-07 1.000e+00 1 CST Assemble System SLV | 106 1.639e-09 7.998e-03 2 CST Assemble System SLV | 88 8.825e-10 2.862e-03 3 CST Assemble System SLV | 55 1.063e-10 1.500e-03 4 CST Assemble System SLV | 49 2.614e-11 1.620e-04 5 CST Assemble System SLV | 47 1.482e-12 8.528e-06 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 8.514e-07 Step 2 out of 10 load steps with current strain: 2.000e-01*5.000e-01 = 1.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 7.570e-09 1.000e+00 1 CST Assemble System SLV | 48 1.903e-11 4.958e-03 2 CST Assemble System SLV | 47 1.557e-13 1.588e-05 3 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 3.845e-09 Step 3 out of 10 load steps with current strain: 3.000e-01*5.000e-01 = 1.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 8.877e-09 1.000e+00 1 CST Assemble System SLV | 46 4.508e-11 1.108e-02 2 CST Assemble System SLV | 45 2.651e-11 3.337e-03 3 CST Assemble System SLV | 47 1.457e-14 1.514e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.072e-10 Step 4 out of 10 load steps with current strain: 4.000e-01*5.000e-01 = 2.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 47 7.301e-09 1.000e+00 1 CST Assemble System SLV | 45 9.118e-11 1.256e-02 2 CST Assemble System SLV | 45 9.937e-13 2.392e-04 3 CST Assemble System SLV | 45 2.209e-16 6.772e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.236e-13 Step 5 out of 10 load steps with current strain: 5.000e-01*5.000e-01 = 2.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 45 8.062e-09 1.000e+00 1 CST Assemble System SLV | 42 1.700e-10 2.016e-02 2 CST Assemble System SLV | 42 1.503e-12 3.099e-04 3 CST Assemble System SLV | 42 2.674e-16 3.797e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 6.136e-14 Step 6 out of 10 load steps with current strain: 6.000e-01*5.000e-01 = 3.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 42 4.447e-09 1.000e+00 1 CST Assemble System SLV | 41 1.542e-10 1.687e-02 2 CST Assemble System SLV | 41 2.336e-12 2.577e-04 3 CST Assemble System SLV | 41 3.422e-16 6.428e-08 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 8.567e-14 Step 7 out of 10 load steps with current strain: 7.000e-01*5.000e-01 = 3.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 4.724e-09 1.000e+00 1 CST Assemble System SLV | 41 1.992e-10 5.067e-02 2 CST Assemble System SLV | 40 1.822e-11 1.629e-03 3 CST Assemble System SLV | 40 2.862e-14 2.663e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.076e-10 Step 8 out of 10 load steps with current strain: 8.000e-01*5.000e-01 = 4.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 4.576e-09 1.000e+00 1 CST Assemble System SLV | 41 8.941e-11 2.600e-02 2 CST Assemble System SLV | 41 4.956e-12 1.182e-03 3 CST Assemble System SLV | 40 8.339e-15 1.543e-06 4 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 3.259e-11 Step 9 out of 10 load steps with current strain: 9.000e-01*5.000e-01 = 4.500e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 41 5.086e-09 1.000e+00 1 CST Assemble System SLV | 40 3.146e-10 8.407e-02 2 CST Assemble System SLV | 44 2.057e-09 5.927e-01 3 CST Assemble System SLV | 44 2.247e-10 4.182e-02 4 CST Assemble System SLV | 45 7.281e-12 1.281e-03 5 CST Assemble System SLV | 45 1.375e-14 3.519e-06 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.762e-10 Step 10 out of 10 load steps with current strain: 1.000e+00*5.000e-01 = 5.000e-01 __________________________________________________________________________________________ SOLVER STEP | LIN_IT LIN_RES RES_NORM __________________________________________________________________________________________ 0 CST Assemble System SLV | 45 1.195e-08 1.000e+00 1 CST Assemble System SLV | 46 1.584e-08 2.264e+00 2 CST Assemble System SLV | 45 2.853e-09 3.281e-01 3 CST Assemble System SLV | 46 9.998e-11 1.797e-02 4 CST Assemble System SLV | 46 1.287e-12 1.043e-04 5 CST Assemble System SLV | 46 3.305e-16 4.150e-08 6 CST Assemble System CONVERGED! __________________________________________________________________________________________ Errors: Rhs: 1.702e-13
==4060635==ERROR: LeakSanitizer: detected memory leaks Direct leak of 792 byte(s) in 3 object(s) allocated from: #0 0x7f3cfb18d608 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7f3cda8675e2 in tbb::internal::task_stream<3>::initialize(unsigned int) (/calculate/dealii-9.3.2/opt/spack/linux-ubuntu22.04-skylake/gcc-12.1.0/intel-tbb-2020.3-ulfjl2ollhdkou6aoriwp27nlydyzuvj/lib/libtbb_debug.so.2+0x415e2) #2 0x7f3cda862af0 in tbb::internal::arena::arena(tbb::internal::market&, unsigned int, unsigned int) ../../src/tbb/arena.cpp:270 #3 0x7f3cda862c64 in tbb::internal::arena::allocate_arena(tbb::internal::market&, unsigned int, unsigned int) ../../src/tbb/arena.cpp:293 #4 0x7f3cda85ea68 in tbb::internal::market::create_arena(int, int, unsigned long) ../../src/tbb/market.cpp:314 #5 0x7f3cda85c980 in tbb::internal::governor::init_scheduler(int, unsigned long, bool) ../../src/tbb/governor.cpp:197 #6 0x7f3cda85d45a in tbb::task_scheduler_init::initialize(int, unsigned long) ../../src/tbb/governor.cpp:490 #7 0x7f3cda85d3a8 in tbb::task_scheduler_init::initialize(int) ../../src/tbb/governor.cpp:478 #8 0x7f3ceefb573f in dealii::MultithreadInfo::set_thread_limit(unsigned int) /calculate/temp/ltmadmin/spack-stage-dealii-9.3.2-fpaxcn6bqnnmqjyg5nnmil5csgbvxate/spack-src/source/base/multithread_info.cc:93 #9 0x7f3ceefb5ada in dealii::MultithreadInfo::initialize_multithreading() /calculate/temp/ltmadmin/spack-stage-dealii-9.3.2-fpaxcn6bqnnmqjyg5nnmil5csgbvxate/spack-src/source/base/multithread_info.cc:132 #10 0x7f3ceefb5af8 in DoOnce /calculate/temp/ltmadmin/spack-stage-dealii-9.3.2-fpaxcn6bqnnmqjyg5nnmil5csgbvxate/spack-src/source/base/multithread_info.cc:147 #11 0x7f3ceefb9297 in __static_initialization_and_destruction_0 /calculate/temp/ltmadmin/spack-stage-dealii-9.3.2-fpaxcn6bqnnmqjyg5nnmil5csgbvxate/spack-src/source/base/multithread_info.cc:149 #12 0x7f3ceefb92b1 in _GLOBAL__sub_I_multithread_info.cc /calculate/temp/ltmadmin/spack-stage-dealii-9.3.2-fpaxcn6bqnnmqjyg5nnmil5csgbvxate/spack-src/source/base/multithread_info.cc:152 #13 0x7f3cfb7a247d in call_init elf/dl-init.c:70 #14 0x7f3cfb7a2567 in call_init elf/dl-init.c:33 #15 0x7f3cfb7a2567 in _dl_init elf/dl-init.c:117 #16 0x7f3cfb7bc2e9 (/lib64/ld-linux-x86-64.so.2+0x202e9) Direct leak of 544 byte(s) in 1 object(s) allocated from: #0 0x7f3cfb18d608 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7f3cd163efb3 (/calculate/dealii-9.3.2/opt/spack/linux-ubuntu22.04-skylake/gcc-12.1.0/oce-0.18.3-ecsmaa46gxbflztayfsqannu7m66vwcb/lib/libTKernel.so.11+0xa3fb3) #2 0x7f3cfb7a247d in call_init elf/dl-init.c:70 #3 0x7f3cfb7a2567 in call_init elf/dl-init.c:33 #4 0x7f3cfb7a2567 in _dl_init elf/dl-init.c:117 #5 0x7f3cfb7bc2e9 (/lib64/ld-linux-x86-64.so.2+0x202e9) SUMMARY: AddressSanitizer: 1336 byte(s) leaked in 4 allocation(s). make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] Error 1 make[2]: *** [CMakeFiles/Makefile2:116: CMakeFiles/run.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2