LAMMPS doesn't exit when given a file name argument that doesn't exist

Not sure whether this is a bug or not, so thought I would post it here before on Github.

I am running the 4 Feb 2025 - Development - patch_4Feb2025-446-g6f0a59372c version of LAMMPS. Upon inputing a file name which does not exist after -in in the command line, LAMMPS stalls it seems, it does not exit with an error message (e.g. “File not found”) which I am pretty sure it did before. I have tested this on two different clusters with the same behavior, both using the intel/2024a compiler toolchain.

I cannot reproduce it. Here is the what I get:

$ ./lmp -in xxx
ERROR: Cannot open input script xxx: No such file or directory (src/lammps.cpp:565)

This is compiled with GCC though:

Large-scale Atomic/Molecular Massively Parallel Simulator - 4 Feb 2025 - Development
Git info (develop / patch_4Feb2025-466-gadaa313990)

[...]

OS: Linux "Fedora Linux 41 (Forty One)" 6.13.7-200.fc41.x86_64 x86_64

Compiler: GNU C++ 14.2.1 20250110 (Red Hat 14.2.1-7) with OpenMP 4.5
C++ standard: C++17
Embedded fmt library version: 10.2.0

MPI v4.1: MPICH Version:      4.2.2
PICH Release date: Wed Jul  3 09:16:22 AM CDT 2024
MPICH ABI:          16:2:4

Accelerator configuration:

GPU package API: HIP
GPU package precision: mixed
KOKKOS package API: OpenMP Serial
KOKKOS package precision: double
Kokkos library version: 4.5.1
OPENMP package API: OpenMP
OPENMP package precision: double
OpenMP standard: OpenMP 4.5
INTEL package API: OpenMP
INTEL package precision: single mixed double
INTEL package SIMD: not enabled

Compatible GPU present: yes

FFT information:

FFT precision  = double
FFT engine  = mpiFFT
FFT library = KISS
KOKKOS FFT engine  = mpiFFT
KOKKOS FFT library = KISS

Active compile time flags:

-DLAMMPS_GZIP
-DLAMMPS_PNG
-DLAMMPS_JPEG
-DLAMMPS_FFMPEG
-DLAMMPS_CURL
-DLAMMPS_SMALLBIG

Ok, thanks for the reply. I will try to compile LAMMPS with some other toolchain to see if that plays a role.

When I compile LAMMPS with the foss/2024a toolchain (Compiler: GNU C++ 13.3.0 with OpenMP 4.5), I get the correct behavior:

(base) [oystegul@idun-login1 build]$ ./lmp -in xxx
ERROR: Cannot open input script xxx: No such file or directory (src/lammps.cpp:565)

However, when I compile LAMMPS with the intel/2023b or intel/2024a toolchains, it just stalls when using srun and -in in the command-line and with wrong input file name.
When I try to run lammps directly without srun I get this error message:

(base) [oystegul@idun-login1 build]$ ./lmp -in xxx
Abort(1090319) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init: Unknown error class, error stack:
MPIR_Init_thread(192):
MPID_Init(1558)......:
MPIR_pmi_init(169)...: PMI2_Job_GetId returned 14

and the same error message when I try ./lmp -h. So it seems to be related to the Intel compilers.

Does this happen on previous stable versions of LAMMPS?

On the latest stable version of LAMMPS (29 Aug 2024 - Update 2), the behavior is correct, i.e. the job exits with error message:
ERROR on proc 0: Cannot open input script asdfasdfasdf: No such file or directory (src/lammps.cpp:565)
This is with a LAMMPS compiled with Intel compilers (intel/2024a).

On the latest release version of LAMMPS (4 Feb 2025), the problem is the same as on the develop version of LAMMPS, i.e. LAMMPS stalls without exiting and without error message.