Skip to content

Feature macros for new features #1002

@devreal

Description

@devreal

Problem

Implementing new features included in a new version of MPI can take significant efforts for implementors and may happen over several releases. Users relying on the MPI version number to test for features may not be able to use a certain until all new features of the new MPI version are properly implemented, even if the desired feature is available in an earlier release of the implementation.

Proposal

New features should introduce a feature test macro, similar to C++. For example, __cpp_lib_atomic_ref can be used to test for std::atomic_ref introduced in C++20.

This will allow applications to conditionally use a feature as soon as they are available in one implementation without having to rely on MPI version numbers. It would also allow applications an easier path to testing features before they were voted into the standard.

Changes to the Text

A short introduction that explains the role of feature macros will be needed. This will mostly impact future features and would have to be enforced by the Forum.

Impact on Implementations

None (other than having to define the feature macro once the feature is supported).

Impact on Users

Earlier access to features, better support for conditional use of features.

References and Pull Requests

C++ feature macro documentation: https://en.cppreference.com/w/cpp/feature_test.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions