PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
prt_vsa.c
Go to the documentation of this file.
1 
8 {
9  int rank;
10  for (rank = 0; rank < vsa->num_nodes; rank++)
11  {
12  if (rank == vsa->node_rank)
13  {
14  printf(" NODE:%3d\n", vsa->node_rank);
15  int thread_rank;
16  for (thread_rank = 0; thread_rank < vsa->num_threads; thread_rank++)
17  {
18  printf(" THREAD:%3d\n", thread_rank);
19  prt_thread_t *thread = vsa->thread[thread_rank];
20  icl_list_t *ptr;
21  for (ptr = icl_list_first(thread->vdps);
22  ptr != NULL;
23  ptr = icl_list_next(thread->vdps, ptr))
24  {
25  prt_vdp_t *vdp = (prt_vdp_t*)ptr->data;
26  printf(" VDP:"); prt_tuple_print(vdp->tuple); printf("\n");
27  int i;
28  for (i = 0; i < vdp->num_inputs; i++)
29  {
30  prt_channel_t *channel = vdp->input[i];
31  if (channel != NULL) {
32  printf(" input from VDP"); prt_tuple_print(channel->src_tuple);
33  if (channel->tag == -1)
34  printf(" slot%3d, channel tag: \n", channel->src_slot);
35  else
36  printf(" slot%3d, channel tag:%3d\n", channel->src_slot, channel->tag);
37  }
38  else {
39  printf(" input NULL\n");
40  }
41  }
42  for (i = 0; i < vdp->num_outputs; i++)
43  {
44  if (i == 0)
45  printf("\n");
46  prt_channel_t *channel = vdp->output[i];
47  if (channel != NULL) {
48  printf(" output to VDP"); prt_tuple_print(channel->dst_tuple);
49  if (channel->tag == -1)
50  printf(" slot%3d, channel tag: \n", channel->dst_slot);
51  else
52  printf(" slot%3d, channel tag:%3d\n", channel->dst_slot, channel->tag);
53  }
54  else {
55  printf(" output NULL\n");
56  }
57  }
58  }
59  }
60  }
61  MPI_Barrier(MPI_COMM_WORLD);
62  fflush(stdout);
63  sleep(1);
64  }
65 
66  for (rank = 0; rank < vsa->num_nodes; rank++)
67  {
68  if (rank == vsa->node_rank)
69  {
70  printf(" NODE:%3d\n", vsa->node_rank);
71  int tmpint;
72  icl_entry_t *tmpent;
73  int *pk;
74  prt_channel_t *pd;
75  icl_hash_foreach(vsa->proxy->tags_hash, tmpint, tmpent, pk, pd)
76  {
77  prt_channel_t *channel = pd;
78  printf(" %d %d: ", pk[0], pk[1]);
79  prt_tuple_print(channel->src_tuple);
80  printf(" -> ");
81  prt_tuple_print(channel->dst_tuple);
82  printf("\n");
83  }
84  }
85  MPI_Barrier(MPI_COMM_WORLD);
86  fflush(stdout);
87  sleep(1);
88  }
89 /*
90  int node;
91  for (node = 0; node < vsa->num_nodes; node++) {
92  MPI_Barrier(MPI_COMM_WORLD);
93  usleep(100);
94  if (node == vsa->node_rank) {
95  for (i = 0; i < vsa->num_nodes; i++)
96  if (vsa->channel_lists[i] != NULL) {
97  icl_list_t *node;
98  printf("%3d\n", i);
99  icl_list_foreach(vsa->channel_lists[i], node) {
100  printf("\t");
101  prt_channel_t *channel = (prt_channel_t*)node->data;
102  prt_tuple_print(channel->src_tuple);
103  printf("\t%3d\t", channel->src_slot);
104  prt_tuple_print(channel->dst_tuple);
105  printf("\t%3d\t", channel->dst_slot);
106  printf("\t%3d\n", channel->tag);
107  }
108  }
109  }
110  }
111 */
112 }
void prt_tuple_print(int *tuple)
tuple print
Definition: prt_tuple.c:172
struct prt_channel_s ** input
Definition: prt_vdp.h:42
#define icl_hash_foreach(ht, tmpint, tmpent, kp, dp)
Definition: icl_hash.h:44
void * data
Definition: icl_list.h:20
void prt_vsa_dump(prt_vsa_t *vsa)
Dump the VSA structure.
Definition: prt_vsa.c:7
struct prt_thread_s ** thread
Definition: prt_vsa.h:51
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
Definition: icl_list.c:221
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
int * dst_tuple
Definition: prt_channel.h:35
int * src_tuple
Definition: prt_channel.h:33
icl_list_t * vdps
Definition: prt_thread.h:32
VDP&#39;s data channel Implements a data link between a pair of VDPs. Identifies the source and destinati...
Definition: prt_channel.h:29
int num_inputs
Definition: prt_vdp.h:41
int num_outputs
Definition: prt_vdp.h:43
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&#39;s worker thread Owns a number of VDPs. Knows the communication proxy.
Definition: prt_thread.h:27
Definition: icl_hash.h:19
struct prt_proxy_s * proxy
Definition: prt_vsa.h:56
struct prt_channel_s ** output
Definition: prt_vdp.h:44
int * tuple
Definition: prt_vdp.h:39
int num_threads
Definition: prt_vsa.h:48
icl_hash_t * tags_hash
Definition: prt_proxy.h:42
icl_list_t * icl_list_next(icl_list_t *head, icl_list_t *pos)
Get the node following the specified node.
Definition: icl_list.c:254