Skip to content
Merged
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
2 changes: 2 additions & 0 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2023-2025 Jeffrey M. Squyres. All rights reserved.
# Copyright (c) 2025 Triad National Security, LLC. All rights reserved.
#
# $COPYRIGHT$
#
Expand Down Expand Up @@ -257,6 +258,7 @@ OMPI_MAN3 = \
MPI_Get_count.3 \
MPI_Get_elements.3 \
MPI_Get_elements_x.3 \
MPI_Get_hw_resource_info.3 \
MPI_Get_library_version.3 \
MPI_Get_processor_name.3 \
MPI_Get_version.3 \
Expand Down
35 changes: 35 additions & 0 deletions docs/man-openmpi/man3/MPI_Get_hw_resource_info.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _mpi_info_get_hw_resource_info:


MPI_Info_get_hw_resource_info
=============================

.. include_body

:ref:`MPI_Info_get_hw_resource_info` |mdash| Returns an info object containing information pertaining to the hardware platform
are used.

.. The following file was automatically generated
.. include:: ./bindings/mpi_get_hw_resource_info.rst

OUTPUT PARAMETERS
-----------------
* ``info``: Info object created (handle).
* ``ierror``: Fortran only: Error status (integer).

DESCRIPTION
-----------

:ref:`MPI_Info_get_hw_resource_info` an info object containing information pertaining to the hardware platform on
which the calling \MPI/ process is executing at the moment of the call. The application is responsible for freeing
the returned info object using :ref:`MPI_Info_free`.

.. note:: Open MPI currently provides no hardware platform information in the returned ``info`` object.

ERRORS
------

.. include:: ./ERRORS.rst

