Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #193 from Takishipp/signals
[simgrid.git] / doc / doxygen / platform.doc
index d53d0c0..1ef202b 100644 (file)
@@ -104,73 +104,39 @@ models the core of a national network interconnecting a small flat
 cluster (AS4) and a larger hierarchical cluster (AS5), a subset of a
 LAN (AS6), and a set of peers scattered around the world (AS7).
 
-\section pf_pftags Resource description
+\section pf_res Resource description
 
-\subsection  pf_tag_zone <zone>
-
-For historical reasons, the XML files use the expression AS for
-NetZones. Netzones are very important because they group other resources (such
-as routers/hosts) together (in fact, any such resource must be
-contained in a NetZone).
-
-Available attributes :
-
-Attribute name  | Mandatory | Values | Description
---------------- | --------- | ------ | -----------
-id              | yes       | String | The identifier of an AS; facilitates referring to this AS. ID must be unique.
-routing         | yes       | Full\| Floyd\| Dijkstra\| DijkstraCache\| None\| Vivaldi\| Cluster | See Section \ref pf_rm for details.
-
-
-<b>Example:</b>
-\code
-<AS id="AS0" routing="Full">
-   <host id="host1" speed="1000000000"/>
-   <host id="host2" speed="1000000000"/>
-   <link id="link1" bandwidth="125000000" latency="0.000100"/>
-   <route src="host1" dst="host2"><link_ctn id="link1"/></route>
-</AS>
-\endcode
-
-In this example, AS0 contains two hosts (host1 and host2). The route
-between the hosts goes through link1.
-
-\subsection pf_Cr Computing resources: hosts, clusters and peers.
+\subsection pf_res_computing Computing Resources
 
 \subsubsection pf_tag_host &lt;host&gt;
 
-A <b>host</b> represents a computer/node card. Every host is able to execute
-code and it can send and receive data to/from other hosts. Most importantly,
-a host can contain more than 1 core.
+An host is the computing resource on which an actor can execute.
 
-### Attributes: ###
-
-Attribute name  | Mandatory | Values | Description
---------------- | --------- | ------ | -----------
-id              | yes       | String | The identifier of the host. facilitates referring to this AS.
-speed           | yes       | double (must be > 0.0) | Computational power of every core of this host in FLOPS. Must be larger than 0.0.
-core            | no        | int (Default: 1) | The number of cores of this host. If more than one core is specified, the "speed" parameter refers to every core, i.e., the total computational power is no_of_cores*speed.<br /> If 6 cores are specified, up to 6 tasks can be executed without sharing the computational power; if more than 6 tasks are executed, computational power will be shared among these tasks. <br /> <b>Warning:</b> Although functional, this model was never scientifically assessed.
-availability_file| no       | string | (Relative or absolute) filename to use as input; must contain availability traces for this host. The syntax of this file is defined below. <br /> <b>Note:</b> The filename must be specified with your system's format.
-state_file      | no        | string |  Same mechanism as availability_file.<br /> <b>Note:</b> The filename must be specified with your system's format.
-coordinates     | no        | string | Must be provided when choosing the Vivaldi, coordinate-based routing model for the AS the host belongs to. More details can be found in the Section \ref pf_P2P_tags.
-pstate     | no        | double (Default: 0.0) | FIXME: Not yet documented.
+Attribute         | Values                                 | Description
+----------------- | -------------------------------------- | -----------
+id                | String (mandatory)                     | The identifier of the host. facilitates referring to this AS.
+speed             | double (mandatory)                     | Computational power of every core of this host in FLOPS (must be positive)
+core              | int (defaults to 1)                    | Number of cores (see @ref howto_multicore)
+state             | optionally "OFF"                       | If set to OFF, the host is initially turned off.
+availability_file | File name (optional) | (Relative or absolute) filename to use as input; must contain availability traces for this host. The syntax of this file is defined below.
+state_file        | File name (optional) |  File to use as a state profile (see @ref howto_churn)
+coordinates       | String (mandatory when using Vivaldi routing) | The coordinates of this host (see @ref pf_P2P_tags).
+pstate     | Double (Defaults to 0) | FIXME: Not yet documented.
 
