====== Gromacs on Caviness ====== Templates for Slurm job submission scripts are available for batch GROMACS jobs in ''/opt/shared/templates/slurm/applications/gromacs''. Copy and edit the template based on your job by following the usage described in ''gromacs.qs''. It is always a good idea to periodically check ''/opt/shared/templates/slurm/applications'' for changes in existing templates, or the addition of new templates, designed to provide the best performance for a particular version of GROMACS on that cluster. ===== Batch job ===== On Caviness, the template (''/opt/shared/templates/slurm/applications/gromacs.qs'') provides a number of options to provide the best performance, but you must read the comments and set the options accordingly for your job. By default the template uses double-precision (''md_rund''), however commenting out ''GROMACS_DOUBLE_PRECISION=YES'' will specify the single-precision version (''md_run'') instead. ====Restart / Append Issues on GROMACS v2023.2 ==== When running long GROMACS jobs on Caviness, users may need to restart simulations after jobs are preempted or reach the time limit. With GROMACS v2023.2, users may encounter the following error when attempting to append to a previous run: System I/O error: File locking is not supported on this system. This issue is related to file locking, which is not supported by the Lustre filesystem on Caviness. When GROMACS reads checkpoint files during a restart, it attempts to establish a lock on the log file. This behavior differs between versions: *GROMACS v2018: Attempts to lock the log file, but if locking fails, the program can still continue when using the ''-append'' option. *GROMACS v2023: The log file handling code was restructured, and the option to ignore a failed file lock was removed. As a result, the program exits with an error if file locking is not supported. This change is present in the [[https://github.com/gromacs/gromacs/blob/main/src/gromacs/mdrunutility/handlerestart.cpp|GROMACS source code on GitHub]]. ===Solution=== A Caviness-specific modification to GROMACS v2023 allows disabling file locking. Users can disable file locking by export GMX_NO_FILE_LOCKING=1 Then users can run commands, for example, gmx mdrun -cpi -deffnm -append