X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e08a76b1a43e12302ebd25abbe8830fcefca72b..3cbf54871089cc3dc50b6832652b5765e1601039:/src/simix/libsmx.cpp diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 9281dca7b6..14f60e6287 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -5,7 +5,7 @@ /* */ /* This is somehow the "libc" of SimGrid */ -/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -20,6 +20,7 @@ #include "simgrid/simix/blocking_simcall.hpp" #include "smx_private.hpp" #include "src/kernel/activity/CommImpl.hpp" +#include "src/kernel/activity/MutexImpl.hpp" #include "src/mc/mc_forward.hpp" #include "src/mc/mc_replay.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" @@ -55,15 +56,14 @@ void simcall_call(smx_actor_t actor) * \param bound * \return A new SIMIX execution synchronization */ -smx_activity_t simcall_execution_start(const char *name, - double flops_amount, - double priority, double bound) +smx_activity_t simcall_execution_start(const char* name, double flops_amount, double priority, double bound, + simgrid::s4u::Host* host) { /* checking for infinite values */ xbt_assert(std::isfinite(flops_amount), "flops_amount is not finite!"); xbt_assert(std::isfinite(priority), "priority is not finite!"); - return simcall_BODY_execution_start(name, flops_amount, priority, bound); + return simcall_BODY_execution_start(name, flops_amount, priority, bound, host); } /** @@ -138,7 +138,7 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority) simgrid::kernel::activity::ExecImplPtr exec = boost::static_pointer_cast(execution); if (exec->surfAction_) - exec->surfAction_->setSharingWeight(priority); + exec->surfAction_->set_priority(priority); }); } @@ -156,7 +156,7 @@ void simcall_execution_set_bound(smx_activity_t execution, double bound) simgrid::kernel::activity::ExecImplPtr exec = boost::static_pointer_cast(execution); if (exec->surfAction_) - exec->surfAction_->setBound(bound); + exec->surfAction_->set_bound(bound); }); } @@ -171,13 +171,18 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution) return (e_smx_state_t) simcall_BODY_execution_wait(execution); } +e_smx_state_t simcall_execution_test(smx_activity_t execution) +{ + return (e_smx_state_t)simcall_BODY_execution_test(execution); +} + /** * \ingroup simix_process_management * \brief Kills all SIMIX processes. */ -void simcall_process_killall(int reset_pid) +void simcall_process_killall() { - simcall_BODY_process_killall(reset_pid); + simcall_BODY_process_killall(); } /** @@ -254,7 +259,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time) * \brief Add an on_exit function * Add an on_exit function which will be executed when the process exits/is killed. */ -XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data) +XBT_PUBLIC void simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) { simcall_BODY_process_on_exit(process, fun, data); } @@ -445,7 +450,7 @@ smx_mutex_t simcall_mutex_init() fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization xbt_abort(); } - return simgrid::simix::kernelImmediate([] { return new simgrid::simix::MutexImpl(); }); + return simgrid::simix::kernelImmediate([] { return new simgrid::kernel::activity::MutexImpl(); }); } /**