pghysels / STRUMPACK

Structured Matrix Package (LBNL)
http://portal.nersc.gov/project/sparse/strumpack/
Other
167 stars 40 forks source link

Can I use C Interface of strumpack-2.1.0 to solving a linear system with a matrix? #10

Open lljjgg opened 6 years ago

lljjgg commented 6 years ago

These days ,I use strumpack-2.1.0 to solving a linear system with a matrix.But I use Fortran program ago.So I may write a conversion interface between C++ and Fortran.This is very diffcult for me.I find that there are C interface but only have problem of solving the 2D Poisson.May the C interface can solving a linear system with a matrix.And the C interface can be used by my fortran program.Because I write conversion interface between C and Fortran may feasible. Looking forward to your reply。

pghysels commented 6 years ago

Hi lljjgg, Are you solving a linear system with a dense matrix? The 2.x.y version of strumpack does not yet have a C or fortran interface for the dense matrix algorithms (the HSS part), only a C interface for the sparse matrix solver. Developing these extra interfaces is on our TODO list.

lljjgg commented 6 years ago

sorry, I don't clearly describe the problem.First I solving a linear system with a sparse matrix.But this c interface with only thread no MPI.Can I revise this interface to use process(MPI)?

pghysels commented 6 years ago

Hi lljjgg,

The C interface to the sparse code also works for the MPI code. For instance when initializing a solver object with:

void STRUMPACK_init
  (STRUMPACK_SparseSolver* S, MPI_Comm comm, STRUMPACK_PRECISION precision,
   STRUMPACK_INTERFACE interface, int argc, char* argv[], int verbose);

You can pass STRUMPACK_MPI_DIST for the STRUMPACK_INTERFACE argument. Then you call

  void STRUMPACK_set_distributed_csr_matrix
  (STRUMPACK_SparseSolver S, const void* local_rows, const void* row_ptr,
   const void* col_ind, const void* values, const void* dist,
   int symmetric_pattern);

to specify a distrubuted CSR matrix. When calling the solve routine,

  STRUMPACK_RETURN_CODE STRUMPACK_solve
  (STRUMPACK_SparseSolver S, const void* b, void* x, int use_initial_guess);

you only pass the local part on each processor of the right-hand side b and the solution vector x.

Pieter

lljjgg commented 6 years ago

Thank you.I will try to write it.

lljjgg commented 6 years ago

Hi Pieter The parameters(dist,local_rows……) of routine (STRUMPACK_set_distributed_csr_matrix) is gived from an complate matrix by the routine ( CSRMatrixMPI<double,int64_t> Adist(&A, MPI_COMM_WORLD, false) ) in C++ interface. In the c interface,how I get this parameters?or some subroutine already haved been given this paramters.Looking forward to your reply.

pghysels commented 6 years ago

Hi,

You can call the routine:

  void STRUMPACK_set_csr_matrix
  (STRUMPACK_SparseSolver S, const void* N, const void* row_ptr,
   const void* col_ind, const void* values, int symmetric_pattern);

this works when only the root has the input matrix. It will distribute the sparse matrix over the available processes. The root has row_ptr and col_ind pointing to the actual data. The other processes can pass NULL for those pointers.

Pieter

lljjgg commented 6 years ago

Hi: In C++ interface,I can get n_local though Adist->local_rows();But when I use routine of STRUMPACK_set_distributed_csr_matrix.I need this parameters,but I don't know c routine don't get it.May some routine can get it?Looking forward to your reply.Thank you very much. lljjgg

pghysels commented 6 years ago

You have a good point. I did not think about that. You can distribute the matrix yourself, then you know n_local (and dist). And then you can call STRUMPACK_set_distributed_csr_matrix directly, iso STRUMPACK_set_csr_matrix.

I will make a note to add a routine in the C interface to redistribute from a sequential matrix to a distributed matrix. Or have the routine STRUMPACK_set_csr_matrix return the local number of rows, begin row, end row, etc. Pieter

lljjgg commented 6 years ago

I haved been write it.Thank you very much.

lljjgg commented 6 years ago

When solving a linear system with a matrix,I want to work in two steps.First I want to get L and U.Then give different right hand b get solution x.there is only once matrix analysis LU factorization.In this code, I only find routine of spss.solve(b.data(), x.data()) include matrix analysis , LU factorization and slove.Is there a separate routines that can get LU and get soution on the basis of LU? Happy Lantern Festival to you.

  lljjgg 
pghysels commented 6 years ago

Hi,

