Checkpoint read fails [pepc-v]
Summary
The code crashes when restarting from data_particle
files.
Steps to reproduce
- Firstly, run the case as in attached file vrings.h at least for a couple of time steps
- Restart the simulation by setting the value
ispecial = 99
invrings.h
What is the current bug behaviour?
Just after reading parameter file the code crashes with:
forrtl: severe (179): Cannot allocate array - overflow on array size calculation.
Image PC Routine Line Source
pepc-v 000000000043F0C5 for_alloc_allocat Unknown Unknown
pepc-v 00000000004F9211 Unknown Unknown Unknown
pepc-v 00000000004CCA40 Unknown Unknown Unknown
pepc-v 000000000040CE62 Unknown Unknown Unknown
libc-2.31.so 000014BBCFAD5083 __libc_start_main Unknown Unknown
pepc-v 000000000040CD6E Unknown Unknown Unknown
Possible fixes
The problem possibly lies in an inconsistency between the writing and the reading of the checkpoint file.
The writing is is done in the subroutine dump
in frontends/pepc-v/files.f90
at line 109:
call MPI_FILE_WRITE(fh,n,1,MPI_INTEGER,status,ierr) ! # particles
Whereas the reading is performed in the subroutine setup_MPI_IO_readin
in physvars.f90
on line 251.
call MPI_FILE_READ(fh,n,1,MPI_KIND_PARTICLE,status,ierr) ! # particles
Since the variable n
is declared as integer(kind_particle)
in physvars.f90
, a fix should be done at the writing stage (subroutine dump
) as:
call MPI_FILE_WRITE(fh,n,1,MPI_KIND_PARTICLE,status,ierr) ! # particles
I tried applying this change and the restart worked.
Edited by Salvatore Marrone