Message management functions.
More...
#include <core/core.h>
#include <limits.h>
#include <stdatomic.h>
#include <stddef.h>
#include <string.h>
Go to the source code of this file.
|
enum | msg_flag { MSG_FLAG_ANTI = 1
, MSG_FLAG_PROCESSED = 2
} |
|
Message management functions.
Message management functions
- Copyright
- Copyright (C) 2008-2022 HPDCS Group https://hpdcs.github.io
◆ msg_is_before
#define msg_is_before |
( |
|
a, |
|
|
|
b |
|
) |
| ((a)->dest_t < (b)->dest_t || ((a)->dest_t == (b)->dest_t && msg_is_before_extended(a, b))) |
Compute the value of the happens-before relation between two messages.
- Parameters
-
[in] | a | a pointer to the first message to compare |
[in] | b | a pointer to the second message to compare |
- Returns
- true if the message pointed by
a
happens-before the message pointed by b
, false otherwise
◆ msg_preamble_size
#define msg_preamble_size |
( |
| ) |
(offsetof(struct lp_msg, dest)) |
Get the size of the message preamble.
- Returns
- the size in bytes of the message preamble The preamble is the initial part of the message which doesn't need to be transmitted over MPI
◆ msg_remote_anti_size
Get the size of the a anti-message data, i.e. the part of the anti-message to be transmitted over MPI.
- Returns
- the size in bytes of the anti-message data
◆ msg_remote_data
#define msg_remote_data |
( |
|
msg | ) |
(&(msg)->dest) |
Get the address of the remote message data, i.e. the part of the message to be transmitted over MPI.
- Parameters
-
[in] | msg | a pointer to the message |
- Returns
- the address of the message data
◆ msg_remote_size
Get the size of the message data, i.e. the part of the message to be transmitted over MPI.
- Parameters
-
[in] | msg | a pointer to the message |
- Returns
- the size in bytes of the message data
◆ msg_is_before_extended()
static bool msg_is_before_extended |
( |
const struct lp_msg *restrict |
a, |
|
|
const struct lp_msg *restrict |
b |
|
) |
| |
|
inlinestatic |
Compute a deterministic order for messages with same timestamp.
- Parameters
-
a | the first message to compare |
b | the second message to compare |
- Returns
- true if the
a
come before b
There can be two distinct messages a and b so that msg_is_before_extended(a, b) == false and msg_is_before_extended(b, a) == false. In that case, the two messages will necessarily induce the same state change in the receiving LP: it doesn't make any difference which one will be processed first.