Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ and [`docs/contributing.rst`](docs/contributing.rst):
single DSO. See the "Symbol Visibility" section of
[`docs/developers/source-code.rst`](docs/developers/source-code.rst)
and [`ompi/mpi/README_ABI.md`](ompi/mpi/README_ABI.md).

> **When hiding internal implementation functions with public ABI wrappers:**
> If an internal function (e.g., `ompi_abi_*`) has a corresponding public ABI
> function (e.g., `MPI_Abi_*`) and is only called through that wrapper, the
> internal function can be marked `OMPI_HIDDEN`. Update any direct callers
> (e.g., tests) to use the public wrapper. Note: Public wrappers may have
> additional requirements (e.g., MPI initialization or error handling) not
> present in the internal implementation.

- **New files need the standard copyright/license header.** Copy the
multi-institution BSD header block — including the `$COPYRIGHT$` and
`$HEADER$` tokens — from a neighboring file. If you substantially
Expand Down
6 changes: 3 additions & 3 deletions ompi/mpi/bindings/ompi_bindings/c.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2024-2026 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2023 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2026 NVIDIA Corporation. All rights reserved.
Expand Down Expand Up @@ -508,9 +508,9 @@ def generate_status_convert_fn_intern_to_abi(self):

def generate_errhandler_args_convert_fn_intern_to_abi(self, header_only=False):
if header_only == True:
self.dump(f'void ompi_convert_errhandler_args_intern_to_abi(void *object, int object_type, int *err_code);')
self.dump(f'OMPI_HIDDEN void ompi_convert_errhandler_args_intern_to_abi(void *object, int object_type, int *err_code);')
return
self.dump(f'void ompi_convert_errhandler_args_intern_to_abi(void *object, int object_type, int *err_code)')
self.dump(f'OMPI_HIDDEN void ompi_convert_errhandler_args_intern_to_abi(void *object, int object_type, int *err_code)')
self.dump('{')
lines = []
lines.append('ompi_communicator_t **comm;')
Expand Down
38 changes: 19 additions & 19 deletions ompi/mpi/c/attr_fn_abi.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2025 Triad National Security, LLC. All rights
* Copyright (c) 2025-2026 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand All @@ -31,32 +31,32 @@
* variables used for certain predefined attributes,
* e.g. MPI_IO, MPI_HOST
*/
int ompi_abi_mpi_proc_null_val = MPI_PROC_NULL_ABI_INTERNAL;
int ompi_abi_mpi_any_source_val = MPI_ANY_SOURCE_ABI_INTERNAL;
int ompi_abi_mpi_lastusedcode = 0;
OMPI_HIDDEN int ompi_abi_mpi_proc_null_val = MPI_PROC_NULL_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_any_source_val = MPI_ANY_SOURCE_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_lastusedcode = 0;

/*
* variables used for certain predefined attributes
* for windows
*/
int ompi_abi_mpi_win_flavor_create = MPI_WIN_FLAVOR_CREATE_ABI_INTERNAL;
int ompi_abi_mpi_win_flavor_allocate = MPI_WIN_FLAVOR_ALLOCATE_ABI_INTERNAL;
int ompi_abi_mpi_win_flavor_shared = MPI_WIN_FLAVOR_SHARED_ABI_INTERNAL;
int ompi_abi_mpi_win_flavor_dynamic = MPI_WIN_FLAVOR_DYNAMIC_ABI_INTERNAL;
int ompi_abi_mpi_win_model_unified = MPI_WIN_UNIFIED_ABI_INTERNAL;
int ompi_abi_mpi_win_model_separate = MPI_WIN_SEPARATE_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_flavor_create = MPI_WIN_FLAVOR_CREATE_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_flavor_allocate = MPI_WIN_FLAVOR_ALLOCATE_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_flavor_shared = MPI_WIN_FLAVOR_SHARED_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_flavor_dynamic = MPI_WIN_FLAVOR_DYNAMIC_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_model_unified = MPI_WIN_UNIFIED_ABI_INTERNAL;
OMPI_HIDDEN int ompi_abi_mpi_win_model_separate = MPI_WIN_SEPARATE_ABI_INTERNAL;

