MPI_AINT_ADD(3)
π MPI_AINT_ADD π
okay bestie, welcome to the Open MPI manual page for MPI_Aint_add and MPI_Aint_diff β the portable girlies for doing arithmetic on MPI_Aint values β¨ no cap, this is the whole thing, so grab a boba π
πΈ SYNTAX πΈ
β¨ C Syntax β¨
#include <mpi.h>
MPI_Aint MPI_Aint_add(MPI_Aint base, MPI_Aint disp)
MPI_Aint MPI_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
π Fortran Syntax π
USE MPI
! or the older form: INCLUDE 'mpif.h'
INTEGER(KIND=MPI_ADDRESS_KIND) MPI_AINT_ADD(BASE, DISP)
INTEGER(KIND=MPI_ADDRESS_KIND) BASE, DISP
INTEGER(KIND=MPI_ADDRESS_KIND) MPI_AINT_DIFF(ADDR1, ADDR2)
INTEGER(KIND=MPI_ADDRESS_KIND) ADDR1, ADDR2
π¦ Fortran 2008 Syntax π¦
USE mpi_f08
INTEGER(KIND=MPI_ADDRESS_KIND) MPI_AINT_ADD(BASE, DISP)
INTEGER(KIND=MPI_ADDRESS_KIND) BASE, DISP
INTEGER(KIND=MPI_ADDRESS_KIND) MPI_AINT_DIFF(ADDR1, ADDR2)
INTEGER(KIND=MPI_ADDRESS_KIND) ADDR1, ADDR2
π INPUT PARAMETERS π
baseβ base address, and yeah it's an integer bestie πdispβ the displacement, also an integer, no thoughts head empty π«Άaddr1β minuend address (integer), she comes first π₯addr2β subtrahend address (integer), she gets taken away π
π DESCRIPTION π
ok so MPI_Aint_add produces a brand-new MPI_Aint value that's equivalent to the sum of the base and disp arguments. base here represents a base address that got returned by a call to MPI_Get_address, and disp represents a signed integer displacement. the resulting address is valid only at the process that generated base, and it must correspond to a location in the same object referenced by base, exactly like MPI-3.1 section 4.1.12 says. the addition is performed in a manner that results in the correct MPI_Aint representation of the output address, as if the process that originally produced base had called:
MPI_Get_address ((char *) base + disp, &result);
lowkey iconic, right? β¨
MPI_Aint_diff produces a new MPI_Aint value that's equivalent to the difference between the addr1 and addr2 arguments, where addr1 and addr2 represent addresses returned by calls to MPI_Get_address. the resulting address is valid only at the process that generated addr1 and addr2, and addr1 and addr2 must correspond to locations in the same object in the same process, as described in MPI-3.1 section 4.1.12. the difference is calculated in a manner that results in the signed difference from addr1 to addr2, as if the process that originally produced the addresses had called (char *) addr1 - (char *) addr2 on the addresses initially passed to MPI_Get_address.
ngl bestie, mind the "same object, same process" rule β the vibes are portable but the addresses are not, and that's on purpose π
See also:
MPI_Get_address
π Copyright π
2003-2026, The Open MPI Community
and that's a wrap, my love π«Ά this whole page came to you straight out of Open MPI, dated Sep 10, 2026, filed under MPI_AINT_ADD(3) β go forth and do cute portable pointer math, periodt π
β¨
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms