PULSAR  2.0.0
Parallel Ultra-Light Systolic Array Runtime
 All Data Structures Files Functions Typedefs Enumerations Macros Groups
PRT API - core interface

Functions

prt_channel_tprt_channel_new (size_t size, int *src_tuple, int src_slot, int *dst_tuple, int dst_slot)
 Creates a new channel. Channel size cannot be larger than INT_MAX, because all data typea are packed inside messages of type MPI_BYTE. More...
 
int * prt_tuple_new (int len,...)
 Creates a new tuple. Allocates memory for the tuple plus the termination symbol (INT_MAX). Fills out the tuple with the integers on the list. There is also a set of macros, prt_tuple_new1/2/3/4/5/6, where the length of the tuple is indicated by the number in the name. Because this is such a tiny function, and is mostly intended to be accessed through macros, skipping error checks for input parameters. More...
 
prt_vdp_tprt_vdp_new (int *tuple, int counter, prt_vdp_function_t function, size_t local_store_size, int num_inputs, int num_outputs, int color)
 Creates a new VDP. More...
 
void prt_vdp_channel_insert (prt_vdp_t *vdp, prt_channel_t *channel, prt_channel_direction_t direction, int slot)
 Inserts a new channel into a VDP. More...
 
prt_packet_tprt_vdp_packet_new (prt_vdp_t *vdp, size_t size, void *data)
 Creates a new packet. Allocates the size amount of data if a NULL pointer is passed. The size cannot be larger than INT_MAX, because all data typea are packed inside messages of type MPI_BYTE. Calls host constructor or device constructor depending on the VDP's location. More...
 
void prt_vdp_packet_release (prt_vdp_t *vdp, prt_packet_t *packet)
 Releases a packet. Decrements the number of active references. Destroys the packet when the number of references goes down to zero. For device packets, puts a callback in the VDP's stream. More...
 
void prt_vdp_channel_push (prt_vdp_t *vdp, int channel_num, prt_packet_t *packet)
 Pushes a packet in a channel. More...
 
prt_packet_tprt_vdp_channel_pop (prt_vdp_t *vdp, int channel_num)
 Fetches a packet from a channel. More...
 
prt_vsa_tprt_vsa_new (int num_threads, int num_devices, void *global_store, struct prt_mapping_s(*vdp_mapping)(int *, void *, int, int))
 Creates a new VSA. More...
 
void prt_vsa_delete (prt_vsa_t *vsa)
 Destroys a VSA. More...
 
void prt_vsa_vdp_insert (prt_vsa_t *vsa, prt_vdp_t *vdp)
 Inserts a VDP in a VSA. Destroys VDPs that do not belong to this node. Puts the VDP in the list of VDPs of the owner thread or device. Connects corresponding input and output channels of intra-node VDPs. Builds the list of channel connections to other nodes. For a device VDP, creates a CUDA stream with the cudaStreamNonBlocking flag. This indicates no synchronization with the default stream (stream 0). Stream 0 is not used anywere in PRT. More...
 
double prt_vsa_run (prt_vsa_t *vsa)
 Implements the VSA's production cycle. Launches worker threads. Sends the master thread in the proxy production cycle. Joins the worker threads. More...
 

Detailed Description

Function Documentation

prt_channel_t* prt_channel_new ( size_t  size,
int *  src_tuple,
int  src_slot,
int *  dst_tuple,
int  dst_slot 
)

Creates a new channel. Channel size cannot be larger than INT_MAX, because all data typea are packed inside messages of type MPI_BYTE.

Parameters
size– The size of packets in bytes.
src_tuple– The tuple of the source VDP.
src_slot– The slot number in the source VDP.
dst_tuple– The tuple of the destination VDP.
dst_slot– The slot number in the destination VDP.
Returns
A new channel.

Definition at line 28 of file prt_channel.c.

int* prt_tuple_new ( int  len,
  ... 
)

Creates a new tuple. Allocates memory for the tuple plus the termination symbol (INT_MAX). Fills out the tuple with the integers on the list. There is also a set of macros, prt_tuple_new1/2/3/4/5/6, where the length of the tuple is indicated by the number in the name. Because this is such a tiny function, and is mostly intended to be accessed through macros, skipping error checks for input parameters.