.. seealso::
* :ref:`MPI_Info_free`
1 change: 1 addition & 0 deletions docs/man-openmpi/man3/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ MPI API manual pages (section 3)
MPI_Get_count.3.rst
MPI_Get_elements.3.rst
MPI_Get_elements_x.3.rst
MPI_Get_hw_resource_info.3.rst
MPI_Get_library_version.3.rst
MPI_Get_processor_name.3.rst
MPI_Get_version.3.rst
Expand Down
2 changes: 2 additions & 0 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,7 @@ OMPI_DECLSPEC int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype
OMPI_DECLSPEC int MPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
OMPI_DECLSPEC int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
OMPI_DECLSPEC int MPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
OMPI_DECLSPEC int MPI_Get_hw_resource_info(MPI_Info *hw_info);
OMPI_DECLSPEC int MPI_Get(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count,
Expand Down Expand Up @@ -3048,6 +3049,7 @@ OMPI_DECLSPEC int PMPI_Get_count(const MPI_Status *status, MPI_Datatype datatyp
OMPI_DECLSPEC int PMPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
OMPI_DECLSPEC int PMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
OMPI_DECLSPEC int PMPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
OMPI_DECLSPEC int PMPI_Get_hw_resource_info(MPI_Info *hw_info);
OMPI_DECLSPEC int PMPI_Get(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count,
Expand Down
6 changes: 4 additions & 2 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
# reserved.
# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights reserved.
# Copyright (c) 2025 Triad National Security, LLC. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -215,8 +216,9 @@ prototype_sources = \
get_count.c.in \
get_elements.c.in \
get_elements_x.c.in \
get_library_version.c.in \
get_processor_name.c.in \
get_hw_resource_info.c.in \
get_library_version.c.in \
get_processor_name.c.in \
get_version.c.in \
graph_create.c.in \
graphdims_get.c.in \
Expand Down
65 changes: 65 additions & 0 deletions ompi/mpi/c/get_hw_resource_info.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2020 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

#include "ompi_config.h"

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"

/**
* Create a info object holding local hardware resource info.
*
* @param info Pointer to the MPI_Info handle
*
* @retval MPI_SUCCESS
* @retval MPI_ERR_INFO
* @retval MPI_ERR_NO_MEM
*
* When an MPI_Info object is not being used, it should be freed using
* MPI_Info_free
*/
PROTOTYPE ERROR_CLASS get_hw_resource_info(INFO_OUT info)
{
if (MPI_PARAM_CHECK) {
if (NULL == info) {
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_INFO,
FUNC_NAME);
}
}

/*
* Just allocate an info object. No resources currently being
* specified so just return empty info object.
*/

*info = ompi_info_allocate ();
if (NULL == (*info)) {
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM,
FUNC_NAME);
}

return MPI_SUCCESS;
}
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
get_count_f.c \
get_elements_f.c \
get_elements_x_f.c \
get_hw_resource_info_f.c \
get_library_version_f.c \
get_processor_name_f.c \
get_version_f.c \
Expand Down
81 changes: 81 additions & 0 deletions ompi/mpi/fortran/mpif-h/get_hw_resource_info_f.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Triad National Security, LLC. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

#include "ompi_config.h"

#include "ompi/mpi/fortran/mpif-h/bindings.h"

#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak PMPI_GET_HW_RESOURCE_INFO = ompi_get_hw_resource_info_f
#pragma weak pmpi_get_hw_resource_info = ompi_get_hw_resource_info_f
#pragma weak pmpi_get_hw_resource_info_ = ompi_get_hw_resource_info_f
#pragma weak pmpi_get_hw_resource_info__ = ompi_get_hw_resource_info_f

#pragma weak PMPI_Get_hw_resource_info_f = ompi_get_hw_resource_info_f
#pragma weak PMPI_Get_hw_resource_info_f08 = ompi_get_hw_resource_info_f
#else
OMPI_GENERATE_F77_BINDINGS (PMPI_GET_HW_RESOURCE_INFO,
pmpi_get_hw_resource_info,
pmpi_get_hw_resource_info_,
pmpi_get_hw_resource_info__,
pompi_get_hw_resource_info_f,
(MPI_Fint *info, MPI_Fint *ierr),
(info, ierr) )
#endif
#endif

#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_GET_HW_RESOURCE_INFO = ompi_get_hw_resource_info_f
#pragma weak mpi_get_hw_resource_info = ompi_get_hw_resource_info_f
#pragma weak mpi_get_hw_resource_info_ = ompi_get_hw_resource_info_f
#pragma weak mpi_get_hw_resource_info__ = ompi_get_hw_resource_info_f

#pragma weak MPI_Get_hw_resource_info_f = ompi_get_hw_resource_info_f
#pragma weak MPI_Get_hw_resource_info_f08 = ompi_get_hw_resource_info_f
#else
#if ! OMPI_BUILD_MPI_PROFILING
OMPI_GENERATE_F77_BINDINGS (MPI_GET_HW_RESOURCE_INFO,
mpi_get_hw_resource_info,
mpi_get_hw_resource_info_,
mpi_get_hw_resource_info__,
ompi_get_hw_resource_info_f,
(MPI_Fint *info, MPI_Fint *ierr),
(info, ierr) )
#else
#define ompi_get_hw_resource_info_f pompi_get_hw_resource_info_f
#endif
#endif


void ompi_get_hw_resource_info_f(MPI_Fint *info, MPI_Fint *ierr)
{
int c_ierr;
MPI_Info c_info;

c_ierr = PMPI_Get_hw_resource_info(&c_info);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

if (MPI_SUCCESS == c_ierr) {
*info = PMPI_Info_c2f(c_info);
}
}
3 changes: 2 additions & 1 deletion ompi/mpi/fortran/mpif-h/profile/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Copyright (c) 2015-2021 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
# Copyright (c) 2019-2022 Triad National Security, LLC. All rights
# Copyright (c) 2019-2025 Triad National Security, LLC. All rights
# reserved.
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
# $COPYRIGHT$
Expand Down Expand Up @@ -203,6 +203,7 @@ linked_files = \
pget_count_f.c \
pget_elements_f.c \
pget_elements_x_f.c \
pget_hw_resource_info_f.c \
pget_library_version_f.c \
pget_processor_name_f.c \
pget_version_f.c \
Expand Down
3 changes: 2 additions & 1 deletion ompi/mpi/fortran/mpif-h/prototypes_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* reserved.
* Copyright (c) 2016-2023 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2019-2023 Triad National Security, LLC. All rights
* Copyright (c) 2019-2025 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -252,6 +252,7 @@ PN2(void, MPI_Get_address, mpi_get_address, MPI_GET_ADDRESS, (char *location, MP
PN2(void, MPI_Get_count, mpi_get_count, MPI_GET_COUNT, (MPI_Fint *status, MPI_Fint *datatype, MPI_Fint *count, MPI_Fint *ierr));
PN2(void, MPI_Get_elements, mpi_get_elements, MPI_GET_ELEMENTS, (MPI_Fint *status, MPI_Fint *datatype, MPI_Fint *count, MPI_Fint *ierr));
PN2(void, MPI_Get_elements_x, mpi_get_elements_x, MPI_GET_ELEMENTS_X, (MPI_Fint *status, MPI_Fint *datatype, MPI_Count *count, MPI_Fint *ierr));
PN2(void, MPI_Get_hw_resource_info, mpi_get_hw_resource_info, MPI_GET_HW_RESOURCE_INFO, (MPI_Fint *info, MPI_Fint *ierr));
PN2(void, MPI_Get, mpi_get, MPI_GET, (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *win, MPI_Fint *ierr));
PN2(void, MPI_Get_library_version, mpi_get_library_version, MPI_GET_LIBRARY_VERSION, (char *version, MPI_Fint *resultlen, MPI_Fint *ierr, MPI_Fint version_len));
PN2(void, MPI_Get_processor_name, mpi_get_processor_name, MPI_GET_PROCESSOR_NAME, (char *name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len));
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ prototype_files = \
get_address_ts.c.in \
get_count.c.in \
get_elements.c.in \
get_hw_resource_info.c.in \
get_ts.c.in \
iallgather_ts.c.in \
iallgatherv_ts.c.in \
Expand Down
35 changes: 35 additions & 0 deletions ompi/mpi/fortran/use-mpi-f08/get_hw_resource_info.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Triad National Security, LLC. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

PROTOTYPE VOID get_hw_resource_info(INFO_OUT info)
{
int c_ierr;
MPI_Info c_info;

c_ierr = @INNER_CALL@(&c_info);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

if (MPI_SUCCESS == c_ierr) {
*info = PMPI_Info_c2f(c_info);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

prototype_files = \
get_hw_resource_info.c.in \
request_get_status.c.in \
request_get_status_all.c.in \
request_get_status_any.c.in \
Expand Down