AP_check_sends

check status of underlying MPI sends

Synopsis

#include "autopack.h"

int AP_check_sends(int flags)

SUBROUTINE AP_CHECK_SENDS(flags, return_value)
INTEGER flags, return_value
INCLUDE 'autopack.fh'

Parameters

flags
specify options (see below)

Description

Check to see if MPI has finished sending any messages, and free their buffer space if they are done. Also, if there are any deferred messages, send as many as possible.

Flags may be a bitwise OR of the following (in Fortran use addition):

AP_NOFLAGS
Do not block (default)

AP_BLOCKING

Block until at least one send completes

AP_WAITDEFER

Block until all deferred sends are posted to MPI (always returns <=0 )

AP_WAITALL

Block until MPI completes all sends (always returns 0)

Caution must be used to avoid deadlock when using AP_BLOCKING. For example, if two processors call this after sending each other messages, neither send is guaranteed to complete before a receive is performed.

Return value

0 if all sends have completed.

If there are deferred sends, returns how many.

If there are no deferred sends, returns -1 times the number of incomplete MPI send requests.

(Note: packages are only counted as a single send.)