AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
553 stars 352 forks source link

Problem when computing gradient solution for MLEBNodeFDLaplacian #4223

Closed clarkse closed 1 week ago

clarkse commented 1 week ago

The gradient solution computed in:

void MLEBNodeFDLaplacian::compGrad

segfaults/assertion failures when querying from WarpX when compiled with EB support on, but not installing an embedded boundary.

Backtrace follows:

(gdb) bt

0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737350221824) at ./nptl/pthread_kill.c:44

1 __pthread_kill_internal (signo=6, threadid=140737350221824) at ./nptl/pthread_kill.c:78

2 __GI___pthread_kill (threadid=140737350221824, signo=signo@entry=6) at ./nptl/pthread_kill.c:89

3 0x00007ffff7c87476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26

4 0x00007ffff7c6d7f3 in __GI_abort () at ./stdlib/abort.c:79

5 0x00007fff957e3b9e in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

6 0x00007fff957ef20c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

7 0x00007fff957ee1e9 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

8 0x00007fff957ee959 in __gxx_personality_v0 () from /lib/x86_64-linux-gnu/libstdc++.so.6

9 0x00007ffff4a23884 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1

10 0x00007ffff4a23f41 in _Unwind_RaiseException () from /lib/x86_64-linux-gnu/libgcc_s.so.1

11 0x00007fff957ef4cb in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6

12 0x00007fff875b527d in amrex::Assert_host (EX=0x7fff87e18098 "i < (this->std::vector<T, Allocator>::size())",

file=0x7fff87e180c8 "/home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/Base/AMReX_Vector.H", line=41, msg=0x0)
at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/Base/AMReX.cpp:292

13 0x00007fff8766c67a in amrex::Assert (msg=0x0, line=41, file=0x7fff87e180c8 "/home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/Base/AMReX_Vector.H",

EX=0x7fff87e18098 "i < (this->std::vector<T, Allocator>::size())") at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/Base/AMReX.H:186

14 amrex::Vector<amrex::MultiFab, std::allocator >::operator[] (this=0x7fffffffb468, i=0)

at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/Base/AMReX_Vector.H:41

15 0x00007fff87d292e9 in amrex::MLEBNodeFDLaplacian::compGrad (this=0x7fffffffacf0, amrlev=0, grad=..., sol=...)

at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.cpp:683

16 0x00007fff85d1205b in amrex::MLMGT::getGradSolution (this=0x555556b118a0, a_grad_sol=...,

a_loc=amrex::LinOpEnumType::Location::FaceCenter) at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/LinearSolvers/MLMG/AMReX_MLMG.H:561

17 0x00007fff85d0b2b9 in amrex::MLMGT::getGradSolution (this=0x555556b118a0, a_grad_sol=std::initializer_list of length 1 = {...},

a_loc=amrex::LinOpEnumType::Location::FaceCenter) at /home/st247c/src/WarpX/build/_deps/fetchedamrex-src/Src/LinearSolvers/MLMG/AMReX_MLMG.H:581

18 0x00007fff85d649d2 in MagnetostaticSolver::EBCalcBfromVectorPotentialPerLevel::operator() (this=0x7fffffffc610, mlmg=..., lev=0)

at /home/st247c/src/WarpX/Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp:456

19 0x00007fff85d690ac in ablastr::fields::computeVectorPotential<MagnetostaticSolver::VectorPoissonBoundaryHandler, std::optional, amrex::EBFArrayBoxFactory> (curr=..., A=..., relative_tolerance=9.9999999999999994e-12, absolute_tolerance=0, max_iters=200, verbosity=2,

geom=..., dmap=..., grids=..., boundary_handler=..., eb_enabled=false, do_single_precision_comms=false, 
rel_ref_ratio=std::optional<amrex::Vector<amrex::IntVectND<2>, std::allocator<amrex::IntVectND<2> > >> = {...}, 
post_A_calculation=std::optional<MagnetostaticSolver::EBCalcBfromVectorPotentialPerLevel> = {...}, current_time=std::optional<const double> = {...}, 
eb_farray_box_factory=std::optional<amrex::Vector<amrex::EBFArrayBoxFactory const*, std::allocator<amrex::EBFArrayBoxFactory const*> >> [no contained value])
at /home/st247c/src/WarpX/Source/ablastr/fields/VectorPoissonSolver.H:278

20 0x00007fff85d6206f in WarpX::computeVectorPotential (this=0x555556b2cab0, curr=..., A=..., required_precision=9.9999999999999994e-12, absolute_tolerance=0,

max_iters=200, verbosity=2) at /home/st247c/src/WarpX/Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp:215

