MPI_TYPE_HVECTOR(3)
π MPI_TYPE_HVECTOR(3) π
ok so real talk bestie, this is an Open MPI page β welcome to the strided-datatype corner of the universe π¦
β¨ NAME β¨
MPI_Type_hvector β makes you a vector (strided) datatype where the offset is measured in bytes. but babes, heads up: this routine is deprecated in favor of MPI_Type_create_hvector π
πΈ SYNTAX πΈ
π C Syntax
#include <mpi.h>
int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_HVECTOR(COUNT, BLOCKLENGTH, STRIDE, OLDTYPE, NEWTYPE,
IERROR)
INTEGER COUNT, BLOCKLENGTH, STRIDE, OLDTYPE
INTEGER NEWTYPE, IERROR
π INPUT PARAMETERS π
countβ how many blocks you're working with. it's a nonnegative integer, no cap, no drama π«Άblocklengthβ how many elements live inside each one of those blocks. also a nonnegative integer β¨strideβ the number of bytes between the start of each block. integer, and yes the byte thing is literally the whole point of this variant πoldtypeβ the old datatype, as a handle. the blueprint you're building on π§
π OUTPUT PARAMETERS π
newtypeβ your brand new datatype, as a handle. main character energy πierrorβ Fortran only: the error status, as an integer π
β DESCRIPTION β
so here's the tea π β use of this routine is deprecated as of MPI-2. like, it's not evil, it's just old news. the glow-up you want is MPI_Type_create_hvector instead. slay, moving on β¨
π ERRORS π
almost every MPI routine hands you back an error value, no cap:
- C routines give it to you as the return result of the function π₯
- Fortran routines tuck it into the last argument π
and before that error value even reaches you, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. that's just how it goes π
if there's no communication object associated with the MPI call, then the call counts as being attached to MPI_COMM_SELF and it'll call that associated MPI error handler. π¦
now, when MPI_COMM_SELF is not initialized β i.e. before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β the error raises the initial error handler. and you can change that initial error handler:
- by calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen you're using the World model π - or via the
mpi_initial_errhandlerCLI argument tompiexecπ» - or via the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multipleπ£
and if no other appropriate error handler has been set? then MPI_ERRORS_RETURN gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. periodt π
Open MPI ships three predefined error handlers you can use, and honestly they're iconic:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic? yes. effective? also yes πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. when it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if it's called on a window or file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. if it's called on a session, it aborts only the local process πMPI_ERRORS_RETURNβ returns an error code to the application. the chill one π«Ά
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ note that MPI does not guarantee that an MPI program can continue past an error. like, fr fr, don't assume you can just keep vibing after one π
see the MPI man page for a full list of MPI error codes π
see the Error Handling section of the MPI-3.1 standard for more information π§
π SEE ALSO π
MPI_Type_create_hvectorβ the non-deprecated glow-up, go here first bestie πMPI_Type_vectorπΈ
π COPYRIGHT π
2003-2026, The Open MPI Community
and that's the whole page, bestie π this little gem was served up on Sep 11, 2026 by the lovely humans of The Open MPI Community β go forth and stride responsibly π¦β¨π
π¦ 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