<div dir="ltr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Created serial ALUGrid<2,2,cube,nonconforming>.</blockquote><div><br></div><div>Is this the problem as the grid is still serial?<br><br></div><div>Thank you<br></div><div>Ganesh <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 9, 2015 at 2:07 PM, Ganesh Diwan <span dir="ltr"><<a href="mailto:gcdiwan83@gmail.com" target="_blank">gcdiwan83@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Andreas<br><br></div>Here is the code:<br><br>// Maybe initialize MPI<br> Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);<br><br> typedef Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming> GridType;<br> <br>// typedef Dune::UGGrid<2> GridType;<br>// std::auto_ptr<HGridType> grid( GmshReader<HGridType>::read( "./inp/mymesh.msh", true, true ) );<br> <br> Dune::GridFactory<GridType> factory;<br> Dune::GmshReader<GridType>::read(factory, "./inp/mymesh.msh", true, true);<br> GridType *grid = factory.createGrid();<br> typedef GridType::LeafGridView GV; // Define a typedef for a Leaf Grid View<br> const GridType::LeafGridView gv = grid->leafGridView(); // actually create a grid view object here<br> <br><br> // now loadbalance<br> grid->loadBalance();<br><br> // <br> int numElemesOnThisProcess = 0;<br> for (auto eIt = gv.begin<0, Interior_Partition>(); eIt != gv.end<0, Interior_Partition>(); ++eIt)<br> {<br> numElemesOnThisProcess++;<br> }<br> std::cout << "you have " << numElemesOnThisProcess << " elements on process " << helper.rank() <<std::endl;<br> const std::string baseOutName = "Grid_";<br> VTKWriter<GV> vtkWriter(gv);<br> std::vector<int> rankField(gv.size(0));<br> std::fill(rankField.begin(), rankField.end(), grid->comm().rank());<br> vtkWriter.addCellData(rankField,"rank");<br> vtkWriter.write(baseOutName+std::to_string(0));<br><br> return 0;<br><br></div>The output from my process 0 xterm window is:<br><br>(gdb) run<br>Starting program: /usr/local/home/gcd3/codes/vem/dune-part/src/dune-part <br>[Thread debugging using libthread_db enabled]<br>Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>Reading 2d Gmsh grid...<br>version 2.2 Gmsh file detected<br>file contains 81 nodes<br>file contains 64 elements<br>number of real vertices = 81<br>number of boundary elements = 0<br>number of elements = 64<br><br>Created serial ALUGrid<2,2,cube,nonconforming>.<br><br>you have 64 elements on process 0<br>[Inferior 1 (process 31987) exited normally]<br><br></div>and that from process 1 window:<br>(gdb) run<br>Starting program: /usr/local/home/gcd3/codes/vem/dune-part/src/dune-part <br>[Thread debugging using libthread_db enabled]<br>Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>Reading 2d Gmsh grid...<br>version 2.2 Gmsh file detected<br>file contains 81 nodes<br>file contains 64 elements<br>number of real vertices = 81<br>number of boundary elements = 0<br>number of elements = 64<br><br>Created serial ALUGrid<2,2,cube,nonconforming>.<br><br>you have 64 elements on process 1<br>[Inferior 1 (process 31958) exited normally]<br><br></div>Since both of them show 64 elements (same as original grid) I thought I am doing something wrong. <br><br></div>Thank you<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Ganesh<br><div><div><div><div><br></div></div></div></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 9, 2015 at 1:17 PM, Andreas Dedner <span dir="ltr"><<a href="mailto:a.s.dedner@warwick.ac.uk" target="_blank">a.s.dedner@warwick.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
How do you read in your grid? Please post the code you are using to do that.<br>
Andreas<br>
<div><div><br>
<br>
On 09/09/15 13:07, Ganesh Diwan wrote:<br>
> Hi Dune list<br>
><br>
> I am not able to distribute the grid with loadbalance when I use alugrid<br>
> as gridtype. All processes contain the same number of elements as the<br>
> original grid. I think alugrid is not correctly configured for parallel<br>
> mode. However uggrid seems to work as loadbalance splits the grid and I<br>
> can see the rank partitions in vtk output fine. I configured with<br>
> following contents in my opts file:<br>
><br>
> CONFIGURE_FLAGS="CXX=g++-4.8 \<br>
> --enable-parallel \<br>
> --enable-experimental-grid-extensions \<br>
> --with-metis=/usr \<br>
> --with-metis-lib=metis \<br>
> --with-parmetis=/usr \<br>
> --with-parmetis-lib=parmetis \<br>
> --with-alberta='/home/gcd3/dune/ext_build/alberta' \<br>
> --with-zoltan='/home/gcd3/dune/ext_build/Zoltan-v3.82' \<br>
> --with-ug='/home/gcd3/dune/ext_build/ug' \<br>
> --prefix='/home/gcd3/dune/core-2.4.0/install/' \<br>
> "<br>
><br>
> Do I need to include any other flags, perhaps adding CXXFLAGS=mpicc? I<br>
> was under impression that --enable-parallel would invoke the parallel<br>
> flags for grid, is it correct?<br>
><br>
> Thanks in advance for help,<br>
> Ganesh<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Dune mailing list<br>
> <a href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a><br>
> <a href="http://lists.dune-project.org/mailman/listinfo/dune" rel="noreferrer" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
><br>
<br>
_______________________________________________<br>
Dune mailing list<br>
<a href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a><br>
<a href="http://lists.dune-project.org/mailman/listinfo/dune" rel="noreferrer" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>