X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/de707cb1c879636021db2bd4c78785baa532aad7..9fd6cbc6c3b06f4b09e3c3339ffb3cc8a68f9bfa:/src/simix/popping_generated.cpp diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 0de896d6bf..a4a813389d 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -4,7 +4,7 @@ /* DO NOT EVER CHANGE THIS FILE */ /* */ /* change simcalls specification in src/simix/simcalls.in */ -/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved. */ /**********************************************************************/ /* @@ -14,62 +14,26 @@ * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :) */ +#include "smx_private.hpp" #include -#include "smx_private.h" #if SIMGRID_HAVE_MC #include "src/mc/mc_forward.hpp" #endif +#include "src/kernel/activity/ConditionVariableImpl.hpp" +#include "src/simix/smx_host_private.hpp" +#include "src/simix/smx_synchro_private.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping); /** @brief Simcalls' names (generated from src/simix/simcalls.in) */ const char* simcall_names[] = { - "SIMCALL_NONE", - "SIMCALL_PROCESS_KILL", - "SIMCALL_PROCESS_KILLALL", - "SIMCALL_PROCESS_CLEANUP", - "SIMCALL_PROCESS_SUSPEND", - "SIMCALL_PROCESS_JOIN", - "SIMCALL_PROCESS_SLEEP", - "SIMCALL_EXECUTION_START", - "SIMCALL_EXECUTION_PARALLEL_START", - "SIMCALL_EXECUTION_CANCEL", - "SIMCALL_EXECUTION_SET_PRIORITY", - "SIMCALL_EXECUTION_SET_BOUND", - "SIMCALL_EXECUTION_WAIT", - "SIMCALL_PROCESS_ON_EXIT", - "SIMCALL_PROCESS_AUTO_RESTART_SET", - "SIMCALL_PROCESS_RESTART", - "SIMCALL_COMM_IPROBE", - "SIMCALL_COMM_SEND", - "SIMCALL_COMM_ISEND", - "SIMCALL_COMM_RECV", - "SIMCALL_COMM_IRECV", - "SIMCALL_COMM_WAITANY", - "SIMCALL_COMM_WAIT", - "SIMCALL_COMM_TEST", - "SIMCALL_COMM_TESTANY", - "SIMCALL_MUTEX_INIT", - "SIMCALL_MUTEX_LOCK", - "SIMCALL_MUTEX_TRYLOCK", - "SIMCALL_MUTEX_UNLOCK", - "SIMCALL_COND_INIT", - "SIMCALL_COND_SIGNAL", - "SIMCALL_COND_WAIT", - "SIMCALL_COND_WAIT_TIMEOUT", - "SIMCALL_COND_BROADCAST", - "SIMCALL_SEM_INIT", - "SIMCALL_SEM_RELEASE", - "SIMCALL_SEM_WOULD_BLOCK", - "SIMCALL_SEM_ACQUIRE", - "SIMCALL_SEM_ACQUIRE_TIMEOUT", - "SIMCALL_SEM_GET_CAPACITY", - "SIMCALL_FILE_READ", - "SIMCALL_FILE_WRITE", - "SIMCALL_MC_RANDOM", - "SIMCALL_SET_CATEGORY", - "SIMCALL_RUN_KERNEL", - "SIMCALL_RUN_BLOCKING", + "SIMCALL_NONE", "SIMCALL_PROCESS_SUSPEND", "SIMCALL_PROCESS_JOIN", "SIMCALL_PROCESS_SLEEP", + "SIMCALL_EXECUTION_WAIT", "SIMCALL_EXECUTION_TEST", "SIMCALL_COMM_IPROBE", "SIMCALL_COMM_SEND", + "SIMCALL_COMM_ISEND", "SIMCALL_COMM_RECV", "SIMCALL_COMM_IRECV", "SIMCALL_COMM_WAITANY", + "SIMCALL_COMM_WAIT", "SIMCALL_COMM_TEST", "SIMCALL_COMM_TESTANY", "SIMCALL_MUTEX_LOCK", + "SIMCALL_MUTEX_TRYLOCK", "SIMCALL_MUTEX_UNLOCK", "SIMCALL_COND_WAIT", "SIMCALL_COND_WAIT_TIMEOUT", + "SIMCALL_SEM_ACQUIRE", "SIMCALL_SEM_ACQUIRE_TIMEOUT", "SIMCALL_IO_WAIT", "SIMCALL_MC_RANDOM", + "SIMCALL_RUN_KERNEL", "SIMCALL_RUN_BLOCKING", }; /** @private @@ -80,275 +44,126 @@ const char* simcall_names[] = { void SIMIX_simcall_handle(smx_simcall_t simcall, int value) { XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call)); SIMCALL_SET_MC_VALUE(simcall, value); - if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP) + if (simcall->issuer->context_->iwannadie) return; switch (simcall->call) { -case SIMCALL_PROCESS_KILL: - simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_PROCESS_KILLALL: - simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_PROCESS_CLEANUP: - SIMIX_process_cleanup(simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_PROCESS_SUSPEND: - simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal(simcall->args[0])); - break; - -case SIMCALL_PROCESS_JOIN: - simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - break; - -case SIMCALL_PROCESS_SLEEP: - simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal(simcall->args[0])); - break; - -case SIMCALL_EXECUTION_START: - simgrid::simix::marshal>( - simcall->result, - simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), - simgrid::simix::unmarshal(simcall->args[3]))); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_EXECUTION_PARALLEL_START: - simgrid::simix::marshal>( - simcall->result, - SIMIX_execution_parallel_start( - simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), - simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), - simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]))); - SIMIX_simcall_answer(simcall); + simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal(simcall->args[0])); break; -case SIMCALL_EXECUTION_CANCEL: - SIMIX_execution_cancel( - simgrid::simix::unmarshal>(simcall->args[0])); - SIMIX_simcall_answer(simcall); +case SIMCALL_PROCESS_JOIN: + simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); break; -case SIMCALL_EXECUTION_SET_PRIORITY: - SIMIX_execution_set_priority( - simgrid::simix::unmarshal>(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); - SIMIX_simcall_answer(simcall); +case SIMCALL_PROCESS_SLEEP: + simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal(simcall->args[0])); break; -case SIMCALL_EXECUTION_SET_BOUND: - SIMIX_execution_set_bound( - simgrid::simix::unmarshal>(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); - SIMIX_simcall_answer(simcall); +case SIMCALL_EXECUTION_WAIT: + simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal>(simcall->args[0])); break; -case SIMCALL_EXECUTION_WAIT: - simcall_HANDLER_execution_wait( +case SIMCALL_EXECUTION_TEST: + simcall_HANDLER_execution_test( simcall, simgrid::simix::unmarshal>(simcall->args[0])); break; -case SIMCALL_PROCESS_ON_EXIT: - SIMIX_process_on_exit(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_PROCESS_AUTO_RESTART_SET: - SIMIX_process_auto_restart_set(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_PROCESS_RESTART: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal(simcall->args[0]))); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_COMM_IPROBE: - simgrid::simix::marshal>( - simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), - simgrid::simix::unmarshal(simcall->args[3]))); + simgrid::simix::marshal>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_SEND: - simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); - break; + simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); + break; case SIMCALL_COMM_ISEND: - simgrid::simix::marshal>( - simcall->result, - simcall_HANDLER_comm_isend( - simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), - simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), - simgrid::simix::unmarshal(simcall->args[6]), - simgrid::simix::unmarshal(simcall->args[7]), - simgrid::simix::unmarshal(simcall->args[8]), - simgrid::simix::unmarshal(simcall->args[9]), simgrid::simix::unmarshal(simcall->args[10]))); + simgrid::simix::marshal>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9]), simgrid::simix::unmarshal(simcall->args[10]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_RECV: - simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8])); - break; + simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8])); + break; case SIMCALL_COMM_IRECV: - simgrid::simix::marshal>( - simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1]), - simgrid::simix::unmarshal(simcall->args[2]), - simgrid::simix::unmarshal(simcall->args[3]), - simgrid::simix::unmarshal(simcall->args[4]), - simgrid::simix::unmarshal(simcall->args[5]), - simgrid::simix::unmarshal(simcall->args[6]), - simgrid::simix::unmarshal(simcall->args[7]))); + simgrid::simix::marshal>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_WAITANY: - simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - break; + simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + break; case SIMCALL_COMM_WAIT: - simcall_HANDLER_comm_wait( - simcall, - simgrid::simix::unmarshal>(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); + simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal>(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); break; case SIMCALL_COMM_TEST: - simcall_HANDLER_comm_test( - simcall, - simgrid::simix::unmarshal>(simcall->args[0])); + simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal>(simcall->args[0])); break; case SIMCALL_COMM_TESTANY: - simcall_HANDLER_comm_testany( - simcall, - simgrid::simix::unmarshal*>(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); + simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal*>(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); break; -case SIMCALL_MUTEX_INIT: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_mutex_init(simcall)); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_MUTEX_LOCK: - simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal(simcall->args[0])); - break; + simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal(simcall->args[0])); + break; case SIMCALL_MUTEX_TRYLOCK: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal(simcall->args[0]))); - SIMIX_simcall_answer(simcall); - break; + simgrid::simix::marshal(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal(simcall->args[0]))); + SIMIX_simcall_answer(simcall); + break; case SIMCALL_MUTEX_UNLOCK: - simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_COND_INIT: - simgrid::simix::marshal(simcall->result, SIMIX_cond_init()); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_COND_SIGNAL: - SIMIX_cond_signal(simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; + simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal(simcall->args[0])); + SIMIX_simcall_answer(simcall); + break; case SIMCALL_COND_WAIT: - simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - break; + simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + break; case SIMCALL_COND_WAIT_TIMEOUT: - simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2])); - break; - -case SIMCALL_COND_BROADCAST: - SIMIX_cond_broadcast(simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_SEM_INIT: - simgrid::simix::marshal(simcall->result, SIMIX_sem_init(simgrid::simix::unmarshal(simcall->args[0]))); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_SEM_RELEASE: - simcall_HANDLER_sem_release(simcall, simgrid::simix::unmarshal(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_SEM_WOULD_BLOCK: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_sem_would_block(simcall, simgrid::simix::unmarshal(simcall->args[0]))); - SIMIX_simcall_answer(simcall); - break; + simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2])); + break; case SIMCALL_SEM_ACQUIRE: - simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal(simcall->args[0])); - break; + simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal(simcall->args[0])); + break; case SIMCALL_SEM_ACQUIRE_TIMEOUT: - simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - break; - -case SIMCALL_SEM_GET_CAPACITY: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_sem_get_capacity(simcall, simgrid::simix::unmarshal(simcall->args[0]))); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_FILE_READ: - simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); + simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); break; -case SIMCALL_FILE_WRITE: - simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); +case SIMCALL_IO_WAIT: + simcall_HANDLER_io_wait( + simcall, + simgrid::simix::unmarshal>(simcall->args[0])); break; case SIMCALL_MC_RANDOM: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]))); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_SET_CATEGORY: - SIMIX_set_category( - simgrid::simix::unmarshal>(simcall->args[0]), - simgrid::simix::unmarshal(simcall->args[1])); + simgrid::simix::marshal(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_RUN_KERNEL: - SIMIX_run_kernel(simgrid::simix::unmarshal const*>(simcall->args[0])); - SIMIX_simcall_answer(simcall); - break; + SIMIX_run_kernel(simgrid::simix::unmarshal const*>(simcall->args[0])); + SIMIX_simcall_answer(simcall); + break; case SIMCALL_RUN_BLOCKING: - SIMIX_run_blocking(simgrid::simix::unmarshal const*>(simcall->args[0])); - break; + SIMIX_run_blocking(simgrid::simix::unmarshal const*>(simcall->args[0])); + break; case NUM_SIMCALLS: break; case SIMCALL_NONE: - THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s", - simcall->issuer->name.c_str(), - sg_host_get_name(simcall->issuer->host) - ); + THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(), + sg_host_get_name(simcall->issuer->host_)); break; - + default: + THROW_IMPOSSIBLE; } }