Page 1 of 1

Restart file creation error

Posted: 26 Sep 2017, 20:17
by hielau
I'm trying to add restart file to my simulation and I noticed that if I haven't created the result directory and sub directory for the restart file the simulation ends in error.

At line 3193 of file /home/elmeruser/Source/elmerfem/fem/src/ModelDescription.F90 (unit = 31)
Fortran runtime error: Cannot open file 'results/im/case.result': No such file or directory

But if I create result and result/im directories before hand then it works just fine. Should it behave like that?

Code: Select all

  Output Intervals = 1
  Output File = "case.result"
-Lauri

Re: Restart file creation error

Posted: 28 Sep 2017, 12:50
by raback
Hi Lauri

Yes, the "Output File" that is nowadays mainly used for restarts only is assumed to be a clean file i.e. it should not include directory. It will be saved to the mesh directory.

Now there is maybe some logic to this: the restart file is married with the mesh file since a restart is possible only with the same mesh. Also there are several places in the code where this should be fixed so I'm slightly reluctant to change this.

The routines that are mainly used to save the postprocessing data are VtuOutputSolver, SaveLine, SaveScalars, etc. The aim is that all these can take the "Output Directory" keyword so that the user can control where this output is written.

If one was to change the logic for the restart file also there would be two ways to do this:
1) Detect the directory from the filename and let the code create the directory
2) Let the user specify a separate keyword that specifies the restart directory.
Of these perhaps the way 2) would be more in line with the current logic. Of course implementing both could be done also...

Any comments?

For now, I just added a warning.

-Peter

Re: Restart file creation error

Posted: 28 Sep 2017, 18:32
by hielau
I think the default directory is fine, but in case the directory is missing, it would be great if Elmer would automatically create necessary directories, so that the saving of the file would not end in error.

-Lauri