#include "autopack.h" int AP_dsend_begin(void)
Like AP_send_begin(), but denote the start of a batch of sends that are guaranteed to arrive in deterministic order. After the sends, call AP_dsend_end().
When this is called, there must be no outstanding messages (i.e. sent but not received) in the system.
Messages sent within the bounds of AP_dsend_begin()/AP_dsend_end() will arrive in a deterministic order.
Unlike AP_send_begin(), this call will cause a global synchronization.
Memory requirements will be substantially higher than for AP_send_begin(), because no messages are passed on to the user until all have arrived at this processor.
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.