What is MPI_Comm_delete_attr_function?

MPI library

MPI, short for Message Passing Interface, is a library that allows you to write parallel programs in Fortran77 or C. The library uses common operating system services to exchange information among the parallel processes it creates.

Parallel processing

MPI_Comm_delete_attr_function

This method is a callback function for caching on communicators. It is invoked when a communicator is deleted by MPI_COMM_FREE or MPI_COMM_DELETE_ATTR functions.

Syntax

int MPI_Comm_delete_attr_function( MPI_Comm comm, int comm_keyval, void *attribute_val,void *extra_state );

Parameters

The copy callback function is called for each key value in oldcomm in an arbitrary order. Each call to the copy callback is made with a key value and its associated attribute.

  • comm is the communicator object describing a group of processes. In many applications, various processes work together, and a communicator describes the processes that a routine initiates.

  • comm_keyval is the key value returned by the MPI_Comm_create_keyval method.

  • attribute_val_in is the pointer to attribute value.

  • extra_state is an optional argument to duplicate the extra state.

Return value

If unsuccessful, the function returns an error. The error, by default, aborts the MPI job.

In case of success, it returns MPI_SUCCESS- the value returned upon successful termination of any MPI routine.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved