[CP2K-user] [CP2K:16823] Re: Segmentation Fault during Force Matching
Hervé Bulou
herve.bulou at gmail.com
Thu Apr 7 14:00:19 UTC 2022
Hello,
I got a similar message and identified that the problem was with line 222
in the optimize_input.F file.
...
214 IF (ASSOCIATED(cell_traj_read)) ALLOCATE (cell_traj(3, 3, n_frames))
215
216 n_frames = 0
217 DO i_frame = oi_env%fm_env%frame_start, oi_env%fm_env%frame_stop,
oi_env%fm_env%frame_stride
218 n_frames = n_frames + 1
219 force_traj(:, :, n_frames) = force_traj_read(:, :, i_frame)
220 pos_traj(:, :, n_frames) = pos_traj_read(:, :, i_frame)
221 energy_traj(n_frames) = energy_traj_read(i_frame)
222 IF (ASSOCIATED(cell_traj)) cell_traj(:, :, n_frames) =
cell_traj_read(:, :, i_frame)
223 ENDDO
...
In the above version of the code, line 214 allows cell_traj to be allocated
if cell_traj_read is allocated.
But this doesn't guarantee that if cell_traj_read is not allocated,
cell_traj is not allocated, , which leads to a memory access problems line
222 (if cell_traj is allocated then we try to write in an array which is
not allocated which leads to the error)
I fixed the problem by adding cell_traj to the NULLIFY command line 200 :
...
200 NULLIFY (cell_traj_read, force_traj_read, pos_traj_read,
energy_traj_read,cell_traj)
...
regards,
Hervé Bulou
IPCMS-DSI
23 rue du Loess
BP43
F-67034 Strasbourg Cedex 2 (FRANCE)
tel +33 (0)3 88 10 70 95
herve.bulou at ipcms.unistra.fr
http://www.ipcms.unistra.fr/?page_id=9707&lang=en
<http://www.ipcms.unistra.fr/?page_id=9707&lang=en>
<http://www.ipcms.unistra.fr/?page_id=9707&lang=en>
Le vendredi 17 décembre 2021 à 11:48:33 UTC+1, rajors... at gmail.com a écrit :
> Dear All,
> I am trying to run the cp2k exercise on fitting empirical potential for
> water molecule using Force Fitting. However, I get a 'Program received
> signal SIGSEGV: Segmentation fault - invalid memory reference" error. The
> details of my system and simulation are as follows:
>
> 1. Version - cp2k 2.6.2
> 2. Input files - attached
> 3. Output -
> Program received signal SIGSEGV: Segmentation fault - invalid memory
> reference.
>
> Backtrace for this error:
> #0 0x7F8BC0B7CE08
> #1 0x7F8BC0B7BF90
> #2 0x7F8BC02AD4BF
> #3 0xD08D8C
> #4 0x42D9F9
> #5 0x4316B5
> #6 0x42AD3B
> #7 0x42A47C
> #8 0x7F8BC029883F
> #9 0x42A4D8
> #10 0xFFFFFFFFFFFFFFFF
> Segmentation fault (core dumped)
>
> 4. Hardware - Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz with 24 CPUs and 2
> threads per core (Architecture : x86_64), 32GB RAM and Ubuntu 16.04LTS
>
> My knowledge of FORTRAN is not good. Any suggestions to get over this
> error will be very helpful.
>
>
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/9365eb32-b944-4350-8155-82142cd87709n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20220407/ae589fcf/attachment-0001.htm>
More information about the CP2K-user
mailing list