Dear FreeFEM developers:
I was converting the code to a parallel version using PETSc, but I found that the number of matrix components changed with the number of processors I used. The test code and results are shown below:
Test 1: ff-mpirun -np 1 test.edp -v 0. \quad Test results:
total: nonzeros=322, allocated nonzeros=322
Test 2: ff-mpirun -np 2 test.edp -v 0. \quad Test results:
total: nonzeros=50, allocated nonzeros=50
Test 3: ff-mpirun -np 4 test.edp -v 0. \quad Test results:
total: nonzeros=81, allocated nonzeros=81
From the above test results, we observe that the number of non-zero components of matrix B are depending on the number of processors used, while matrices A and C are fixed. The version of FreeFEM I used is 4.12.
I would appreciate it if anyone can help me or give me a hint. Thanks in advance.
The following is the test code:
load "PETSc" macro dimension() 2 // include "macro_ddm.idp" mesh Th = square(20, 20); mesh Thb = emptymesh(Th); buildDmesh(Th); buildDmesh(Thb); fespace Vh(Th, P2); fespace Vhb(Thb, P2); varf TemTran(u, uu) = int2d(Th) ( dx(u)*dx(uu)+dy(u)*dy(uu) ); varf matLag(vv, uu) = int1d(Thb, 1, 3)(vv*uu); Mat A; createMat(Th, A, P2); Mat C; createMat(Thb, C, P2); C = matLag(Vhb, Vhb); matrix vA = TemTran(Vh, Vh); A = vA; matrix vB = matLag(Vhb, Vh); Mat B(A, C, vB); ObjectView(B, format = "info"); cout<< endl << endl;