X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e94c2a7fc81a82998524aa55db075be69990d4ea..e3e8e37466f1b6409356444985ec349103fce08d:/src/simix/smx_global.cpp diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index d61721f99a..10547b123b 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2019. 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. */ @@ -144,12 +144,6 @@ double SIMIX_timer_next() return simix_timers.empty() ? -1.0 : simix_timers.top().first; } -static void kill_process(smx_actor_t process) -{ - SIMIX_process_kill(process, nullptr); -} - - namespace simgrid { namespace simix { @@ -179,12 +173,9 @@ void SIMIX_global_init(int *argc, char **argv) simgrid::mc::Client::initialize(); #endif - if (not simix_global) { + if (simix_global == nullptr) { simix_global = std::unique_ptr(new simgrid::simix::Global()); simix_global->maestro_process = nullptr; - simix_global->create_process_function = &SIMIX_process_create; - simix_global->kill_process_function = &kill_process; - simix_global->cleanup_process_function = &SIMIX_process_cleanup; surf_init(argc, argv); /* Initialize SURF structures */ SIMIX_context_mod_init(); @@ -201,7 +192,7 @@ void SIMIX_global_init(int *argc, char **argv) #endif /* register a function to be called by SURF after the environment creation */ sg_platf_init(); - simgrid::s4u::on_platform_created.connect(SIMIX_post_create_environment); + simgrid::s4u::on_platform_created.connect(surf_presolve); simgrid::s4u::Storage::on_creation.connect([](simgrid::s4u::Storage& storage) { sg_storage_t s = simgrid::s4u::Storage::by_name(storage.get_cname()); @@ -560,45 +551,6 @@ double SIMIX_timer_get_date(smx_timer_t timer) { return timer ? timer->getDate() : 0; } -/** - * @brief Registers a function to create a process. - * - * This function registers a function to be called - * when a new process is created. The function has - * to call SIMIX_process_create(). - * @param function create process function - */ -void SIMIX_function_register_process_create(smx_creation_func_t function) -{ - simix_global->create_process_function = function; -} - -/** - * @brief Registers a function to kill a process. - * - * This function registers a function to be called when a process is killed. The function has to call the - * SIMIX_process_kill(). - * - * @param function Kill process function - */ -void SIMIX_function_register_process_kill(void_pfn_smxprocess_t function) -{ - simix_global->kill_process_function = function; -} - -/** - * @brief Registers a function to cleanup a process. - * - * This function registers a user function to be called when a process ends properly. - * - * @param function cleanup process function - */ -void SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function) -{ - simix_global->cleanup_process_function = function; -} - - void SIMIX_display_process_status() { int nbprocess = simix_global->process_list.size();