MPI_AINT_DIFF(3)

πŸ“¦
version 5.0.10 Β· 4 versions
, in ubuntu stonking

πŸ’– MPI_Aint_add + MPI_Aint_diff πŸ’–

okay so bestie, you just opened the Open MPI manual page for MPI_Aint_add and MPI_Aint_diff β€” literally the portable functions for arithmetic on MPI_Aint values, and ngl they are kind of the moment. πŸ’…


✨ 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 β€” the base address bestie, and it's an integer πŸ’œ
  • disp β€” the displacement, also an integer ✨
  • addr1 β€” the minuend address (integer, yes, still an integer πŸ™ˆ)
  • addr2 β€” the subtrahend address (integer, we stay consistent around here)

πŸ¦‹ DESCRIPTION πŸ¦‹

MPI_Aint_add produces a new MPI_Aint value that is equivalent to the sum of the base and disp arguments, where 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, 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. fr fr, that's the whole vibe check. πŸ’€

bestie please note: both of these are doing pointer-ish math behind the scenes, so the "same object, same process" rule is not a suggestion, it's the law πŸ‘‘ stay in your lane and everything slays.

πŸ‘€ See also:

  • MPI_Get_address

2003-2026, The Open MPI Community


and that's a wrap, queen 🫢 this whole page came to you straight from Open MPI, dated Sep 10, 2026, filed under MPI_AINT_DIFF(3) β€” go forth and add and diff responsibly, no cap 🌈✨

πŸ“¦ where this page comes from