-### Possible children: ###
+#### Included tags ####
 
-Tag name        | Description | Documentation
-------------    | ----------- | -------------
-\<mount/\>        | Defines mounting points between some storage resource and the host. | \ref pf_storage_entity_mount
-\<prop/\>         | The prop tag allows you to define additional information on this host following the attribute/value schema. You may want to use it to give information to the tool you use for rendering your simulation, for example. | N/A
+ - @ref pf_tag_mount Specifies the storages mounted on that host
+ - @ref pf_tag_prop Specifies a user-defined property of that host, that you can retrieve with MSG_host_get_property_value() or simgrid::s4u::Host::property().
 
-### Example ###
-
-\verbatim
-   <host id="host1" speed="1000000000"/>
-   <host id="host2" speed="1000000000">
-       <prop id="color" value="blue"/>
-       <prop id="rendershape" value="square"/>
-   </host>
-\endverbatim
+#### Examples ####
 
+\code{.xml}
+<host id="host1" speed="1000000000"/>
+<host id="host2" speed="1000000000">
+   <prop id="color" value="blue"/>
+   <prop id="rendershape" value="square"/>
+</host>
+\endcode
 
 \anchor pf_host_dynamism
 ### Expressing dynamism ###
@@ -209,53 +175,7 @@ will start delivering 80\% of its power. In this example, this amounts to 400 Mf
 Since the periodicity in line 1 was set to be 1.0, i.e., 1 timestep, this host will
 continue to provide 500 Mflop/s from time 21. From time 32 it will provide 250 MFlop/s and so on.
 
-### Changing initial state ###
-
-It is also possible to specify whether the host is up or down by setting the
-``state`` attribute to either <b>ON</b> (default value) or <b>OFF</b>.
-
-#### Example: Expliciting the default value "ON" ####
-
-\verbatim
-<platform version="4">
-   <host id="bob" speed="500Gf" state="ON" />
-</platform>
-\endverbatim
-
-If you want this host to be unavailable, simply substitute ON with OFF.
-
-\anchor pf_host_churn
-### Expressing churn ###
-
-To express the fact that a host can change state over time (as in P2P
-systems, for instance), it is possible to use a file describing the time
-at which the host is turned on or off. An example of the content
-of such a file is presented below.
-
-#### Adding a state file ####
-
-\verbatim
-<platform version="4">
-  <host id="bob" power="500Gf" state_file="bob.fail" />
-</platform>
-\endverbatim
-
-#### Example of "bob.fail" file ####
-
-~~~{.py}
-  PERIODICITY 10.0
-  1.0 0
-  2.0 1
-~~~
-
-A zero value means <b>down</b> (i.e., OFF) while a positive one means <b>up and
-  running</b> (i.e., ON). From time 0.0 to time 1.0, the host is on as usual. At time 1.0, it is
-turned off and at time 2.0, it is turned on again until time 12 (2 plus the
-periodicity 10). It will be turned off again at time 13.0 until time 23.0, and
-so on.
-
-
-\subsubsection pf_cluster &lt;cluster&gt;
+\subsubsection pf_tag_cluster &lt;cluster&gt;
 
 ``<cluster />`` represents a machine-cluster. It is most commonly used
 when one wants to define many hosts and a network quickly. Technically,
@@ -359,7 +279,7 @@ c-99.me
     This tag is only available when the routing mode of the AS
     is set to ``Cluster``.
 
-The ``&lt;cabinet /&gt;`` tag is, like the \ref pf_cluster "&lt;cluster&gt;" tag,
+The ``&lt;cabinet /&gt;`` tag is, like the \ref pf_tag_cluster "&lt;cluster&gt;" tag,
 a meta-tag. This means that it is simply a shortcut for creating a set of (homogenous) hosts and links quickly;
 unsurprisingly, this tag was introduced to setup cabinets in data centers quickly. Unlike
 &lt;cluster&gt;, however, the &lt;cabinet&gt; assumes that you create the backbone