/*
* predefined callbacks for win, comm, type attributes
*/
int ABI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
OMPI_HIDDEN int ABI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
void* attribute_val_out,
void* extra_state )
{
return MPI_SUCCESS;
}

int ABI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
OMPI_HIDDEN int ABI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
void* extra_state,
void* attribute_val_in,
void* attribute_val_out,
Expand All @@ -66,7 +66,7 @@ int ABI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_ke
return MPI_SUCCESS;
}

int ABI_C_MPI_TYPE_DUP_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
OMPI_HIDDEN int ABI_C_MPI_TYPE_DUP_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
void* extra_state,
void* attribute_val_in, void* attribute_val_out,
int* flag )
Expand All @@ -76,14 +76,14 @@ int ABI_C_MPI_TYPE_DUP_FN( MPI_Datatype_ABI_INTERNAL datatype, int type_keyval,
return MPI_SUCCESS;
}

int ABI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win_ABI_INTERNAL window, int win_keyval,
OMPI_HIDDEN int ABI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win_ABI_INTERNAL window, int win_keyval,
void* attribute_val_out,
void* extra_state )
{
return MPI_SUCCESS;
}

int ABI_C_MPI_WIN_NULL_COPY_FN( MPI_Win_ABI_INTERNAL window, int win_keyval,
OMPI_HIDDEN int ABI_C_MPI_WIN_NULL_COPY_FN( MPI_Win_ABI_INTERNAL window, int win_keyval,
void* extra_state,
void* attribute_val_in,
void* attribute_val_out, int* flag )
Expand All @@ -92,7 +92,7 @@ int ABI_C_MPI_WIN_NULL_COPY_FN( MPI_Win_ABI_INTERNAL window, int win_keyval,
return MPI_SUCCESS;
}

int ABI_C_MPI_WIN_DUP_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, void* extra_state,
OMPI_HIDDEN int ABI_C_MPI_WIN_DUP_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, void* extra_state,
void* attribute_val_in, void* attribute_val_out,
int* flag )
{
Expand All @@ -101,14 +101,14 @@ int ABI_C_MPI_WIN_DUP_FN( MPI_Win_ABI_INTERNAL window, int win_keyval, void* ext
return MPI_SUCCESS;
}

int ABI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval,
OMPI_HIDDEN int ABI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval,
void* attribute_val_out,
void* extra_state )
{
return MPI_SUCCESS;
}

int ABI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval,
OMPI_HIDDEN int ABI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval,
void* extra_state,
void* attribute_val_in,
void* attribute_val_out, int* flag )
Expand All @@ -117,7 +117,7 @@ int ABI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval,
return MPI_SUCCESS;
}

int ABI_C_MPI_COMM_DUP_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval, void* extra_state,
OMPI_HIDDEN int ABI_C_MPI_COMM_DUP_FN( MPI_Comm_ABI_INTERNAL comm, int comm_keyval, void* extra_state,
void* attribute_val_in, void* attribute_val_out,
int* flag )
{
Expand Down
14 changes: 8 additions & 6 deletions ompi/mpi/c/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2026 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -118,14 +120,14 @@ BEGIN_C_DECLS
} while (0)


int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag,
OMPI_HIDDEN int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag,
void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status);
int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag,
OMPI_HIDDEN int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag,
void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request * request);
int ompi_abi_get_fortran_info(ompi_info_t **info);
int ompi_abi_set_fortran_info(ompi_info_t *info);
int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
int ompi_abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false);
OMPI_HIDDEN int ompi_abi_get_fortran_info(ompi_info_t **info);
OMPI_HIDDEN int ompi_abi_set_fortran_info(ompi_info_t *info);
OMPI_HIDDEN int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
OMPI_HIDDEN int ompi_abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false);

