From: Arnaud Giersch Date: Mon, 11 Feb 2019 15:07:12 +0000 (+0100) Subject: No need to answer to simcall when host is off. X-Git-Tag: v3_22~356^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2a4e0832d58c384b44501fea364c650327b830f9 No need to answer to simcall when host is off. These changes should fix tests platform-failures where some processes were duplicated in process_to_run[], leading to runtime errors with boost and raw contexts. The error could be seen with a "xbt_assert(next_context != this);" just before "this->swap_into(next_context);" in SwappedContext::suspend(). --- diff --git a/examples/deprecated/msg/CMakeLists.txt b/examples/deprecated/msg/CMakeLists.txt index f16b7865b2..b8b6bef89d 100644 --- a/examples/deprecated/msg/CMakeLists.txt +++ b/examples/deprecated/msg/CMakeLists.txt @@ -73,8 +73,6 @@ foreach(x app-masterworker cloud-masterworker ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh) endforeach() -set_tesh_properties(msg-platform-failures "raw;boost" WILL_FAIL TRUE) # FIXME - foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-process-migration trace-host-user-variables) ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x} diff --git a/examples/s4u/CMakeLists.txt b/examples/s4u/CMakeLists.txt index cebbebfc38..6327f60579 100644 --- a/examples/s4u/CMakeLists.txt +++ b/examples/s4u/CMakeLists.txt @@ -31,8 +31,6 @@ foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh) endforeach() -set_tesh_properties(s4u-platform-failures "raw;boost" WILL_FAIL TRUE) # FIXME - # Multi-files examples ###################### diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 53fd30cd5d..597021e6d7 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -124,12 +124,14 @@ void SIMIX_execution_finish(smx_activity_t synchro) default: xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", (int)exec->state_); } - /* Fail the process if the host is down */ - if (simcall->issuer->host_->is_off()) - simcall->issuer->context_->iwannadie = true; simcall->issuer->waiting_synchro = nullptr; simcall_execution_wait__set__result(simcall, exec->state_); - SIMIX_simcall_answer(simcall); + + /* Fail the process if the host is down */ + if (simcall->issuer->host_->is_off()) + simcall->issuer->context_->iwannadie = true; + else + SIMIX_simcall_answer(simcall); } } diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 2898422e40..24947e8600 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -53,11 +53,10 @@ void SIMIX_io_finish(smx_activity_t synchro) xbt_die("Internal error in SIMIX_io_finish: unexpected synchro state %d", static_cast(synchro->state_)); } - if (simcall->issuer->host_->is_off()) { - simcall->issuer->context_->iwannadie = true; - } - simcall->issuer->waiting_synchro = nullptr; - SIMIX_simcall_answer(simcall); + if (simcall->issuer->host_->is_off()) + simcall->issuer->context_->iwannadie = true; + else + SIMIX_simcall_answer(simcall); } } diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index e3cc2047d2..ed7189c6d9 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -624,9 +624,6 @@ void SIMIX_comm_finish(smx_activity_t synchro) } } - if (simcall->issuer->host_->is_off()) - simcall->issuer->context_->iwannadie = true; - simcall->issuer->waiting_synchro = nullptr; simcall->issuer->comms.remove(synchro); if(comm->detached){ @@ -643,7 +640,10 @@ void SIMIX_comm_finish(smx_activity_t synchro) } } - SIMIX_simcall_answer(simcall); + if (simcall->issuer->host_->is_off()) + simcall->issuer->context_->iwannadie = true; + else + SIMIX_simcall_answer(simcall); } } diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 4658773cdd..7fd7af1ffe 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -65,16 +65,15 @@ void SIMIX_synchro_finish(smx_activity_t synchro) smx_simcall_t simcall = synchro->simcalls_.front(); synchro->simcalls_.pop_front(); - if (synchro->state_ != SIMIX_SRC_TIMEOUT) { - if (synchro->state_ == SIMIX_FAILED) - simcall->issuer->context_->iwannadie = true; - else - THROW_IMPOSSIBLE; - } - SIMIX_synchro_stop_waiting(simcall->issuer, simcall); simcall->issuer->waiting_synchro = nullptr; - SIMIX_simcall_answer(simcall); + + if (synchro->state_ != SIMIX_SRC_TIMEOUT) { + xbt_assert(synchro->state_ == SIMIX_FAILED); + simcall->issuer->context_->iwannadie = true; + } else { + SIMIX_simcall_answer(simcall); + } XBT_OUT(); }