'/usr/bin/mpirun' --oversubscribe -np 1 /usr/local/bin/FreeFem++-mpi -nw elasticity-block.edp -- FreeFem++ v4.400004 (Mon Jan 27 22:40:12 CST 2020 - git v4.4-3-135-gc66cc179) Load: lg_fem lg_mesh lg_mesh3 eigenvalue parallelempi 1 : // run with MPI: ff-mpirun -np 1 script.edp 2 : // NBPROC 1 3 : load "hpddm" // HPDDM plugin 4 : load "medit" 5 : macro dimension()3// EOM // 2D or 3D 6 : include "macro_ddm.idp"include "getARGV.idp" // for gestion of FreeFem++ argument and in version 3.10-1 FH 2 : // F. Hecht 3 : // Usage: getARGV(n,defaultvalue) // get the fist used default valeu 4 : // or getARGV(after,defaultvalue) // get the arg after after 5 : // the type of delfaut value given the return type: int,double, string 6 : func int usedARGV(int n) 7 : { 8 : int k=1,ii=1,kk=1,ret=-1; 9 : for(int i=1;i=0;--i) 36 : if(ARGV[i]==after) { ret=++i; break;} 37 : if(ARGV.n0) d=atoi(ARGV[k]); 46 : return d; 47 : } 48 : func real getARGV(int n,real default) 49 : { 50 : real d=default; 51 : int k=usedARGV(n); 52 : if(k>0) d=atof(ARGV[k]); 53 : return d; 54 : } 55 : func string getARGV(int n,string default) 56 : { 57 : string d=default; 58 : int k=usedARGV(n); 59 : if(k>0) d=ARGV[k]; 60 : return d; 61 : } 62 : 63 : func int getARGV(string after,int default) 64 : { 65 : int d=default; 66 : int k=usedARGV(after); 67 : if(k>0) d=atoi(ARGV[k]); 68 : return d; 69 : } 70 : func real getARGV(string after,real default) 71 : { 72 : real d=default; 73 : int k=usedARGV(after); 74 : if(k>0) d=atof(ARGV[k]); 75 : return d; 76 : } 77 : func string getARGV(string after,string default) 78 : { 79 : string d=default; 80 : int k=usedARGV(after); 81 : if(k>0) d=ARGV[k]; 82 : return d; 83 : } 84 : 85 : /* 86 : cout << getARGV(1,100) << endl; 87 : cout << getARGV(2,200.) << endl; 88 : cout << getARGV(3,"300.000") << endl; 89 : cout << getARGV("-n"," xxx") << endl; 90 : */ 91 : 2 : searchMethod = 1; 3 : 4 : macro bb2(boundingMesh, overshoot, ThGlobal) 5 # real[int] bb(4); 6 # boundingbox(bb, boundingMesh); 7 # bb(0) -= overshoot; 8 # bb(1) += overshoot; 9 # bb(2) -= overshoot; 10 # bb(3) += overshoot; 11 # 12 # ThGlobal = trunc(ThGlobal, (x >= bb(0) && x <= bb(1) && y >= bb(2) && y <= bb(3))); ) // EOM 13 : 14 : macro bb3(boundingMesh, overshoot, ThGlobal) 15 # real[int] bb(6); 16 # boundingbox(bb, boundingMesh); 17 # bb(0) -= overshoot; 18 # bb(1) += overshoot; 19 # bb(2) -= overshoot; 20 # bb(3) += overshoot; 21 # bb(4) -= overshoot; 22 # bb(5) += overshoot; 23 # 24 # ThGlobal = trunc(ThGlobal, (x >= bb(0) && x <= bb(1) && y >= bb(2) && y <= bb(3) && z >= bb(4) && z <= bb(5))); ) // EOM 25 : 26 : macro plotMPI(Th, u, legend, Pk, def, K, d, w) 27 # if(mpirank == 0) { 28 # meshN ThCurrent = Th; 29 # meshN[int] meshTab(mpisize); 30 # fespace Xh(ThCurrent, Pk); 31 # Xh[int] def(uTab)(mpisize); 32 # uTab[0][] = u; 33 # meshTab[0] = Th; 34 # mpiRequest[int] rq(mpisize - 1); 35 # for(int i = 1; i < mpisize; ++i) 36 # Irecv(processor(i, mpiCommWorld, rq[i - 1]), meshTab[i]); 37 # for(int i = 1; i < mpisize; ++i) 38 # mpiWaitAny(rq); 39 # for(int i = 1; i < mpisize; ++i) { 40 # ThCurrent = meshTab[i]; 41 # Irecv(processor(i, mpiCommWorld, rq[i - 1]), uTab[i][]); 42 # } 43 # for(int i = 1; i < mpisize; ++i) 44 # mpiWaitAny(rq); 45 # plot(uTab, wait = w, nbiso = 40, fill = 1, value = 1, dim = d, cmm = legend); 46 # } 47 # else { 48 # mpiRequest[int] rq(2); 49 # Isend(processor(0, rq[0]), Th); 50 # Isend(processor(0, rq[1]), u); 51 # mpiWait(rq[0]); 52 # mpiWait(rq[1]); 53 # } ) // EOM 54 : 55 : macro partition(meshName, borderName, globalName, PhGlobal, part, s, overlap, D, Wh, P, arrayIntersection, restrictionIntersection, comm, fakeInterface) 56 # meshName = trunc(globalName, abs(part - mpiRank(comm)) < 0.1, label = fakeInterface); 57 # mpiBarrier(comm); 58 # real timerPartition = mpiWtime(); 59 # { 60 # fespace PhLocal(meshName, P0); 61 # PhLocal overshoot = hTriangle; 62 # real max = 2.0 * overlap * overshoot[].max; 63 # bbN(meshName, max, globalName) 64 # } 65 # fespace VhGlobal(globalName, P1); 66 # PhGlobal supp = abs(part - mpiRank(comm)) < 0.1; 67 # VhGlobal suppSmooth; 68 # AddLayers(globalName, supp[], 2 * overlap, suppSmooth[]); 69 # { 70 # meshN neighbors = trunc(globalName, suppSmooth > 0.001 && suppSmooth < 0.999); 71 # fespace Oh(neighbors, P0); 72 # Oh partOverlap = part; 73 # Unique(partOverlap[], arrayIntersection); 74 # } 75 # fespace VhLocal(meshName, P1); 76 # VhLocal[int] partitionIntersection(arrayIntersection.n); 77 # if(s > 1) { 78 # globalName = trunc(globalName, suppSmooth > 0.001, split = s); 79 # supp = abs(part - mpiRank(comm)) < 0.1; 80 # suppSmooth = 0; 81 # AddLayers(globalName, supp[], 2 * overlap, suppSmooth[]); 82 # } 83 # globalName = trunc(globalName, suppSmooth > 0.001); 84 # supp = supp; 85 # suppSmooth = suppSmooth; 86 # meshName = trunc(globalName, suppSmooth > 0.501, label = fakeInterface); 87 # borderName = trunc(globalName, (suppSmooth > (overlap - 0.999) / (2 * overlap)) && (suppSmooth < 0.501), label = (abs(fakeInterface) + 1) * 100); 88 # VhLocal khi = max(2 * suppSmooth - 1.0, 0.0); 89 # VhLocal sum = khi; 90 # VhGlobal phi = 0; 91 # real eps = intN(globalName)(1.0); 92 # part = part; 93 # int numberIntersection = 0; 94 # for(int i = 0; i < arrayIntersection.n; ++i) { 95 # PhGlobal suppPartition = abs(arrayIntersection[i] - part) < 0.1; 96 # AddLayers(globalName, suppPartition[], overlap, phi[]); 97 # real intersection = intN(globalName)(phi) / eps; 98 # if(intersection > 1.0e-6) { 99 # partitionIntersection[numberIntersection] = phi; 100 # sum[] += partitionIntersection[numberIntersection][]; 101 # arrayIntersection[numberIntersection++] = arrayIntersection[i]; 102 # } 103 # } 104 # khi[] = khi[] ./= sum[]; 105 # if(numberIntersection != arrayIntersection.n) 106 # arrayIntersection.resize(numberIntersection); 107 # Wh def(func2vec) = init(khi); 108 # D.resize(Wh.ndof); 109 # D = func2vec[]; 110 # restrictionIntersection.resize(numberIntersection); 111 # for(int i = 0; i < numberIntersection; ++i) { 112 # meshN meshIntersection = trunc(meshName, partitionIntersection[i] > 1.0e-6); 113 # fespace WhIntersection(meshIntersection, P); 114 # matrix R = interpolate(WhIntersection, Wh); 115 # real[int] C; 116 # int[int] I; 117 # [I, restrictionIntersection[i], C] = R; 118 # restrictionIntersection[i].resize(R.nbcoef); 119 # } ) // EOM 120 : 121 : macro build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded) 122 # { 123 # real timing = mpiWtime(); 124 # if(mpisize > 1 && !excluded) { 125 # fespace PhGlobal(ThGlobal, P0); 126 # PhGlobal part; 127 # if(mpiRank(comm) == 0) { 128 # if(verbosity > 0) 129 # cout.scientific << " --- global mesh of " << ThGlobal.nt << " elements (prior to refinement) generated (in " << mpiWtime() - timing << ") and partitioned with "; 130 # timing = mpiWtime(); 131 # if(partitioner == 2) { 132 # scotch(part[], ThGlobal, mpiSize(comm)); 133 # if(verbosity > 0) 134 # cout << "SCOTCH"; 135 # } 136 # else { 137 # metisdual(part[], ThGlobal, mpiSize(comm)); 138 # if(verbosity > 0) 139 # cout << "Metis"; 140 # } 141 # if(verbosity > 0) 142 # cout.scientific << " (in " << mpiWtime() - timing << ")" << endl; 143 # } 144 # timing = mpiWtime(); 145 # broadcast(processor(0, comm), part[]); 146 # partition(Th, ThBorder, ThGlobal, PhGlobal, part, s, overlap, D, Wh, P, arrayIntersection, restrictionIntersection, comm, fakeInterface) 147 # } 148 # else if(mpisize == 1) { 149 # Th = ThGlobal; 150 # D.resize(Wh.ndof); 151 # D = 1.; 152 # } 153 # mpiBarrier(mpiCommWorld); 154 # if(verbosity > 0 && mpirank == 0) cout.scientific << " --- partition of unity built (in " << mpiWtime() - timing << ")" << endl; 155 # } ) // EOM 156 : // additional DDM functions 7 : 8 : macro def(i)[i, i#B, i#C] ) // EOM // vector field definition 9 : macro init(i)[i, i, i] ) // EOM // vector field initialization 10 : /*# DiffMacros #*/ 11 : real Sqrt = sqrt(2.0); 12 : macro epsilon(u)[dx(u), dy(u#B), dz(u#C), (dz(u#B) + dy(u#C)) / Sqrt, (dz(u) + dx(u#C)) / Sqrt, (dy(u) + dx(u#B)) / Sqrt] ) // EOM 13 : macro div(u)(dx(u) + dy(u#B) + dz(u#C)) ) // EOM 14 : /*# DiffMacrosEnd #*/ 15 : func Pk = [P1, P1, P1]; // finite element space 16 : 17 : /*# DDMoptions #*/ 18 : int s = getARGV("-split", 1); // refinement factor 19 : 20 : int[int] LL = [2,3, 2,1, 2,2]; 21 : meshN The Identifier meshN does not exist Error line number 21, in file elasticity-block.edp, before token meshN current line = 20 mpirank 0 / 1 Compile error : line number :21, meshN error Compile error : line number :21, meshN code = 1 mpirank: 0 ------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code.. Per user-direction, the job has been aborted. ------------------------------------------------------- -------------------------------------------------------------------------- mpirun detected that one or more processes exited with non-zero status, thus causing the job to be terminated. The first process to do so was: Process name: [[28704,1],0] Exit code: 1 --------------------------------------------------------------------------