@@ -443,7 +363,7 @@ See the documentation of simgrid::kernel::routing::VivaldiZone for
 details on how the latency is computed from the coordinate, and on the
 the up and down bandwidth are used.
 
-\subsection pf_ne Network equipments: links and routers
+\subsection pf_ne Network equipments
 
 There are two tags at all times available to represent network entities and
 several other tags that are available only in certain contexts.
@@ -636,7 +556,6 @@ be adjusted to 0.01 (or 10ms) and one second later it will be set again to 1ms.
 value will not change until second 5, when the periodicity defined in line 1
 kicks in. It then loops back, starting at 100µs (the initial value) for one second.
 
-
 #### The ``<prop/>`` tag ####
 
 Similar to the ``<host>`` tag, a link may also contain the ``<prop/>`` tag; see the host
@@ -687,7 +606,7 @@ Entity name     | Description
 --------------- | -----------
 \ref pf_storage_entity_storage_type "storage_type"    | Defines a template for a particular kind of storage (such as a hard-drive) and specifies important features of the storage, such as capacity, performance (read/write), contents, ... Different models of hard-drives use different storage_types (because the difference between an SSD and an HDD does matter), as they differ in some specifications (e.g., different sizes or read/write performance).
 \ref pf_storage_entity_storage "storage"        | Defines an actual instance of a storage type (disk, RAM, ...); uses a ``storage_type`` template (see line above) so that you don't need to re-specify the same details over and over again.
-\ref pf_storage_entity_mount "mount"          | Must be wrapped by a \ref pf_tag_host tag; declares which storage(s) this host has mounted and where (i.e., the mountpoint).
+\ref pf_tag_mount "mount"          | Must be wrapped by a \ref pf_tag_host tag; declares which storage(s) this host has mounted and where (i.e., the mountpoint).
 
 
 \anchor pf_storage_content_file
@@ -763,10 +682,9 @@ these might also help you to get started.
 Attribute name  | Mandatory | Values | Description
 --------------- | --------- | ------ | -----------
 id              | yes       | string | Identifier of this storage_type; used when referring to it
-model           | yes       | string | For reasons of future backwards compatibility only; specifies the name of the model for the storage that should be used
+model           | no        | string | In the future, this will allow to change the performance model to use
 size            | yes       | string | Specifies the amount of available storage space; you can specify storage like "500GiB" or "500GB" if you want. (TODO add a link to all the available abbreviations)
 content         | yes       | string | Path to a \ref pf_storage_content_file "Storage Content File" on your system. This file must exist.
-content_type    | no        | ("txt_unix"\|"txt_win") | Determines which kind of filesystem you're using; make sure the filenames (stored in that file, see \ref pf_storage_content_file_structure "Storage Content File Structure"!)
 
 This tag must contain some predefined model properties, specified via the &lt;model_prop&gt; tag. Here is a list,
 see below for an example:
@@ -775,7 +693,6 @@ Property id     | Mandatory | Values | Description
 --------------- | --------- | ------ | -----------
 Bwrite          | yes       | string | Bandwidth for write access; in B/s (but you can also specify e.g. "30MBps")
 Bread           | yes       | string | Bandwidth for read access; in B/s (but you can also specify e.g. "30MBps")
-Bconnexion      | yes       | string | Throughput (of the storage connector) in B/s.
 
 \note
      A storage_type can also contain the <b>&lt;prop&gt;</b> tag. The &lt;prop&gt; tag allows you
@@ -785,26 +702,21 @@ Bconnexion      | yes       | string | Throughput (of the storage connector) in
 
 Here is a complete example for the ``storage_type`` tag:
 \verbatim
-<storage_type id="single_HDD" model="linear_no_lat" size="4000" content_type="txt_unix">
+<storage_type id="single_HDD" size="4000">
   <model_prop id="Bwrite" value="30MBps" />
   <model_prop id="Bread" value="100MBps" />