The routines are:

  STRUMPACK_RETURN_CODE STRUMPACK_reorder(STRUMPACK_SparseSolver S);
  STRUMPACK_RETURN_CODE STRUMPACK_factor(STRUMPACK_SparseSolver S);
  STRUMPACK_RETURN_CODE STRUMPACK_solve
  (STRUMPACK_SparseSolver S, const void* b, void* x, int use_initial_guess);

you can call them in this order. The reorder routine does some symbolic analysis of the matrix. The factor routine computes the LU factorization, and the solve routine does the triangular solves.

If you call solve, it will check whether factor was called first, and if not, it will call factor. Same if you call factor, it will check if reorder was called, if not, it will call that first. You can call solve multiple times without redoing factor if the matrix doesn't change.

lljjgg commented 6 years ago

I get it.Thank you very much

lljjgg commented 6 years ago

Hi: I have recently encountered a new problem and hope to get your help.I am installing the strumpack-2.1.0 in other computer.It is Successful,But When I run this program with mpi(There is no problem with one process),it report an error that Fatal error in PMPI_Comm_size: Invalid communicator, error stack: PMPI_Comm_size(112): MPI_Comm_size(comm=0x5b, size=0x833838) failed PMPI_Comm_size(71).: Invalid communicator I try to solve this problem but there no any progress in one week.Have you encountered similar problems?My compiler is gcc version 5.4.0 and mpicc for MPICH version 3.2.1 with gcc version 5.4.0.Math library is MKL 2015. look forward to your reply.Thank you. lljjgg

lljjgg commented 6 years ago

Hi: I try compiler strumpack-2.1.0 with other versions of MPI and other versions of mkl. But the mistake has never been solved.Is this related to the version of the system?I use Ubuntu16.4. I felt hopeless for this problem. look forward to your reply.Thank you.

pghysels commented 6 years ago

Hi,

Which test program are you running? With what options? Can you give me some more information so I can try to reproduce the problem?

You can try with the latest version of the git master branch.

Pieter

lljjgg commented 6 years ago

Hi, My test program is testMMdoubleMPIDist64.I didn't change any program.This is output of running problem. ` opening file 'pde900.mtx' %%MatrixMarket matrix coordinate real general reading 900 by 900 matrix with 4,380 nnz's from pde900.mtx Initializing STRUMPACK using 1 OpenMP thread using 4 MPI processes initial matrix:

And this is output of cmake

cmake ../ -DCMAKE_BUILD_TYPE=Release \

