Code crashes for certain systems, perhaps due to aligned allocation
The following input file crashes while running BigDFT. input.yaml
BigDFT was compiled with GCC 9.2.0 on Mac OS 10.15.2 log.yaml
I tried investigating the source of this error Routines-0
The crash happens inside the subroutine initialize_work_arrays_locham_nlr
. There is the following line:
w%y_c = f_malloc_ptr((/ w%nyc, nspinor /),id='w%y_c',info='{alignment: 32}')
which I believe fails, and so subsequently when we call:
call f_zero(w%y_c)
the code crashes. If I remove the alignment request, the code runs without an errors. Digging deeper, I see that on my computer the allocation is performed using the system provided aligned_alloc
, as called from allocate-aligned-inc.f90
. It is called with the following values: 32, 795600. However, aligned_alloc
expects the second argument to be a multiple of the first (documentation).