project-asgard / asgard

MIT License
27 stars 20 forks source link

1D Diffusion equation won't plot in MATLAB #669

Closed quantumsteve closed 4 weeks ago

quantumsteve commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. git commit hash being built d936f39862530f3279f3fed9c5f7535d96533996
  2. cmake command cmake -G Ninja -DASGARD_USE_MATLAB=ON ..
  3. full program/test invocation command asgard -p diffusion_1 -n 1
  4. additional steps

Expected behavior A clear and concise description of what you expected to happen.

see https://github.com/project-asgard/asgard/wiki/Example-Execution

System:

my laptop, Ubuntu 20.04

Additional context Add any other context about the problem here.

svh@LAP131024:~/Documents/asgard/build$ gdb ./asgard
GNU gdb (Ubuntu 10.2-0ubuntu1~20.04~1) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./asgard...
(gdb) run -p diffusion_1 -n 1
Starting program: /home/svh/Documents/asgard/build/asgard -p diffusion_1 -n 1
warning: the debug information found in "/opt/intel/oneapi/compiler/2024.0/lib/libiomp5.dbg" does not match "/opt/intel/oneapi/compiler/2024.0/lib/libiomp5.so" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Branch: fix_matlab
Commit Summary: d936f39862530f3279f3fed9c5f7535d96533996
  Date: Tue Mar 12 13:03:16 2024 -0400
      Remove unused value?
This executable was built on Tuesday, March 12 2024 at  1:21 pm
generating: pde...
ASGarD problem configuration:
  selected PDE: diffusion_1
  degree: 2
  N steps: 1
  write freq: 0
  realspace freq: 0
  implicit: 0
  full grid: 0
  CFL number: 0.01
  Poisson solve: 0
  starting levels: 3 
  max adaptivity levels: 8
--- begin setup ---
  generating: adaptive grid...
  degrees of freedom: 16
  generating: basis operator...
  basis operator allocation (MB): 0.000854492
  generating: dimension mass matrices...
  generating: initial conditions...
  degrees of freedom (post initial adapt): 16
  generating: coefficient matrices...
  generating: moment vectors...
--- begin time loop staging ---
  connecting with MATLAB...
[New Thread 0x7fffe16fa700 (LWP 4155347)]
[Thread 0x7fffe16fa700 (LWP 4155347) exited]
[New Thread 0x7fffe16fa700 (LWP 4155348)]
[Thread 0x7fffe16fa700 (LWP 4155348) exited]
[New Thread 0x7fffe16fa700 (LWP 4155349)]
[New Thread 0x7fffe0ef9700 (LWP 4155350)]
[New Thread 0x7fffdbfff700 (LWP 4155351)]
[New Thread 0x7fffdb068700 (LWP 4155352)]
[New Thread 0x7fffda867700 (LWP 4155353)]
[New Thread 0x7fffda066700 (LWP 4155354)]
[New Thread 0x7fffd9865700 (LWP 4155355)]
[New Thread 0x7fffd9064700 (LWP 4155356)]
[New Thread 0x7fffd8863700 (LWP 4155357)]
[New Thread 0x7fffb7fff700 (LWP 4155358)]
[Detaching after fork from child process 4155359]
[New Thread 0x7fffb77fe700 (LWP 4155466)]
[New Thread 0x7fffb6ffd700 (LWP 4155467)]
[New Thread 0x7fffb67fc700 (LWP 4155568)]
[New Thread 0x7fffb5ffb700 (LWP 4155569)]
[New Thread 0x7fffb57fa700 (LWP 4155591)]
[Thread 0x7fffe0ef9700 (LWP 4155350) exited]
[New Thread 0x7fffe0ef9700 (LWP 4155592)]
[Thread 0x7fffe0ef9700 (LWP 4155592) exited]
[New Thread 0x7fffe0ef9700 (LWP 4155600)]
[New Thread 0x7fffb4e00700 (LWP 4155601)]
[New Thread 0x7fff97fff700 (LWP 4155602)]
[Thread 0x7fff97fff700 (LWP 4155602) exited]
[Detaching after fork from child process 4155612]
[Thread 0x7fffb4e00700 (LWP 4155601) exited]
[Thread 0x7fffe16fa700 (LWP 4155349) exited]
  connected to MATLAB
