Skip to content

Commit d5d24b6

Browse files
tclunedependabot[bot]atrayano
authored
Integration branch: enums relocation + regularization + labeler bump (#4914)
* Create enums/ library (Tier 0) from scattered types Relocate 11 enum-like types from esmf_utils/, generic3g/, and component/ into a new enums/ directory (MAPL.enums). No public module names or interfaces changed. The three *Metadata files previously used mapl3g_InfoUtilities as a thin pass-through to ESMF; replace with direct ESMF calls to keep MAPL.enums free of upward esmf_utils dependency. Part of MAPL v3 restructuring (#4905), closes #4907. * Bump actions/labeler from 5 to 6 Bumps [actions/labeler](https://github.com/actions/labeler) from 5 to 6. - [Release notes](https://github.com/actions/labeler/releases) - [Commits](actions/labeler@v5...v6) --- updated-dependencies: - dependency-name: actions/labeler dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update CHANGELOG.md Co-authored-by: Atanas Trayanov <Atanas.L.Trayanov@nasa.gov> * Regularize MAPL.enums module names and cleanup Rename all 11 enum module prefixes from mapl3g_ to mapl_ and update all use statements across the codebase (~55 files). Additional cleanup in CouplerPhases: remove stale #include MAPL.h and strengthen implicit none to implicit none(type,external). Add rationale comments to CouplerPhases and GenericPhases explaining why enum,bind(c) is used instead of integer parameters. Part of MAPL v3 restructuring (#4905), closes #4908. * Remove MPI from ErrorHandling and Throw layers (#4921) * Remove MPI from ErrorHandling and Throw layers - MAPL_Throw.F90: replace MAPL_Fail (MPI-dependent) with a serial error stop default; add MAPL_set_throw_method procedure pointer - ErrorHandling.F90: remove 'use MPI'; replace MPI_Abort in MAPL_abort with a procedure pointer defaulting to error stop; add MAPL_set_abort_handler; collapse MAPL_ExceptionHandling alias into bottom of file; delete MAPL_ExceptionHandling.F90 - MAPL_MpiErrorHandling.F90: new file owning both MPI-aware handlers and MAPL_initialize_error_handling() registration routine; call this once after MPI_Init for MPI programs - Remove dead 'use MPI' from AbstractCommSplitter.F90, pfio/BaseThread.F90, pfio/ForwardDataAndMessage.F90 - Update shared/CMakeLists.txt accordingly Closes #4917 * Add CHANGELOG entry for #4917 MPI-free error handling * Fix wrong module name in Test_Scenarios.pf mapl3g_GenericPhases does not exist; correct name is mapl_GenericPhases (defined in enums/GenericPhases.F90). * Fix mapl3g_ -> mapl_ for enum modules in tests * Fix more mapl3g_ -> mapl_ for enum modules in tests * Create utils/ (MAPL.utils, Tier 1, MPI-free) (#4922) * Create utils/ (MAPL.utils, Tier 1, MPI-free) - New utils/ directory consolidates MPI-free foundational code - Moves from shared/: ErrorHandling.F90, MAPL_Throw.F90, hash.c, sort.c, and all serial utility modules (String, Sort, Range, etc.) plus Constants/ and Interp/ subdirectories - Moves from utilities/: all sources, arrays/, regex/, tests/ - Moves udunits2f/ into utils/udunits2f/ - Moves generic3g/Validation.F90 into utils/ - MAPL_MpiErrorHandling.F90 stays in shared/ (MPI-dependent) - MAPL.shared now depends on MAPL.utils; all MAPL.utilities references updated to MAPL.utils - SYSTEM_DSO_SUFFIX and OpenMP definitions moved to utils/ Part of #4905, closes #4915 * Add CHANGELOG entry for #4915 MAPL.utils creation * Add MAPL.utilities alias for backward compat * Fix MAPL.utilities compat: interface lib instead of alias * Create mp_utils/ (MAPL.mp_utils, Tier 2, MPI-dependent) (#4924) * Create mp_utils/ (MAPL.mp_utils, Tier 2, MPI-dependent) * Remove nonexistent tests subdir from mp_utils * Add CHANGELOG entry for #4923 MAPL.mp_utils creation * Move profiler to mp_utils/profiler/, clean stale shared/ copies * Restore ShaveMantissa.h needed by ShaveMantissa.c --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Atanas Trayanov <Atanas.L.Trayanov@nasa.gov>
1 parent 0a7acf3 commit d5d24b6

222 files changed

Lines changed: 1644 additions & 534 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
contents: read
1616
pull-requests: write
1717
steps:
18-
- uses: actions/labeler@v5
18+
- uses: actions/labeler@v6
1919
with:
2020
repo-token: ${{ secrets.GITHUB_TOKEN }}
2121
configuration-path: .github/labeler.yml

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Changed
1919

20+
- Create `mp_utils/` directory (`MAPL.mp_utils`, Tier 2) as an MPI-dependent,
21+
ESMF-free library. Absorbs comm-splitter and load-balance sources from
22+
`shared/`, and the entire `profiler/` library (sources + reporting).
23+
`MAPL.profiler` and `MAPL.shared` remain as backward-compatible targets.
24+
Part of the MAPL v3 directory restructuring (#4905, phase 3, closes #4923).
25+
26+
- Create `utils/` directory (`MAPL.utils`, Tier 1) as an MPI-free library
27+
consolidating serial-only sources from `shared/`, `utilities/`, `udunits2f/`,
28+
and `generic3g/`. `MAPL.utils` depends only on ESMF and OpenMP — no MPI.
29+
Part of the MAPL v3 directory restructuring (#4905, phase 2a, closes #4915).
30+
31+
- Remove direct MPI dependencies from `ErrorHandling.F90` and `MAPL_Throw.F90`
32+
using a lazy-init procedure pointer pattern. Both modules now default to serial
33+
`error stop` behavior and are fully MPI-free. MPI-aware error handling (rank in
34+
error messages, `MPI_Abort`) is provided by the new `MAPL_MpiErrorHandling.F90`
35+
module; call `MAPL_initialize_error_handling()` once after `MPI_Init` to
36+
register MPI-aware handlers. Serial and pFUnit programs require no changes.
37+
`MAPL_ExceptionHandling` is now an alias defined in `ErrorHandling.F90` rather
38+
than a separate file. Closes #4917, part of #4905.
39+
40+
- Create `enums/` directory (`MAPL.enums`, Tier 0) and relocate 11 enum-like
41+
type definitions into it from `esmf_utils/`, `generic3g/`, and `component/`.
42+
No module names or interfaces changed; this is a pure file relocation.
43+
Part of the MAPL v3 directory restructuring (#4905, phase 1a, closes #4907).
44+
45+
Several files were renamed, MAPL_InfoSet was replaced with ESMF_InfoSet.
2046
### Removed
2147

2248
### Deprecated

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ if (APPLE)
222222
add_compile_definitions("-D__DARWIN")
223223
endif()
224224

225-
add_subdirectory (udunits2f)
225+
add_subdirectory (enums)
226+
add_subdirectory (utils)
227+
add_subdirectory (mp_utils)
226228
add_subdirectory (pfio)
227-
add_subdirectory (profiler)
228229
add_subdirectory (generic3g)
229230
add_subdirectory (vm)
230231
add_subdirectory (field)
@@ -234,7 +235,6 @@ add_subdirectory (shared)
234235
add_subdirectory (include)
235236
add_subdirectory (base3g)
236237
add_subdirectory (mapl3g)
237-
add_subdirectory (utilities)
238238
add_subdirectory (gridcomps)
239239
add_subdirectory (GeomIO)
240240
add_subdirectory (esmf_utils)

base3g/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set (srcs
2323

2424
esma_add_library (${this}
2525
SRCS ${srcs}
26-
DEPENDENCIES ESMF::ESMF PFLOGGER::pflogger GFTL_SHARED::gftl-shared-v2 MAPL.shared MAPL.geom MAPL.esmf_utils MAPL.pfio MAPL.field_bundle MAPL.utilities MAPL.constants MPI::MPI_Fortran NetCDF::NetCDF_Fortran
26+
DEPENDENCIES ESMF::ESMF PFLOGGER::pflogger GFTL_SHARED::gftl-shared-v2 MAPL.shared MAPL.geom MAPL.esmf_utils MAPL.pfio MAPL.field_bundle MAPL.utils MAPL.constants MPI::MPI_Fortran NetCDF::NetCDF_Fortran
2727
TYPE SHARED
2828
)
2929

component/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
esma_set_this (OVERRIDE MAPL.component)
22

33
set (srcs
4-
CouplerPhases.F90
54
ComponentDriver.F90
65
ComponentDriverVector.F90
76
ComponentDriverPtrVector.F90
@@ -13,7 +12,7 @@ set (srcs
1312

1413
esma_add_library(${this}
1514
SRCS ${srcs}
16-
DEPENDENCIES MAPL.esmf_utils MAPL.shared
15+
DEPENDENCIES MAPL.enums MAPL.esmf_utils MAPL.shared
1716
TYPE SHARED
1817
)
1918

component/GriddedComponentDriver/run_export_couplers.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
submodule(mapl3g_GriddedComponentDriver) run_export_couplers_smod
44

5-
use mapl3g_CouplerPhases
5+
use mapl_CouplerPhases
66
use mapl_ErrorHandling
77
implicit none(type,external)
88

component/GriddedComponentDriver/run_import_couplers.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "MAPL.h"
22

33
submodule(mapl3g_GriddedComponentDriver) run_import_couplers_smod
4-
use mapl3g_CouplerPhases
4+
use mapl_CouplerPhases
55
use mapl_ErrorHandling
66
implicit none(type,external)
77

enums/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
esma_set_this (OVERRIDE MAPL.enums)
2+
3+
set (srcs
4+
ConservationType.F90
5+
NormalizationType.F90
6+
QuantityType.F90
7+
VectorBasisKind.F90
8+
ConservationMetadata.F90
9+
NormalizationMetadata.F90
10+
QuantityTypeMetadata.F90
11+
ValidationMode.F90
12+
VerificationStatus.F90
13+
GenericPhases.F90
14+
CouplerPhases.F90
15+
)
16+
17+
esma_add_library (${this}
18+
SRCS ${srcs}
19+
DEPENDENCIES MAPL.shared ESMF::ESMF
20+
TYPE SHARED
21+
)
22+
23+
target_include_directories (${this} PUBLIC
24+
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "MAPL.h"
22

3-
module mapl3g_ConservationMetadata
4-
use mapl3g_ConservationType
5-
use mapl3g_InfoUtilities
3+
module mapl_ConservationMetadata
4+
use mapl_ConservationType
65
use mapl_ErrorHandling
7-
use esmf
6+
use esmf, only: ESMF_Info, ESMF_InfoCreate, ESMF_InfoIsPresent
7+
use esmf, only: ESMF_InfoSet, ESMF_InfoGet, ESMF_InfoGetCharAlloc
88

99
implicit none(type, external)
1010
private
@@ -90,12 +90,12 @@ function make_info(this, rc) result(info)
9090

9191
info = ESMF_InfoCreate(_RC)
9292

93-
call MAPL_InfoSet(info, key=KEY_IS_MIRROR, value=this%is_mirror(), _RC)
93+
call ESMF_InfoSet(info, key=KEY_IS_MIRROR, value=this%is_mirror(), _RC)
9494
_RETURN_IF(this%is_mirror())
9595

9696
! Write conservation properties
97-
call MAPL_InfoSet(info, KEY_CONSERVATION_TYPE, this%conservation_type%to_string(), _RC)
98-
call MAPL_InfoSet(info, KEY_IS_CONSERVABLE, this%is_conservable, _RC)
97+
call ESMF_InfoSet(info, KEY_CONSERVATION_TYPE, this%conservation_type%to_string(), _RC)
98+
call ESMF_InfoSet(info, KEY_IS_CONSERVABLE, this%is_conservable, _RC)
9999

100100
_RETURN(_SUCCESS)
101101
end function make_info
@@ -117,7 +117,7 @@ function make_ConservationMetadata(info, key, rc) result(metadata)
117117
if (present(key)) full_key = key // full_key
118118
is_present = ESMF_InfoIsPresent(info, key=full_key, _RC)
119119
if (is_present) then
120-
call MAPL_InfoGet(info, key=full_key, value=is_mirror, _RC)
120+
call ESMF_InfoGet(info, key=full_key, value=is_mirror, _RC)
121121
end if
122122

123123
if (is_mirror) then
@@ -133,7 +133,7 @@ function make_ConservationMetadata(info, key, rc) result(metadata)
133133
if (present(key)) full_key = key // full_key
134134
is_present = ESMF_InfoIsPresent(info, key=full_key, _RC)
135135
if (is_present) then
136-
call MAPL_InfoGet(info, full_key, str_value, _RC)
136+
call ESMF_InfoGetCharAlloc(info, full_key, str_value, _RC)
137137
metadata%conservation_type = ConservationType(str_value)
138138
end if
139139

@@ -142,7 +142,7 @@ function make_ConservationMetadata(info, key, rc) result(metadata)
142142
if (present(key)) full_key = key // full_key
143143
is_present = ESMF_InfoIsPresent(info, key=full_key, _RC)
144144
if (is_present) then
145-
call MAPL_InfoGet(info, full_key, is_conservable_buffer, _RC)
145+
call ESMF_InfoGet(info, full_key, is_conservable_buffer, _RC)
146146
metadata%is_conservable = is_conservable_buffer
147147
end if
148148

@@ -173,4 +173,4 @@ logical function not_equal_to(lhs, rhs) result(not_equals)
173173
not_equals = .not. (lhs == rhs)
174174
end function not_equal_to
175175

176-
end module mapl3g_ConservationMetadata
176+
end module mapl_ConservationMetadata
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module mapl3g_ConservationType
1+
module mapl_ConservationType
22
implicit none(type, external)
33
private
44

@@ -103,4 +103,4 @@ function conservation_type_from_string(name, rc) result(ctype)
103103
if (present(rc)) rc = 0
104104
end function conservation_type_from_string
105105

106-
end module mapl3g_ConservationType
106+
end module mapl_ConservationType

0 commit comments

Comments
 (0)