H3S vc-relax weird behavior - Free Energy not decreasing? #40
-
|
Hello, I tried running the H3S example on the Bebop cluster at ANL, where my main change was running the calculations at fixed pressure instead of fixed volume, and changing the # of kpoints. I seem to get strange results: The free energy has that strange jump, and then the code crashes with a segfault without any other information. I suspected it could be because of the Kong Liu effective sample size parameter getting smaller, so I tried to adapt the code to use the Relax module used for the LaH10 example. Here's the modified code: The H3S_initphon script seems to work perfectly fine. The SSCHA relax script has the following output behavior: The free energy has this strange behavior, and those large 'wide' regions are actually huge oscillations between steps. The code runs for about 6 iterations of the relax process, and then crashes. If I change the # of kpoints, it changes how many iterations the code goes for before segfaulting. For 2x2x2 kpoints, it ran for 4 iterations before segfaulting. The only thing I can think of is that the code isn't fully supporting of fixed pressure (as opposed to fixed-volume) calculations? But I'm not sure. Looking forward to hearing back, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
|
Hi, the first case of minimization is actually very good. The jump you see in the free energy is normal and simply a consequence of the fact you generated a new ensemble of ionic configurations. In this way, the free energy (which contains a term computed averaging the energy of the extracted configurations) will change in the new ensemble, but, as you see, remains compatible with the previous value within the stochastic error. Actually, in the first case, I think the code converged (both gradients reached zero within their stochastic error). It is quite surprising it ended with a seg. fault. can you attach the full output so we can try to spot what went wrong? In the second case, if you optimize at a fixed pressure, you are minimizing the Gibbs free energy. The code is printing the Helmoltz free energy, so you should probably add a PV term to the free energy to see that one. Since it is a variable cell relaxation, your volume changes abruptly after each ensemble to optimize the Gibbs free energy. This is probably giving the jumps in the free energy. In particular, it seems you are optimizing the cell at a bigger pressure than the starting one, this means your volume is getting smaller after each population (to optimize the target pressure). Indeed, the Helmoltz free energy increases a lot when the volume decreases. It will print the stress tensor after each minimization. You can check if it is correctly converging to the pressure value you choose. Also in the second case, if you look at both the gradient and the Kong-Liu (Neff / N0) ratio, the code seems to be converged after almost every iteration (apart from the first). You recognize this because the Neff value reaches 1/2 of the initial value (N0) only in the first population. In this case the code halts because the ensemble is no more good, and a new ensemble is generated. However, in the next populations, the code stops when Neff > N0 / 2, this means that it stops because the gradient converged to 0 within the stochastic error (the simulation converged). You can check this looking at the gradient plot. Therefore, also here the code probably stopped because it reached the correct value of the pressure. |
Beta Was this translation helpful? Give feedback.
-
|
Hello, Thank you for the thorough response! I learned a few things from it. Yes, I am getting "/var/spool/slurmd/job1999230/slurm_script: line 23: 1000 Segmentation fault (core dumped) python3 SSCHArelax.py > relaxoutput.out" at the end, after AMASS: {} {} is printed. Extracting the pressure via the cat STRESS command, it appears the pressure I have started at 219 GPa (I tried relaxing it to 210 GPa), but it increases during each SSCHA step, up to 420 GPa or so. Hm. That is strange. My input desired pressure is 210 GPa, and it stopped once the code hit ~ 420 GPa. Maybe there's something accidentally doubling the target pressure? Attached is the output text file for my 2nd case, along with input files for the phonon calc (H3S_initphon.py; this ran fine) ahd the SSCHA relaxation (SSCHArelax.py). Perhaps me specifying both 'press: 2100' in the SCF file input, and "target_press=2100" in the relax.vc_relax call resulted in a doubling to 420 GPa? While I wait for a reply, I'll try running things without the "press: 2100" in the SCF file input. |
Beta Was this translation helpful? Give feedback.


Hi, the first case of minimization is actually very good. The jump you see in the free energy is normal and simply a consequence of the fact you generated a new ensemble of ionic configurations. In this way, the free energy (which contains a term computed averaging the energy of the extracted configurations) will change in the new ensemble, but, as you see, remains compatible with the previous value within the stochastic error.
Actually, in the first case, I think the code converged (both gradients reached zero within their stochastic error). It is quite surprising it ended with a seg. fault. can you attach the full output so we can try to spot what went wrong?
Did the code print the dyna…