HPDDM and Block-CG solver example

Hi, I really want to test the Block-CG method through HPDDM. I know that in FreeFem++ we can use all the features of HPDDM and it is mentioned in the tutorial that HPDDM has a Block-CG method. But I didn’t see any examples of it. Did I miss something? Or anyone can tell me where to start with?

You can have a look at this example for solving problems with multiple RHS. You need to concatenate one after the other in a single FreeFEM vector, then call ^-1 as usual. By default, this example use a pseudo-block GMRES. If you want to try BCG or BFBCG, please switch to a symmetric preconditioner -hpddm_schwarz_method asm, and then also turn on the correct option, -hpddm_krylov_method bfbcg. See more about these options in the last page of the HPDDM cheatsheet.

About your issue with BLAS/LAPACK and PETSc compilation, you can now remove your reference installation, pull the develop branch, and relaunch the compilation. If there is no available BLAS, I’ve made the necessary changes so that PETSc compiles it for you as well, cf. this recent commit.

Thanks for the hint!

About the compilation, I tried to reinstall the develop branch, but it’s still not working.
When I ‘make check’, it passes all the testing examples, but when I input ‘FreeFem++’,it show:

freeglut (ffglut): failed to open display ‘’

Also when I install FreeFem+±cs, and run ‘FreeFem+±cs’, it shows errors:
Can’t open display:

  • ffloader: error: main(): run: unix: system(/home/ylnz7/FreeFem+±cs_18.1/Contents/Linux/FreeFem+±gui -MainPath /home/ylnz7/FreeFem+±cs_18.1 ): returned with error code 1

which never happened before.

config.log (356.5 KB)

Yes, you don’t have a X server on your machine, or at least FreeFEM ./configure can’t find it. This means that you cannot use ffglut.

Hi,

I figured out the previous problem is caused by some errors in my Ubuntu system and it was fixed. Now new compilation errors show up. Could you please tell me if you have any ideas. Thank you very much!

configure:   freefem++ used download: yes 
configure:   --  Dynamic load facility: yes 
configure:   --  ARPACK (eigen value): yes 
configure:   --  UMFPACK (sparse solver): yes 
configure:   --  BLAS: yes 
configure:   --  with MPI:     yes
configure:     --  with PETSC: yes / PETSC complex: yes 
configure:     --  with SLEPC: yes / SLEPC complex: yes 
configure:     --  with hpddm: yes (need MPI & c++11: yes) 
configure:     --  with htool: yes (need MPI & c++11: yes) 
configure:   --  without libs:  
configure:   --  without plugin:  
configure:     progs: FreeFem++-nw bamg cvmsh2  FreeFem++-mpi ffmedit ffglut 
configure:       use of download freeyams  see 3rdparty/yams/freeyams.2011.02.22 (suface mesh adaptation)  
configure:       use of download mmg3d (v4)   see 3rdparty/mmg3d/mmg3d4/LICENCE.txt  
configure:       use of download mmg  
configure:       use of download parmmg  
configure:       try to download: htool yams mshmet parmmg mmg mmg3d 
configure:       Please run "3rdparty/getall" to download all necessary packages before running make

I don’t see any compilation error.

But I still got the following error when I try to run the above mentioned sample code:

-- FreeFem++ v4.400004 (Mon Jan 27 22:40:12 CST 2020 - git v4.4-3-135-gc66cc179)
 Load: lg_fem lg_mesh lg_mesh3 eigenvalue 
    1 : //  run with MPI:  ff-mpirun -np 1 script.edp
    2 : // NBPROC 1
    3 : 
    4 : load "hpddm"
Load error: hpddm
	 fail: 
 dlerror : /usr/local/lib/ff++/4.4-4/lib/hpddm.so: cannot open shared object file: No such file or directory
list prefix: '/usr/lib/freefem++/' './' '/usr/local/lib/ff++/4.4-4/lib/' list suffix: '' , '.so' 
  current line = 4
Load error : hpddm
	line number :4, hpddm
error Load error : hpddm
	line number :4, hpddm
 code = 2 mpirank: 0

Is there a file /usr/local/lib/ff++/4.4-4/lib/hpddm.so in your installation?
If so, could you please launch the code with 1 process and the added flags -ns -v 100, and send the full log, please.
If the file is not present, you have an incomplete FreeFEM installation.

The hpddm.so is not in the dir: /usr/local/lib/ff++/4.4-4/lib/hpddm.so
but it is in the dir: /usr/local/lib/ff++/4.4-4/lib/mpi/hpddm.so
Does that mean an incomplete installation?

You need to use FreeFem++-mpi, not FreeFem++.

I tried then got:

   21 : int[int] LL = [2,3, 2,1, 2,2];
   22 : meshN The Identifier meshN does not exist 

 Error line number 22, in file elasticity-block.edp, before  token meshN

  current line = 21 mpirank 0 / 1
Compile error : 
	line number :22, meshN
error Compile error : 
	line number :22, meshN
 code = 1 mpirank: 0

Could you please send the result of ff-mpirun -np 1 elasticity-block.edp > dump.log?
If dimension is set to 3, as done here, then meshN should be set to mesh3, so I don’t quite understand the error you get.

Please check!
dump.log (12.4 KB)

There is something seriously wrong with your macro_ddm.idp, looks like a version from at least two years ago. Do you have an older version of FreeFEM lying around on your machine? Please make sure that the .idp you are loading is indeed the one as available here.

Actually, I can run the example in the dir:

~/FreeFem-sources/examples/hpddm$

and it normally end
but I cannot if run it in the following dir or others like ~/examples:
/usr/local/share/FreeFEM/4.4-4/examples/hpddm

You need to setup a proper .freefem++.pref to load the correct libraries and .idp, cf. the documentation.