SaveGridData in parallel simulation

Numerical methods and mathematical models of Elmer
fretamal
Posts: 9
Joined: 14 Apr 2022, 03:25
Antispam: Yes

SaveGridData in parallel simulation

Post by fretamal »

Hi all,
I'm modelling a 3D glacier and trying to save the data as an ascii file to export it to Matlab. I was using the solver SaveGridData and it was working untill I started running the model in parallel with two partitions, now it's creating two files which are empty. I want to save the surface velocities if there is another option or solver to do the same would be great.

Thanks in advance,

Franco

Code: Select all

Solver 4
  Exec Solver = after all
  Equation = SaveGrid
  Procedure = "SaveGridData" "SaveGridData"
  Grid nx = Integer 100
  Grid Origin At Corner = Logical True
  Check For Duplicates = Logical False
  Filename Prefix = String glyphs_BSL
  Table Format = Logical True
End
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: SaveGridData in parallel simulation

Post by Rich_B »

Hello,

There are three tests under fem/tests that include the filename 'SaveGridData'.

Each of them include this command:
Procedure = File "SaveGridData" "ParticleOutputSolver"
The three tests are testing the subroutine "ParticleOutputSolver" in the Fortran source file "SaveGridData.F90". There does not seem to be a test of the subroutine "SaveGridData".

Anyway, you have probably already tried this: if you run those three tests in parallel and call the subroutine "SaveGridData" instead of "ParticleOutputSolver", with
Procedure = File "SaveGridData" "SaveGridData"
what happens?

Rich.

Edit: Sorry, I had the filename and subroutine names backwards, so the above edits correct this post.
Last edited by Rich_B on 23 Apr 2022, 15:57, edited 1 time in total.
fretamal
Posts: 9
Joined: 14 Apr 2022, 03:25
Antispam: Yes

Re: SaveGridData in parallel simulation

Post by fretamal »

Hi Rich, thanks for your response.

I actually run the test ParticleFalling3 and it's working fine even running it in parallel and it's able to save the data using "ParticleOutputSolver" but I tried with "SaveGridData" and works with a normal mesh, but when I tried running it in parallel creates two empty files, so I cannot make it work :(
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: SaveGridData in parallel simulation

Post by Rich_B »

Hello,

I edited my first response, take a look, although you have already taken the right steps.

Would you be able to post a small example, with geometry and sif file, of the "SaveGridData" test that doesn't work properly? Maybe set up two archives, one in serial that works and the other in parallel that doesn't?

Thanks, Rich.
fretamal
Posts: 9
Joined: 14 Apr 2022, 03:25
Antispam: Yes

Re: SaveGridData in parallel simulation

Post by fretamal »

Hi attached are the files that you asked. I tryed saving the data in Vti format and appear a message telling that "SaveGridData" in Vti format is not implemented in parallel yet, maybe it's happening the same with Table Format.
Attachments
geometry.msh
geometry file
(474.58 KiB) Downloaded 56 times
case_parallel.sif
parallel case, isn't saving data
(6.41 KiB) Downloaded 58 times
case_serial.sif
serial case, saving data in table format
(5.45 KiB) Downloaded 61 times
raback
Site Admin
Posts: 4826
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveGridData in parallel simulation

Post by raback »

Hi

Could you give the exact commands how you prepare the mesh. Just to be doing the same thing...

-Peter
fretamal
Posts: 9
Joined: 14 Apr 2022, 03:25
Antispam: Yes

Re: SaveGridData in parallel simulation

Post by fretamal »

Hi, to run in parallel I'm using this command

Code: Select all

ElmerGrid 14 2 geometry.msh -autoclean -partdual -metiskway 2 
In serial is just

Code: Select all

ElmerGrid 14 2 geometry.msh -autoclean
kevinarden
Posts: 2308
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveGridData in parallel simulation

Post by kevinarden »

May be irrelevant but have not experienced anyone going straight from gmsh to parallel. I have always seen
ElmerGrid 14 2 geometry.msh -autoclean
ElmerGrid 2 2 geometry -autoclean -partdual -metiskway 2

then you are partitioning an Elmer mesh.
fretamal
Posts: 9
Joined: 14 Apr 2022, 03:25
Antispam: Yes

Re: SaveGridData in parallel simulation

Post by fretamal »

You're right I got confused looking how I did the mesh, I'm new in all of this of Elmer.

The way I did the partition is exactly as you said

ElmerGrid 14 2 geometry.msh -autoclean
ElmerGrid 2 2 geometry -autoclean -partdual -metiskway 2
raback
Site Admin
Posts: 4826
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveGridData in parallel simulation

Post by raback »

Hi

I could not really reproduce the case as some files were missing. However, I tested with some other random case.

At least there was a problem in that the bounding box was not communicated which resulted to each partition making their own grid which ended up not matching. This is now fixed such that a global bounding box is used to define the grid while a local bounding box is used to find potential candidates in each partition.

The changes are in devel branch since a few minutes.

Thanx for reporting!

-Peter
Post Reply