[Dune] alucubegrid's readGrid method

Marco Cisternino marco.cisternino at optimad.it
Wed Apr 24 11:03:12 CEST 2013


Ok, I prepared a small test case to show exactly what I'm doing.
The code generates a structured grid(backupGrid), it globally refines 
the grid, it writes the grid vtk and write the grid using writeGrid 
method. Then the code declares a second grid(restoreGrid), it reads the 
grid using the readGrid method and it writes the grid vtk.
The filename argument of read/writeGrid methods can be chosen to be a 
single filename for every process or one filename for any of them.
If I launch the code with one process everything works fine.
But if I lauch the code with 2 processes I get 2 different behaviours 
depending on the way I pass the filename.
With a single filename I get a warning in writing the grid and a 
Segmentation Fault in reading it:

**WARNUNG (IGNORIERT) Lockfile konnte nicht gel"oscht werden.

[marco-laptop:14879] *** Process received signal ***
[marco-laptop:14879] Signal: Segmentation fault (11)
[marco-laptop:14879] Signal code: Address not mapped (1)
[marco-laptop:14879] Failing at address: 0x68
[marco-laptop:14879] [ 0] [0xb77cb410]
[marco-laptop:14879] [ 1] 
./BRSmallCase(_ZN4Dune7ALUGridILi3ELi3ELNS_18ALUGridElementTypeE1ELNS_21ALUGridRefinementTypeE1EP19ompi_communicator_tED1Ev+0x1a) 
[0x82e6400]
[marco-laptop:14879] [ 2] ./BRSmallCase(main+0x66d) [0x82dd20a]
[marco-laptop:14879] [ 3] 
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb6bbcbd6]
[marco-laptop:14879] [ 4] ./BRSmallCase() [0x82dca21]
[marco-laptop:14879] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 14879 on node marco-laptop 
exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------
With different filenames for every process I get the same warning in 
writing and a warning in reading :
**WARNING: GitterDuneBasis :: restoreIndices: indices (id = ) not read! 
file: duneinterface/gitter_dune_impl.cc, line: 157

In both cases no grid on process 1!!!
I would flyspray a bug, but without documentation I'm not sure this is 
the right way to do backup and restore.
I hope that some of you can have some minutes to run my code and to 
reproduce the behaviours or to say to me all this is wrong, do it by 
this way.
Thanks for your attention and your precious time.

Best regards,

Marco




Il 15/04/2013 20:24, Marco Cisternino ha scritto:
> 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
------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: BRSmallCase.cc
Type: text/x-c++src
Size: 3286 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20130424/f496bb43/attachment.cc>


More information about the Dune mailing list