Hello,
I am writing to you because I encounter some problems using MUMPS for 3D simulations. The calculations themselves are fine but increasing the number of processors to solve my problem does not speed-up the solving of the system. It is even slower to go from 5 processors to 10 or 20 processors (with a 5-fold increase in calculation time between going from 5 to 20 processors).
I have seen on this forum that using PETSc could perhaps solve my problem, however I am using for my calculations a supercomputer on which I have no control on the implementation of FreeFEM and stuck with only MUMPS. I am giving you one of my test code to solve a simple thermal problem with a thermal power.
load "msh3"
load "iovtk"
load "medit"
load "MUMPS"
load "mmg"
int master = 0;
/*Création du domaine et maillage*/
/*Creation cylindre*/
mesh3 Th ;
int Dirichlet=3; int Neumann=2; int fixe=1; int interface=0;
int N=200;//20
real radius = 1. ;
real Longueur = 3.3 ;
border cc(t=0,2*pi){x=radius*cos(t);y=radius*sin(t);label=Dirichlet;}
mesh Th2= buildmesh(cc(N));
real z0=0. ;
real z1 = Longueur;
int[int] labelmidvec = [0,Dirichlet,1,Dirichlet,2,Dirichlet,3,Dirichlet];
int[int] labelupvec = [0,fixe,1,fixe,2,fixe,3,fixe];
int[int] labeldownvec = [0,fixe,1,fixe,2,fixe,3,fixe];
Th = buildlayers(Th2, N, zbound=[z0,z1],
labelmid=labelmidvec, labelup = labelupvec, labeldown = labeldownvec);
Th=change(Th,fregion= nuTriangle%mpisize);
/* Espaces éléments finis */
fespace ScalarField0(Th,P0);
fespace ScalarField1(Th,P1);
fespace ScalarField2(Th, P1);
/* Characteristic function and measure of the observation area */
real area = int3d(Th)(1.);
/*Variables fonctionnelles*/
ScalarField1 T; // Temperature
ScalarField1 Trenorm; // renormalized temperature
ScalarField1 v; // fonction test
/* Volume function */
macro volume(hr) (int3d(Th)(hr)) // EOM
// Operators
real sqrt2 = sqrt(2.);
// gradient 3D of scalar function
macro grad3D(u)[dx(u), dy(u),dz(u)] // EOM
varf heatvarf(Trenorm,v) =
int3d(Th,mpirank)((15. * grad3D(Trenorm))' * grad3D(v))
+ int3d(Th,mpirank)(1. * v)
+ on(3,Trenorm=0.);
matrix A = heatvarf(ScalarField1,ScalarField1);
set(A, solver = sparsesolver,master=-1);
real[int] bheat = heatvarf(0, ScalarField1);
Trenorm[] = A^-1 * bheat;
The command to launch the programm is :
mpirun -np N FreeFem++-mpi Thermic.edp
The code is based on the example MUMPS.edp on Github : https://github.com/FreeFem/FreeFem-sources/blob/master/examples/mpi/MUMPS.edp. Are there any improvements/changes I could make to this code to improve the speed-up or to reduce the construction and solving time of my system ?
Thank you !
PS : the DoF of my problem during my tests on this program was equal to 4198800.