-DCMAKE_INSTALL_PREFIX=/NSFCGZ/nsfc2015_302/ganggang/str2.2install \ -DSTRUMPACK_USE_OPENMP=ON \ -DSCALAPACK_LIBRARIES="/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_scalapack_lp64.a;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_blacs_lp64.a" \ -DMETIS_INCLUDES=/NSFCGZ/nsfc2015_302/ganggang/metisinstall/include \ -DMETIS_LIBRARIES=/NSFCGZ/nsfc2015_302/ganggang/metisinstall/lib/libmetis.a \ -DSTRUMPACK_USE_PARMETIS=ON \ -DPARMETIS_INCLUDES=/NSFCGZ/nsfc2015_302/ganggang/parmetisinstall/include \ -DPARMETIS_LIBRARIES=/NSFCGZ/nsfc2015_302/ganggang/parmetisinstall/lib/libparmetis.a \ -DSTRUMPACK_USE_SCOTCH=OFF \ -- The CXX compiler identification is GNU 4.9.2 -- The C compiler identification is GNU 4.9.2 -- The Fortran compiler identification is GNU 4.9.2 -- Check for working CXX compiler: /NSFCGZ/app/gcc/4.9.2/bin/c++ -- Check for working CXX compiler: /NSFCGZ/app/gcc/4.9.2/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /NSFCGZ/app/gcc/4.9.2/bin/gcc -- Check for working C compiler: /NSFCGZ/app/gcc/4.9.2/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working Fortran compiler: /NSFCGZ/app/gcc/4.9.2/bin/gfortran -- Check for working Fortran compiler: /NSFCGZ/app/gcc/4.9.2/bin/gfortran -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether /NSFCGZ/app/gcc/4.9.2/bin/gfortran supports Fortran 90 -- Checking whether /NSFCGZ/app/gcc/4.9.2/bin/gfortran supports Fortran 90 -- yes -- Performing Test COMPILER_SUPPORTS_CXX14 -- Performing Test COMPILER_SUPPORTS_CXX14 - Success -- Found MPI_C: /usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so
-- Found MPI_CXX: /usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpicxx.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so
-- Found MPI_Fortran: /usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpifort.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so
-- Found C mpi compiler: /NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/bin/mpicc -- Found C++ mpi compiler: /NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/bin/mpicxx -- Found Fortran mpi compiler: /NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/bin/mpif90 -- Detecting Fortran/C Interface -- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling -- Verifying Fortran/CXX Compiler Compatibility -- Verifying Fortran/CXX Compiler Compatibility - Success -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP Fortran flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Found OpenMP: -fopenmp
-- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE
-- Found PTHREADS library -- Looking for Fortran sgemm -- Looking for Fortran sgemm - found -- A library with BLAS API found. -- Found BLAS library: /NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_intel_lp64.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_gnu_thread.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_core.so;/NSFCGZ/app/gcc/4.9.2/lib64/libgomp.so -- A library with BLAS API found. -- Looking for Fortran cheev -- Looking for Fortran cheev - found -- A library with LAPACK API found. -- Found LAPACK library: /NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_intel_lp64.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_gnu_thread.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_core.so;/NSFCGZ/app/gcc/4.9.2/lib64/libgomp.so;-lm -- Building STRUMPACK without PAPI support. -- Found PARMETIS: /NSFCGZ/nsfc2015_302/ganggang/parmetisinstall/include
-- Found METIS: /NSFCGZ/nsfc2015_302/ganggang/metisinstall/include
-- Found Metis library -- Building STRUMPACK without Scotch/PTScotch support. -- Linking with: /usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so;/usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpicxx.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so;/usr/lib64/libdl.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpifort.so;/NSFCGZ/app/MPICH/mpich3.1.3-gcc4.9.2/lib/libmpi.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_intel_lp64.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_gnu_thread.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_core.so;/NSFCGZ/app/gcc/4.9.2/lib64/libgomp.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_intel_lp64.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_gnu_thread.so;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_core.so;/NSFCGZ/app/gcc/4.9.2/lib64/libgomp.so;-lm;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_scalapack_lp64.a;/NSFCGZ/app/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_blacs_lp64.a;/NSFCGZ/nsfc2015_302/ganggang/parmetisinstall/lib/libparmetis.a;/NSFCGZ/nsfc2015_302/ganggang/metisinstall/lib/libmetis.a -- Implicit C libs: c -- Implicit CXX libs: stdc++;m;c -- Implicit Fortran libs: gfortran;m;quadmath;m;c -- Found Doxygen: /usr/bin/doxygen (found version "1.6.1") -- Configuring done -- Generating done -- Build files have been written to: /NSFCGZ/nsfc2015_302/ganggang/STRUMPACK-master/build

I try with the latest version of the git master branch,but there is same problem.

lljjgg commented 6 years ago

Hi I tried to find the function where the problem happend.I found that the problem may happened in TaskTimer t0("symbolic-factorization", [&](){ setup_tree(); }); But I didn't solve the prolem. Does this function call other libraries? perhaps the libraries which this function called were invalid.look forward to your reply.Thank you. lljjgg

pghysels commented 6 years ago

Hi lljjgg,

I tried to run the same test, with the latest version of the code in git. It works for me. I checked your CMake output. It seems correct, the MKL libraries seem ok.

The setup_tree() function does not call any external libraries. This is called after the reordering code (done with Metis), so the problem is not with Metis.

Can you try with -DCMAKE_BUILD_TYPE=Debug instead of Release? The error happens in MPI_Comm_size, which in the code is always called from

inline int mpi_nprocs(MPI_Comm c=MPI_COMM_WORLD) { assert(c != MPI_COMM_NULL); int nprocs; MPI_Comm_size(c, &nprocs); return nprocs; }

So compiling with Debug, might trigger the assertion. It could help to see when the assertion is triggered. Perhaps you could then also make a core dump?

Pieter

lljjgg commented 6 years ago

Hi I tried to find the function where the problem happend again.And I try with -DCMAKE_BUILD_TYPE=Debug instead of Release.There is a same problem.And I found that the problem may happened in front = new FDMPI_t(_local_pfronts.size(), dsep_begin, dsep_end,dsep_upd, front_comm, P); (in ElinminationTreeMPIDist.hpp); I guess the source of this mistake appear in if (_P>1) MPI_Comm_dup(this->_comm, &tree_comm); The Communication domain of tree_comm may have a bit of a problem .Can this function be implemented in other ways?There might be other better solutions? look forward to your reply.Thank you. lljjgg

pghysels commented 6 years ago

I will look into it. Thank you for reporting.

lljjgg commented 6 years ago

hi I feel so happy for your reply every time.And I hope it doesn't bother you.I will continue to try to solve this problem that may exists only to me.Thank you very much. look forward to your reply

