<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><p data-path-to-node="6">Dear Quantum ESPRESSO Developers and Community,</p><p data-path-to-node="7">I am writing to report a persistent runtime error in the GPU-accelerated version of <code>ph.x</code> (Quantum ESPRESSO v7.5) when calculating electron-phonon coefficients using the OpenACC port.</p><p data-path-to-node="8">While the code successfully calculates the Dynamical Matrices and Frequencies on the GPU, it consistently crashes during the final electron-phonon interaction step (routine <code>elphon</code>) with a File I/O error, specifically related to the temporary file <code>a2Fsave</code>.</p><p data-path-to-node="9"><b>1. System and Compilation Details:</b></p><ul data-path-to-node="10"><li><p data-path-to-node="10,0,0"><b>Version:</b> Quantum ESPRESSO v7.5 (GitLab release)</p></li><li><p data-path-to-node="10,1,0"><b>Compiler:</b> NVIDIA HPC SDK v24.9</p></li><li><p data-path-to-node="10,2,0"><b>Configuration:</b> <code>./configure --enable-openacc --with-cuda=yes --with-cuda-cc=89 --with-cuda-runtime=12.6</code></p></li><li><p data-path-to-node="10,3,0"><b>Hardware:</b> NVIDIA RTX 4090 (Ada Lovelace)</p></li><li><p data-path-to-node="10,4,0"><b>MPI:</b> OpenMPI (via NVIDIA HPC SDK)</p></li></ul><p data-path-to-node="11"><b>2. The Issue:</b> When running <code>ph.x</code> with <code>electron_phonon = 'interpolated'</code> (or any mode that triggers <code>elphon</code>), the execution aborts immediately after diagonalizing the dynamical matrix for the first q-point. The crash occurs regardless of the MPI parallelization level (reproduced with both <code>-np 1</code> and <code>-np 8</code>).</p><p data-path-to-node="12"><b>3. Error Log:</b> The crash points to a read error in <code>elphon.f90</code> attempting to read a file that appears to be empty or not flushed to disk.</p><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><response-element ng-version="0.0.0-PLACEHOLDER"><div _ngcontent-ng-c2179167942="" class="formatted-code-block-internal-container ng-tns-c2179167942-174"><div _ngcontent-ng-c2179167942="" class="animated-opacity ng-tns-c2179167942-174"><pre _ngcontent-ng-c2179167942="" class="ng-tns-c2179167942-174"><code _ngcontent-ng-c2179167942="" role="text" data-test-id="code-content" class="code-container formatted ng-tns-c2179167942-174"> FIO-F-217/list-directed read/unit=40/attempt to read past end of file.
File name = './out/mgb2.a2Fsave', formatted, sequential access record = 1
In source file /path/to/q-e/PHonon/PH/elphon.f90, at line number 847
</code></pre></div></div></response-element></blockquote><response-element ng-version="0.0.0-PLACEHOLDER"><div _ngcontent-ng-c2179167942="" class="formatted-code-block-internal-container ng-tns-c2179167942-174"><div _ngcontent-ng-c2179167942="" class="animated-opacity ng-tns-c2179167942-174"><pre _ngcontent-ng-c2179167942="" class="ng-tns-c2179167942-174"><code _ngcontent-ng-c2179167942="" role="text" data-test-id="code-content" class="code-container formatted ng-tns-c2179167942-174"> File name = './out/mgb2.a2Fsave', formatted, sequential access record = 1
In source file /path/to/q-e/PHonon/PH/elphon.f90, at line number 847
</code></pre></div></div></response-element><p data-path-to-node="14"><b>4. Reproduction Case (MgB2):</b> I reproduced this using a standard MgB2 test case.</p><p data-path-to-node="15"><i>Input snippet (<code>ph.in</code>):</i></p><response-element ng-version="0.0.0-PLACEHOLDER">Fortran<div _ngcontent-ng-c2179167942="" class="formatted-code-block-internal-container ng-tns-c2179167942-175"><div _ngcontent-ng-c2179167942="" class="animated-opacity ng-tns-c2179167942-175"><pre _ngcontent-ng-c2179167942="" class="ng-tns-c2179167942-175"><code _ngcontent-ng-c2179167942="" role="text" data-test-id="code-content" class="code-container formatted ng-tns-c2179167942-175">&INPUTPH
tr2_ph = <span class="hljs-number">1.0d-14</span>,
prefix = <span class="hljs-string">'mgb2'</span>,
outdir = <span class="hljs-string">'./out'</span>,
fildyn = <span class="hljs-string">'mgb2.dyn'</span>,
fildvscf = <span class="hljs-string">'mgb2.dvscf'</span>,
electron_phonon = <span class="hljs-string">'interpolated'</span>, <span class="hljs-comment">! <--- Triggers the crash</span>
trans = .true.,
ldisp = .true.,
nq1=<span class="hljs-number">6</span>, nq2=<span class="hljs-number">6</span>, nq3=<span class="hljs-number">4</span>
/
</code></pre></div></div></response-element><p data-path-to-node="17"><b>5. Observations:</b></p><ol start="1" data-path-to-node="18"><li><p data-path-to-node="18,0,0"><b>Pure Phonons work:</b> If I comment out <code>electron_phonon</code>, the GPU run finishes successfully and writes <code>.dyn</code> and <code>.dvscf</code>files.</p></li><li><p data-path-to-node="18,1,0"><b>CPU Works:</b> The exact same input runs successfully on the CPU-only binary (gfortran compilation).</p></li><li><p data-path-to-node="18,2,0"><b>File Incompatibility:</b> I attempted to run the heavy phonon calculation on the GPU and the final electron-phonon collection on the CPU (using <code>recover=.true.</code> or <code>trans=.false.</code>), but the CPU binary cannot read the GPU-generated <code>.dvscf</code>/binary files ("problems reading u" error), likely due to binary format/padding differences between <code>nvfortran</code>and <code>gfortran</code>.</p></li></ol><p data-path-to-node="19">It appears there is a race condition or file handling issue in the OpenACC implementation of the <code>elphon</code> routine where the <code>a2Fsave</code> file is read before it is successfully written/closed.</p><p data-path-to-node="20">Any advice on a workaround or a patch for <code>elphon.f90</code> to stabilize the GPU I/O would be greatly appreciated.</p><p data-path-to-node="21">Thank you for your time and for developing this software.</p><p data-path-to-node="22">Best regards,</p><p data-path-to-node="22">Dholon Kumar Paul</p><p data-path-to-node="22">Research Assistant, BRAC University, Bangladesh</p></body></html>