PULSAR  2.0.0
Parallel Ultra-Light Systolic Array Runtime
 All Data Structures Files Functions Typedefs Enumerations Macros Groups
prt_packet.h File Reference

PRT data packet. More...

#include "prt.h"

Go to the source code of this file.

Data Structures

struct  prt_packet_s
 VDP's data packet A packet of data transferred through VDP's channels. More...
 

Typedefs

typedef struct prt_packet_s prt_packet_t
 VDP's data packet A packet of data transferred through VDP's channels. More...
 

Functions

prt_packet_tprt_packet_new_host (size_t size, void *data)
 Creates a new packet in host memory. Allocates the size amount of data if a NULL pointer is passed. More...
 
prt_packet_tprt_packet_new_device (size_t size, void *data, struct prt_vdp_s *vdp)
 Creates a new packet in device memory. Allocates the size amount of data if a NULL pointer is passed. More...
 
void prt_packet_resize_host (prt_packet_t *packet, size_t size)
 Resizes a packet in host memory. Used to resize placeholder packets for incoming MPI messages, wich initially are allocated with the maximum packet size. More...
 
void prt_packet_release_host (prt_packet_t *packet)
 Releases a packet located in host memory. Decrements the number of active references. Destroys the packet when the last reference is removed. More...
 
void prt_packet_release_device (prt_packet_t *packet)
 Releases a packet located in device memory. Decrements the number of active references. Destroys the packet when the last reference is removed. More...
 
void prt_packet_host_to_device (prt_packet_t *src_packet, struct prt_channel_s *channel)
 Transfers a packet from the host to a device. More...
 
void prt_packet_device_to_host (prt_packet_t *src_packet, struct prt_channel_s *channel)
 Transfers a packet from the host to a device. More...
 
void prt_packet_device_to_device (prt_packet_t *src_packet, struct prt_channel_s *channel)
 Transfers a packet from a device to another device. More...
 
void prt_packet_device_to_device_direct (prt_packet_t *src_packet, struct prt_channel_s *channel)
 Transfers a packet from a device to another device. Uses a direct copy, without involving the host. More...
 
void prt_packet_device_mpi_to_host (prt_packet_t *src_packet, struct prt_channel_s *channel, int agent)
 Initiates an MPI transfer from a device. Sends a packet from a device to the host. Then requests an MPI transfer from the host. More...
 

Detailed Description

PRT data packet.

Author
Jakub Kurzak

PULSAR Runtime http://icl.utk.edu/pulsar/ Copyright (C) 2012-2015 University of Tennessee.

Definition in file prt_packet.h.

Typedef Documentation

typedef struct prt_packet_s prt_packet_t

VDP's data packet A packet of data transferred through VDP's channels.

"num_refs" is a multi-access synchronization variable. Therefore, declared as volatile and accessed with atomics.

Function Documentation

void prt_packet_device_mpi_to_host ( prt_packet_t src_packet,
prt_channel_t channel,
int  agent 
)

Initiates an MPI transfer from a device. Sends a packet from a device to the host. Then requests an MPI transfer from the host.

Parameters
src_packet– The packet to transfer.
channel– The destination channel.

Definition at line 306 of file prt_packet.c.

void prt_packet_device_to_device ( prt_packet_t src_packet,
prt_channel_t channel 
)

Transfers a packet from a device to another device.

Parameters
src_packet– The packet to transfer.
channel– The destination channel.

Definition at line 238 of file prt_packet.c.

void prt_packet_device_to_device_direct ( prt_packet_t src_packet,
prt_channel_t channel 
)

Transfers a packet from a device to another device. Uses a direct copy, without involving the host.

Parameters
src_packet– The packet to transfer.
channel– The destination channel.

Definition at line 270 of file prt_packet.c.

void prt_packet_device_to_host ( prt_packet_t src_packet,
prt_channel_t channel 
)

Transfers a packet from the host to a device.

Parameters
packet– The packet to transfer.
channel– The destination channel.
kind– The direction of the transfer.

Definition at line 207 of file prt_packet.c.

void prt_packet_host_to_device ( prt_packet_t src_packet,
prt_channel_t channel 
)

Transfers a packet from the host to a device.

Parameters
packet– The packet to transfer.
channel– The destination channel.
kind– The direction of the transfer.

Definition at line 174 of file prt_packet.c.

prt_packet_t* prt_packet_new_device ( size_t  size,
void *  data,
prt_vdp_t vdp 
)

Creates a new packet in device memory. Allocates the size amount of data if a NULL pointer is passed.

Registers increased memory usage in both cases. This way the ending balance is expected to be zero. Packet release does not care (know) how the data was allocated.

Parameters
size– The size of the packet's data.
data– The pointer to the packet's data.
vdp– The VDP creating the packet.
Returns
A new packet.

Definition at line 68 of file prt_packet.c.

prt_packet_t* prt_packet_new_host ( size_t  size,
void *  data 
)

Creates a new packet in host memory. Allocates the size amount of data if a NULL pointer is passed.

Registers increased memory usage in both cases. This way the ending balance is expected to be zero. Packet release does not care (know) how the data was allocated.

Parameters
size– The size of packet's data.
data– The pointer to the packet's data.
Returns
A new packet.

Definition at line 27 of file prt_packet.c.

void prt_packet_release_device ( prt_packet_t packet)

Releases a packet located in device memory. Decrements the number of active references. Destroys the packet when the last reference is removed.

Parameters
packet– The device packet to release.

Definition at line 148 of file prt_packet.c.

void prt_packet_release_host ( prt_packet_t packet)

Releases a packet located in host memory. Decrements the number of active references. Destroys the packet when the last reference is removed.

Parameters
packet– The host packet to release.

Definition at line 127 of file prt_packet.c.

void prt_packet_resize_host ( prt_packet_t packet,
size_t  size 
)

Resizes a packet in host memory. Used to resize placeholder packets for incoming MPI messages, wich initially are allocated with the maximum packet size.

Parameters
packet– The packet to resize.
size– The new size in bytes.

Definition at line 105 of file prt_packet.c.