MPI_COMM_DUP_FN(3)
π MPI_COMM_DUP_FN(3) π
okay bestie, gather round, because we're talking about a LAM/MPI function and it's giving built-in, no-thoughts-just-vibes energy. This is MPI_COMM_DUP_FN, and she is the β¨ default β¨ attribute-copying function for communicators. Sit with that. She's the baseline. The blueprint. The main character that everyone else gets compared to. π
πΈ NAME πΈ
MPI_COMM_DUP_FN β a built-in MPI function that simple-mindedly copies communicator attributes. and when I say simple-mindedly I mean it with so much love, bestie, she is not trying to be clever, she is just doing the assignment π
β¨ SYNOPSIS β¨
#include <mpi.h>
int MPI_COMM_DUP_FN(MPI_Comm comm, int key, void *extra,
void *attrin, void *attrout, int *flag)
π«Ά INPUT PARAMETERS π«Ά
commβ the communicator, aka a handle. it's the thing whose attributes are getting copied.keyβ a key value (integer). yes it's just sitting there.extraβ extra state.attrinβ the in value for the attribute. the thing getting copied FROM.
π OUTPUT PARAMETERS π
attroutβ the out value for the attribute. the thing getting copied INTO.flagβ1if the attribute was copied successfully,0otherwise (logical). and babes, spoiler alert, she's gonna be1.
π NOTES π
okay so here's the whole tea: this function blindly byte-copies attributes on communicators. no thinking. no checking. no drama. she just does it. π¦
She is the default attribute-copying function for communicators. And she is so unbothered that this function will always return MPI_SUCCESS, and flag will always be set to 1. Every single time. No cap. π
The actual copy is performed by the code:
*((void **) attrout) = attrin;
that's it. that's the whole move. iconic behavior honestly. π
But listen β if this simple assignment is not sufficient for your attributes, you will need to reassign the attribute-copying function on the relevant keyvals on communicators with the MPI_Comm_keyval_create function. so basically if your attribute is built different, she can't help you, and you gotta go make your own. π
π NOTES FOR FORTRAN π
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they are invoked with the call statement. so like, different syntax, same soul π§
Also! All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. periodt. π
π₯ SEE ALSO π₯
MPI_Comm_keyval_create
β MORE INFORMATION β
For more information, please see the official MPI Forum web site, which contains 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 like, go read the source bestie, this is just the vibe summary π).
π ACKNOWLEDGEMENTS π
The LAM Team would like to thank the MPICH Team for the handy program to generate man pages ("doctext" from ftp://ftp.mcs.anl.gov/pub/sowing/sowing.tar.gz), the initial formatting, and some initial text for most of the MPI-1 man pages. shoutout to the OGs, they ate and left no crumbs π«Άβ¨
π¦ LOCATION π¦
dupfn.c
k so quick vibe check reminder: this function always returnsMPI_SUCCESSand always setsflagto1, and the copy is literally just*((void **) attrout) = attrin;β so if your attributes need something fancier, that's on you andMPI_Comm_keyval_create, not on her π
alright that's the whole page babes, no notes, she slays, she's built-in, she's simple-minded in the most endearing way possible πβ¨
LAM/MPI 7.1.4 π 6/24/2006 π and that's the date and version stamp, bestie β kiss kiss, stay compiling πππ¦
π¦ 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