Tue Feb 9 12:06:26 EST 2016 FREEFEM_MPI Run FreeFem++-MPI, with two processes, on the schwarz_mpi.edp input file. initparallele rank 0 on 2 -- FreeFem++ v 3.420000 (date Mon Feb 8 15:16:00 EST 2016) Load: lg_fem lg_mesh lg_mesh3 eigenvalue parallelempi 1 : // Discussion: 2 : // 3 : // This script is intended as a simple test for the MPI version of 4 : // FreeFem++. It implements the Schwarz method in parellel, using 5 : // just two processes. 6 : // 7 : // Location: 8 : // 9 : // http://people.sc.fsu.edu/~jburkardt/freefem++/schwarz_mpi/schwarz_mpi.edp 10 : // 11 : // Licensing: 12 : // 13 : // This code is distributed under the GNU LGPL license. 14 : // 15 : // Modified: 16 : // 17 : // 03 February 2016 18 : // 19 : // Author: 20 : // 21 : // Frederic Hecht 22 : // 23 : // Reference: 24 : // 25 : // Frederic Hecht, 26 : // Freefem++, 27 : // Third Edition, version 3.22 28 : // 29 : cout << "\n"; 30 : cout << "SCHWARZ_MPI\n"; 31 : cout << " Schwarz method in parallel, using two processes ... : .\n"; 32 : 33 : if ( mpisize != 2 ) 34 : { 35 : cout << "\n"; 36 : cout << "SCHWARZ_MPI - Fatal error!\n"; 37 : cout << " Number of processors is not 2!\n"; 38 : exit ( 1 ); 39 : } 40 : 41 : verbosity=3; 42 : // 43 : // Region labels. 44 : // 45 : int interior = 2; 46 : int exterior = 1; 47 : // 48 : // Define the border. 49 : // 50 : border a ( t = 1, 2 ) { x = t; y = 0; label = exterior; }; 51 : border b ( t = 0, 1 ) { x = 2; y = t; label = exterior; }; 52 : border c ( t = 2, 0 ) { x = t; y = 1; label = exterior; }; 53 : border d ( t = 1, 0 ) { x = 1 - t; y = t; label = interior; }; 54 : border e ( t = 0, pi/2 ) { x = cos ( t ); y = sin(t); label = interior; }; 55 : border e1 ( t = pi/2, 2*pi ) { x = cos ( t ); y = sin(t); label = exterior; }; 56 : // 57 : // Create a mesh Th. 58 : // Process 0 meshes a+b+c+d. 59 : // Process 1 meshes e+e1. 60 : // 61 : int n = 4; 62 : mesh[int] Th(mpisize); 63 : if ( mpirank == 0 ) 64 : { 65 : Th[0] = buildmesh ( a(5*n) + b(5*n) + c(10*n) + d(5*n) ); 66 : } 67 : else 68 : { 69 : Th[1] = buildmesh ( e(5*n) + e1(25*n) ); 70 : } 71 : // 72 : // Broadcast each mesh to all other processes. 73 : // 74 : broadcast ( processor(0), Th[0] ); 75 : broadcast ( processor(1), Th[1] ); 76 : // 77 : // Process 0 plots the mesh. 78 : // 79 : if ( mpirank == 0 ) 80 : { 81 : plot ( Th[0], Th[1], ps = "schwarz_mpi_mesh.eps" ); 82 : } 83 : // 84 : // Define the finite element spaces on this process and "the other" process. 85 : // 86 : fespace Vh ( Th[ mpirank], P1 ); 87 : fespace Vhother ( Th[1-mpirank], P1 ); 88 : 89 : Vh u=0.0; 90 : Vh v; 91 : Vhother U=0.0; 92 : 93 : int i = 0; 94 : 95 : problem pb ( u, v, init = i, solver = Cholesky ) = 96 : int2d ( Th[mpirank] ) ( dx(u) * dx(v) + dy(u) * dy(v) ) 97 : + int2d ( Th[mpirank] ) ( -v ) 98 : + on ( interior, u = U ) 99 : + on ( exterior, u = 0.0 ); 100 : 101 : for ( i = 0; i < 20; i++ ) 102 : { 103 : cout << mpirank << " loop " << i << endl; 104 : 105 : pb; 106 : // 107 : // Send the contents of u to the other process. 108 : // Receive in U the solution computed in the other process. 109 : // 110 : processor(1-mpirank) << u[]; 111 : processor(1-mpirank) >> U[]; 112 : 113 : real err0; 114 : real err1; 115 : err0 = int1d ( Th[mpirank], interior ) ( square ( U - u ) ); 116 : // 117 : // send err0; 118 : // receive err1. 119 : // 120 : processor(1-mpirank) << err0; 121 : processor(1-mpirank) >> err1; 122 : SCHWARZ_MPI Schwarz method in parallel, using two processes. 123 : real err = sqrt ( err0 + err1 ); 124 : 125 : cout << " err = " << err Begin: ConstGeometry from nb Border 2 126 : << " err0 = " << err0 127 : << " err1 = " << err1 << endl; 128 : 129 : if ( err < 1.0e-03 ) 130 : { 131 : break; 132 : } 133 : }; 134 : // 135 : // Process 0 plots the solution. 136 : // Geom: min=[-0.999877,-0.999877]max =[1,1] 137 : if ( mpirank == 0 ) 138 : { hmin = 3.72506e-09 139 : plot ( u, U, ps = "schwarz_mpi_u.eps" ); 140 : } 141 : // 142 : // Terminate. Nb of common points 2 143 : // 144 : cout << "\n"; 145 : cout << "SCHWARZ_MPI:\n"; 146 : cout << " Normal end of execution.\n"; 147 : 148 : sizestack + 1024 =1816 ( 792 ) SCHWARZ_MPI Schwarz method in parallel, using two processes. Begin: ConstGeometry from nb Border 4 Geom: min=[0,0]max =[2,1] hmin = 3.72529e-09 Nb of common points 4 -- Insert initial 120 vertices -- ForceBoundary nb of edge 120 -- Insert initial 100 vertices -- Find all internal sub-domain Nb of Sub borned Domain = 1 NbOutTriangles = 120 -- ForceBoundary nb of edge 100 -- Find all internal sub-domain Nb of Sub borned Domain = 1 NbOutTriangles = 100 -- Triangles::NewPoints Nb Of Vertices =633 Nb of triangles = 1164 NbSwap final = 0 Nb Total Of Swap = 1746 -- mesh: Nb of Triangles = 1164, Nb of Vertices 633 Nb of Vertices 633 , Nb of Triangles 1164 Nb of edge on user boundary 100 , Nb of edges on true boundary 100 number of real boundary edges 100 -- Mesh: Gibbs: old skyline = 97522 new skyline = 13029 MPI Bcast (mesh *) 0x309c680 mesh Serialized : 32504 1164 633 100 size to bcast : 32504 mpirank : 0 -- Triangles::NewPoints Nb Of Vertices =1061 Nb of triangles = 2000 NbSwap final = 0 Nb Total Of Swap = 3524 -- mesh: Nb of Triangles = 2000, Nb of Vertices 1061 Nb of Vertices 1061 , Nb of Triangles 2000 Nb of edge on user boundary 120 , Nb of edges on true boundary 120 number of real boundary edges 120 -- Mesh: Gibbs: old skyline = 254282 new skyline = 36146 MPI Bcast (mesh *) 0 size to bcast : 32504 mpirank : 1 MPI Bcast (mesh *) 0 mesh serialized : 32504 1164 633 100 End of un serialize: area on mesh = 1.5 Nb of Vertices 633 , Nb of Triangles 1164 Nb of edge on user boundary 100 , Nb of edges on true boundary 100 number of real boundary edges 100 MPI Bcast (mesh *) 0x164f5b0 mesh Serialized : 54680 2000 1061 120 size to bcast : 54680 mpirank : 0 size to bcast : 54680 mpirank : 1 mesh serialized : 54680 2000 1061 120 FESpace: Nb Of Nodes = 1061 Nb of DF = 1061 FESpace: Nb Of Nodes = 633 Nb of DF = 633 End of un serialize: area on mesh = 3.13991 -- vector function's bound 0 0 -- vector function's bound 0 0 1 loop 0 Problem(): initmat 1 VF (discontinuous Galerkin) = 0 Nb of Vertices 1061 , Nb of Triangles 2000 Nb of edge on user boundary 120 , Nb of edges on true boundary 120 -- size of Matrix 4340 Bytes skyline =1 -- discontinous Galerkin =0 size of Mat =4340 Bytes number of real boundary edges 120 Plot bound [x,y] -0.999906 -0.999906 max [x,y] 2 1 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 2.18559e-32 max 0.249892 FESpace: Nb Of Nodes = 633 Nb of DF = 633 FESpace: Nb Of Nodes = 1061 Nb of DF = 1061 -- vector function's bound 0 0 -- vector function's bound 0 0 0 loop 0 Problem(): initmat 1 VF (discontinuous Galerkin) = 0 -- size of Matrix 2628 Bytes skyline =1 -- discontinous Galerkin =0 size of Mat =2628 Bytes -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 3.2567e-65 max 0.0949787 err = 0.119172 err0 = 0.00249685 err1 = 0.0117052 1 loop 1 err = 0.119172 err0 = 0.0117052 err1 = 0.00249685 0 loop 1 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.79102e-63 max 0.124832 -- Solve : min 2.23119e-32 max 0.258194 err = 0.0573511 err0 = 0.000827449 err1 = 0.0024617 err = 0.0573511 err0 = 0.0024617 err1 = 0.000827449 1 loop 2 0 loop 2 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.82284e-63 max 0.15581 -- Solve : min 2.2611e-32 max 0.26784 err = 0.0338021 err0 = 0.000236904 err1 = 0.000905677 1 loop 3 err = 0.0338021 err0 = 0.000905677 err1 = 0.000236904 0 loop 3 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.85508e-63 max 0.188525 -- Solve : min 2.26832e-32 max 0.270668 err = 0.0185983 err0 = 9.09831e-05 err1 = 0.000254913 0 loop 4 err = 0.0185983 err0 = 0.000254913 err1 = 9.09831e-05 1 loop 4 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.86586e-63 max 0.197845 -- Solve : min 2.27583e-32 max 0.273642 err = 0.0114934 err0 = 3.26066e-05 err1 = 9.9492e-05 1 loop 5 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 err = 0.0114934 err0 = 9.9492e-05 err1 = 3.26066e-05 0 loop 5 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.87705e-63 max 0.207746 -- Solve : min 2.27815e-32 max 0.274581 err = 0.00703283 err0 = 1.35297e-05 err1 = 3.5931e-05 0 loop 6 err = 0.00703283 err0 = 3.5931e-05 err1 = 1.35297e-05 1 loop 6 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88084e-63 max 0.210987 -- Solve : min 2.28058e-32 max 0.275679 err = 0.00470118 err0 = 7.34711e-06 err1 = 1.4754e-05 1 loop 7 err = 0.00470118 err0 = 1.4754e-05 err1 = 7.34711e-06 0 loop 7 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.8848e-63 max 0.214362 -- Solve : min 2.28138e-32 max 0.276041 err = 0.0033688 err0 = 3.33461e-06 err1 = 8.01418e-06 err = 0.0033688 err0 = 8.01418e-06 err1 = 3.33461e-06 1 loop 8 0 loop 8 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88615e-63 max 0.215473 -- Solve : min 2.28221e-32 max 0.27642 err = 0.00261906 err0 = 3.56152e-06 err1 = 3.29794e-06 0 loop 9 err = 0.00261906 err0 = 3.29794e-06 err1 = 3.56152e-06 1 loop 9 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88756e-63 max 0.216633 -- Solve : min 2.28249e-32 max 0.276548 err = 0.00226018 err0 = 3.46799e-06 err1 = 1.64042e-06 1 loop 10 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 err = 0.00226018 err0 = 1.64042e-06 err1 = 3.46799e-06 0 loop 10 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88805e-63 max 0.217024 -- Solve : min 2.28278e-32 max 0.276682 err = 0.00203251 err0 = 1.69576e-06 err1 = 2.43535e-06 0 loop 11 err = 0.00203251 err0 = 2.43535e-06 err1 = 1.69576e-06 1 loop 11 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88856e-63 max 0.217433 -- Solve : min 2.28288e-32 max 0.276728 err = 0.00193857 err0 = 1.27026e-06 err1 = 2.48779e-06 0 loop 12 err = 0.00193857 err0 = 2.48779e-06 err1 = 1.27026e-06 1 loop 12 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88873e-63 max 0.217573 -- Solve : min 2.28299e-32 max 0.276776 err = 0.00186697 err0 = 2.19868e-06 err1 = 1.2869e-06 1 loop 13 err = 0.00186697 err0 = 1.2869e-06 err1 = 2.19868e-06 0 loop 13 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88892e-63 max 0.217719 -- Solve : min 2.28302e-32 max 0.276793 err = 0.00183946 err0 = 1.16707e-06 err1 = 2.21653e-06 0 loop 14 err = 0.00183946 err0 = 2.21653e-06 err1 = 1.16707e-06 1 loop 14 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88898e-63 max 0.217769 -- Solve : min 2.28306e-32 max 0.27681 err = 0.00181532 err0 = 1.17267e-06 err1 = 2.12273e-06 0 loop 15 err = 0.00181532 err0 = 2.12273e-06 err1 = 1.17267e-06 1 loop 15 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88905e-63 max 0.217822 -- Solve : min 2.28307e-32 max 0.276816 err = 0.00180631 err0 = 2.12905e-06 err1 = 1.1337e-06 1 loop 16 err = 0.00180631 err0 = 1.1337e-06 err1 = 2.12905e-06 0 loop 16 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88907e-63 max 0.21784 -- Solve : min 2.28309e-32 max 0.276822 err = 0.00179782 err0 = 1.13567e-06 err1 = 2.09649e-06 0 loop 17 err = 0.00179782 err0 = 2.09649e-06 err1 = 1.13567e-06 1 loop 17 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88909e-63 max 0.217859 -- Solve : min 2.28309e-32 max 0.276825 err = 0.00179469 err0 = 1.12213e-06 err1 = 2.09876e-06 0 loop 18 err = 0.00179469 err0 = 2.09876e-06 err1 = 1.12213e-06 1 loop 18 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.8891e-63 max 0.217866 -- Solve : min 2.2831e-32 max 0.276827 err = 0.00179165 err0 = 2.08716e-06 err1 = 1.12284e-06 1 loop 19 err = 0.00179165 err0 = 1.12284e-06 err1 = 2.08716e-06 0 loop 19 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 Problem(): initmat 0 VF (discontinuous Galerkin) = 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- AssembleLinearForm 2, discontinous Galerkin =0 binside = 0 levelset integration 0 -- Solve : min 4.88911e-63 max 0.217873 -- Solve : min 2.2831e-32 max 0.276828 err = 0.00179053 err0 = 1.11801e-06 err1 = 2.08798e-06 err = 0.00179053 err0 = 2.08798e-06 err1 = 1.11801e-06 SCHWARZ_MPI: Normal end of execution. times: compile 0.01s, execution 0.09s, mpirank:1 CodeAlloc : nb ptr 3159, size :387080 mpirank: 1 Plot bound [x,y] -0.999906 -0.999906 max [x,y] 2 1 SCHWARZ_MPI: Normal end of execution. times: compile 0.01s, execution 0.09s, mpirank:0 CodeAlloc : nb ptr 3159, size :387080 mpirank: 0 Ok: Normal End FreeFem++-mpi finalize correctly . FreeFem++-mpi finalize correctly . FREEFEM_MPI Normal end of execution. Tue Feb 9 12:06:27 EST 2016