HeMPS  8.0
communication.h
Go to the documentation of this file.
1 
18 #ifndef SOFTWARE_INCLUDE_COMMUNICATION_COMMUNICATION_H_
19 #define SOFTWARE_INCLUDE_COMMUNICATION_COMMUNICATION_H_
20 
21 #include "../../include/kernel_pkg.h"
22 #include "../include/api.h"
23 
24 
25 #define PIPE_SIZE MAX_LOCAL_TASKS * 3 //24
26 #define REQUEST_SIZE MAX_LOCAL_TASKS*(MAX_TASKS_APP-1) //50
27 #define MAX_TASK_SLOTS PIPE_SIZE/MAX_LOCAL_TASKS
28 
29 
32 enum PipeSlotStatus {EMPTY, LOCKED, USED};
33 
37 typedef struct {
41  char status;
42  unsigned int order;
43 } PipeSlot;
44 
45 
49 typedef struct {
50  int requester;
51  int requested;
54 
55 
56 
57 void init_communication();
58 
59 int add_PIPE(int, int, Message *);
60 
61 unsigned int search_PIPE_producer(int);
62 
63 unsigned int PIPE_msg_number();
64 
65 PipeSlot * remove_PIPE(int, int);
66 
68 
69 int insert_message_request(int, int, int);
70 
71 int search_message_request(int, int);
72 
73 int remove_message_request(int, int);
74 
75 int remove_all_requested_msgs(int, unsigned int *);
76 
77 
78 
79 
80 #endif /* SOFTWARE_INCLUDE_COMMUNICATION_COMMUNICATION_H_ */
This structure store a task message (Message) in a kernel memory area called PIPE.
Definition: communication.h:37
int requested
Stores the requested task id ( task that performs the Send() API )
Definition: communication.h:51
int remove_all_requested_msgs(int, unsigned int *)
Definition: communication.c:279
unsigned int search_PIPE_producer(int)
Definition: communication.c:109
int remove_message_request(int, int)
Definition: communication.c:256
int add_PIPE(int, int, Message *)
Definition: communication.c:45
int requester
Store the requested task id ( task that performs the Receive() API )
Definition: communication.h:50
PipeSlot * get_PIPE_free_position()
Definition: communication.c:197
This structure stores the message requests used to implement the blocking Receive MPI...
Definition: communication.h:49
PipeSlotStatus
This enum stores the pipe status.
Definition: communication.h:32
void init_communication()
Definition: communication.c:27
Definition: api.h:51
int requester_proc
Stores the requester processor address.
Definition: communication.h:52
int producer_task
Stores producer task id (task that performs the Send() API )
Definition: communication.h:38
unsigned int PIPE_msg_number()
Definition: communication.c:129
Message message
Stores the message itself - Message is a structure defined into api.h.
Definition: communication.h:40
unsigned int order
Stores pipe message order, useful to sort the messages stored in the pipe.
Definition: communication.h:42
int consumer_task
Stores consumer task id (task that performs the Receive() API )
Definition: communication.h:39
int search_message_request(int, int)
Definition: communication.c:240
int insert_message_request(int, int, int)
Definition: communication.c:215
PipeSlot * remove_PIPE(int, int)
Definition: communication.c:155
char status
Stores pipe status.
Definition: communication.h:41