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
[mc] Move stacks_areas code in mcer_ignore
[simgrid.git]
/
src
/
simix
/
smx_network.c
diff --git
a/src/simix/smx_network.c
b/src/simix/smx_network.c
index
921aa00
..
fbeb548
100644
(file)
--- a/
src/simix/smx_network.c
+++ b/
src/simix/smx_network.c
@@
-7,10
+7,10
@@
#include "smx_private.h"
#include "xbt/log.h"
#include "mc/mc.h"
#include "smx_private.h"
#include "xbt/log.h"
#include "mc/mc.h"
+#include "mc/mc_replay.h"
#include "xbt/dict.h"
#include "smpi/private.h"
#include "xbt/dict.h"
#include "smpi/private.h"
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
"SIMIX network-related synchronization");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
"SIMIX network-related synchronization");
@@
-44,9
+44,6
@@
void SIMIX_network_exit(void)
/* Rendez-Vous Points */
/******************************************************************************/
/* Rendez-Vous Points */
/******************************************************************************/
-smx_rdv_t simcall_HANDLER_rdv_create(smx_simcall_t simcall, const char *name){
- return SIMIX_rdv_create(name);
-}
smx_rdv_t SIMIX_rdv_create(const char *name)
{
/* two processes may have pushed the same rdv_create simcall at the same time */
smx_rdv_t SIMIX_rdv_create(const char *name)
{
/* two processes may have pushed the same rdv_create simcall at the same time */
@@
-67,9
+64,6
@@
smx_rdv_t SIMIX_rdv_create(const char *name)
return rdv;
}
return rdv;
}
-void simcall_HANDLER_rdv_destroy(smx_simcall_t simcall, smx_rdv_t rdv){
- return SIMIX_rdv_destroy(rdv);
-}
void SIMIX_rdv_destroy(smx_rdv_t rdv)
{
if (rdv->name)
void SIMIX_rdv_destroy(smx_rdv_t rdv)
{
if (rdv->name)
@@
-97,9
+91,6
@@
smx_rdv_t SIMIX_rdv_get_by_name(const char *name)
return xbt_dict_get_or_null(rdv_points, name);
}
return xbt_dict_get_or_null(rdv_points, name);
}
-unsigned int simcall_HANDLER_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host){
- return SIMIX_rdv_comm_count_by_host(rdv, host);
-}
int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
{
smx_synchro_t comm = NULL;
int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
{
smx_synchro_t comm = NULL;
@@
-114,17
+105,11
@@
int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
return count;
}
return count;
}
-smx_synchro_t simcall_HANDLER_rdv_get_head(smx_simcall_t simcall, smx_rdv_t rdv){
- return SIMIX_rdv_get_head(rdv);
-}
smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv)
{
return xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
}
smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv)
{
return xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
}
-smx_process_t simcall_HANDLER_rdv_get_receiver(smx_simcall_t simcall, smx_rdv_t rdv){
- return SIMIX_rdv_get_receiver(rdv);
-}
/**
* \brief get the receiver (process associated to the mailbox)
* \param rdv The rendez-vous point
/**
* \brief get the receiver (process associated to the mailbox)
* \param rdv The rendez-vous point
@@
-135,10
+120,6
@@
smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv)
return rdv->permanent_receiver;
}
return rdv->permanent_receiver;
}
-void simcall_HANDLER_rdv_set_receiver(smx_simcall_t simcall, smx_rdv_t rdv,
- smx_process_t process){
- SIMIX_rdv_set_receiver(rdv, process);
-}
/**
* \brief set the receiver of the rendez vous point to allow eager sends
* \param rdv The rendez-vous point
/**
* \brief set the receiver of the rendez vous point to allow eager sends
* \param rdv The rendez-vous point
@@
-277,9
+258,7
@@
smx_synchro_t SIMIX_comm_new(e_smx_comm_type_t type)
synchro->latency_limited = -1;
#endif
synchro->latency_limited = -1;
#endif
-#ifdef HAVE_TRACING
synchro->category = NULL;
synchro->category = NULL;
-#endif
XBT_DEBUG("Create communicate synchro %p", synchro);
++smx_total_comms;
XBT_DEBUG("Create communicate synchro %p", synchro);
++smx_total_comms;
@@
-442,7
+421,7
@@
smx_synchro_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
other_synchro->comm.copy_data_fun = copy_data_fun;
other_synchro->comm.copy_data_fun = copy_data_fun;
- if (MC_is_active()) {
+ if (MC_is_active()
|| MC_record_replay_is_active()
) {
other_synchro->state = SIMIX_RUNNING;
return (detached ? NULL : other_synchro);
}
other_synchro->state = SIMIX_RUNNING;
return (detached ? NULL : other_synchro);
}
@@
-551,7
+530,7
@@
smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
SIMIX_comm_copy_data(other_synchro);*/
SIMIX_comm_copy_data(other_synchro);*/
- if (MC_is_active()) {
+ if (MC_is_active()
|| MC_record_replay_is_active()
) {
other_synchro->state = SIMIX_RUNNING;
return other_synchro;
}
other_synchro->state = SIMIX_RUNNING;
return other_synchro;
}
@@
-612,7
+591,7
@@
void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, dou
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
xbt_fifo_push(synchro->simcalls, simcall);
simcall->issuer->waiting_synchro = synchro;
- if (MC_is_active()) {
+ if (MC_is_active()
|| MC_record_replay_is_active()
) {
int idx = SIMCALL_GET_MC_VALUE(simcall);
if (idx == 0) {
synchro->state = SIMIX_DONE;
int idx = SIMCALL_GET_MC_VALUE(simcall);
if (idx == 0) {
synchro->state = SIMIX_DONE;
@@
-649,7
+628,7
@@
void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, dou
void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro)
{
void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro)
{
- if(MC_is_active()){
+ if(MC_is_active()
|| MC_record_replay_is_active()
){
simcall_comm_test__set__result(simcall, synchro->comm.src_proc && synchro->comm.dst_proc);
if(simcall_comm_test__get__result(simcall)){
synchro->state = SIMIX_DONE;
simcall_comm_test__set__result(simcall, synchro->comm.src_proc && synchro->comm.dst_proc);
if(simcall_comm_test__get__result(simcall)){
synchro->state = SIMIX_DONE;
@@
-676,7
+655,7
@@
void simcall_HANDLER_comm_testany(smx_simcall_t simcall, xbt_dynar_t synchros)
smx_synchro_t synchro;
simcall_comm_testany__set__result(simcall, -1);
smx_synchro_t synchro;
simcall_comm_testany__set__result(simcall, -1);
- if (MC_is_active()){
+ if (MC_is_active()
|| MC_record_replay_is_active()
){
int idx = SIMCALL_GET_MC_VALUE(simcall);
if(idx == -1){
SIMIX_simcall_answer(simcall);
int idx = SIMCALL_GET_MC_VALUE(simcall);
if(idx == -1){
SIMIX_simcall_answer(simcall);
@@
-706,7
+685,7
@@
void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros)
smx_synchro_t synchro;
unsigned int cursor = 0;
smx_synchro_t synchro;
unsigned int cursor = 0;
- if (MC_is_active()){
+ if (MC_is_active()
|| MC_record_replay_is_active()
){
int idx = SIMCALL_GET_MC_VALUE(simcall);
synchro = xbt_dynar_get_as(synchros, idx, smx_synchro_t);
xbt_fifo_push(synchro->simcalls, simcall);
int idx = SIMCALL_GET_MC_VALUE(simcall);
synchro = xbt_dynar_get_as(synchros, idx, smx_synchro_t);
xbt_fifo_push(synchro->simcalls, simcall);
@@
-810,7
+789,7
@@
void SIMIX_comm_finish(smx_synchro_t synchro)
continue; // if process handling comm is killed
if (simcall->call == SIMCALL_COMM_WAITANY) {
SIMIX_waitany_remove_simcall_from_actions(simcall);
continue; // if process handling comm is killed
if (simcall->call == SIMCALL_COMM_WAITANY) {
SIMIX_waitany_remove_simcall_from_actions(simcall);
- if (!MC_is_active())
+ if (!MC_is_active()
&& !MC_record_replay_is_active()
)
simcall_comm_waitany__set__result(simcall, xbt_dynar_search(simcall_comm_waitany__get__comms(simcall), &synchro));
}
simcall_comm_waitany__set__result(simcall, xbt_dynar_search(simcall_comm_waitany__get__comms(simcall), &synchro));
}
@@
-955,9
+934,6
@@
void SIMIX_post_comm(smx_synchro_t synchro)
}
}
}
}
-void simcall_HANDLER_comm_cancel(smx_simcall_t simcall, smx_synchro_t synchro){
- SIMIX_comm_cancel(synchro);
-}
void SIMIX_comm_cancel(smx_synchro_t synchro)
{
/* if the synchro is a waiting state means that it is still in a rdv */
void SIMIX_comm_cancel(smx_synchro_t synchro)
{
/* if the synchro is a waiting state means that it is still in a rdv */
@@
-967,6
+943,7
@@
void SIMIX_comm_cancel(smx_synchro_t synchro)
synchro->state = SIMIX_CANCELED;
}
else if (!MC_is_active() /* when running the MC there are no surf actions */
synchro->state = SIMIX_CANCELED;
}
else if (!MC_is_active() /* when running the MC there are no surf actions */
+ && !MC_record_replay_is_active()
&& (synchro->state == SIMIX_READY || synchro->state == SIMIX_RUNNING)) {
surf_action_cancel(synchro->comm.surf_comm);
&& (synchro->state == SIMIX_READY || synchro->state == SIMIX_RUNNING)) {
surf_action_cancel(synchro->comm.surf_comm);
@@
-992,9
+969,6
@@
void SIMIX_comm_resume(smx_synchro_t synchro)
/************* synchro Getters **************/
/************* synchro Getters **************/
-double simcall_HANDLER_comm_get_remains(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_remains(synchro);
-}
/**
* \brief get the amount remaining from the communication
* \param synchro The communication
/**
* \brief get the amount remaining from the communication
* \param synchro The communication
@@
-1025,17
+999,11
@@
double SIMIX_comm_get_remains(smx_synchro_t synchro)
return remains;
}
return remains;
}
-e_smx_state_t simcall_HANDLER_comm_get_state(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_state(synchro);
-}
e_smx_state_t SIMIX_comm_get_state(smx_synchro_t synchro)
{
return synchro->state;
}
e_smx_state_t SIMIX_comm_get_state(smx_synchro_t synchro)
{
return synchro->state;
}
-void* simcall_HANDLER_comm_get_src_data(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_src_data(synchro);
-}
/**
* \brief Return the user data associated to the sender of the communication
* \param synchro The communication
/**
* \brief Return the user data associated to the sender of the communication
* \param synchro The communication
@@
-1046,9
+1014,6
@@
void* SIMIX_comm_get_src_data(smx_synchro_t synchro)
return synchro->comm.src_data;
}
return synchro->comm.src_data;
}
-void* simcall_HANDLER_comm_get_dst_data(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_dst_data(synchro);
-}
/**
* \brief Return the user data associated to the receiver of the communication
* \param synchro The communication
/**
* \brief Return the user data associated to the receiver of the communication
* \param synchro The communication
@@
-1059,28
+1024,17
@@
void* SIMIX_comm_get_dst_data(smx_synchro_t synchro)
return synchro->comm.dst_data;
}
return synchro->comm.dst_data;
}
-smx_process_t simcall_HANDLER_comm_get_src_proc(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_src_proc(synchro);
-}
smx_process_t SIMIX_comm_get_src_proc(smx_synchro_t synchro)
{
return synchro->comm.src_proc;
}
smx_process_t SIMIX_comm_get_src_proc(smx_synchro_t synchro)
{
return synchro->comm.src_proc;
}
-smx_process_t simcall_HANDLER_comm_get_dst_proc(smx_simcall_t simcall, smx_synchro_t synchro){
- return SIMIX_comm_get_dst_proc(synchro);
-}
smx_process_t SIMIX_comm_get_dst_proc(smx_synchro_t synchro)
{
return synchro->comm.dst_proc;
}
#ifdef HAVE_LATENCY_BOUND_TRACKING
smx_process_t SIMIX_comm_get_dst_proc(smx_synchro_t synchro)
{
return synchro->comm.dst_proc;
}
#ifdef HAVE_LATENCY_BOUND_TRACKING
-int simcall_HANDLER_comm_is_latency_bounded(smx_simcall_t simcall, smx_synchro_t synchro)
-{
- return SIMIX_comm_is_latency_bounded(synchro);
-}
-
/**
* \brief verify if communication is latency bounded
* \param comm The communication
/**
* \brief verify if communication is latency bounded
* \param comm The communication