Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c

What is MPI_Win_detach?

Adnan Abbas

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Answers Code

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_Win_detach

This method detaches memory from a dynamic window. It detaches a previously attached memory chunk beginning at the pointer passed in the argument. The arguments passed to this function must be the same ones with which MPI_Win_attach was called.

Syntax

int MPI_Win_detach(MPI_Win win, const void *base)

Parameters

  • win is the window object used by processes to perform RMA operations.

  • base is the initial address of the memory to be detached.

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, which is the value returned upon successful termination of any MPI routine.

  • If an invalid MPI window object is provided in the function’s argument, MPI_ERR_WIN is returned.

  • MPI_ERR_RANK is returned if the source or destination rank is invalid. Rank must be between one and size of communicator minus one.

  • MPI_ARR_ARG is returned if an invalid argument is used and the error class does not identify that.

  • MPI_ERR_COUNT is returned if the count argument is invalid. Count values must be non-negative.

  • MPI_ERR_TYPE is returned if the data type argument is invalid. Moreover, this error can also arise if an uncommitted MPI_Datatype is used in a communication call.

RELATED TAGS

c

CONTRIBUTOR

Adnan Abbas
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Answers Code
Keep Exploring