FreeFem++ petsc ubuntu

Hello everyone, I am a FreeFem++ learner. Recently, I encountered the issue of FreeFem++ code running very slowly on my CPU. Therefore, I wanted to try using PETSc to accelerate it (on a Linux system). I followed the tutorial on GitHub, but I failed.

Then, I try install the binary package.
Now I can output the correct results by using command FreeFem++ -nw file.edp, but I don’t know how to run diffusion-2d-PETSc.edp or diffusion-2d.edp like this in hpddm file. Please help me!!!

https://github.com/FreeFem/FreeFem-sources/tree/master/examples

You both compiled FreeFEM sources and installed the binary package? That’s not ideal. You’ll need to remove one of the installation before going further.

I failed in compiling FreeFEM sources, so I installed the binary package. Do I need to remove FreeFEM sources? I don’t know how to do it.

You should just remove the folder of the sources.

Yes, I have removed the corresponding folder. But the question I want to ask is:
Now I can output the correct results by using command FreeFem++ -nw file.edp, but I don’t know how to run diffusion-2d-PETSc.edp or diffusion-2d.edp like this in hpddm folder. Please help me!!!

https://github.com/FreeFem/FreeFem-sources/tree/master/examples

You need to use ff-mpirun.

Thank you very much, professor. I tried using command ff-mpirun for diffusion-2d-PETSc.edp and diffusion-2d.edp, but what should I set the number of mpi processes - np to?

Whatever you decide.

Yes, but it will output a reminder of memory leak every time. Does this have any impact?

######## We forget of deleting   0 Nb pointer,   0Bytes  ,  mpirank 1, memory leak =110992
 CodeAlloc : nb ptr  7859,  size :698024 mpirank: 1
times: compile 0.035767s, execution 0.111224s,  mpirank:2
 ######## We forget of deleting   0 Nb pointer,   0Bytes  ,  mpirank 2, memory leak =219216
 CodeAlloc : nb ptr  7859,  size :698024 mpirank: 2

times: compile 4.819200e-02s, execution 1.103700e-02s,  mpirank:0
 ######## We forget of deleting   0 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =304368
 CodeAlloc : nb ptr  7859,  size :698024 mpirank: 0
Ok: Normal End
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
There is one unused database option. It is:
Option left: name:-nw value: examples/hpddm/diffusion-2d-PETSc.edp source: command line
times: compile 0.035693s, execution 0.111251s,  mpirank:3
 ######## We forget of deleting   0 Nb pointer,   0Bytes  ,  mpirank 3, memory leak =219808
 CodeAlloc : nb ptr  7859,  size :698024 mpirank: 3

I don’t know, you tell me.