Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

gm_send.c File Reference

#include "gm_call_trace.h"
#include "gm_debug.h"
#include "gm_enable_fast_small_send.h"
#include "gm_enable_trace.h"
#include "gm_internal.h"
#include "gm_send_queue.h"

Functions

GM_ENTRY_POINT void gm_send_with_callback (gm_port_t *p, void *message, unsigned int size, gm_size_t len, unsigned int priority, unsigned int target_node_id, unsigned int target_port_id, gm_send_completion_callback_t callback, void *context)

Detailed Description

This file contains the GM API functions gm_send_with_callback().


Function Documentation

GM_ENTRY_POINT void gm_send_with_callback gm_port_t *    p,
void *    message,
unsigned int    size,
gm_size_t    len,
unsigned int    priority,
unsigned int    target_node_id,
unsigned int    target_port_id,
gm_send_completion_callback_t    callback,
void *    context
 

gm_send_with_callback() is a fully asynchronous send. It queues the message of length len to be sent with priority priority to node target_node_id. As GM is event-based, the effective completion of the send is notified to the client software by the execution of the callback function specified by callback. Before calling gm_send_with_callback(), the client software must first possess a send token of the same priority, and by calling gm_send_with_callback() the client implicitly relinquishes this send token. After a call to gm_send_with_callback(..., message, len, ...), the memory specified by message and len must not be modified until the send completes. After the send completes, callback(port,context,status) will be called inside gm_unknown(), with status indicating the status of the completed send.

Note: The order of messages with different priorities or with different destination ports is not preserved. Only the order of messages with the same priority and to the same destination port is preserved.

In the special case that the target_port_id is the same as the sending port ID (as is often the case), the streamlined gm_send_to_peer_with_callback() function may be used instead of gm_send_with_callback(), allowing the target_port_id parameter to be omitted, and slightly improving small-message performance.

Parameters:
p  (IN) A pointer to the GM port on the source/sender GM node over which the message is to be sent.
message  (IN) A pointer to the data to be sent.
size  (IN) The size receive buffer in which to store the message on the remote node.
len  (IN) The length (in bytes) of the message to be sent.
priority  (IN) The priority with which to send the message ('GM_HIGH_PRIORITY' or 'GM_LOW_PRIORITY').
target_node_id  (IN) The ID of the GM node to which the message should be sent.
target_port_id  (IN) The ID of the GM port to which the message should be sent.
callback  (IN) The client function to call when the send completes.
context  (IN) A pointer to pass to the CALLBACK function when it is called.
See also:
gm_send_to_peer_with_callback
Author:
Glenn Brown
Version:
GM_API_VERSION (as defined in gm.h)


Generated on Mon Nov 3 15:39:26 2003 for GM by doxygen1.2.15