44 for (i = 0; i < num_threads; i++) {
73 prt_assert(status == 0,
"icl_hash_destroy failed");
81 prt_assert(size == 0,
"destroying non-empty deque");
83 prt_assert(status == 0,
"icl_deque_destroy failed");
86 prt_assert(size == 0,
"destroying non-empty list");
88 prt_assert(status == 0,
"icl_list_destroy failed");
108 MPI_Type_size(channel->
datatype, &type_size);
109 size_t packet_size = (size_t)channel->
count*type_size;
148 retval = MPI_Get_count(&request->
status, MPI_BYTE, &count);
149 prt_assert(retval == MPI_SUCCESS,
"MPI_Get_count failed");
153 int source = request->
status.MPI_SOURCE;
154 int tag = request->
status.MPI_TAG;
175 int threads_finished;
216 MPI_BYTE, MPI_ANY_SOURCE, MPI_ANY_TAG);
233 threads_finished = 1;
237 threads_finished = 0;
251 while (!threads_finished || sends_requested || sends_posted);
260 MPI_Barrier(MPI_COMM_WORLD);
icl_node_t * icl_deque_append(icl_deque_t *deque, void *data)
Insert the node at the end of the deque.
icl_list_t * recvs_posted
icl_list_t ** sends_posted
int icl_hash_destroy(icl_hash_t *ht, void(*free_key)(void *), void(*free_data)(void *))
Free hash table structures. Key and data are freed using functions.
icl_list_t * icl_list_new()
Create new linked list.
prt_packet_t * prt_channel_pop(prt_channel_t *channel)
Fetches a packef from a channel. Does not decrement the number of active references. The packet leaves the channel, but enters the VDP.
int icl_list_size(icl_list_t *head)
Get the number of items in this linked list.
void prt_request_send(prt_request_t *request)
Post a send request. Detects a possible overflow of the request size.
icl_deque_t * icl_deque_new()
deque constructor
int icl_deque_size(icl_deque_t *deque)
Return the deque size.
int icl_list_destroy(icl_list_t *head, void(*free_function)(void *))
Frees the resources associated with this linked list.
icl_node_t * icl_deque_first(icl_deque_t *deque)
Get the first node in the deque.
struct prt_thread_s ** thread
icl_list_t * icl_list_append(icl_list_t *head, void *data)
Insert a node at the end of this list.
void prt_proxy_delete(prt_proxy_t *proxy)
communication proxy destructor Checking if all the lists are empty at the time of destruction...
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
void prt_request_cancel(prt_request_t *request)
Cancel a request. Cancel the request, release the packet, free the request object.
VDP's data packet A packet of data transferred through VDP's channels.
unsigned int prt_tuple_hash(void *tuple)
tuple hash Required by the VSA's tuples hash table. Computes the lenght in characters and calls a str...
prt_request_t * prt_request_new(prt_packet_t *packet, int count, MPI_Datatype datatype, int peer, int tag)
request constructor
VSA's communication proxy Serves communication requests from the worker threads. Contains a list of r...
void prt_channel_push(prt_channel_t *channel, prt_packet_t *packet)
Sends a packed down a channel. Increments the packet's number of active references.
prt_proxy_t * prt_proxy_new(int num_threads)
communication proxy constructor
void prt_proxy_max_packet_size(prt_proxy_t *proxy, prt_channel_t *channel)
Look for maximum channel/packet size.
#define PRT_PROXY_MAX_SENDS_PER_THREAD
int prt_request_test(prt_request_t *request)
Test a request. Trace only completed requests.
#define prt_tuple_new2(a, b)
int icl_deque_destroy(icl_deque_t *deque, void(*free_func)(void *))
deque destructor
VDP's data channel Implements a data link between a pair of VDPs. Identifies the source and destinati...
struct prt_packet_s * packet
icl_deque_t ** sends_requested
int icl_deque_delete(icl_deque_t *deque, icl_node_t *node, void(*free_func)(void *))
Delete the node from the deque.
#define prt_assert(cond, msg)
#define PRT_PROXY_MAX_RECVS_PER_THREAD
void prt_request_destroy(prt_request_t *request)
request destructor Request is only an envelope for a packet. Request destruction does not affect the ...
int icl_list_delete(icl_list_t *head, icl_list_t *pos, void(*free_function)(void *))
Delete the specified node.
void * icl_hash_find(icl_hash_t *ht, void *key)
Search for an entry in a hash table.
int prt_tuple_equal(void *tuple_a, void *tuple_b)
tuple equality check Check if tuples are identical in length and content.
void prt_proxy_run(prt_proxy_t *proxy)
communication proxy production cycle Serves communication requests of local worker threads until shut...
icl_hash_t * icl_hash_create(int nbuckets, unsigned int(*hash_function)(void *), int(*hash_key_compare)(void *, void *))
Create a new hash table.
void prt_request_recv(prt_request_t *request)
Post a receive request. Detects a possible overflow of the request size.
void prt_proxy_recv(prt_proxy_t *proxy, prt_request_t *request)
recv to a channel
VSA proxy's communication request Contains basic information about the communication request...
void prt_packet_release(prt_packet_t *packet)
Release a packet. Decrements the number of active references. Destroys the packet when the last refer...
#define PRT_PROXY_MAX_TAGS_PER_NODE
maximum tags per node Size of the proxy's hash table of tags. Should be a prime number.
prt_packet_t * prt_packet_new(size_t data_size)
packet constructor Sets the number of references to one.
void prt_proxy_send(prt_proxy_t *proxy, int thread_rank, prt_channel_t *channel)
send from a channel