/usr/share/doc/freefem++/examples/examples++-mpi/testsolver_dsuperlu_dist.edp is in freefem++-doc 3.19.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | load "dSuperLU_DIST"
// read parameter for superlu from file
verbosity=2;
{
matrix A =
[[ 1e16, 2, 2, 1, 1],
[ 2, 12, 0, 10 , 10],
[ 2, 0, 1e16, 0, 2],
[ 1, 10, 0, 22, 0.],
[ 1, 10, 2, 0., 22]];
real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); // xb(4),bbb(4);
b=A*xx;
cout << "b=" << b << endl;
cout << "xx=" << xx << endl;
set(A,solver=sparsesolver,datafilename="ffsuperlu_dist_fileparam.txt");
cout << "solving solution" << endl;
x = A^-1*b;
cout << "b=" << b << endl;
cout << "x=" << endl; cout << x << endl;
di = xx-x;
if(mpirank==0){
cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl;
}
}
// read parameter for superlu from string and
verbosity=2;
{
matrix A =
[[ 1e16, 2, 2, 1, 1],
[ 2, 12, 0, 10 , 10],
[ 2, 0, 1e16, 0, 2],
[ 1, 10, 0, 22, 0.],
[ 1, 10, 2, 0., 22]];
real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); // xb(4),bbb(4);
b=A*xx;
cout << "b=" << b << endl;
cout << "xx=" << xx << endl;
set(A,solver=sparsesolver,sparams="nprow=2,npcol=1,matrix=distributedglobal,ColPerm=MMD_AT_PLUS_A");
cout << "solving solution" << endl;
x = A^-1*b;
cout << "b=" << b << endl;
cout << "x=" << endl; cout << x << endl;
di = xx-x;
if(mpirank==0){
cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl;
}
}
|