MPI_Type_create_hindexed_block(3)

πŸ“¦
version 5.0.1 Β· 5 versions
, in nixos 26.05, ubuntu stonking

πŸ’– MPI_Type_create_hindexed_block β€” bestie edition πŸ’–

okay so this is the MPI manual page for MPI_Type_create_hindexed_block, and it's literally here to help you build an hindexed datatype with constant-sized blocks ✨


🌸 NAME 🌸

MPI_Type_create_hindexed_block β€” create an hindexed datatype with constant-sized blocks 🧚


✨ SYNOPSIS ✨

int MPI_Type_create_hindexed_block(int count, int blocklength,
const MPI_Aint array_of_displacements[],
MPI_Datatype oldtype, MPI_Datatype *newtype)
int MPI_Type_create_hindexed_block_c(MPI_Count count, MPI_Count blocklength,
const MPI_Count array_of_displacements[],
MPI_Datatype oldtype,
MPI_Datatype *newtype)

πŸ’… INPUT PARAMETERS πŸ’…

  • count β€” the length of the array of displacements. it's a non-negative integer, no cap. πŸŽ€
  • blocklength β€” size of each block. also a non-negative integer. πŸ‘‘
  • array_of_displacements β€” the byte displacement of each block, as integers. this is the main character array fr. ⭐
  • oldtype β€” the old datatype, as a handle. πŸ¦‹

🫢 OUTPUT PARAMETERS 🫢

  • newtype β€” the new datatype, as a handle. she's born ✨

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

This routine is thread-safe. That means you can safely use it from multiple threads without needing any user-provided thread locks. no cap, go off. πŸ’…

BUT β€” and this is the important part bestie β€” the routine is not interrupt safe. Typically that's because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so like, don't @ it with signals. 😭


🌈 NOTES FOR FORTRAN 🌈

All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an extra argument ierr tacked onto the end of the argument list. ierr is an integer and it means the same thing as the return value of the routine in C. In Fortran, MPI routines are subroutines, and you invoke them with the call statement. πŸŽ€

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. periodt. πŸ’–


πŸ’€ ERRORS πŸ’€

All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β€” C routines as the value of the function, and Fortran routines in the last argument. Before the value is returned, the current MPI error handler gets called. By default, this error handler aborts the MPI job. like, full stop, the whole job. 😳

The error handler may be changed with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated β€” don't be that girl. πŸ™ˆ

The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. 🫢

  • MPI_SUCCESS β€” no error; the MPI routine completed successfully. we love a happy ending πŸ’–
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and isn't identified by a specific error class (e.g., MPI_ERR_RANK). πŸ’€
  • MPI_ERR_COUNT β€” invalid count argument. count arguments must be non-negative; a count of zero is often valid. πŸ“
  • MPI_ERR_TYPE β€” invalid datatype argument. additionally, this error can occur if an uncommitted MPI_Datatype (see MPI_Type_commit) is used in a communication call. not me forgetting to commit 😭
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code. the catch-all, iykyk. ⭐

bestie reminder: count and blocklength are non-negative, array_of_displacements is in bytes, and if anything goes sideways, check the error class before spiralling. πŸ’…

and that's the whole page, no notes. this was the MPI manual page MPI_Type_create_hindexed_block(3) from the MPI documentation, dated 4/10/2026 🌈 β€” slay, go build some datatypes, and stay threaded-safe out there πŸ’œβœ¨

πŸ“¦ where this page comes from