MPI_WIN_DUP_FN(3)
π MPI_WIN_DUP_FN π
okay so bestie, this is a page from the LAM/MPI manual β yes, MPI_WIN_DUP_FN(3), that one β and we're gonna get into it. it's short, it's sweet, it's literally the most no-thoughts-just-vibes function in all of MPI. let's go π¦
β¨ NAME β¨
MPI_WIN_DUP_FN β the built-in MPI function that simple-mindedly copies window attributes. and when i say simple-minded i mean it in the most affectionate way possible. it's not dumb, it's uncomplicated. main character energy fr π
πΈ SYNOPSIS πΈ
#include <mpi.h>
int MPI_WIN_DUP_FN(MPI_Win win, int key, void *extra,
void *attrin, void *attrout, int *flag)
π INPUT PARAMETERS π
winβ the window (handle). your lil window boo πͺkeyβ the key value (integer)extraβ extra stateattrinβ the in value for the attribute
π OUTPUT PARAMETERS π
attroutβ the out value for the attribute. this is where the copied thing lands β¨flagβ1if the attribute got copied successfully,0otherwise (logical)
π«Ά NOTES π«Ά
so here's the tea, and it's honestly iconic: this function blindly byte-copies attributes on windows. like, no looking, no thinking, just copy. and it's the default attribute-copying function for windows, so if you never set anything else, this is what you're getting. periodt.
it will always return MPI_SUCCESS, and flag will always be set to 1. no drama, no edge cases, no surprises. she's consistent.
the actual copy is performed by this code right here, and yes it's literally one line:
*((void **) attrout) = attrin;
and if that simple assignment isn't enough for your attributes β like if you've got something fancier going on in your head β then bestie you're gonna need to reassign the attribute-copying function on the relevant keyvals on windows using the MPI_Win_keyval_create function. that's the move. that's the fix. iykyk π
π NOTES FOR FORTRAN π
all MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK β those two are the exceptions, everyone else plays by the rules) have an additional argument ierr tacked on at the end of the argument list. ierr is an integer and it means the exact same thing as the return value of the routine in C. so like, same energy, different language π«
in Fortran, MPI routines are subroutines, and you invoke them with the call statement. yes, call. that's the vibe.
also, all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. not handles, not structs, just INTEGER. keep that in your notes bestie π
π SEE ALSO π
MPI_Win_keyval_create
π MORE INFORMATION π
for more information, please see the official MPI Forum web site β it's got the text of both the MPI-1 and MPI-2 standards. those documents contain detailed information about each MPI function, most of which is not duplicated in these man pages, so if you want the deep lore, that's where you go π§
http://www.mpi-forum.org/
πΈ ACKNOWLEDGEMENTS πΈ
the LAM Team would like to thank the MPICH Team for the handy program that generates man pages (that's "doctext" from ftp://ftp.mcs.anl.gov/pub/sowing/sowing.tar.gz), for the initial formatting, and for some initial text for most of the MPI-1 man pages. absolute legends, we love to see it π«Ά
π¦ LOCATION π¦
dupfn.c
and that's the whole page, bestie!! no cap, you now know everything MPI_WIN_DUP_FN(3) has to offer π
β¨
this was LAM/MPI 7.1.4, dated 6/24/2006 β yeah she's an elder but she still ate π go forth and copy those bytes, you got this π
π¦ where this page comes from
- debian bookworm: lam4-dev 7.1.4-7+b1
- debian trixie: lam4-dev 7.1.4-7.2
- ubuntu jammy: lam4-dev 7.1.4-7
- ubuntu noble: lam4-dev 7.1.4-7.1build2
- ubuntu questing: lam4-dev 7.1.4-8
- ubuntu resolute: lam4-dev 7.1.4-8build1
- ubuntu stonking: lam4-dev 7.1.4-8build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms