Registered Member
|
I'm new to using SuperLU and do not consider myself very well versed in c or c++, but I do write and compile code in it for my research.
I'm totally stumped in my use of serial SuperrLU 4.3. The basic rundown of the problem is that I'm using the SuperLU solver within two loops, an outer time loop and an inner Newton-Raphson loop. The sparcity structure of the matrix I'm trying to solve does not change in either of these loops and is precomputed. I'm getting memory errors when I run the code and the particular location of the error is dependent on where and how I declare and free my SuperLU variables. In many instances, they code will run without errors for one or two NR loops, and then will crash with a memory error on a line of code it had already executed once or twice before! Can someone explain to me what SuperLU's built in StatFree(&stat), SUPERLU_FREE(), Destroy_CompCol_Matrix(&A), Destroy_SuperMatrix_Store(&A) and Destroy_SuperNode_Matrix(&A) work? Specifically, what is each freeing/destroying? For example, I use the following code inside the innermost loop:
perm_r, perm_c, a, and asub and created outside of all the loops options is created and set outside the loops In the case described above, the code will crash where StatInit(&stat) is called for the second time after running just fine the first time through the loop. Here is the GDB output, in case this helps: test(16548) malloc: *** error for object 0x100100798: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug Program received signal SIGABRT, Aborted. 0x00007fff885f00b6 in __kill () (gdb) where #0 0x00007fff885f00b6 in __kill () #1 0x00007fff886909f6 in abort () #2 0x00007fff8867f62d in szone_error () #3 0x00007fff885a68ed in tiny_malloc_from_free_list () #4 0x00007fff885a5abd in szone_malloc_should_clear () #5 0x00007fff885a598a in malloc_zone_malloc () #6 0x00007fff885a3c88 in malloc () #7 0x000000010000bc11 in intCalloc () at locale_facets.tcc:2578 #8 0x000000010000b827 in StatInit () at locale_facets.tcc:2578 #9 0x0000000100007f96 in main () at main.cpp:483 Any advice or help would be thoroughly appreciated. Even if you could point me to a resource that would help me understand this better. (BTW, I've already read the documentation the makers of SuperLU publish, and that didn't really clear it up for me.) |
Global Moderator
|
I have no idea on the topic, but generally for debugging non-trivial memory errors, running your program through valgrind (especially with the --track-origins=yes option) can be very helpful.
Cheers, Sven
I'm working on the KDevelop IDE.
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]