MPI_WIN_DUP_FN(3)

πŸ“¦
version 7.1.4 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 state
  • attrin β€” the in value for the attribute

πŸ’œ OUTPUT PARAMETERS πŸ’œ

  • attrout β€” the out value for the attribute. this is where the copied thing lands ✨
  • flag β€” 1 if the attribute got copied successfully, 0 otherwise (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 πŸŽ€