END_C_DECLS

Expand Down
6 changes: 3 additions & 3 deletions ompi/mpi/c/isendrecv_replace.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2024 Triad National Security, LLC. All rights
* Copyright (c) 2021-2026 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2026 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -68,12 +68,12 @@ static void ompi_isendrecv_context_destructor(ompi_isendrecv_replace_context_t *
OBJ_DESTRUCT(&context->convertor);
}

OBJ_CLASS_INSTANCE(ompi_isendrecv_replace_context_t,
OMPI_HIDDEN OBJ_CLASS_INSTANCE(ompi_isendrecv_replace_context_t,
opal_object_t,
ompi_isendrecv_context_constructor,
ompi_isendrecv_context_destructor);
#else
OBJ_CLASS_DECLARATION(ompi_isendrecv_replace_context_t);
OMPI_HIDDEN OBJ_CLASS_DECLARATION(ompi_isendrecv_replace_context_t);
#endif /* OMPI_BUILD_MPI_PROFILING */

static int ompi_isendrecv_replace_complete_func (ompi_comm_request_t *request)
Expand Down
10 changes: 5 additions & 5 deletions ompi/mpi/c/ompi_abi_fortran.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2023, 2026 Jeffrey M. Squyres. All rights reserved.
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
* Copyright (c) 2024-2026 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -70,7 +70,7 @@ static int ompi_abi_fortran_finalize(void)
return OMPI_SUCCESS;
}

int ompi_abi_get_fortran_info(ompi_info_t **info)
OMPI_HIDDEN int ompi_abi_get_fortran_info(ompi_info_t **info)
{
ompi_info_t *newinfo = NULL;
int ret = MPI_SUCCESS;
Expand Down Expand Up @@ -185,7 +185,7 @@ int ompi_abi_get_fortran_info(ompi_info_t **info)
return ret;
}

int ompi_abi_set_fortran_info(ompi_info_t *info)
OMPI_HIDDEN int ompi_abi_set_fortran_info(ompi_info_t *info)
{
int ret = MPI_SUCCESS;
static bool already_called = false;
Expand Down Expand Up @@ -225,7 +225,7 @@ int ompi_abi_set_fortran_info(ompi_info_t *info)

}

int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set)
OMPI_HIDDEN int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set)
{
int ret = MPI_SUCCESS;

Expand Down Expand Up @@ -451,7 +451,7 @@ int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *lo
return ret;
}

int ompi_abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false)
OMPI_HIDDEN int ompi_abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false)
{
int ret=MPI_SUCCESS;
static bool already_called = false;
Expand Down
6 changes: 3 additions & 3 deletions ompi/mpi/c/ompi_isendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2021-2024 Triad National Security, LLC. All rights
* Copyright (c) 2021-2026 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -45,7 +45,7 @@ struct ompi_isendrecv_context_t {
};

typedef struct ompi_isendrecv_context_t ompi_isendrecv_context_t;
OBJ_CLASS_INSTANCE(ompi_isendrecv_context_t, opal_object_t, NULL, NULL);
OMPI_HIDDEN OBJ_CLASS_INSTANCE(ompi_isendrecv_context_t, opal_object_t, NULL, NULL);

static int ompi_isendrecv_complete_func (ompi_comm_request_t *request)
{
Expand Down Expand Up @@ -77,7 +77,7 @@ static int ompi_isendrecv_complete_func (ompi_comm_request_t *request)
return OMPI_SUCCESS;
}

int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request * request)
OMPI_HIDDEN int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request * request)
{
ompi_isendrecv_context_t *context = NULL;
ompi_comm_request_t *crequest;
Expand Down
4 changes: 2 additions & 2 deletions ompi/mpi/c/ompi_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* Copyright (c) 2024-2026 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand All @@ -36,7 +36,7 @@
#include "ompi/memchecker.h"
#include "ompi/runtime/ompi_spc.h"

int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status)
OMPI_HIDDEN int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status)
{
ompi_request_t* req = MPI_REQUEST_NULL;
int rc = MPI_SUCCESS;
Expand Down
28 changes: 15 additions & 13 deletions ompi/mpi/tool/mpit-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2025 Triad National Security, LLC. All rights
* Copyright (c) 2025-2026 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2026 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -43,8 +43,8 @@ typedef struct ompi_mpit_cvar_handle_t {
void *bound_object;
} ompi_mpit_cvar_handle_t;

void ompi_mpit_lock (void);
void ompi_mpit_unlock (void);
OMPI_HIDDEN void ompi_mpit_lock (void);
OMPI_HIDDEN void ompi_mpit_unlock (void);

OMPI_DECLSPEC extern volatile uint32_t ompi_mpit_init_count;

Expand All @@ -57,15 +57,17 @@ OMPI_DECLSPEC extern volatile uint32_t ompi_mpit_init_count;
why the two must never be conflated). */
OMPI_DECLSPEC extern int ompi_mpit_thread_level;

