Skip to content

Bug: n_MOK/p_MOK use m_glb_read instead of n_glb_read/p_glb_read in file_per_process restart path #1269

@sbryngelson

Description

@sbryngelson

Summary

Copy-paste bug in src/simulation/m_start_up.fpp lines 575-577 (on master). In the file_per_process Lustre sequential-read restart path, n_MOK and p_MOK are both computed from m_glb_read instead of n_glb_read and p_glb_read respectively.

Location

src/simulation/m_start_up.fpp, inside s_read_data_files, in the if (file_per_process) then block:

! Current (buggy):
m_MOK = int(m_glb_read + 1, MPI_OFFSET_KIND)
n_MOK = int(m_glb_read + 1, MPI_OFFSET_KIND)   ! should be n_glb_read
p_MOK = int(m_glb_read + 1, MPI_OFFSET_KIND)   ! should be p_glb_read

Fix

m_MOK = int(m_glb_read + 1, MPI_OFFSET_KIND)
n_MOK = int(n_glb_read + 1, MPI_OFFSET_KIND)
p_MOK = int(p_glb_read + 1, MPI_OFFSET_KIND)

Impact

This path is only used when file_per_process = .true. (Lustre sequential-read mode). The n_MOK/p_MOK values are computed but not actually used in this branch — the file_per_process path calls MPI_FILE_READ (sequential) rather than MPI_FILE_SET_VIEW (which uses offset calculations involving n_MOK/p_MOK). So this is currently dead-code-level impact, but it would become a real bug if the Lustre path ever switches to MPI_FILE_SET_VIEW for multi-dimensional data.

Note: the corresponding else branch (the standard parallel I/O path) correctly uses m_glb, n_glb, p_glb and is not affected.

cc @bwilfong3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working or doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions