OffTarget

Observed issues › nvhpc-c-dist-schedule-chunk-compile-hang

Appears to behave incorrectlyCompiler hangs · C · OpenMP · Open

nvc -mp=gpu: compile does not finish with dist_schedule(static, 4) on target teams distribute parallel for

Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked

Affected variants

CompilerMI300A gfx942
unified memory (XNACK 1)
MI300A gfx942
copy (XNACK 0)
MI250X gfx90a
copy (XNACK 0)
MI300X gfx942
copy (XNACK 0)
MI350X gfx950
copy (XNACK 0)
A100 sm_80
separate memory
A100 sm_80
managed memory
AFAR 24.3.0correctcorrectunknown
not run
correctcorrectn/an/a
CCE 19.0.0correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 20.0.2correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.3correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.4correctcorrectunknown
not run
unknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/abehaves incorrectlybehaves incorrectly
NVHPC 26.9n/an/an/an/an/abehaves incorrectlybehaves incorrectly
GCC 16.2.0correctcorrectcorrectcorrectcorrectcorrectn/a

"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.

Messages

ResultCompiler and GPUMessage
behaves incorrectlyNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
NVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
Compilation terminated.
cleaning up after signal(15)...

Reproduce

NVHPC 25.11, A100 separate

export LD_LIBRARY_PATH=$NVHPC_25_11/compilers/lib
nvc -mp=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.c -o repro
OMP_TARGET_OFFLOAD=mandatory ./repro

NVHPC 26.9, A100 separate

export LD_LIBRARY_PATH=$NVHPC_26_9/compilers/lib
nvc -mp=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.c -o repro
OMP_TARGET_OFFLOAD=mandatory ./repro

AFAR 24.3.0, MI300A unified (runs correctly)

$AFAR/bin/amdclang -fopenmp --offload-arch=gfx942 -O2 repro.c -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (37 lines)
// NVHPC 25.11, NVIDIA A100 80GB PCIe (wingtip, sm_80; the hang is
// in the compile on the x86-64 host), both memory modes: nvc does not
// finish compiling this program: its C front end (nvcpfe) runs until
// killed (more than 60 s here; the catalog's 900 s compile timeout in both
// memory modes). Without dist_schedule(static, 4), or with either of the
// two `if (i == 1)` statements removed, it compiles in a second.
// Spec: with dist_schedule(static, chunk_size) the chunks "are assigned to
// the initial teams of the league in a round-robin fashion in the order of
// the initial team number" (5.2 §11.6.1 p.256); the program is legal.
// Vendor: "The private, firstprivate, collapse, and dist_schedule(static [
// ,chunksize]) clauses are supported" (HPC Compilers User's Guide 25.11
// §7.4, 2.9.4).
// Expected: the compile ends (and the run prints "nt=<teams> host_flag=0").
// Observed (2026-10-24, nvc 25.11-0, -O2, with -gpu=mem:separate and with
// the default): `timeout 60 nvc ...` ends with status 124.
// Found by the catalog (omp52/60-c-clause-dist_schedule-chunk_size:
// compile_timeout, confirmer R10b-own-link-or-hang); reduced with a
// line-deletion script, then by hand.
// NVHPC 26.9 (26.9-0, the latest release; rerun 2026-10-24 on wingtip with
// the same flags): still present -- the same: `timeout 120 nvc` ends with 124 in both modes.
// Fix (2026-10-24): rerun on 25.11 and 26.9 in both memory modes,
// each with its own runtime libraries (LD_LIBRARY_PATH = the release's
// compilers/lib; the first 26.9 runs had loaded 25.11's): still present
// on both releases, the same output.
// NVHPC: nvc -mp=gpu -gpu=cc80 -gpu=mem:separate -O2
#include <stdio.h>
#include <omp.h>
int main(void) {
  int nt = -1, host_flag = 1;
  #pragma omp target teams distribute parallel for map(from: nt, host_flag) dist_schedule(static, 4)
  for (int i = 1; i <= 64; i++) {
    if (i == 1) nt = omp_get_num_teams();
    if (i == 1) host_flag = (omp_is_initial_device() ? 1 : 0);
  }
  printf("nt=%d host_flag=%d\n", nt, host_flag);
  return 0;
}

Source in the repository

Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page

Expected and observed

Observed where it behaves incorrectly

Compilation terminated.
cleaning up after signal(15)...

What the specification requires

The specification text this program relies on and the compiler is expected to support.

OpenMP 5.2 §11.6.1 p.256

are assigned to the initial teams of the league in a round-robin fashion in the order of the initial team number

Evidence

Same compiler, one change

  • dist_schedule(static, 4) removed: AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct; NVHPC 25.11: correct; NVHPC 26.9: correct
    Control program
    #include <stdio.h>
    #include <omp.h>
    int main(void) {
      int nt = -1, host_flag = 1;
      #pragma omp target teams distribute parallel for map(from: nt, host_flag)
      for (int i = 1; i <= 64; i++) {
        if (i == 1) nt = omp_get_num_teams();
        if (i == 1) host_flag = (omp_is_initial_device() ? 1 : 0);
      }
      printf("nt=%d host_flag=%d\n", nt, host_flag);
      return 0;
    }
    

Other compilers run it correctly

AFAR 24.3.0, CCE 19.0.0, CCE 20.0.2, CCE 21.0.3, CCE 21.0.4, GCC 16.2.0