GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
fortran/openmp

Fortran/OpenMP adds module support for declare mapper

The Fortran OpenMP implementation now fully supports `declare mapper` directives, allowing their definitions to be shared and resolved via modules.

The Fortran OpenMP implementation in GCC now fully supports the declare mapper directive, addressing previous limitations and removing “sorry, unimplemented” messages. Mapper resolution has moved from the parsing stage to a later resolution stage, and definitions can now be stored and loaded from Fortran modules. This change allows users to define custom data mappings for OpenMP in one module and use them across different compilation units, greatly improving the modularity and usability of OpenMP’s advanced mapping features.

In Details

This commit significantly enhances the Fortran OpenMP front end's support for declare mapper directives. Key changes involve moving mapper_id resolution from parsing to a later resolution stage (in gfc_find_omp_udm and resolve_omp_clauses), allowing for more flexible type checking. Crucially, module.cc is updated to serialize and deserialize user-defined mappers (write_omp_udm, load_omp_udms) into and out of module files, adding MOD_VERSION_NUMERIC and new structures in gfortran.h (gfc_omp_namelist_udm). This enables the sharing and reuse of declare mapper definitions ac…

For Context

OpenMP is a set of tools in Fortran for writing programs that can run on multiple processors at once. A 'mapper' is a custom rule you can define for how your program's data should be structured and moved around when it runs in parallel. This update vastly improves how Fortran compilers handle these custom mappers. Previously, defining a mapper might have resulted in a "sorry, unimplemented" message, or the compiler couldn't easily share these mapper rules between different parts of your code. Now, you can define a mapper in one file (a 'module') and then use it in other files, making your parallel Fortran programs more organized and powerful. The compiler now fully understands and processes these custom data mapping rules, removing previous limitations.

Filed Under: fortranopenmpmodules