[dune-pdelab] Parallel ALUGrid and gmshreader
Pavel Hron
pavel.hron at iwr.uni-heidelberg.de
Thu Jul 3 18:23:34 CEST 2014
Dear Lukas,
I use ALUgrid in following way (tested some time ago, dune-course2014):
typedef Dune::ALUCubeGrid<3,3> GridType;
// read gmsh file
Dune::GridFactory<GridType> factory;
// only processor 0 will load the msh file
if (helper.rank()==0)
Dune::GmshReader<GridType>::read(factory,"./grids/complex.msh",true,true);
GridType *grid=factory.createGrid();
grid->loadBalance();
typedef GridType::LeafGridView GV;
const GV& gv_cube_alu=grid->leafGridView();
Maybe there is some other way how to initialize alugrid in parallel.
You need to use nonoverlapping constraints, e.g.
typedef Dune::PDELab::NonoverlappingConformingDirichletConstraints<GV>
CON;
CON con(gv);
and call function compute_ghosts after initializing of the
GridFunctionSpace gfs:
con.compute_ghosts(gfs);
as linear solver, you need to use NOVLP solver, e.g.
ISTLBackend_NOVLP_BCGS_SSORk
PS. I would recommend you the 2.3.1 release of the Dune core modules! If
you are using the 2.3 from the dune-course 2014 then it is ok.
Best
Pavel
On Thu, 2014-07-03 at 11:38 +0200, Lukas Riedel wrote:
> Dear Developers,
>
>
> I built a working code in PDELab for parallel computation using
> YaspGrid and OpenMPI.
> Now i want to use the gmshreader and the ALUgrid (simplex,2D) for the
> same code but i cannot find out how to initialize the ALUgrid in
> parallel mode.
>
>
> OS: Mac OS X 10.9.3 Mavericks
> GCC: gcc (MacPorts gcc49 4.9-20140416_2) 4.9.0 20140416 (prerelease)
> G++: g++ (MacPorts gcc49 4.9-20140416_2) 4.9.0 20140416 (prerelease)
> clang: clang version 3.5.0 (trunk 210448)
> Target: x86_64-apple-darwin13.2.0
> Thread model: posix
> CC: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
> Target: x86_64-apple-darwin13.2.0
> Thread model: posix
> DUNE-modules: dune-common.............: version 2.3.0
> dune-geometry...........: version 2.3.0
> dune-grid...............: version 2.3.0
> dune-istl...............: version 2.3.0
> dune-localfunctions.....: version 2.3.0
> dune-pdelab.............: version 2.0-dev
> dune-typetree...........: version 2.3-dev
> ALBERTA.................: version 2.0
> ALUGrid.................: version 1.52 (parallel)
>
>
>
>
> With YaspGrid, I wrote a „YaspPartition“ class and passed the MPI
> communicator:
>
>
> int overlap=1;
> const YaspPartition<2> yp;
> Dune::YaspGrid<2>
> grid(helper.getCommunicator(),L,N,periodic,overlap,&yp);
>
>
> Now, I use the gmshreader in the following way:
>
>
> typedef Dune::ALUGrid<2,2,Dune::simplex,Dune::conforming>
> GridType;
> Dune::shared_ptr<GridType>
> gridp(Dune::GmshReader<GridType>::read(meshfilename));
>
>
> The check whether the created ALUGrid Type is parallel
> ( Dune::Capabilities::isParallel<GridType>::v ) returns false.
>
>
> The output when executing $mpirun -n 2 <myProgram> reveals that two
> processes are executed, but both seem to calculate the whole problem
> on their own:
> (every line doubled, of course)
>
>
> parallel run on 2 process(es)
>
>
> Reading 2d Gmsh grid...
> version 2.2 Gmsh file detected
> file contains 378 nodes
> file contains 754 elements
> number of real vertices = 378
> number of boundary elements = 68
> number of elements = 686
> Created serial ALUGrid<2,2,simplex,conforming>
>
>
> rank 0 number of DOF = 378
> number of DOF 378
>
>
> I built ALUGrid using METIS, parMETIS and OpenMPI
>
>
> ./configure CC=gcc CXX=g++ F77=gfortran —prefix=$HOME/opt/alugrid
> --with-metis=/usr/local --with-parmetis=/usr/local
> CPPFLAGS="$CPPFLAGS `../dune-common*/bin/mpi-config --cflags
> --disable-cxx —mpicc=mpicc`" LDFLAGS="$LDFLAGS
> `../dune-common*/bin/mpi-config --libs --disable-cxx
> --mpicc=mpicc`“ CXXFLAGS="-O3 -DNDEBUG“ CFLAGS="-O3 -DNDEBUG“
>
>
> and DUNE successfully checks the serial and parallel usability of
> ALUGrid:
>
>
> configure: searching for ALUGrid in /Users/lriedel/opt/alugrid...
> checking ALUGrid version >= 1.52... yes (ALUGrid-1.52)
> checking alugrid_serial.h usability... yes
> checking alugrid_serial.h presence... yes
> checking for alugrid_serial.h... yes
> checking alugrid_parallel.h usability... yes
> checking alugrid_parallel.h presence... yes
> checking for alugrid_parallel.h… yes
>
>
> How can i initialize a parallel ALUgrid using the gmshreader? How can
> i access/change the load balance of the grid?
>
>
> Currently, i am using the following ISTL Solver Backend:
>
>
> typedef Dune::PDELab::ISTLBackend_BCGS_AMG_SSOR<IGO> LS;
> LS ls(gfs,5000,0,false,true);
>
>
> As ALUgrid has no overlap but only ghosts, do i need to use a NOVLP
> solver backend then?
> Are the ghosts assembled automatically?
>
>
> Thank you for your help and best regards,
> Lukas Riedel
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab
More information about the dune-pdelab
mailing list