ROMS hangs up reading input file

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
joaob

ROMS hangs up reading input file

#1 Unread post by joaob »

Hi forum,

I've been facing a possible bug with serial and OpenMP ROMS. The model hangs up when reading the input file. This doesn't happen when I compile the model with MPI. More precisely, the model hangs in the following section of the code in read_phypar.f90 (the problematic line is marked with **):

Code: Select all

!
!-----------------------------------------------------------------------
!  Read in physical model parameters. Then, load input data into module.
!  Take into account nested grid configurations.
!-----------------------------------------------------------------------
!
      DO WHILE (.TRUE.)
        ** READ (inp,'(a)',ERR=10,END=20) line
        status=decode_line(line, KeyWord, Nval, Cval, Rval)
        IF (status.gt.0) THEN
          SELECT CASE (TRIM(KeyWord))
            CASE ('TITLE')
I've run it through GDB and the trace is the following:
joao@naval1181:~/Observa.FISH/Malhas/ECNA124K_INTEL_OMP$ gdb ./romsG ecna124k.in
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./romsG...done.
"/home/joao/Observa.FISH/Malhas/ECNA124K_INTEL_OMP/ecna124k.in" is not a core dump: File format not recognized
(gdb) run
Starting program: /home/joao/Observa.FISH/Malhas/ECNA124K_INTEL_OMP/romsG
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
--------------------------------------------------------------------------------
Model Input Parameters: ROMS/TOMS version 3.7
Monday - April 29, 2019 - 1:20:18 PM
--------------------------------------------------------------------------------

^C
Program received signal SIGINT, Interrupt.
0x00007ffff729234e in __libc_read (fd=0, buf=0x29b6360, nbytes=1) at ../sysdeps/unix/sysv/linux/read.c:27
27 ../sysdeps/unix/sysv/linux/read.c: No such file or directory.
(gdb) backtrace
#0 0x00007ffff729234e in __libc_read (fd=0, buf=0x29b6360, nbytes=1) at ../sysdeps/unix/sysv/linux/read.c:27
#1 0x000000000238e7d4 in for.read_input ()
#2 0x000000000238d114 in for.get_s ()
#3 0x000000000234c155 in for_read_seq_fmt ()
#4 0x000000000052c630 in read_phypar (model=1, inp=5, out=6, lwrite=4294967295) at read_phypar.f90:83
#5 0x0000000000433b14 in inp_par (model=1) at inp_par.f90:65
#6 0x000000000040d3bf in ocean_control_mod::roms_initialize (first=.FALSE.,
mpicomm=<error reading variable: Cannot access memory at address 0x0>) at ocean_control.f90:73
#7 0x000000000040cd2d in ocean () at master.f90:73
#8 0x000000000040cbc2 in main ()
#9 0x00007ffff6cadb97 in __libc_start_main (main=0x40cb90 <main>, argc=1, argv=0x7fffffffbaa8, init=<optimized out>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffba98) at ../csu/libc-start.c:310
#10 0x000000000040caaa in _start ()
I'm usinf Ifort but the same thing happens with gfortran. Compiler versions are:
ifort (IFORT) 19.0.3.199 20190206
GNU Fortran (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
I've checked that this simple fortran code (compiled with ifort) can read the input file line by line:

Code: Select all

    program Console1
    implicit none
    integer :: il, ierr
    character(256) :: gchar
    open(15,file='text1.txt',status='old',iostat=ierr)
    do while (ierr.eq.0)
      read(15,'(A)',ERR=10,END=20) gchar
!      il=len_trim(gchar)
!      print *, il
      print *, gchar
    enddo
10  WRITE (*,*) 'ERROR READING', gchar
20  CLOSE (15)

    end program Console1
So I can really figure what is the problem. Any help would be highly appreciated.
Best regards,
Joao

System information:
uname -a:
Linux naval1181 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
lscpu:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 36
On-line CPU(s) list: 0-35
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Core(TM) i9-9980XE CPU @ 3.00GHz
Stepping: 4
CPU MHz: 1200.533
CPU max MHz: 4500,0000
CPU min MHz: 1200,0000
BogoMIPS: 6000.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 25344K
NUMA node0 CPU(s): 0-35
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req flush_l1d

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: ROMS hangs up reading input file

#2 Unread post by kate »

Code: Select all

gdb ./romsG ecna124k.in
If the model was not compiled for MPI, you should do this instead:

Code: Select all

gdb ./romsG < ecna124k.in
and the model will read from the standard input.

joaob

Re: ROMS hangs up reading input file

#3 Unread post by joaob »

Thanks, Kate. Don't know how I missed that.
Cheers,
Joao

Post Reply