Parameters
len– The length of the tuple.
...– A list of elements of type int.
Returns
A pointer to an array of integers terminated by INT_MAX.

Definition at line 31 of file prt_tuple.c.

void prt_vdp_channel_insert ( prt_vdp_t vdp,
prt_channel_t channel,
prt_channel_direction_t  direction,
int  slot 
)

Inserts a new channel into a VDP.

Parameters
vdp– The VDP to insert the channel into.
channel– The channel to insert.
direction– The direction of the channel.
slot– The slot number.

Definition at line 200 of file prt_vdp.c.

prt_packet_t* prt_vdp_channel_pop ( prt_vdp_t vdp,
int  channel_num 
)

Fetches a packet from a channel.

Parameters
vdp– The VDP fetching the packet.
channel_num– The number of the channel to fetch from.
Returns
A packet.

Definition at line 393 of file prt_vdp.c.

void prt_vdp_channel_push ( prt_vdp_t vdp,
int  channel_num,
prt_packet_t packet 
)

Pushes a packet in a channel.

Parameters
vdp– The VDP pushing to the channel.
channel_num– The number of the channel to push to.
packet– The packet to push.

Definition at line 360 of file prt_vdp.c.

prt_vdp_t* prt_vdp_new ( int *  tuple,
int  counter,
prt_vdp_function_t  function,
size_t  local_store_size,
int  num_inputs,
int  num_outputs,
int  color 
)

Creates a new VDP.

Parameters
tuple– A unique identifier of the VDP.
counter– The number of times to fire the VDP.
function– The function implementing the VDP's actions.
local_store_size– The size of VDP's persistent local store in bytes.
num_inputs– The number of input channels.
num_outputs– The number of output channels.
color– The VDP's color in the SVG traces.
Returns
A new VDP.

Definition at line 28 of file prt_vdp.c.

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

Creates a new packet. Allocates the size amount of data if a NULL pointer is passed. The size cannot be larger than INT_MAX, because all data typea are packed inside messages of type MPI_BYTE. Calls host constructor or device constructor depending on the VDP's location.

Parameters
vdp– The VDP creating the packet.
size– The size of the packet in bytes.
data– The data payload of the packet.
Returns
A new packet.

Definition at line 258 of file prt_vdp.c.

void prt_vdp_packet_release ( prt_vdp_t vdp,
prt_packet_t packet 
)

Releases a packet. Decrements the number of active references. Destroys the packet when the number of references goes down to zero. For device packets, puts a callback in the VDP's stream.

Parameters
vdp– The VDP releasing the packet.
packet– The packet to release.

Definition at line 330 of file prt_vdp.c.

void prt_vsa_delete ( prt_vsa_t vsa)

Destroys a VSA.

Parameters
VSA– The VSA to destroy.

Definition at line 140 of file prt_vsa.c.

prt_vsa_t* prt_vsa_new ( int  num_threads,
int  num_devices,
void *  global_store,
struct prt_mapping_s(*)(int *, void *, int, int)  vdp_mapping 
)

Creates a new VSA.

Parameters
num_threads– The number of local CPU threads.
num_devices– The number of local GPU devices.
global_store– VSA's global store, accessible to all VDPs.
vdp_mapping– The function for mapping VDPs to cores and accelerators.
Returns
A new VSA.

Definition at line 28 of file prt_vsa.c.

double prt_vsa_run ( prt_vsa_t vsa)

Implements the VSA's production cycle. Launches worker threads. Sends the master thread in the proxy production cycle. Joins the worker threads.

Parameters
vsa– The VSA to run.
Returns
The VSA's execution time in seconds.

Definition at line 546 of file prt_vsa.c.

void prt_vsa_vdp_insert ( prt_vsa_t vsa,
prt_vdp_t vdp 
)

Inserts a VDP in a VSA. Destroys VDPs that do not belong to this node. Puts the VDP in the list of VDPs of the owner thread or device. Connects corresponding input and output channels of intra-node VDPs. Builds the list of channel connections to other nodes. For a device VDP, creates a CUDA stream with the cudaStreamNonBlocking flag. This indicates no synchronization with the default stream (stream 0). Stream 0 is not used anywere in PRT.

Parameters
vsa– The VSA to insert into.
vdp– The VDP to insert.

Definition at line 200 of file prt_vsa.c.