/usr/include/freefem++/idp/MPIGMRESmacro.idp is in libfreefem++-dev 3.47+dfsg1-2build1.
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | // MPIGMRSmacro.idp file.. version 0.
// include in MPIGMRES.edp file ..
// Frederic Hecht 2010
// LGPL licence
// Author Frederic.Hecht@upmc.fr
// -------------------------------
// macro to def // send-recv message
// -----------------------------------
func real maxM(matrix & A)
{
int[int] I(1),J(1);
real[int] C(1);
[I,J,C] =A;
return C.max ;
}
macro InitU(n,Vh,Th,aTh,U)
Vh[int] U(n);
for(int j=0;j<n;++j)
{
Th=aTh[j];
U[j]=0;
}
//EOM
macro ISendRecvAny(comm,jpart,Si,Ri)
{ /* sorry no Irecv of complex objet ...*/
int n= jpart.n,nn=n+n;
if(vdebug) cout << mpirank << " --ISendRecvAny " << n << endl;
mpiRequest[int] rq(nn);
for (int j=0;j<n;++j)
Irecv(processor(jpart[j],comm,rq[j]),Ri[j]);
if(vdebug) cout << mpirank << " ++ISendRecvAny " << n << endl;
for (int j=0;j<n;++j)
Isend(processor(jpart[j],comm,rq[n+j]),Si[j]);
for (int j=0;j<nn;++j)
{
int k= mpiWaitAny(rq);
if(vdebug)
cout << " ++ISendRecvAny wait: get " << k << endl;
}
}
//EOM
macro SendRecvAny(comm,jpart,Si,Ri)
{ verbosity=200;
int n= jpart.n;
for (int j=0;j<n;++j)
processor(comm,jpart[j]) << Si[j];
cout << " ** wait revc " << endl;
for (int j=0;j<n;++j)
processor(comm,jpart[j]) >> Ri[j];
}
// EOM
macro CheckUV(comm,jpart,Si,Ri)
{
int ipart=mpiRank(comm);
int n= jpart.n;
int[int] rn(n),sn(n),in(n);
for (int j=0;j<n;++j)
{ sn[j]= Si[j][].n;
processor(jpart[j],comm) << sn[j];
processor(jpart[j],comm) << ipart;
}
for (int j=0;j<n;++j)
processor(jpart[j],comm) >> rn[j];
for (int j=0;j<n;++j)
processor(jpart[j],comm) >> in[j];
int err=0;
for (int j=0;j<n;++j)
{
int rj=Ri[j][].n;
err += rj != rn[j];
cout << rj << " s ========= r " << rn[j] << " " << ipart << " <-> " << in[j] << " " << err << endl;
}
assert(err==0);
}//EOM
macro SendRecvUV(comm,jpart,Si,Ri)
{
int n= jpart.n;
mpiRequest[int] rq(n);
for (int j=0;j<n;++j)
Irecv(processor(jpart[j],comm,rq[j]), Ri[j][]);
for (int j=0;j<n;++j)
processor(jpart[j],comm) << Si[j][];
/* for (int j=0;j<n;++j)
processor(jpart[j],comm) >> Ri[j][];*/
for (int j=0;j<n;++j)
int k= mpiWaitAny(rq);
}
// EOF
|