AP_send_end

End a batch of sends, initiate asynchronous reduction

Synopsis

#include "autopack.h"

void AP_send_end(void)

SUBROUTINE AP_SEND_END

Parameters

None

Description

This function denotes the end of a batch of sends. (To start of a batch of sends, see AP_send_begin().)

After flushing the send buffers (see AP_flush()), this function initiates an asynchronous reduction to compute how many messages this processor will receive from the batch of sends. The result of this reduction may be queried through AP_recv_count().

Caveats

Messages to implement the asynchronous reduction are handled transparently. However, each processor is obligated to call AP_recv() repeatedly until AP_recv_count() has indicated the reduction is complete. Otherwise, the reduction will not complete on this processor (and possibly others).

Messages that implement the asynchronous reduction are always sent immediately and are never deferred. This may use up to 2 MPI send requests per processor which are not counted in the nwait or nwait_proc setting (see AP_setparam()).

Return Value

None

Overview

The general organization of user code should be as follows. Each processor calls AP_send_begin(), then does some sends, then calls AP_send_end(). Then it loops calling AP_recv(), blocking if desired (but using the AP_DROPOUT flag if blocking). AP_recv_count() will indicate when the loop should terminate. It is not necessary to synchronize the processors at any point during this process.