Defines the PipeSlot and MessageRequest structures.
More...
#include "../../include/kernel_pkg.h"
#include "../include/api.h"
Go to the source code of this file.
|
struct | PipeSlot |
| This structure store a task message (Message) in a kernel memory area called PIPE. More...
|
|
struct | MessageRequest |
| This structure stores the message requests used to implement the blocking Receive MPI. More...
|
|
|
#define | PIPE_SIZE MAX_LOCAL_TASKS * 3 |
|
#define | REQUEST_SIZE MAX_LOCAL_TASKS*(MAX_TASKS_APP-1) |
|
#define | MAX_TASK_SLOTS PIPE_SIZE/MAX_LOCAL_TASKS |
| Maximum number of pipe slots that a task have.
|
|
|
enum | PipeSlotStatus { EMPTY,
LOCKED,
USED
} |
| This enum stores the pipe status.
|
|
Defines the PipeSlot and MessageRequest structures.
HEMPS VERSION - 8.0 - support for RT applications
Distribution: June 2016
Created by: Marcelo Ruaro - contact: marce.nosp@m.lo.r.nosp@m.uaro@.nosp@m.acad.nosp@m..pucr.nosp@m.s.br
Research group: GAPH-PUCRS - contact: ferna.nosp@m.ndo..nosp@m.morae.nosp@m.s@pu.nosp@m.crs.b.nosp@m.r
PipeSlot stores the user's messages produced by not consumed yet. MessageRequest stores the requested messages send to the consumer task by not produced yet
int add_PIPE |
( |
int |
producer_task, |
|
|
int |
consumer_task, |
|
|
Message * |
msg |
|
) |
| |
Add a message to the PIPE if it have available space
- Parameters
-
producer_task | ID of the producer task |
consumer_task | ID of the consumer task |
msg | Message pointer for the message to be stored |
- Returns
- 0 if pipe is full, 1 if the message was stored with success
Gets a pipe free position pointer
- Returns
- PipeSlot free position pointer
void init_communication |
( |
| ) |
|
Initializes the message request and the pipe array
int insert_message_request |
( |
int |
producer_task, |
|
|
int |
consumer_task, |
|
|
int |
requester_proc |
|
) |
| |
Inserts a message request into the message_request array
- Parameters
-
producer_task | ID of the producer task of the message |
consumer_task | ID of the consumer task of the message |
requester_proc | Processor of the consumer task |
- Returns
- 0 if the message_request array is full, 1 if the message was successfully inserted
unsigned int PIPE_msg_number |
( |
| ) |
|
Counts the number of message in the pipe
- Returns
- The number of messages in the pipe
int remove_all_requested_msgs |
( |
int |
requested_task, |
|
|
unsigned int * |
removed_msgs |
|
) |
| |
Remove all message request of a requested task ID and copies such messages to the removed_msgs array. This function is used for task migration only, when a task need to be moved to other processor
- Parameters
-
requested_task | ID of the requested task |
removed_msgs | array pointer of the removed messages |
- Returns
- number of removed messages
int remove_message_request |
( |
int |
producer_task, |
|
|
int |
consumer_task |
|
) |
| |
Remove a message request
- Parameters
-
producer_task | ID of the producer task of the message |
consumer_task | ID of the consumer task of the message |
- Returns
- -1 if the message was not found or the requester processor address (processor of the consumer task)
PipeSlot* remove_PIPE |
( |
int |
producer_task, |
|
|
int |
consumer_task |
|
) |
| |
Remove the next message from the pipe. The remotion occurs following the order of insertion of the message
- Parameters
-
producer_task | ID of the producer task of the message |
consumer_task | ID of the consumer task of the message |
- Returns
- 0 if it not found any message, or the PipeSlot pointer if the message was successfully removed
int search_message_request |
( |
int |
producer_task, |
|
|
int |
consumer_task |
|
) |
| |
Searches for a message request
- Parameters
-
producer_task | ID of the producer task of the message |
consumer_task | ID of the consumer task of the message |
- Returns
- 0 if the message was not found, 1 if the message was found
unsigned int search_PIPE_producer |
( |
int |
producer_task | ) |
|
Tells if the producer task have some message in the pipe
- Parameters
-
producer_task | ID of the producer task |
- Returns
- 0 if it not has, 1 if it has