A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename sup-mmap.c into mmorecore.c and simplify the code since we want no more than...
[simgrid.git]
/
src
/
msg
/
msg_mailbox.c
diff --git
a/src/msg/msg_mailbox.c
b/src/msg/msg_mailbox.c
index
bedccad
..
4eb5053
100644
(file)
--- a/
src/msg/msg_mailbox.c
+++ b/
src/msg/msg_mailbox.c
@@
-6,48
+6,48
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "mailbox.h"
-#include "msg
/
private.h"
+#include "m
sg_m
ailbox.h"
+#include "msg
_
private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg,
"Logging specific to MSG (mailbox)");
msg_mailbox_t MSG_mailbox_new(const char *alias)
{
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg,
"Logging specific to MSG (mailbox)");
msg_mailbox_t MSG_mailbox_new(const char *alias)
{
- return
SIMIX_req
_rdv_create(alias);
+ return
simcall
_rdv_create(alias);
}
void MSG_mailbox_free(void *mailbox)
{
}
void MSG_mailbox_free(void *mailbox)
{
-
SIMIX_req
_rdv_destroy((msg_mailbox_t)mailbox);
+
simcall
_rdv_destroy((msg_mailbox_t)mailbox);
}
int MSG_mailbox_is_empty(msg_mailbox_t mailbox)
{
}
int MSG_mailbox_is_empty(msg_mailbox_t mailbox)
{
- return (NULL ==
SIMIX_req
_rdv_get_head(mailbox));
+ return (NULL ==
simcall
_rdv_get_head(mailbox));
}
m_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox)
{
}
m_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox)
{
- smx_action_t comm =
SIMIX_req
_rdv_get_head(mailbox);
+ smx_action_t comm =
simcall
_rdv_get_head(mailbox);
if (!comm)
return NULL;
if (!comm)
return NULL;
- return (m_task_t)
SIMIX_req
_comm_get_src_data(comm);
+ return (m_task_t)
simcall
_comm_get_src_data(comm);
}
int
MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox,
m_host_t host)
{
}
int
MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox,
m_host_t host)
{
- return
SIMIX_req
_rdv_comm_count_by_host(mailbox,
+ return
simcall
_rdv_comm_count_by_host(mailbox,
host->simdata->smx_host);
}
msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
{
host->simdata->smx_host);
}
msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
{
- msg_mailbox_t mailbox =
SIMIX_req
_rdv_get_by_name(alias);
+ msg_mailbox_t mailbox =
simcall
_rdv_get_by_name(alias);
if (!mailbox)
mailbox = MSG_mailbox_new(alias);
if (!mailbox)
mailbox = MSG_mailbox_new(alias);
@@
-58,6
+58,7
@@
msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
msg_mailbox_t MSG_mailbox_get_by_channel(m_host_t host,
m_channel_t channel)
{
msg_mailbox_t MSG_mailbox_get_by_channel(m_host_t host,
m_channel_t channel)
{
+ XBT_WARN("DEPRECATED! Now use MSG_mailbox_get_by_alias");
xbt_assert((host != NULL), "Invalid host");
xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
xbt_assert((host != NULL), "Invalid host");
xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
@@
-79,19
+80,19
@@
MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
CHECK_HOST();
#ifdef HAVE_TRACING
TRACE_msg_task_get_start();
CHECK_HOST();
#ifdef HAVE_TRACING
TRACE_msg_task_get_start();
- double start_time = MSG_get_clock();
+
volatile
double start_time = MSG_get_clock();
#endif
/* Sanity check */
xbt_assert(task, "Null pointer for the task storage");
if (*task)
#endif
/* Sanity check */
xbt_assert(task, "Null pointer for the task storage");
if (*task)
- XBT_
CRITICAL
- ("
MSG_task_receive() was asked to write in a non empty task struct
.");
+ XBT_
WARN
+ ("
Asked to write the received task in a non empty struct -- proceeding
.");
/* Try to receive it by calling SIMIX network layer */
TRY {
/* Try to receive it by calling SIMIX network layer */
TRY {
-
SIMIX_req
_comm_recv(mailbox, task, NULL, NULL, NULL, timeout);
+
simcall
_comm_recv(mailbox, task, NULL, NULL, NULL, timeout);
XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox);
(*task)->simdata->isused=0;
}
XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox);
(*task)->simdata->isused=0;
}
@@
-130,7
+131,7
@@
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
MSG_error_t ret = MSG_OK;
simdata_task_t t_simdata = NULL;
m_process_t process = MSG_process_self();
MSG_error_t ret = MSG_OK;
simdata_task_t t_simdata = NULL;
m_process_t process = MSG_process_self();
- simdata_process_t p_simdata = SIMIX_process_self_get_data();
+ simdata_process_t p_simdata = SIMIX_process_self_get_data(
process
);
CHECK_HOST();
#ifdef HAVE_TRACING
CHECK_HOST();
#ifdef HAVE_TRACING
@@
-140,7
+141,7
@@
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
/* Prepare the task to send */
t_simdata = task->simdata;
t_simdata->sender = process;
/* Prepare the task to send */
t_simdata = task->simdata;
t_simdata->sender = process;
- t_simdata->source =
MSG_host_self()
;
+ t_simdata->source =
((simdata_process_t) SIMIX_process_self_get_data(process))->m_host
;
xbt_assert(t_simdata->isused == 0,
"This task is still being used somewhere else. You cannot send it now. Go fix your code!");
xbt_assert(t_simdata->isused == 0,
"This task is still being used somewhere else. You cannot send it now. Go fix your code!");
@@
-153,21
+154,16
@@
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
/* Try to send it by calling SIMIX network layer */
TRY {
/* Try to send it by calling SIMIX network layer */
TRY {
-#ifdef HAVE_TRACING
- if (TRACE_is_enabled()) {
- smx_action_t comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
+ smx_action_t comm = simcall_comm_isend(mailbox, t_simdata->message_size,
t_simdata->rate, task, sizeof(void *),
t_simdata->rate, task, sizeof(void *),
- NULL, NULL, 0);
- SIMIX_req_set_category(comm, task->category);
- SIMIX_req_comm_wait(comm, timeout);
- } else {
-#endif
- SIMIX_req_comm_send(mailbox, t_simdata->message_size,
- t_simdata->rate, task, sizeof(void*),
- NULL, NULL, timeout);
+ NULL, NULL, task, 0);
#ifdef HAVE_TRACING
#ifdef HAVE_TRACING
+ if (TRACE_is_enabled()) {
+ simcall_set_category(comm, task->category);
}
#endif
}
#endif
+ t_simdata->comm = comm;
+ simcall_comm_wait(comm, timeout);
}
CATCH(e) {
}
CATCH(e) {
@@
-190,6
+186,7
@@
MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
t_simdata->isused = 0;
}
t_simdata->isused = 0;
}
+
p_simdata->waiting_task = NULL;
#ifdef HAVE_TRACING
if (call_end)
p_simdata->waiting_task = NULL;
#ifdef HAVE_TRACING
if (call_end)