#include "autopack.h" int AP_check_sends(int flags)
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_NOFLAGSDo not block (default)AP_BLOCKING
Block until at least one send completesAP_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.
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.)