pghysels commented 6 years ago

Hi,

Can you try again with the latest version of the master branch on git? I pushed many changes. The MPI_Comm is now encapsulated in a C++ object. This might fix your issue.

How do you run the code, how many threads/processes? I can run it fine with OMP_NUM_THREADS=1 mpirun -n 4 ./testMMdoubleMPIDist64 pde900.mtx

lljjgg commented 6 years ago

Hi. I try again with the latest version of the master branch on git. But the problem still exists. I found that
the problem happened in ctxt_ = scalapack::Csys2blacshandle(comm.comm());But I test the communication domain (comm_.comm()) with "MPI_Commsize(comm.comm(), &numprocs)".there is no problem.The function belongs to the math library of scalapack.Does this mean that the math library have problem that I'm calling.I use "mkl-15.0.1" and "mkl-18". I use threads with 1 and processes with 4. Do you have any other ideas or solutions? I hope it doesn't bother you. look forward to your reply,thank you

pghysels commented 6 years ago

Can you check whether you are using the same MPI version than the one used by MKL? Use the MKL link advisor: https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor to select the correct MPI version.

lljjgg commented 6 years ago

Hi: I slove it.Thank you very much.

pghysels commented 6 years ago

If you don't mind me asking, what was the problem?

lljjgg commented 6 years ago

Hi: I am fell so sorry,I didn't log in to the website recently.The problem is the produce need link libmkl_blacs_intelmpi_lp64.a.But my makefile don't link it. lljjgg

pghysels commented 5 years ago

Hi, lljjgg

Can you try to replace STRUMPACK_set_matching with STRUMPACK_set_mc64job

Pieter

On Sun, Oct 28, 2018 at 1:19 AM lljjgg notifications@github.com wrote:

Hi: Recently I want to write a Fortran interface of strumpack(zexample.c), but I have some problems.When I pass struct(spss) in subfunction( STRUMPACK_set_matching(spss, 0)).but it success in subfunction(STRUMPACK_init).Here is my code ` type,bind(C)::FSTRUMPACK_SparseSolver type(C_PTR) :: solver integer(C_INT) :: precision1 integer(C_INT) :: interface1 end type FSTRUMPACK_SparseSolver subroutine FSTRUMPACK_init & (FS,fcomm, fprecision,finterface, fargc, fargv,fverbose) & bind (C,name='FSTRUMPACK_init') import :: FSTRUMPACK_SparseSolver import :: C_PTR import :: C_INT implicit none type(FSTRUMPACK_SparseSolver) :: FS integer(C_INT), value :: fcomm integer(C_INT), value :: fprecision integer(C_INT), value :: finterface integer(C_INT), value :: fargc type(C_PTR), value :: fargv integer(C_INT), value :: fverbose end subroutine FSTRUMPACK_init

 subroutine FSTRUMPACK_set_matching &
 (FS,Fjob) &
 bind (C,name='STRUMPACK_set_matching')
 import :: FSTRUMPACK_SparseSolver
 import :: C_INT
 implicit none
 type(FSTRUMPACK_SparseSolver) :: FS
 integer(C_INT), value :: Fjob
end subroutine FSTRUMPACK_set_matching
type(FSTRUMPACK_SparseSolver) :: spss
call FSTRUMPACK_init(spss,MPI_COMM_WORLD, &
STRUMPACK_DOUBLECOMPLEX,STRUMPACK_MT,argc1,Cargv1,1)
call FSTRUMPACK_set_matching(spss,job)

` How do you fix this bug? I hope it doesn't bother you. look forward to your reply,thank you

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pghysels/STRUMPACK/issues/10#issuecomment-433685665, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab4pzjFGIMFPumxeSkO_BB92nW8wEoLCks5upWiegaJpZM4R1MDC .

lljjgg commented 5 years ago

Hi: I want compile this progran with icpc(intel compiler),but failed.I found that it need header file of GCC in the instructions, but I don't know how to add it.Can you tell me how to solve this problem?Thank you lljjgg

pghysels commented 5 years ago

Hi lljjgg,

On what type of machine are you working? Is there a module system? If yes, you can unload the GCC module and load a more recent version: module unload gcc module load gcc/7.2.0 (or something similar, preferable 5 or higher)

Otherwise you can try this solution: https://stackoverflow.com/questions/37122526/using-different-standard-c-library-headers-with-intel-compiler

Try adding -cxxlib=/path/to/your/g++/headers to -DCMAKE_CXX_FLAGS when running cmake.

Pieter

lljjgg commented 5 years ago

