E3SM-Project / E3SM-Project/E3SM

Eliminate build warning in GPTL

Open
#7,986 3 comments 0 reactions 0 assignees View on GitHub
gptl (timer library) Utils
Dominant language
Fortran
Stars
440
Forks
481
Avg merge
4d 6h
Merged PRs (30d)
36

Description

We see the following build warning, that can be easily eliminated

```
In file included from /global/cfs/cdirs/e3sm/ndk/repos/ndkmf-alv-update2026/share/timing/f_wrappers.c:12:
/global/cfs/cdirs/e3sm/ndk/repos/ndkmf-alv-update2026/share/timing/gptl.h:30:9: warning: "THREADED_OMP" redefined
30 | #define THREADED_OMP
| ^~~~~~~~~~~~
: note: this is the location of the previous definition
```

Just need to add a single ifdef guard in `share/timing/gptl.h` to test for `#ifndef THREADED_OMP`
```
#ifdef _OPENMP
#ifndef THREADED_PTHREADS
#ifndef THREADED_OMP
#define THREADED_OMP
#endif
#endif
#endif
```

It may be we don't even need `THREADED_PTHREADS` and can do further cleanup, but I think for now, could just be good to have simple fix.

Note there are 4 of these gptls:
```
./cime/CIME/non_py/src/timing/gptl.h
./share/timing/gptl.h
./externals/scorpio_classic/timing/gptl.h
./externals/scorpio/src/gptl/gptl.h
```

Contributor guide

Open the contributing guide

Research direction

Inspect the four listed GPTL headers, especially share/timing/gptl.h, and compare their THREADED_OMP definitions. Run the affected build to reproduce the warning, then verify that the warning is eliminated consistently across all four copies.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.