Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This file is generated in maintainermode => must be in CVS for non-maintainer mode...
[simgrid.git] / doc / module-surf.doc
1 /** \addtogroup SURF_API 
2
3   \section SURF_doc Surf documentation
4    - \ref SURF_simulation
5    - \ref SURF_actions
6    - \ref SURF_resources
7    - \ref SURF_build_api
8
9 */
10
11 /**     \addtogroup SURF_simulation
12         \ingroup SURF_API  */
13 /**     \addtogroup SURF_actions
14         \ingroup SURF_API  */
15 /**     \addtogroup SURF_resources
16         \ingroup SURF_API  */
17 /**     \addtogroup SURF_build_api
18         \ingroup SURF_API  */
19
20 /** \defgroup SURF_simulation Simulation
21     \ingroup SURF_API
22     \brief Functions for creating the environment and launching the simulation
23         
24     This section describes the functions for initialising SURF, performing
25     the simulation and exiting SURF.
26 */
27
28 /** \defgroup SURF_actions SURF actions
29     \ingroup SURF_API
30     \brief This section describes the different datatypes and operations related to the actions in SURF.
31     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Actions" --> \endhtmlonly
32 */
33
34 /** \defgroup SURF_resources SURF resources
35     \ingroup SURF_API
36     \brief This section describes the different datatypes and operations related to the resources in SURF.
37     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Resources" --> \endhtmlonly
38 */
39
40 /** \defgroup SURF_build_api Create a new API
41     \ingroup SURF_API
42     \brief How to build a new API on top of SURF
43
44     SURF provides the functionnalities to simulate the platform. There are two main datatypes in SURF:
45     the actions and the resources. Several types of resources exist:
46         - the workstation resource,
47         - the network resource,
48         - the CPU resource,
49         - the timer resource.
50
51     The implentation of these resources depends on the platform model you choose. There are several
52     platform models. You can select your model by calling surf_workstation_resource_init_CLM03()
53     or surf_workstation_resource_init_KCCFLN05(). See the documentation of these functions to have
54     more details about the models. Remember that the model KCCFLN05 is an implementation of both the
55     workstation resource and the network.
56
57     Typically, your functions should call the SURF functions provided by the structures
58     \a surf_workstation_resource->common_public and \a surf_workstation_resource->extension_public.
59     See surf_resource_public and surf_workstation_resource_extension_public to know the available functions.
60
61     To initialize SURF, call surf_init(). Then call surf_timer_resource_init() and
62     surf_workstation_resource_init_CLM03() or surf_workstation_resource_init_KCCFLN05()
63     to create the platform.
64
65     Then you can access the workstations and the network links with the global variables \ref workstation_set
66     and \ref network_link_set. Some functions in \a surf_workstation_resource->extension_public can give
67     you some information about:
68         - a workstation: get_speed(), get_available_speed();
69         - a network link: get_link_name(), get_link_latency(), get_link_bandwith();
70         - a route: get_route(), get_route_size().
71
72     During the simulation, call \a surf_workstation_resource->extension_public->execute() to schedule a
73     computation task on a workstation, or \a surf_workstation_resource->extension_public->communicate()
74     to schedule a communication task between two workstations. You can also create parallel task
75     with \a surf_workstation_resource->extension_public->execute_parallel_task(). These functions return
76     a new action that represents the task you have just created.
77
78     To execute the actions created with \a execute(), \a communicate() or \a execute_parallel_task(), call
79     surf_solve(). The function surf_solve() is where the simulation takes place. It returns the
80     time elapsed to execute the actions. You can know what actions have changed their state thanks
81     to the states sets. For example, if your want to know what actions are finished,
82     extract them from \a surf_workstation_resource->common_public->states.done_action_set.
83     Depending on these results, you can schedule other tasks and call surf_solve() again. 
84
85     When the simulation is over, just call surf_exit() to clean the memory.
86
87     Have a look at the implementation of \ref MSG_API "MSG" and \ref SD_API "Simdag" to see how these module
88     interact with SURF. But if you want to create a new API on top of SURF,
89     we strongly recommand you to contact us before anyway.
90
91 */