21 0x00007fff85d6199d in WarpX::AddMagnetostaticFieldLabFrame (this=0x555556b2cab0)

--Type for more, q to quit, c to continue without paging-- r.cpp:146

22 0x00007fff85d61304 in WarpX::ComputeMagnetostaticField (this=0x555556b2cab0) at /home/st247c/src/WarpX/Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp:75

23 0x00007fff85e7494c in WarpX::InitData (this=0x555556b2cab0) at /home/st247c/src/WarpX/Source/Initialization/WarpXInitData.cpp:601

24 0x00007fff85b7f4fb in pybind11::cpp_function::cpp_function<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}::operator()(WarpX*) const (__closure=0x555556b1a6e8, c=0x555556b2cab0)

at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/pybind11.h:154

25 0x00007fff85b8779d in pybind11::detail::argument_loader<WarpX>::call_impl<void, pybind11::cpp_function::cpp_function<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}&, 0ul, pybind11::detail::void_type>(pybind11::cpp_function::cpp_function<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX*)#1}&, std::integer_sequence<unsigned long, 0ul>, pybind11::detail::void_type&&) &&

(this=0x7fffffffcca0, f=...) at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/cast.h:1613

26 0x00007fff85b83efc in pybind11::detail::argument_loader<WarpX>::call<void, pybind11::detail::void_type, pybind11::cpp_function::cpp_function<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}&>(pybind11::cpp_function::cpp_function<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX*)#1}&) && (this=0x7fffffffcca0, f=...)

at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/cast.h:1587

27 0x00007fff85b80a9e in pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}, void, WarpX, pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(pybind11::cpp_function::initialize<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}&&, void ()(WarpX*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(pybind11::detail::function_call&)#3}::operator()(pybind11::detail::function_call&) const (__closure=0x0,

call=...) at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/pybind11.h:297

28 0x00007fff85b80bc9 in pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}, void, WarpX, pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(pybind11::cpp_function::initialize<void, WarpX, , pybind11::name, pybind11::is_method, pybind11::sibling, char [33]>(void (WarpX::)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(WarpX)#1}&&, void ()(WarpX*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [33])::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) ()

at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/pybind11.h:267

29 0x00007fff85b26a0b in pybind11::cpp_function::dispatcher (self=0x7fffdac6cff0, args_in=0x7ffff7bbb220, kwargs_in=0x0)

at /home/st247c/src/WarpX/build/_deps/fetchedpybind11-src/include/pybind11/pybind11.h:987

30 0x00005555556b0b2e in ?? ()

31 0x00005555556a72db in _PyObject_MakeTpCall ()

32 0x00005555556bf55b in ?? ()

33 0x000055555569f34a in _PyEval_EvalFrameDefault ()

34 0x00005555556bf281 in ?? ()

35 0x000055555569ab93 in _PyEval_EvalFrameDefault ()

36 0x00005555556bf281 in ?? ()

37 0x000055555569ab93 in _PyEval_EvalFrameDefault ()

38 0x00005555556b142c in _PyFunction_Vectorcall ()

39 0x0000555555699abb in _PyEval_EvalFrameDefault ()

--Type for more, q to quit, c to continue without paging--c

40 0x00005555556b142c in _PyFunction_Vectorcall ()

41 0x0000555555699abb in _PyEval_EvalFrameDefault ()

42 0x0000555555696016 in ?? ()

43 0x000055555578b8b6 in PyEval_EvalCode ()

44 0x00005555557b6918 in ?? ()

45 0x00005555557b01db in ?? ()

46 0x00005555557b6665 in ?? ()

47 0x00005555557b5b48 in _PyRun_SimpleFileObject ()

48 0x00005555557b5793 in _PyRun_AnyFileObject ()

49 0x00005555557a82ce in Py_RunMain ()

50 0x000055555577e70d in Py_BytesMain ()

51 0x00007ffff7c6ed90 in __libc_start_call_main (main=main@entry=0x55555577e6d0, argc=argc@entry=2, argv=argv@entry=0x7fffffffdfd8) at ../sysdeps/nptl/libc_start_call_main.h:58

52 0x00007ffff7c6ee40 in __libc_start_main_impl (main=0x55555577e6d0, argc=2, argv=0x7fffffffdfd8, init=, fini=, rtld_fini=, stack_end=0x7fffffffdfc8) at ../csu/libc-start.c:392

53 0x000055555577e605 in _start ()

WeiqunZhang commented 1 week ago

Please reopen it if the issue is not resolved.