-  <model_prop id="Bconnection" value="150MBps" />
   <prop id="Brand" value="Western Digital" />
 </storage_type>
 \endverbatim
 
-\anchor pf_storage_entity_storage
-#### &lt;storage&gt; ####
-
-``storage`` attributes:
+@subsubsection pf_tag_storage &lt;storage&gt; 
 
-Attribute name | Mandatory | Values | Description
+Attributes     | Mandatory | Values | Description
 -------------- | --------- | ------ | -----------
 id             | yes       | string | Identifier of this ``storage``; used when referring to it
 typeId         | yes       | string | Here you need to refer to an already existing \ref pf_storage_entity_storage_type "\<storage_type\>"; the storage entity defined by this tag will then inherit the properties defined there.
 attach         | yes       | string | Name of a host (see Section \ref pf_host) to which this storage is <i>physically</i> attached to (e.g., a hard drive in a computer)
 content        | no        | string | When specified, overwrites the content attribute of \ref pf_storage_entity_storage_type "\<storage_type\>"
-content_type   | no        | string | When specified, overwrites the content_type attribute of \ref pf_storage_entity_storage_type "\<storage_type\>"
 
 Here are two examples:
 
@@ -812,8 +724,7 @@ Here are two examples:
      <storage id="Disk1" typeId="single_HDD" attach="bob" />
 
      <storage id="Disk2" typeId="single_SSD"
-              content="content/win_storage_content.txt"
-              content_type="txt_windows" attach="alice" />
+              content="content/win_storage_content.txt" />
 \endverbatim
 
 The first example is straightforward: A disk is defined and called "Disk1"; it is
@@ -825,14 +736,12 @@ now specifies a new content file (so the contents will be different from Disk1)
 and the filesystem uses the windows style; finally, it is attached to a second host,
 called alice (which is again not defined here).
 
-\anchor pf_storage_entity_mount
-#### &lt;mount&gt; ####
+\subsubsection pf_tag_mount &lt;mount&gt;
 
-Attributes:
-| Attribute name   | Mandatory   | Values   | Description                                                                                               |
-| ---------------- | ----------- | -------- | -------------                                                                                             |
-| id               | yes         | string   | Refers to a \ref pf_storage_entity_storage "&lt;storage&gt;" entity that will be mounted on that computer |
-| name             | yes         | string   | Path/location to/of the logical reference (mount point) of this disk
+| Attribute   | Mandatory   | Values   | Description                                                                                               |
+| ----------- | ----------- | -------- | -------------                                                                                             |
+| id          | yes         | string   | Refers to a \ref pf_storage_entity_storage "&lt;storage&gt;" entity that will be mounted on that computer |
+| name        | yes         | string   | Path/location to/of the logical reference (mount point) of this disk
 
 This tag must be enclosed by a \ref pf_tag_host tag. It then specifies where the mountpoint of a given storage device (defined by the ``id`` attribute)
 is; this location is specified by the ``name`` attribute.
@@ -840,18 +749,17 @@ is; this location is specified by the ``name`` attribute.
 Here is a simple example, taken from the file ``examples/platform/storage.xml``:
 
 \verbatim
-    <storage_type id="single_SSD" model="linear_no_lat" size="500GiB">
+    <storage_type id="single_SSD" size="500GiB">
        <model_prop id="Bwrite" value="60MBps" />
        <model_prop id="Bread" value="200MBps" />
-       <model_prop id="Bconnection" value="220MBps" />
     </storage_type>
 
     <storage id="Disk2" typeId="single_SSD"
               content="content/win_storage_content.txt"
-              content_type="txt_windows" attach="alice" />
+              attach="alice" />
     <storage id="Disk4" typeId="single_SSD"
              content="content/small_content.txt"
-             content_type="txt_unix" attach="denise"/>
+             attach="denise"/>
 
     <host id="alice" speed="1Gf">
       <mount storageId="Disk2" name="c:"/>