Hi: Now I compile the program in ubuntu16.04 with my own computer.If I don't set the compiler, it defaults to set GCC.So I set that
cmake ../ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/home/ganggang/cstrm-install \ -DCMAKE_CXX_COMPILER=icpc \ -DCMAKE_C_COMPILER=icc \ -DCMAKE_Fortran_COMPILER=ifort \ -DCMAKE_CXX_FLAGS=-cxxlib=/usr/include/c++/4.9 But there was a mistake. CMake Error: The source directory "/home/ganggang/luojiangang/STRUMPACK-master/ccbuild/-cxxlib=/usr/include/c++/4.9" does not exist. Sorry,May I don't understand your reply.I remove the setting of -DCMAKE_CXX_FLAGS=-cxxlib=/usr/include/c++/4.9.The cmake succeed but compilation still fails.and I find the compile of intel not detected to support C++ 11.Look forward your reply.Thank you. lljjgg

pghysels commented 5 years ago

Try adding quotes: cmake ../ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/home/ganggang/cstrm-install \ -DCMAKE_CXX_COMPILER=icpc \ -DCMAKE_C_COMPILER=icc \ -DCMAKE_Fortran_COMPILER=ifort \ -DCMAKE_CXX_FLAGS="-cxxlib=/usr/include/c++/4.9"

lljjgg commented 5 years ago

Hi: Recently I recently tested the HSS matrix compressed.But I found that the calculation time increased after I opened the compression.And I set the function of STRUMPACK_set_Krylov_solver is STRUMPACK_DIRECT.Is this phenomenon normal?Maybe some of my settings are not proper or Calculation time is related to the shape of the matrix..I hope you can answer my doubts.Thank you. lljjgg

lljjgg commented 5 years ago

Hi: Merry Christmas. lljjgg

pghysels commented 5 years ago

Hi Merry Christmas! Do you mean that the calculation time for the sparse solver increases when you enable HSS compression? This is possible yes. There is some overhead in the HSS compression, so it only pays off when the matrix is large enough, and when it actually compresses well into the HSS format. What type of problem are you trying to solve?

Have a look at the documentation here: http://portal.nersc.gov/project/sparse/strumpack/v3.1.0/HSS_Preconditioning.html for a description of the parameters that control the HSS compression in the sparse solver.

STRUMPACK_DIRECT means the solver is used as a direct but approximate solver. The final accuracy will depend on the HSS compression tolerance. When instead, you set this to STRUMPACK_PREC_GMRES or to STRUMPACK_AUTO the approximate solver with HSS compression is used as a preconditioner for GMRES. So then the final accuracy should be the tolerance specified for the iterative solver.

Pieter

lljjgg commented 5 years ago

Hi: I solved the problem of electromagnetic field.I tried changing the parameters. But the effect is not obvious.But The BLR is effective to my problem.And I am trying to adopt HODLR compress,but there is a problem that “Cannot bisect a graph with 0 vertices! ***You are trying to partition a graph into too many parts!”.Do you know how to solve this problem?In addition, I would like to ask whether the new version of the library can solve dense matrix?.Look forward your reply.Thank you. lljjgg

pghysels commented 5 years ago

Hi,

“Cannot bisect a graph with 0 vertices! .." can happen when you use too many processes, or the problem is too small. This error comes from the sparse matrix reordering (using METIS). You can try to use a different reordering, such as SCOTCH.

Yes, it can solve dense matrices. See here http://portal.nersc.gov/project/sparse/strumpack/master/dense_matrices.html

Pieter

lljjgg commented 5 years ago

Hi, I see what you mean,but the problem of “Cannot bisect a graph with 0 vertices only happened when I open HODLR compress.I guess that there is something wrong with the way I called the program.I only add a one-liner (spss.options().enable_HODLR()).And I will try to adopt SCOTCH.How is this method of HODLR called different from other methods?Look forward your reply.Thank you. lljjgg

pghysels commented 5 years ago

Hi, The HODLR support is still a work in progress. It should be usable in the near future. Pieter

lljjgg commented 5 years ago

Hi: thank you for your reply.In addition, I still have a question to ask you.Recently I tested a big example.But there is a error of "terminate called after throwing an instance of 'std::bad_array_new_length".I think it is caused by an array too large.Do you know the reason or the solution? lljjgg

pghysels commented 5 years ago

Hi, This sounds like a bug. Unfortunately, I can't say much without any further information. It could be a 32bit integer overflow, or a stack overflow (too many recursion levels, deep separator tree), or you might be running out of memory (although I think that should give a different error).

Can you give more info about your code? Is there any output? Can you generate a stack trace?