asgard: /home/svh/Documents/asgard/src/batch.cpp:319: asgard::batch_chain<P, resrc, method>::batch_chain(const std::vector<asgard::fk::matrix<P, asgard::mem_type::const_view, resrc> >&, const asgard::fk::vector<P, asgard::mem_type::const_view, resrc>&, std::array<asgard::fk::vector<P, asgard::mem_type::view, resrc>, 2>&, asgard::fk::vector<P, asgard::mem_type::view, resrc>&) [with asgard::chain_method m_ = asgard::chain_method::realspace; <template-parameter-2-2> = void; P = double; asgard::resource resrc = asgard::resource::host; asgard::chain_method method = asgard::chain_method::realspace]: Assertion `workspace[0].size() >= workspace_len' failed.

Thread 1 "asgard" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fffefa86859 in __GI_abort () at abort.c:79
#2  0x00007fffefa86729 in __assert_fail_base (fmt=0x7fffefc1c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5555558035a8 "workspace[0].size() >= workspace_len", file=0x555555802980 "/home/svh/Documents/asgard/src/batch.cpp", line=319, 
    function=<optimized out>) at assert.c:92
#3  0x00007fffefa97fd6 in __GI___assert_fail (assertion=0x5555558035a8 "workspace[0].size() >= workspace_len", file=0x555555802980 "/home/svh/Documents/asgard/src/batch.cpp", line=319, 
    function=0x5555558032f0 "asgard::batch_chain<P, resrc, method>::batch_chain(const std::vector<asgard::fk::matrix<P, asgard::mem_type::const_view, resrc> >&, const asgard::fk::vector<P, asgard::mem_type::const_view, resrc>&, s"...) at assert.c:101
#4  0x000055555578e49a in asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0>::batch_chain<(asgard::chain_method)0, void> (this=0x555555c91cf0, matrices=std::vector of length 1, capacity 1 = {...}, x=..., workspace=..., final_output=...)
    at /home/svh/Documents/asgard/src/batch.cpp:319
#5  0x000055555573048d in __gnu_cxx::new_allocator<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0> >::construct<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0>, std::vector<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0>, std::allocator<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0> > >&, asgard::fk::vector<double, (asgard::mem_type)2, (asgard::resource)0> const&, std::array<asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>, 2ul>&, asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>&> (this=0x7fffffffc950, __p=0x555555c91cf0) at /usr/include/c++/9/ext/new_allocator.h:146
#6  0x000055555572e824 in std::allocator_traits<std::allocator<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0> > >::construct<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0>, std::vector<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0>, std::allocator<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0> > >&, asgard::fk::vector<double, (asgard::mem_type)2, (asgard::resource)0> const&, std::array<asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>, 2ul>&, asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>&> (__a=..., __p=0x555555c91cf0) at /usr/include/c++/9/bits/alloc_traits.h:483
#7  0x000055555572e95e in std::vector<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0>, std::allocator<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0> > >::_M_realloc_insert<std::vector<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0>, std::allocator<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0> > >&, asgard::fk::vector<double, (asgard::mem_type)2, (asgard::resource)0> const&, std::array<asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>, 2ul>&, asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>&> (this=0x7fffffffc950, __position=non-dereferenceable iterator for std::vector) at /usr/include/c++/9/bits/vector.tcc:449
#8  0x000055555572c862 in std::vector<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0>, std::allocator<asgard::batch_chain<double, (asgard::resource)0, (asgard::chain_method)0> > >::emplace_back<std::vector<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0>, std::allocator<asgard::fk::matrix<double, (asgard::mem_type)2, (asgard::resource)0> > >&, asgard::fk::vector<double, (asgard::mem_type)2, (asgard::resource)0> const&, std::array<asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>, 2ul>&, asgard::fk::vector<double, (asgard::mem_type)1, (asgard::resource)0>&> (this=0x7fffffffc950) at /usr/include/c++/9/bits/vector.tcc:121
#9  0x0000555555728662 in asgard::wavelet_to_realspace<double> (dims=std::vector of length 1, capacity 1 = {...}, wave_space=..., table=..., transformer=..., workspace=..., real_space=..., quad_mode=asgard::quadrature_mode::use_degree)
    at /home/svh/Documents/asgard/src/transformations.cpp:265
#10 0x000055555572828f in asgard::wavelet_to_realspace<double> (pde=..., wave_space=..., table=..., transformer=..., workspace=..., real_space=..., quad_mode=asgard::quadrature_mode::use_degree) at /home/svh/Documents/asgard/src/transformations.cpp:217
#11 0x0000555555569c6c in main (argc=5, argv=0x7fffffffd348) at /home/svh/Documents/asgard/src/main.cpp:190
mkstoyanov commented 4 weeks ago

We removed MATLAB plotting, now we plot using Python or Python-MATLAB integration.