@@ -952,6 +860,31 @@ are all calculating shortest paths. They do require some time to converge, but
 eventually, when the routing tables have stabilized, your packets will follow
 the shortest paths.
 
+\subsection  pf_tag_zone &lt;zone&gt;
+
+Before SimGrid v3.16, networking zones used to be called Autonomous
+Systems, but this was misleading as zones may include other zones in a
+hierarchical manner. If you find any remaining reference to ASes,
+please report this as a bug.
+
+Attribute   | Value                                             | Description
+----------- | ------------------------------------------------- | ----------------------------------------------
+id          | String (mandatory)                                | The identifier of this zone (must be unique)
+routing     | One of the existing routing algorithm (mandatory) | See Section \ref pf_rm for details.
+
+<b>Example:</b>
+\code
+<AS id="AS0" routing="Full">
+   <host id="host1" speed="1000000000"/>
+   <host id="host2" speed="1000000000"/>
+   <link id="link1" bandwidth="125000000" latency="0.000100"/>
+   <route src="host1" dst="host2"><link_ctn id="link1"/></route>
+</AS>
+\endcode
+
+In this example, AS0 contains two hosts (host1 and host2). The route
+between the hosts goes through link1.
+
 \subsection pf_rm Routing models
 
 For each AS, you must define explicitly which routing model will
