MPI_Op_commute(3)
π MPI_Op_commute(3) β the MPI manual, bestie edition
okay so this page lives in the MPI manual, and the filename is MPI_Op_commute(3) but the actual function you call is MPI_Op_commutative β yes, icon behavior, the title and the function don't match, we love that for us π. Anyway. This one's short and sweet: it asks an MPI reduction operation "hey bestie, are you commutative?" and hands you back a yes/no. That's it, that's the whole vibe.
β¨ NAME β¨
MPI_Op_commute β queries an MPI reduction operation for its commutativity. π₯
π¦ SYNOPSIS π¦
int MPI_Op_commutative(MPI_Op op, int *commute)
πΈ INPUT PARAMETERS πΈ
opβ the operation, as a handle. this is the little guy you're interrogating π
β OUTPUT PARAMETERS β
commuteβ a logical flag that comes back true ifopis a commutative operation. like, the answer to the question π
π NULL HANDLES π
okay so this is the part where the standard gets very serious and we must too, no cap. the MPI 1.1 spec, in the section on opaque objects, explicitly disallows freeing a null communicator. here's the text straight from the standard, and yes it's giving law school:
A null handle argument is an erroneousINargument in MPI calls, unless an exception is explicitly stated in the text that defines the function. Such exception is allowed for handles to request objects inWaitandTestcalls (sections Communication Completion and Multiple Completions ). Otherwise, a null handle can only be passed to a function that allocates a new object and returns a reference to it in the handle.
so like. read it and weep π«Ά that's the rule.
π§ THREAD AND INTERRUPT SAFETY π§
this routine is thread-safe β¨ which means multiple threads can use it safely and you do not need to bring your own user-provided thread locks. self-sufficient queen behavior.
but β and this is the important part β the routine is not interrupt safe. typically that's because of memory allocation routines like malloc or other non-Intel(R) MPI Library runtime routines that are themselves not interrupt-safe. so like, interrupt it at your own risk π
π NOTES FOR FORTRAN π
- all MPI routines in Fortran (except
MPI_WTIMEandMPI_WTICK) have an extra argumentierrtacked on at the end of the argument list.ierris an integer and it means the exact same thing as the return value of the routine in C. slay, consistent π - in Fortran, MPI routines are subroutines and you invoke them with the
callstatement. - all MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. that's just how it is π
π 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 that value comes back, the current MPI error handler gets called. by default this error handler aborts the MPI job π so like, heads up.
the error handler can be changed with:
MPI_Comm_set_errhandler(for communicators)MPI_File_set_errhandler(for files)MPI_Win_set_errhandler(for RMA windows)
the MPI-1 routine MPI_Errhandler_set may also be used, but its use is deprecated (do not come for me, that's what the page says). the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead.
note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. so likeβ¦ best effort, no promises π
the specific ones for this routine:
MPI_SUCCESSβ no error; the MPI routine completed successfully. π we ate.MPI_ERR_ARGβ invalid argument. some argument is invalid and isn't identified by a specific error class (e.g.,MPI_ERR_RANK). something's wrong but the error is being mysterious about it π
π«Ά SEE ALSO π«Ά
MPI_Op_createβ go make an op first, then come back and vibe check it β¨
π COPYRIGHT INFORMATION π
okay bestie, this is the long one, and every single word of it stays, so buckle in. π
information in this document is provided in connection with INTEL(R) PRODUCTS. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. except as provided in Intel's terms and conditions of sale for such products, INTEL assumes no liability whatsoever, and INTEL disclaims any express or implied warranty relating to sale and/or use of INTEL products, including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. unless otherwise agreed in writing by INTEL, the INTEL products are not designed nor intended for any application in which the failure of the INTEL product could create a situation where personal injury or death may occur.
Intel may make changes to specifications and product descriptions at any time, without notice. designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. the information here is subject to change without notice. do not finalize a design with this information.
the products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. current characterized errata are available on request. contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting the Intel Web Site.
Intel processor numbers are not a measure of performance. processor numbers differentiate features within each processor family, not across different processor families. see http://www.intel.com/products/processor_number for details.
BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino logo, Core Inside, FlashFile, i960, InstantIP, Intel, Intel logo, Intel386, Intel486, Intel740, IntelDX2, IntelDX4, IntelSX2, Intel Core, Intel Inside, Intel Inside logo, Intel. Leap ahead., Intel. Leap ahead. logo, Intel NetBurst, Intel NetMerge, Intel NetStructure, Intel SingleDriver, Intel SpeedStep, Intel StrataFlash, Intel Viiv, Intel vPro, Intel XScale, IPLink, Itanium, Itanium Inside, MCS, MMX, Oplus, OverDrive, PDCharm, Pentium, Pentium Inside, skoool, Sound Mark, The Journey Inside, VTune, Xeon, and Xeon Inside are trademarks of Intel Corporation in the U.S. and other countries.
* Other names and brands may be claimed as the property of others.
Copyright (C) 2003-2015, Intel Corporation. All rights reserved.
okay that's the whole page, you made it, I'm so proud of you π₯Ήβ¨ this lil drop is from the MPI manual, page MPI_Op_commute(3), dated 11/9/2015 β go forth and ask your ops if they commute, bestie. mwah ππ
π¦ where this page comes from
- arch rolling: intel-oneapi-toolkit 2026.0.1.27+c9c3d3e3_ddb4_490e_bb41_6e9041ba32a7-2 Β· LicenseRef-Intel-EULA-Developer-Tools AND LicenseRef-Intel-Simplified
- Copyright (C) 2003-2015, Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms