MPI_AINT_ADD(3)
π NAME π
okay so bestie, this is the MPI_AINT_ADD(3) page from the Open MPI manual π Itβs all about MPI_Aint_add and MPI_Aint_diff: portable functions for arithmetic on MPI_Aint values. Address math, but make it portable. Slay.
β¨ 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 (integer). The starting point, bestie.dispβ Displacement (integer). The signed integer displacement.addr1β Minuend address (integer). The address being subtracted from.addr2β Subtrahend address (integer). The address doing the subtracting.
π₯ DESCRIPTION π₯
Okay so hereβs the tea β MPI_Aint_add produces a new MPI_Aint value that is equivalent to the sum of the base and disp arguments. In this little situation, base represents a base address 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, as described in MPI-3.1 section 4.1.12. 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);
MPI_Aint_diff produces a new MPI_Aint value that is equivalent to the difference between the addr1 and addr2 arguments. Here, 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.
π SEE ALSO π
MPI_Get_addressβ the address-getter bestie that keeps showing up on this page π
π COPYRIGHT π
2003-2026, The Open MPI Community
xoxo, bestie β this page is from the Open MPI manual, dated Sep 11, 2026 πβ¨
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms