From: Martin Quinson Date: Fri, 17 Jun 2016 09:39:43 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_14~976 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7b138f8b1ed3e8816eda5cb26deb71fe81b4087a?hp=5d98a94013bfc4b0ad30cedfe65aa30220bef737 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/doc/Layout.xml b/doc/Layout.xml index b34e45100a..ba859ecd96 100644 --- a/doc/Layout.xml +++ b/doc/Layout.xml @@ -64,7 +64,8 @@ - + + @@ -74,7 +75,6 @@ - diff --git a/doc/doxygen/module-s4u.doc b/doc/doxygen/module-s4u.doc index 9e629e1e6d..324edb0fcc 100644 --- a/doc/doxygen/module-s4u.doc +++ b/doc/doxygen/module-s4u.doc @@ -10,128 +10,9 @@ SimGrid will be possible in S4U. that path unless you know what you are doing. If unsure, proceed to @ref MSG_API instead. -@section s4u_funct Offered functionalities Unsurprisingly, the S4U interface matches the concepts presented in -@ref starting_components "the introduction": +@ref starting_components "the introduction". You should read this page +first, to not get lost in the amount of classes provided here. - - @ref s4u_actor - - @{ */ - -/** @defgroup s4u_actor Actors: simulation agents */ - -/** @} */ - - - \ref msg_simulation - - \ref m_process_management - - \ref m_host_management - - \ref m_task_management - - \ref msg_mailbox_management - - @ref msg_file - - \ref msg_task_usage - - \ref msg_VMs - - \ref msg_synchro - - \ref msg_trace_driven - - \ref MSG_examples - -@defgroup msg_simulation Main MSG simulation Functions -@ingroup MSG_API -@brief How to setup and control your simulation. - -The basic workflow is the following (check the \ref MSG_examples for -details). - - -# Initialize the library with #MSG_init - -# Create a platform (usually by parsing a file with - #MSG_create_environment) - -# Register the functions that your processes are supposed to run with - #MSG_function_register (and maybe #MSG_function_register_default) - -# Launch your processes from a deployment file with #MSG_launch_application - -# Run the simulation with #MSG_main -* - -** @defgroup m_process_management Process Management Functions - * @ingroup MSG_API - * @brief This section describes the process structure of MSG - * (#msg_process_t) and the functions for managing it. - */ - -** @defgroup m_host_management Host Management Functions - * @ingroup MSG_API - * @brief Host structure of MSG - * - -** @defgroup m_task_management Task Management Functions - * @ingroup MSG_API - * @brief Task structure of MSG (#msg_task_t) and associated functions. See - * \ref msg_task_usage to see how to put the tasks in action. - * - -** @defgroup msg_mailbox_management Mailbox Management Functions - * @ingroup MSG_API - * @brief Mailbox structure of MSG (#msg_mailbox_t) and associated functions. - * - -** @defgroup msg_task_usage Task Actions - * @ingroup MSG_API - * @brief This section describes the functions that can be used - * by a process to execute, communicate or otherwise handle some task. - * - -** @defgroup msg_synchro Explicit Synchronization Functions - * @ingroup MSG_API - * @brief Explicit synchronization mechanisms: semaphores (#msg_sem_t) and friends. - * - * In some situations, these things are very helpful to synchronize processes without message exchanges. - * - -** @defgroup msg_VMs VMs - * @ingroup MSG_API - * @brief Interface created to mimic IaaS clouds. - * - * With it, you can create virtual machines to put your processes - * into, and interact directly with the VMs to manage groups of - * processes. - * - * This interface is highly experimental at this point. Testing is - * welcomed, but do not expect too much of it right now. Even the - * interfaces may be changed in future releases of SimGrid (although - * things are expected to stabilize nicely before SimGrid v3.8). - * There is no guaranty on the rest of SimGrid, and there is less - * than that on this part. - * - * - -** @defgroup msg_storage_management Storage Management Functions - * @ingroup MSG_API - * @brief Storage structure of MSG (#msg_storage_t) and associated functions, inspired from POSIX. - * - -** @defgroup msg_file File Management Functions - @ingroup MSG_API - @brief MSG files (#msg_file_t) and associated functions, inspired from POSIX. -* - -** -@defgroup msg_trace_driven Trace-driven simulations -@ingroup MSG_API -@brief This section describes the functions allowing to build trace-driven simulations. - -This is very handy when you want to test an algorithm or protocol that -does nothing unless it receives some events from outside. For example, -a P2P protocol reacts to requests from the user, but does nothing if -there is no such event. - -In such situations, SimGrid allows to write your protocol in your C -file, and the events to react to in a separate text file. Declare a -function handling each of the events that you want to accept in your -trace files, register them using #xbt_replay_action_register in your main, -and then use #MSG_action_trace_run to launch the simulation. You can -either have one trace file containing all your events, or a file per -simulated process. - -Check the examples in examples/msg/actions/actions.c for details. - - * diff --git a/include/simgrid/host.h b/include/simgrid/host.h index 70bbccaea6..3879b924dd 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -26,7 +26,6 @@ XBT_PUBLIC(sg_host_t *) sg_host_list(void); XBT_PUBLIC(size_t) sg_host_extension_create(void(*deleter)(void*)); XBT_PUBLIC(void*) sg_host_extension_get(sg_host_t host, size_t rank); XBT_PUBLIC(sg_host_t) sg_host_by_name(const char *name); -XBT_PUBLIC(sg_host_t) sg_host_by_name_or_create(const char *name); XBT_PUBLIC(const char*) sg_host_get_name(sg_host_t host); XBT_PUBLIC(xbt_dynar_t) sg_hosts_as_dynar(void); diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index 629ff2f8cb..89a752e4cf 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -22,9 +22,7 @@ namespace simgrid { namespace s4u { -/** @addtogroup s4u_actor - * - * @tableofcontents +/** @ingroup s4u_api * * An actor is an independent stream of execution in your distributed application. * @@ -40,8 +38,6 @@ namespace s4u { * of this standard may help to understand the philosophy of the S4U * Actors. * - * (back to the @ref s4u_api "S4U documentation") - * * @section s4u_actor_def Defining the skeleton of an Actor * * %As in the C++11 @@ -49,6 +45,8 @@ namespace s4u { * pure function or as an object. It is very simple with functions: * * @code{.cpp} + * #include "s4u/actor.hpp" + * * // Declare the code of your worker * void worker() { * printf("Hello s4u"); @@ -56,7 +54,8 @@ namespace s4u { * }; * * // From your main or from another actor, create your actor on the host Jupiter - * Actor("worker", simgrid::s4u::Host::by_name("Jupiter"), worker); + * // The following line actually creates a new actor, even if there is no "new". + * Actor("Alice", simgrid::s4u::Host::by_name("Jupiter"), worker); * @endcode * * But some people prefer to encapsulate their actors in classes and @@ -76,7 +75,7 @@ namespace s4u { * }; * * // From your main or from another actor, create your actor. Note the () after Worker - * Actor("worker", simgrid::s4u::Host::by_name("Jupiter"), Worker()); + * Actor("Bob", simgrid::s4u::Host::by_name("Jupiter"), Worker()); * @endcode * * @section s4u_actor_flesh Fleshing your actor @@ -245,7 +244,8 @@ private: smx_process_t pimpl_ = nullptr; }; -/** @brief Static methods working on the current actor (see @ref s4u_actor) */ +/** @ingroup s4u_api + * @brief Static methods working on the current actor (see @ref s4u::Actor) */ namespace this_actor { /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */ diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index 3d741de67b..ebe969bf41 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -21,21 +21,22 @@ namespace simgrid { namespace xbt { -extern template class XBT_PUBLIC() Extendable; + extern template class XBT_PUBLIC() Extendable; } - namespace s4u { -/** @brief Simulated machine that can host some actors +/** @ingroup s4u_api + * + * @tableofcontents * - * It represents some physical resource with computing and networking capabilities. + * An host represents some physical resource with computing and networking capabilities. * * All hosts are automatically created during the call of the method * @link{simgrid::s4u::Engine::loadPlatform()}. * You cannot create a host yourself. * - * You can retrieve a particular host using @link{simgrid::s4u::Host.byName()}, - * and actors can retrieve the host on which they run using @link{simgrid::s4u::Host.current()}. + * You can retrieve a particular host using simgrid::s4u::Host::byName() + * and actors can retrieve the host on which they run using simgrid::s4u::Host::current(). */ XBT_PUBLIC_CLASS Host : public simgrid::xbt::Extendable { @@ -44,11 +45,12 @@ private: explicit Host(const char *name); public: // TODO, make me private ~Host(); -public: + /** Do not use this function, it should be private */ + static Host* by_name_or_create(const char* name); + /** Retrieves an host from its name, or return nullptr */ static Host* by_name_or_null(const char* name); - static Host* by_name_or_create(const char* name); - /** Retrieves an host from its name. */ + /** Retrieves an host from its name, or die */ static s4u::Host *by_name(std::string name); /** Retrieves the host on which the current actor is running */ static s4u::Host *current(); diff --git a/include/xbt/Extendable.hpp b/include/xbt/Extendable.hpp index fd4f59adea..99c981d947 100644 --- a/include/xbt/Extendable.hpp +++ b/include/xbt/Extendable.hpp @@ -41,7 +41,7 @@ public: * with a notion of Host extended with another concept (such as mobility). * You could completely externalize these data with an associative map Host->EnergyHost. * It would work, provided that you implement this classical feature correctly (and it would induce a little performance penalty). - * Instead, you should add a new facet to the Host class, that happens to be Facetable. + * Instead, you should add a new extension to the Host class, that happens to be Extendable. * */ template diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index f3954fcd37..7d386319d5 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -53,11 +53,6 @@ sg_host_t sg_host_by_name(const char *name) return simgrid::s4u::Host::by_name_or_null(name); } -sg_host_t sg_host_by_name_or_create(const char *name) -{ - return simgrid::s4u::Host::by_name_or_create(name); -} - xbt_dynar_t sg_hosts_as_dynar(void) { xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),nullptr); diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index 399d2ce02a..90855a80c6 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -105,7 +105,7 @@ VMHL13::VMHL13(VMModel *model, const char* name, sg_host_t host_PM) * from the VM name, we have to make sure that the system does not call the * free callback for the network resource object. The network resource object * is still used by the physical machine. */ - sg_host_t host_VM = sg_host_by_name_or_create(name); + sg_host_t host_VM = simgrid::s4u::Host::by_name_or_create(name); host_VM->pimpl_netcard = host_PM->pimpl_netcard; p_vm_state = SURF_VM_STATE_CREATED; diff --git a/tools/cmake/Documentation.cmake b/tools/cmake/Documentation.cmake index 2eacceb3bd..431c28ae32 100644 --- a/tools/cmake/Documentation.cmake +++ b/tools/cmake/Documentation.cmake @@ -78,11 +78,11 @@ if(DOXYGEN_FOUND) WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc ) -### Fill in the "make sync-gforge" target ### +### Fill in the "make gforge-gforge" target ### set(RSYNC_CMD rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --times --omit-dir-times --perms --chmod=a+rX,ug+w,o-w,Dg+s) -add_custom_target(sync-gforge-doc +add_custom_target(gforge-sync COMMAND ssh scm.gforge.inria.fr mkdir -p -m 2775 /home/groups/simgrid/htdocs/simgrid/${release_version}/ || true COMMAND ${RSYNC_CMD} doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/doc/ || true @@ -91,16 +91,12 @@ add_custom_target(sync-gforge-doc doc/webcruft/simgrid_logo_2011_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/ COMMAND ${RSYNC_CMD} src/surf/xml/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/ + COMMAND ${RSYNC_CMD} src/surf/xml/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/simgrid.dtd WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" ) -add_dependencies(sync-gforge-doc documentation) +add_dependencies(gforge-sync documentation) -add_custom_target(sync-gforge-dtd - COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/simgrid.dtd - COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid.dtd - WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" - ) endif() # Doxygen found if (Java_FOUND)