@@ -1128,7 +1061,7 @@ routing model (the path is given relative to SimGrid's source directory):
 
 | Name                                     | Description                                                                                                                         |
 | ---------------------------------------- | ------------------------------------------------------------------------------                                                      |
-| \ref pf_routing_model_cluster "Cluster"  | This is specific to the \ref pf_cluster "&lt;cluster/&gt;" tag and should not be used by the user, as several assumptions are made. |
+| \ref pf_routing_model_cluster "Cluster"  | This is specific to the \ref pf_tag_cluster "&lt;cluster/&gt;" tag and should not be used by the user, as several assumptions are made. |
 | \ref pf_routing_model_none    "None"     | No routing at all. Unless you know what you're doing, avoid using this mode in combination with a non-constant network model.       |
 | \ref pf_routing_model_vivaldi "Vivaldi"  | Perfect when you want to use coordinates. Also see the corresponding \ref pf_P2P_tags "P2P section" below.                          |
 
@@ -1469,93 +1402,67 @@ information to SimGrid. Here is a file doing it all :
 </AS>
 \endverbatim
 
-\section pf_other_tags Tags not (directly) describing the platform
+\section pf_other Other tags
 
 The following tags can be used inside a \<platform\> tag even if they are not
 directly describing the platform:
-\li \ref pf_config "config": it allows you to pass some configuration stuff like, for
-    example, the network model and so on. It follows the
-\li \ref pf_include "include": allows you to include another file into the current one.
 
-\subsection pf_config config
+  - @ref pf_tag_config passes configuration options, e.g. to change the network model;
+  - @ref pf_tag_prop gives user-defined properties to various elements
 
-The only purpose of this tag is to contain the \c prop tags, as described below.
-These tags will then configure the options as described by Section \ref options.
-(See the example)
+\subsection pf_tag_config &lt;config&gt;
 
-#### Attributes ####
+Adding configuration flags into the platform file is particularly
+useful when the described platform is best used with specific
+flags. For example, you could finely tune SMPI in your platform file directly.
 
-| Attribute name  | Mandatory | Values                  | Description                                                                                                  |
-| --------------- | --------- | ----------------------  | -----------                                                                                                  |
-| id              | yes       | String                  | The identifier of the config tag when referring to id; this is basically useless, though.                    |
+| Attribute  | Values              | Description                                    |
+| ---------- | ------------------- | ---------------------------------------------- |
+| id         | String (optional)   | This optional identifier is ignored by SimGrid |
 
-#### Possible children ####
+* **Included tags:** @ref pf_tag_prop to specify a given configuration item (see @ref options).
 
-Tag name        | Description | Documentation
-------------    | ----------- | -------------
-\<prop/\>       | The prop tag allows you to define different configuration options following the attribute/value schema. See the \ref options page. | N/A
+Any such configuration must be given at the very top of the platform file.
 
-#### Example ####
+* **Example**
 
 \verbatim
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="4">
-<config id="General">
-       <prop id="maxmin/precision" value="0.000010"></prop>
-       <prop id="cpu/optim" value="TI"></prop>
-       <prop id="host/model" value="compound"></prop>
-       <prop id="network/model" value="SMPI"></prop>
-       <prop id="path" value="~/"></prop>
-       <prop id="smpi/bw-factor" value="65472:0.940694;15424:0.697866;9376:0.58729"></prop>
+<config>
+       <prop id="maxmin/precision" value="0.000010" />
+       <prop id="cpu/optim" value="TI" />
+       <prop id="network/model" value="SMPI" />
+       <prop id="smpi/bw-factor" value="65472:0.940694;15424:0.697866;9376:0.58729" />
 </config>
 
 <AS  id="AS0"  routing="Full">
 ...
 \endverbatim
 
-\subsection pf_include include
-
-Even if it can be used in other contexts, this tag was originally created
-to be used with \ref pf_trace. The idea was to have a file describing the
-platform, and another file attaching traces of a given period to the platform.
-
-The drawback is that the file chuncks that will be included do not
-constitute valid XML files. This may explain why this feature was never really
-used in practice (as far as we know). Other mechanisms, such as the ability to load
-several platform files one after the other, could be considered in the future.
+\subsection pf_tag_prop &lt;prop&gt;
 
-In the meanwhile, the \c include tag allows you to import other platforms into your
-local file. This is done with the intention to help people
-combine their different AS and provide new platforms. Those files
-should contain XML that consists of 
-\ref pf_include "include", \ref pf_cluster "cluster", \ref pf_peer "peer", \ref pf_As "AS", \ref pf_trace "trace", \ref pf_trace "tags".
+Defines a user-defined property, identified with a name and having a
+value. You can specify such properties to most kind of resources:
+@ref pf_tag_zone, @ref pf_tag_host, @ref pf_tag_storage,
+@ref pf_tag_cluster and @ref pf_tag_link. These values can be retrieved
+at runtime with MSG_zone_property() or simgrid::s4u::NetZone::property(),
+or similar functions.
 
-Do not forget to close the tag to make it work, or you will end up with an invalid XML file.
-
-#### Attributes ####
-
-| Attribute name  | Mandatory | Values                  | Description                                                                                                  |
-| --------------- | --------- | ----------------------  | -----------                                                                                                  |
-| file            | yes       | String                  | Filename of the path you want to include with either relative or absolute path. |
+| Attribute | Values                  | Description                                                                               |
+| --------- | ----------------------  | ----------------------------------------------------------------------------------------- |
+| id        | String (mandatory)      | Identifier of this property. Must be unique for a given property holder, eg host or link. |
+| value     | String (mandatory)      | Value of this property; The semantic is completely up to you.                             |
 
+* **Included tags:** none.
 
 #### Example ####
 
-The following example includes two files, clusterA.xml and clusterB.xml and
-combines them two one platform file; all hosts, routers etc. defined in 
-each of them will then be usable.
+\code{.xml}
+<prop id="Operating System" value="Linux" />
+\endcode
 
-\verbatim
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
-       <AS id="main" routing="Full">
-               <include file="clusterA.xml"></include>
-               <include file="clusterB.xml"></include>
-       </AS>
-</platform>
-\endverbatim
 
 \subsection pf_trace trace and trace_connect
 
@@ -1620,7 +1527,7 @@ are some best practices you should pay attention to in order to
 produce good platform and some choices you can make in order to have
 faster simulations. Here's some hints and tips, then.
 
-@subsection Finding the platform example that you need
+@subsection pf_hints_search Finding the platform example that you need
 
 Most platform files that we ship are in the @c examples/platforms
 folder. The good old @c grep tool can find the examples you need when