Segfault when using several independent spm matrices on different MPI processes and replicated = 0
In composyx we need to solve independent linear systems on each MPI process. To do that we tried to initialize spm as follows :
_spm = (spmatrix_t*)malloc(sizeof(spmatrix_t));
spmInitDist(_spm, MPI_COMM_SELF);
_spm->replicated = 0;
but we got the following segfault in spm :
Thread 1 "composyx_simple" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e4e6bf in d_spmMergeDuplicate (spm=<optimized out>) at /home/florent/git/solverstack/pastix/build/spm/src/d_spm_mergeduplicate.c:76
76 jg = spm->replicated ? jl : *loc2glob - baseval;
(gdb) bt
#0 0x00007ffff7e4e6bf in d_spmMergeDuplicate (spm=<optimized out>) at /home/florent/git/solverstack/pastix/build/spm/src/d_spm_mergeduplicate.c:76
#1 0x00007ffff7e54825 in spmMergeDuplicate (spm=spm@entry=0x7fffffffb3a0) at /home/florent/git/solverstack/pastix/spm/src/spm.c:812
#2 0x00007ffff7e54b82 in spmCheckAndCorrect (spm_in=0x555555841810, spm_out=0x7fffffffb4f0) at /home/florent/git/solverstack/pastix/spm/src/spm.c:906
#3 0x00005555555b348f in composyx::Pastix<composyx::SparseMatrixCOO<double, int>, composyx::DenseMatrix<double, 1> >::set_matrix (this=0x55555584a908, A=...)
at /home/florent/git/composyx/composyx-private/include/composyx/solver/Pastix.hpp:292
#4 0x00005555555acf7f in composyx::Pastix<composyx::SparseMatrixCOO<double, int>, composyx::DenseMatrix<double, 1> >::setup (this=0x55555584a908, A=...)
at /home/florent/git/composyx/composyx-private/include/composyx/solver/Pastix.hpp:373