OMPI_HIDDEN extern opal_mutex_t ompi_mpit_big_lock;

/* Set when a first MPI_T_init_thread() failed partway through framework
registration, which is not unwindable; MPI_T can never be brought up
in this process again, and MPI_T_finalize() must not run the component
closes (see both files for the details). */
extern bool ompi_mpit_init_failed;
OMPI_HIDDEN extern bool ompi_mpit_init_failed;

int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype);
int ompit_opal_to_mpit_error (int rc);
bool ompit_obj_invalid(void *obj_handle);
OMPI_HIDDEN int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype);
OMPI_HIDDEN int ompit_opal_to_mpit_error (int rc);
OMPI_HIDDEN bool ompit_obj_invalid(void *obj_handle);

/* --- MPI_T events support (see specs/mpi-t-events/spec.md sec. 6) --------- */

Expand Down Expand Up @@ -94,24 +96,24 @@ typedef struct ompi_mpit_event_cb_ctx_t {
void *user_data;
} ompi_mpit_event_cb_ctx_t;

ompi_mpit_event_cb_ctx_t *ompit_event_cb_ctx_new(ompit_generic_fn_t fn, void *user_data);
void ompit_event_ctx_release(void *user_data);
OMPI_HIDDEN ompi_mpit_event_cb_ctx_t *ompit_event_cb_ctx_new(ompit_generic_fn_t fn, void *user_data);
OMPI_HIDDEN void ompit_event_ctx_release(void *user_data);

/* Trampolines with the OPAL callback signatures; each forwards to the user's
MPI_T callback after casting the opaque handles. Calling an MPI_T callback
through an OPAL function-pointer type would be undefined behaviour, so these
bridge the (function-pointer) type mismatch. */
void ompit_event_cb_trampoline(mca_base_event_instance_t *inst,
OMPI_HIDDEN void ompit_event_cb_trampoline(mca_base_event_instance_t *inst,
mca_base_event_registration_t *reg,
mca_base_event_cb_safety_t cb_safety, void *user_data);
void ompit_event_dropped_trampoline(opal_count_t count, mca_base_event_registration_t *reg,
OMPI_HIDDEN void ompit_event_dropped_trampoline(opal_count_t count, mca_base_event_registration_t *reg,
int source_index, mca_base_event_cb_safety_t cb_safety,
void *user_data);
void ompit_event_free_trampoline(mca_base_event_registration_t *reg,
OMPI_HIDDEN void ompit_event_free_trampoline(mca_base_event_registration_t *reg,
mca_base_event_cb_safety_t cb_safety, void *user_data);

/* Install the OPAL debug raise-check hook (a no-op unless OPAL_ENABLE_DEBUG). */
void ompit_install_event_debug_hook(void);
OMPI_HIDDEN void ompit_install_event_debug_hook(void);

static inline int mpit_is_initialized (void)
{
Expand Down
Loading
Loading