PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
prt_vsa.h
Go to the documentation of this file.
1 
11 #ifndef PRT_VSA_H
12 #define PRT_VSA_H
13 
14 #include "prt.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 struct prt_vdp_s;
21 struct prt_proxy_s;
22 struct prt_config_s;
23 struct prt_thread_s;
26 
32 #define PRT_VSA_MAX_VDPS_PER_NODE 10003
33 
38 typedef int (*prt_vdp_map_func_t)(int*, void*, int);
39 
45 typedef struct prt_vsa_s {
46  int node_rank; // node ID
47  int num_nodes; // total number of nodes
48  int num_threads; // number of local threads
49  int num_cores; // total number of worker cores
50  pthread_attr_t thread_attr; // attributes of worker threads
51  struct prt_thread_s **thread; // array of worker threads
52  void *global_store; // VSA's global store accessible by VDPs
53  prt_vdp_map_func_t vdp_to_core; // function mapping VDPs' tuples to workers
54  icl_hash_t *vdps_hash; // VDPs lookup by tuple
55  struct prt_config_s *config; // VSA's configuration parameters
56  struct prt_proxy_s *proxy; // VSA's communication proxy
57  icl_list_t **channel_lists; // list of channels to each node
58 } prt_vsa_t;
59 
61  int num_threads, void *global_store, int (*vdp_to_core)(int*, void*, int));
63 void prt_vsa_vdp_insert(prt_vsa_t *vsa, struct prt_vdp_s *vdp);
65  prt_vsa_t *vsa, struct prt_vdp_s *vdp, int node_rank);
67  prt_vsa_t *vsa, struct prt_vdp_s *vdp, int core, int node_rank);
71  prt_vsa_t *vsa, enum prt_config_param_e param, enum prt_config_value_e value);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* PRT_VSA_H */
void prt_vsa_config_set(prt_vsa_t *vsa, prt_config_param_t param, prt_config_value_t value)
Set VSA configuration parameter.
Definition: prt_vsa.c:357
prt_vdp_map_func_t vdp_to_core
Definition: prt_vsa.h:53
struct prt_config_s * config
Definition: prt_vsa.h:55
struct prt_thread_s ** thread
Definition: prt_vsa.h:51
Virtual Systolic Array (VSA) VSA contains global informationa about the system, a local communication...
Definition: prt_vsa.h:45
int num_nodes
Definition: prt_vsa.h:47
void prt_vsa_vdp_insert(prt_vsa_t *vsa, prt_vdp_t *vdp)
Inserts a new VDP into a VSA. Destroys VDPs that do not belong to this node. Puts the VDP in the list...
Definition: prt_vsa.c:113
PRT configuration.
Definition: prt_config.h:41
VSA's communication proxy Serves communication requests from the worker threads. Contains a list of r...
Definition: prt_proxy.h:39
void prt_vsa_vdp_merge_channels(prt_vsa_t *vsa, prt_vdp_t *vdp, int node_rank)
Connects corresponding input and output channels of intra-node VDPs.
Definition: prt_vsa.c:154
int num_cores
Definition: prt_vsa.h:49
void prt_vsa_channel_tags(prt_vsa_t *vsa)
Assign channel tags. Build the node-tag lookup. Destroy channel lists.
Definition: prt_vsa.c:274
void prt_vsa_run(prt_vsa_t *vsa)
VSA's production cycle Launches worker threads. Sends the master thread in the communication proxy pr...
Definition: prt_vsa.c:314
prt_config_param_e
PRT configuration parameters.
Definition: prt_config.h:23
prt_vsa_t * prt_vsa_new(int num_threads, void *global_store, int(*vdp_to_core)(int *, void *, int))
VSA constructor.
Definition: prt_vsa.c:28
pthread_attr_t thread_attr
Definition: prt_vsa.h:50
void * global_store
Definition: prt_vsa.h:52
struct prt_vsa_s * vsa
Definition: prt_proxy.h:40
int node_rank
Definition: prt_vsa.h:46
Virtual Data Processor (VDP) Is uniquely identified by a tuple. Fires for a predefined number of cycl...
Definition: prt_vdp.h:37
VSA's worker thread Owns a number of VDPs. Knows the communication proxy.
Definition: prt_thread.h:27
icl_list_t ** channel_lists
Definition: prt_vsa.h:57
icl_hash_t * vdps_hash
Definition: prt_vsa.h:54
void prt_vsa_delete(prt_vsa_t *vsa)
VSA destructor.
Definition: prt_vsa.c:81
struct prt_proxy_s * proxy
Definition: prt_vsa.h:56
prt_config_value_e
values of PRT configuration parameters
Definition: prt_config.h:31
int(* prt_vdp_map_func_t)(int *, void *, int)
VSA's VDPs mapping function pointer Defines the pointer to the function mapping VDPs to cores...
Definition: prt_vsa.h:38
struct prt_vsa_s prt_vsa_t
Virtual Systolic Array (VSA) VSA contains global informationa about the system, a local communication...
void prt_vsa_vdp_track_tags(prt_vsa_t *vsa, prt_vdp_t *vdp, int core, int node_rank)
Builds the list of channel connections to other nodes.
Definition: prt_vsa.c:212
int num_threads
Definition: prt_proxy.h:41
int num_threads
Definition: prt_vsa.h:48