Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segmentation fault when built with MPI and run on 1 process in global mode #11

@milancurcic

Description

@milancurcic

When UMWM is compiled with -DMPI, isglobal = .true. in namelists/main.nml, and the program is run on 1 process, it triggers a segmentation fault, e.g.:

umwm: nmlread: warning: pm should be divisible by 8 for optimal propagation properties
umwm: grid: dx min/max/mean [m]:              970.33       111193.26        70782.45
umwm: grid: dy min/max/mean [m]:           111193.70       111195.98       111134.87
umwm: grid: area min/max/mean [m^2]:    107894896.00  12364143616.00   7870612992.00
umwm: masks: total number of grid points:     64800
umwm: masks: number of land points:           20149,  31.1%
umwm: masks: number of sea points:            44651,  68.9%
umwm: masks: shallowest point:               10.000 meters
umwm: masks: deepest point:                8330.680 meters
umwm: partition: tiling summary:
+---------+------------+----------------+----------------+
|  nproc  |    ilen    |     istart     |      iend      |
+---------+------------+----------------+----------------+
|       0 |      44651 |              1 |          44651 |
+---------+------------+----------------+----------------+
umwm: remap: tiling with halo summary:
+---------+------------+----------------+----------------+
|  nproc  |   iilen    |    iistart     |     iiend      |
+---------+------------+----------------+----------------+
|       0 |        497 |           -164 |            332 |
+---------+------------+----------------+----------------+
umwm: output_grid: grid definition written in output/umwmout.grid
umwm: dispersion: solving for dispersion relationship;
forrtl: severe (408): fort: (2): Subscript #2 of the array CP0 has value 333 which is greater than the upper bound of 332

Image              PC                Routine            Line        Source
umwm.mpi           0000000000A9BC80  Unknown               Unknown  Unknown
umwm.mpi           000000000042897C  umwm_init_mp_disp        1445  umwm_init.F90
umwm.mpi           0000000000439D7C  umwm_init_mp_init        1336  umwm_init.F90
umwm.mpi           00000000004DB0AD  umwm_top_mp_umwm_          26  umwm_top.F90
umwm.mpi           000000000040C1C8  MAIN__                      7  umwm.F90
umwm.mpi           000000000040C0EE  Unknown               Unknown  Unknown
libc-2.22.so       00002AAAAD567725  __libc_start_main     Unknown  Unknown
umwm.mpi           000000000040BFE9  Unknown               Unknown  Unknown

This occurs because iiend is not set to a correct value at initialization. iiend must be greater than iend when isglobal is true.

Running on 2 or more processes is fine. Running on 1 process, but compiled without -DMPI, i.e. with CPPFLAGS="", is fine as well.

Reported by @adarmenov.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions