[Dune] alucubegrid's readGrid method

Marco Cisternino marco.cisternino at optimad.it
Tue Apr 16 11:35:47 CEST 2013


Hi Andreas,
if I don't add the rank to the filename, I get 3 files (one without 
extension, one .macro and one .extra) with the portion of the grid 
relative to the last process, i.e. process 1, completely loosing the 
portion relative to process 0.
I tried to run the restore code with 1 process reading in separate runs 
backupGrid_0 and backupGrid_1. They work, I mean the process is able to 
read the 2 different portion of the grid in 2 different runs, while 
launching the restore code with 2 processes leads to process 0 with the 
right portion of the grid and process 1 with an empty grid.
I realize that no dune/grid/alugrid/common/backuprestore.hh is available 
in dune versions before 2.3, then with 2.2.1 using backup/restore 
methods leads to an "Not implemented" exception.
I cannot understand why readGrid method doesn't work. I would like to 
understand if this is a bug or my misunderstanding of the use of that 
method.
If you think that using backup/restore methods in dune 2.3 is the way to 
get right behaviour of this capability, I can move to that version, but 
I would expect that writeGrid/readGrid methods would have worked.
Is there someone who uses the backup/restore capability with alugrid??

Thanks.

Marco


Il 15/04/2013 21:16, Dedner, Andreas ha scritto:
> Hi.
> I think you should not add the rank to the filename - alu will do that.
> But I'm not quite sure if that will solve the problem...
> Andreas
> ________________________________________
> From: dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Marco Cisternino [marco.cisternino at optimad.it]
> Sent: 15 April 2013 19:24
> To: dune at dune-project.org
> Subject: [Dune] alucubegrid's readGrid method
>
> Hi to all,
> I'm trying to use ALUCubeGrid writeGrid and readGrid methods in order to
> backup my grid and restore the simulation using that grid.
> I'm able, I think, to write the grid in xdr format simply using
>       std::string backup = "backupGrid_";
>       std::stringstream backupString;
>       backupString<<  backup<<  helper.rank();
>       grid.writeGrid<Dune::xdr>(backupString.str(),0.0);
> and getting 6 files with 2 processes (2 files without extension and 2
> files .extra and 2 files .macro)
> Unfortunately, I'm not able to read the grid. I use (with GridType =
> ALUCubeGrid<3,3>):
>       std::string restoreFilename = "backupGrid_";
>       std::stringstream restoreString;
>       restoreString<<  restoreFilename<<  helper.rank();
>       double time = 0.0;
>       GridType grid;
>       grid.readGrid<Dune::xdr>(restoreString.str(),time);
> I launch the restore code with the same number of processes (2), but
> only process 0 gets the right portion of grid, while process 1 gets nothing.
> I looked inside the code and I saw that process 1 is not able to compute
> the maxLevel. It never enters the loop at line 340 in grid_imp.cc (dune
> 2.2.1).
> I don't know if the sketched procedure to write/read a backup grid file
> is correct. That's what I've understood.
> I hope that someone can give me some hints to get rid of the
> backup/restore system.
> Thanks for any help.
>
> Bests,
>
> Marco
>
>
> --
> ------------------------------------
> Marco Cisternino, Ph.D.
> OPTIMAD Engineering s.r.l.
> Via Giacinto Collegno 18
> 10143 Torino - Italy
> www.optimad.it
> marco.cisternino at optimad.it
> +39 011 19719782
> ------------------------------------
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
>

-- 
------------------------------------
Marco Cisternino, Ph.D.
OPTIMAD Engineering s.r.l.
Via Giacinto Collegno 18
10143 Torino - Italy
www.optimad.it
marco.cisternino at optimad.it
+39 011 19719782
------------------------------------





More information about the Dune mailing list