Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Tue, 3 Apr 2012 18:19:09 +0000 (20:19 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Tue, 3 Apr 2012 18:19:09 +0000 (20:19 +0200)
40 files changed:
buildtools/Cmake/GenerateDoc.cmake
doc/bindings.doc
doc/fig/simgrid_modules.fig
doc/index.doc
doc/platform.doc
examples/msg/io/file.c
examples/platforms/storage.xml
include/msg/datatypes.h
include/msg/msg.h
include/simix/datatypes.h
include/simix/simix.h
include/xbt/file_stat.h [new file with mode: 0644]
include/xbt/misc.h
src/include/surf/datatypes.h
src/include/surf/surf.h
src/include/surf/surf_resource.h
src/instr/instr_config.c
src/instr/instr_msg_process.c
src/instr/instr_routing.c
src/msg/msg_io.c
src/msg/msg_private.h
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_private.h
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/surf/maxmin_private.h
src/surf/storage.c
src/surf/storage_private.h
src/surf/surf.c
src/surf/surf_private.h
src/surf/surf_routing.c
src/surf/surf_routing_dijkstra.c
src/surf/surf_routing_floyd.c
src/surf/surf_routing_full.c
src/surf/surfxml_parseplatf.c
src/surf/workstation.c
tools/doxygen/doxygen_postprocesser.pl
tools/gras/s_smx_process_t
tools/gras/struct_diff.c

index a2739f5..c61d7ef 100644 (file)
@@ -69,7 +69,7 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSI
                string(REPLACE ".fig" ".png" tmp_file ${file})
                string(REPLACE "${CMAKE_HOME_DIRECTORY}/doc/fig/" "${CMAKE_HOME_DIRECTORY}/doc/html/" tmp_file ${tmp_file})
                ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
-                       COMMAND ${FIG2DEV_PATH}/fig2dev -Lpng ${file} ${tmp_file}
+                       COMMAND ${FIG2DEV_PATH}/fig2dev -Lpng -S 4 ${file} ${tmp_file}
                )
        endforeach(file ${DOC_FIGS})
        
index 122eacb..5c25bf9 100644 (file)
@@ -149,7 +149,7 @@ Don't forget to register your platform, that SURF callbacks starts their work ;)
 \verbatim
    simgrid.register_application();
 \endverbatim
-Yes, Here too you have to resgiter your application before running the simulation.
+Yes, Here too you have to register your application before running the simulation.
 
 the full example is distributed in the file examples/lua/master_slave_bypass.lua
 
index 81a2032..eb9e845 100644 (file)
@@ -1,4 +1,4 @@
-#FIG 3.2  Produced by xfig version 3.2.5
+#FIG 3.2  Produced by xfig version 3.2.5b
 Landscape
 Center
 Metric
@@ -7,58 +7,53 @@ A4
 Single
 -2
 1200 2
-0 32 #84e373
-0 33 #ffcb84
-0 34 #adbeff
-0 35 #ff4952
-0 36 #a5a6a5
-0 37 #ff9700
+0 32 #83e273
+0 33 #feca83
+0 34 #acbdfe
+0 35 #fe4952
+0 36 #a4a5a4
+0 37 #fe9600
 6 -360 2340 1305 3105
-4 1 0 50 -1 4 14 0.0000 2 165 540 472 2520 MSG\001
-4 1 0 50 -1 4 12 0.0000 2 195 1650 472 2835 Simple application-\001
-4 1 0 50 -1 4 12 0.0000 2 150 1260 472 3105 level simulator\001
+4 1 0 50 -1 4 14 0.0000 2 135 270 472 2520 MSG\001
+4 1 0 50 -1 4 12 0.0000 2 165 1710 472 2835 Simple application-\001
+4 1 0 50 -1 4 12 0.0000 2 135 1350 472 3105 level simulator\001
 -6
 6 1845 2295 3915 3240
-4 1 0 50 -1 4 14 0.0000 2 165 690 2430 2475 GRAS\001
-4 1 0 50 -1 4 12 0.0000 2 150 960 2430 2745 Framework\001
-4 1 0 50 -1 4 12 0.0000 2 195 960 2430 2970 to  develop\001
-4 1 0 50 -1 4 12 0.0000 2 195 2055 2880 3195  distributed applications\001
+4 1 0 50 -1 4 14 0.0000 2 135 360 2430 2475 GRAS\001
+4 1 0 50 -1 4 12 0.0000 2 135 810 2430 2745 Framework\001
+4 1 0 50 -1 4 12 0.0000 2 165 990 2430 2970 to  develop\001
+4 1 0 50 -1 4 12 0.0000 2 165 2250 2880 3195  distributed applications\001
 -6
 6 3060 2205 4095 2835
 # href="group__AMOK__API.html" ALT="AMOK"
 2 2 0 1 0 27 60 -1 20 0.000 0 0 -1 0 0 5
         3082 2205 4072 2205 4072 2835 3082 2835 3082 2205
-4 1 0 50 -1 4 12 0.0000 2 150 630 3577 2745 toolbox\001
-4 1 0 50 -1 4 14 0.0000 2 165 705 3577 2475 AMOK\001
+4 1 0 50 -1 4 12 0.0000 2 135 630 3577 2745 toolbox\001
+4 1 0 50 -1 4 14 0.0000 2 135 360 3577 2475 AMOK\001
 -6
 6 -675 3510 9045 4365
 6 3082 3645 5287 4185
-4 1 0 50 -1 4 12 0.0000 2 195 2145 4184 4102 virtual platform simulator\001
-4 1 0 50 -1 4 14 0.0000 2 165 675 4184 3847 SURF\001
+4 1 0 50 -1 4 12 0.0000 2 165 2340 4184 4102 virtual platform simulator\001
+4 1 0 50 -1 4 14 0.0000 2 135 360 4184 3847 SURF\001
 -6
 # href="group__SURF__API.html" ALT="SMPI"
 2 2 0 1 0 34 60 -1 20 0.000 0 0 -1 0 0 5
         -675 3510 9045 3510 9045 4365 -675 4365 -675 3510
 -6
 6 6840 2340 8865 3150
-4 1 0 50 -1 4 14 0.0000 2 210 870 7852 2520 SimDag\001
-4 1 0 50 -1 4 12 0.0000 2 150 1245 7852 2835 Framework for\001
-4 1 0 50 -1 4 12 0.0000 2 195 1965 7852 3105 DAGs of parallel tasks\001
+4 1 0 50 -1 4 14 0.0000 2 165 540 7852 2520 SimDag\001
+4 1 0 50 -1 4 12 0.0000 2 135 1170 7852 2835 Framework for\001
+4 1 0 50 -1 4 12 0.0000 2 165 1980 7852 3105 DAGs of parallel tasks\001
 -6
 6 -158 4590 7987 5085
-4 1 0 50 -1 4 12 0.0000 2 195 8085 3914 5025 Grounding features (logging, etc.), usual data structures (lists, sets, etc.) and portability layer\001
-4 1 0 50 -1 4 14 0.0000 2 165 480 3914 4770 XBT\001
+4 1 0 50 -1 4 12 0.0000 2 180 8910 3914 5025 Grounding features (logging, etc.), usual data structures (lists, sets, etc.) and portability layer\001
+4 1 0 50 -1 4 14 0.0000 2 135 270 3914 4770 XBT\001
 -6
-6 -810 1215 9135 1935
-6 5670 1305 8370 1800
+6 5435 1305 8318 1800
 # href="/contrib.html" ALT="Contrib"
 2 2 0 1 0 37 55 -1 20 0.000 0 0 -1 0 0 5
-        5670 1800 8370 1800 8370 1305 5670 1305 5670 1800
-4 1 0 50 -1 4 14 0.0000 2 165 780 7020 1635 Contrib\001
--6
-2 2 0 1 0 31 70 -1 20 0.000 0 0 -1 0 0 5
-        -810 1935 9135 1935 9135 1215 -810 1215 -810 1935
-4 1 0 50 -1 4 14 0.0000 2 165 1155 3914 1650 User Code\001
+        5435 1800 8318 1800 8318 1305 5435 1305 5435 1800
+4 1 0 50 -1 4 15 0.0000 2 135 630 6876 1635 Contrib\001
 -6
 # href="group__MSG__API.html" ALT="MSG"
 2 2 0 1 0 32 60 -1 20 0.000 0 0 -1 0 0 5
@@ -70,13 +65,21 @@ Single
 # href="group__SMPI__API.html" ALT="SMPI"
 2 2 0 1 0 36 60 -1 20 0.000 0 0 -1 0 0 5
         4230 2205 6570 2205 6570 3375 4230 3375 4230 2205
-# href="group__SD__API.html" ALT="SimDag"
-2 2 0 1 0 23 60 -1 30 0.000 0 0 -1 0 0 5
-        6705 2205 9045 2205 9045 3375 6705 3375 6705 2205
+2 2 0 1 0 31 70 -1 20 0.000 0 0 -1 0 0 5
+        -810 1935 9855 1935 9855 1215 -810 1215 -810 1935
 # href="group__XBT__API.html" ALT="XBT"
 2 3 0 1 0 33 80 -1 20 0.000 0 0 -1 0 0 5
         -810 2160 -810 5220 9135 5220 9135 2160 -810 2160
-4 1 0 50 -1 4 12 0.0000 2 195 1860 5400 2955 applications on top of\001
-4 1 0 50 -1 4 12 0.0000 2 150 1815 5400 3210 a virtual environment\001
-4 1 0 50 -1 4 12 0.0000 2 195 1560 5400 2745 Library to run MPI\001
-4 1 0 50 -1 4 14 0.0000 2 165 585 5400 2520 SMPI\001
+# href="group__SD__API.html" ALT="SimDag"
+2 2 0 1 0 23 60 -1 30 0.000 0 0 -1 0 0 5
+        6705 2205 9045 2205 9045 3375 6705 3375 6705 2205
+# href="group__TRACE__API.html" ALT="TRACE"
+2 2 0 1 0 3 50 -1 30 0.000 0 0 -1 0 0 5
+        9270 2160 9810 2160 9810 5220 9270 5220 9270 2160
+4 1 0 50 -1 4 12 0.0000 2 165 1980 5400 2955 applications on top of\001
+4 1 0 50 -1 4 12 0.0000 2 135 1890 5400 3210 a virtual environment\001
+4 1 0 50 -1 4 12 0.0000 2 165 1620 5400 2745 Library to run MPI\001
+4 1 0 50 -1 4 15 0.0000 2 135 810 3560 1650 User Code\001
+4 0 0 50 -1 4 15 1.5708 2 135 450 9630 5085 TRACE\001
+4 1 0 50 -1 4 14 0.0000 2 135 360 5400 2520 SMPI\001
+4 0 0 50 -1 4 12 1.5708 2 165 1620 9585 4050 Tracing simulation\001
index 07a91f4..37fa420 100644 (file)
@@ -120,6 +120,9 @@ XBT_dict, \ref XBT_heap, \ref XBT_set and \ref XBT_swag.
 See the \ref XBT_API section for more details.
 
 
+\subsection lucas_layer Tracing simulation
+Finally, a transversal module allows you to trace your simulation. More documentation in the section \ref TRACE_doc
+
 \htmlonly <!-- ______BODY_BEGIN______ --!> \endhtmlonly
 <br>
 The SimGrid software package can be downloaded from 
index b14feef..9e09a04 100644 (file)
@@ -1,4 +1,4 @@
-/*! \page platform Platform description
+/*! \page platform Platform Description
 
 \htmlinclude .platform.doc.toc
 
@@ -7,8 +7,8 @@ In order to run any simulation, SimGrid needs 3 things: something to run
 application, and finally it needs something to know where to deploy what.
 
 For the latest 2 entries, you have basically 2 ways to give it as an input :
-\li You can program it, either using the Lua console or if you're using MSG some 
-of its platform and deployments functions. If you want to use it, please refer 
+\li You can program it, either using the Lua console (\ref MSG_Lua_funct) or if you're using MSG some 
+of its platform and deployments functions(\ref msg_easier_life). If you want to use it, please refer 
 to its doc. (you can also  check the section  \ref pf_flexml_bypassing but this is strongly deprecated, as there is a new way to do it properly, but not yet documented).
 \li You can use two XML files: a platform description file and a deployment 
 description one.
@@ -142,6 +142,8 @@ assessed. Please keep this fact in mind when using it.
 \li <b>state_file</b>: Same mechanism as availability_file, similar syntax for value.
 \li <b>coordinates</b>: you'll have to give it if you choose the vivaldi, coordinate-based routing model for the AS the host belongs to. More details about it in the P2P coordinate based section.
 
+An host can contain some <b>mount</b> that defines mounting points between some storage resource and the <b>host</b>. Please refer to the storage doc for more information. 
+
 An host can also contain the <b>prop</b> tag. the prop tag allows you to define additional informations 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.
 
 <b>host example</b>
@@ -293,16 +295,17 @@ the router name is defined as the resulting String in the following java line of
 
 \subsubsection pf_peer peer
 A <b>peer</b> represents a peer, as in Peer-to-Peer (P2P). Basically, as cluster, <b>A PEER IS INTERNALLY INTERPRETED AS AN \<AS\></b>. It's just a kind of shortcut that does the following : 
-\li It creates an host that has coordinates
+\li It creates an host 
 \li Two links : one for download and one for upload. This is convenient to use and simulate stuff under the last mile model (as ADSL peers).
+\li It creates a gateway that serve as entry point for this peer zone. This router has coordinates.
  
 <b>peer</b> attributes : 
 \li <b>id (mandatory)</b>: the identifier of the peer to be used when referring to it.
-\li <b>power CDATA (mandatory)</b>:
-\li <b>bw_in CDATA (mandatory)</b>:
-\li <b>bw_out CDATA (mandatory)</b>:
-\li <b>lat CDATA (mandatory)</b>:
-\li <b>coordinates</b>:
+\li <b>power CDATA (mandatory)</b>: as in host
+\li <b>bw_in CDATA (mandatory)</b>: bandwidth in.
+\li <b>bw_out CDATA (mandatory)</b>:bandwidth out.
+\li <b>lat CDATA (mandatory)</b>: Latency for in and out links.
+\li <b>coordinates</b>: coordinates of the gateway for this peer.
 \li <b>sharing_policy</b>: sharing policy for links. Can be SHARED or FULLDUPLEX, FULLDUPLEX is the default. See <b>link</b> description for details.
 \li <b>availability_file</b>: availability file for the peer. Same as host availability file. See <b>host</b> description for details.
 \li <b>state_file </b>: state file for the peer. Same as host state file. See <b>host</b> description for details.
@@ -384,7 +387,7 @@ interval, 1ms on [1, 2[, 10ms on [2, 3[, 1ms on [3,5[ (i.e., until the end of pe
 at 100µs for one second.
 
 <b>link</b> attributes : 
-\li <b>id (mandatory)</b>: the identifier of the cluster to be used when referring to it.
+\li <b>id (mandatory)</b>: the identifier of the link to be used when referring to it.
 \li <b>bandwidth (mandatory)</b>: bandwidth for the link.
 \li <b>lat </b>: latency for the link. Default is 0.0.
 \li <b>sharing_policy</b>: sharing policy for the link.
@@ -402,12 +405,57 @@ As an host, a <b>link</b> tag can also contain the <b>prop</b> tag.
 
 
 \subsection pf_storage Storage
+<b>Note : This is a prototype version that should evolve quickly, this is just some doc valuable only at the time of writing this doc</b>
+This section describes the storage management under SimGrid ; nowadays it's only usable with MSG. It relies basically on linux-like concepts. You also may want to have a look to its corresponding section in \ref m_file_management ; functions access are organized as a POSIX-like interface.
+
+\subsubsection pf_sto_conc Storage Main concepts
+Basically there is 3 different entities to know : 
+\li the <b>storage_type</b>: here you define some kind of storage that you will instantiate many type on your platform. Think of it like a definition of throughput of a specific disk.
+\li the <b>storage</b>: instance of a <b>storage_type</b>. Defines a new storage of <b>storage_type</b>
+\li the <b>mount</b>: says that the storage is located into this specific resource.
+
+the content of a storage has to be defined in a content file that contains the content. The path to this file has to be passed within the <b>content</b> attribute . Here is a way to generate it:
+\verbatim
+find /path/you/want -type f -exec ls -l {} \; 2>/dev/null > ./content.txt
+\endverbatim
+
+\subsubsection pf_sto_sttp storage_type
+
+
+<b>storage_type</b> attributes : 
+\li <b>id (mandatory)</b>: the identifier of the storage_type to be used when referring to it.
+\li <b>model (mandatory)</b>: Unused for now by the simulator (but mandatory, ok)
+\li <b>content</b>: default value 0. The file containing the disk content. (may be moved soon or later to <b>storage</b> tag.
+
+The tag must contains some predefined prop, as may do some other resources tags. This should moved to attributes soon or later.
+<b>storage_type</b> mandatory <b>prop</b> : 
+\li <b>Bwrite</b>: value in B/s. Write throughput
+\li <b>Bread</b>: value in B/s. Read throughput
+\li <b>Bconnexion</b>: value in B/s. Connection throughput (i.e. the throughput of the storage connector).
+
+\subsubsection pf_sto_st storage
+
+<b>storage_type</b> attributes : 
+\li <b>id (mandatory)</b>: the identifier of the storage to be used when referring to it.
+\li <b>typeId (mandatory)</b>: the identifier of the storage_type that this storage  belongs to.
 
-At the time of writing this doc, a storage protoype has been implemented. While it is not stable, no doc for it, sorry.
+
+\subsubsection pf_sto_mo mount
+
+
+<b>mount</b> attributes : 
+\li <b>id (mandatory)</b>: the id of the <b>storage</b> that must be mounted on that computer.
+\li <b>name (mandatory)</b>: the name that will be the logical reference to this disk (the mount point).
+
+\subsubsection pf_sto_mst mstorage
+<b>Note : unused for now</b>
+<b>mstorage</b> attributes : 
+\li <b>typeId (mandatory)</b>: the id of the <b>storage</b> that must be mounted on that computer.
+\li <b>name (mandatory)</b>: the name that will be the logical reference to this disk (the mount point).
 
 \section pf_routing Routing
 
-In order to run fast, it has been chosen to use static routing within SimGrid. By static, it means that it is calculated once, and will not change during execution. We chose to do that because it is rare to have a real deficience of a resource ; most of the time, a communication fails because the links are too overloaded, and so your connection stops before the time out, or because the computer at the other end is not answering. 
+In order to run fast, it has been chosen to use static routing within SimGrid. By static, it means that it is calculated once (or almost), and will not change during execution. We chose to do that because it is rare to have a real deficience of a resource ; most of the time, a communication fails because the links are too overloaded, and so your connection stops before the time out, or because the computer at the other end is not answering. 
 
 We also chose to use shortests paths algorithms in order to emulate routing. Doing so is consistent with the reality: RIP, OSPF, BGP are all calculating shortest paths. They have some convergence time, but at the end, so when the platform is stable (and this should be the moment you want to simulate something using SimGrid) your packets will follow the shortest paths.  
  
@@ -436,9 +484,11 @@ To express those topological information, some <b>route</b> have to be defined s
 \subsubsection pf_rm_sh Shortest-path based models 
 
 Here is the complete list of such models, that computes routes using classic shortest-paths algorithms. How to choose the best suited algorithm is discussed later in the section devoted to it.
-\li <b>Floyd</b>: Floyd routing data
-\li <b>Dijkstra</b>: Dijkstra routing data 
-\li <b>DijkstraCache</b>: Dijkstra routing data 
+\li <b>Floyd</b>: Floyd routing data. Pre-calculates all routes once.
+\li <b>Dijkstra</b>: Dijkstra routing data ,calculating routes when necessary.
+\li <b>DijkstraCache</b>: Dijkstra routing data. Handle some cache for already calculated routes.
+
+All those shortest-path models are instanciated the same way. Here are some example of it: 
 
 Floyd example : 
 \verbatim
@@ -467,12 +517,30 @@ ASroute given at the end gives a topological information : link1 is between rout
 
 Dijsktra example : 
 \verbatim
-XXX?
+ <AS id="AS_2" routing="Dijsktra">    
+     <host id="AS_2_host1" power="1000000000"/>        
+     <host id="AS_2_host2" power="1000000000"/>        
+     <host id="AS_2_host3" power="1000000000"/>        
+     <link id="AS_2_link1" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link2" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link3" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link4" bandwidth="1250000000" latency="5E-4"/>  
+     <router id="central_router"/>
+     <router id="AS_2_gateway"/>
+     <!-- routes providing topological information --> 
+     <route src="central_router" dst="AS_2_host1"><link_ctn id="AS_2_link1"/></route>  
+     <route src="central_router" dst="AS_2_host2"><link_ctn id="AS_2_link2"/></route>  
+     <route src="central_router" dst="AS_2_host3"><link_ctn id="AS_2_link3"/></route>  
+     <route src="central_router" dst="AS_2_gateway"><link_ctn id="AS_2_link4"/></route>        
+  </AS>
 \endverbatim
 
 DijsktraCache example : 
 \verbatim
-XXX?
+<AS id="AS_2" routing="DijsktraCache">    
+     <host id="AS_2_host1" power="1000000000"/>        
+     ...
+(platform unchanged compared to upper example)
 \endverbatim
 
 \subsubsection pf_rm_me Manually-entered route models 
@@ -533,15 +601,16 @@ RuleBased example :
                </AS>
 \endverbatim
 
-The example upper contains $1. Those $1 are evaluated as follow XXX?
+The example upper contains $1src and $1dst. It's simply a reference to string matching regexp enclosed by "()" within respectively <b>src</b> and <b>dst</b> attributes. If they were more than 1 "()", then you could referer to it as $2src, $3src and so on.
 
 \subsubsection pf_rm_sf Simple/fast models 
 
 \li <b>none</b>: No routing (Unless you know what you are doing, avoid using this mode in combination with a non Constant network model).
 None Example :
 \verbatim
-XXX?
-\endverbatim
+<AS id="exitAS"  routing="none">
+       <router id="exit_gateway"/>
+</AS>\endverbatim
 
 \li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates. See the corresponding section P2P below for details.
 \li <b>Cluster</b>: Cluster routing, specific to cluster tag, should not be used, except internally.
@@ -700,15 +769,51 @@ As said before, once you choose a model, it (if so) calculates routes for you. B
 
 \subsection pb_baroex Basic Routing Example
 
-Let's say you have an AS named AS_Big that contains two other AS, AS_1 and AS_2. If you want to make an host (h1) from AS_1 with another one (h2) from  AS_2 and you did not have choosen to use some routing model that compute routes automatically, then you'll have to proceed as follow: 
+Let's say you have an AS named AS_Big that contains two other AS, AS_1 and AS_2. If you want to make an host (h1) from AS_1 with another one (h2) from  AS_2 then you'll have to proceed as follow: 
 \li First, you have to ensure that a route is defined from h1 to the AS_1's exit gateway and from h2 to AS_2's exit gateway.
-\li Then, you'll have to define a route between AS_1 to AS_2. As those AS are both resources belonging to AS_Big, then it has to be done at AS_big level. To define such a route, you have to give the source AS (AS_1), the destination AS (AS_2), and their respective gateway (as the route is effectively defined between those two entry/exit points). Elements of this route can only be elements belonging to AS_Big, so links and routers in this route should be defined inside AS_Big. 
+\li Then, you'll have to define a route between AS_1 to AS_2. As those AS are both resources belonging to AS_Big, then it has to be done at AS_big level. To define such a route, you have to give the source AS (AS_1), the destination AS (AS_2), and their respective gateway (as the route is effectively defined between those two entry/exit points). Elements of this route can only be elements belonging to AS_Big, so links and routers in this route should be defined inside AS_Big. If you choose some shortest-path model, this route will be computed automatically.
 
 As said before, there are mainly 2 tags for routing :
 \li <b>ASroute</b>: to define routes between two  <b>AS</b>
 \li <b>route</b>: to define routes between two <b>host/router</b>
 
-As we are dealing with routes between AS, it means that those we'll have some definition at AS_Big level. Let consider AS_1 and AS_2 contains 1 host, 1 link and one router. 
+As we are dealing with routes between AS, it means that those we'll have some definition at AS_Big level. Let consider AS_1  contains 1 host, 1 link and one router and AS_2 3 hosts, 4 links and one router. There will be a central router, and a cross-like topology. At the end of the crosses arms, you'll find the 3 hosts and the router that will act as a gateway. We have to define routes inside those two AS. Let say that AS_1 contains full routes, and AS_2 contains some Floyd routing (as we don't want to bother with defining all routes). As we're using some shortest path algorithms to  route into AS_2, we'll then have to define some <b>route</b> to gives some topological information to SimGrid. Here is a file doing it all :
+
+\verbatim
+<AS  id="AS_Big"  routing="Dijsktra">
+  <AS id="AS_1" routing="Full">    
+     <host id="AS_1_host1" power="1000000000"/>        
+     <link id="AS_1_link" bandwidth="1250000000" latency="5E-4"/>  
+     <router id="AS_1_gateway"/>
+     <route src="AS_1_host1" dst="AS_1_gateway">
+            <link_ctn id="AS_1_link"/>
+     </route>  
+  </AS>
+  <AS id="AS_2" routing="Floyd">    
+     <host id="AS_2_host1" power="1000000000"/>        
+     <host id="AS_2_host2" power="1000000000"/>        
+     <host id="AS_2_host3" power="1000000000"/>        
+     <link id="AS_2_link1" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link2" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link3" bandwidth="1250000000" latency="5E-4"/>  
+     <link id="AS_2_link4" bandwidth="1250000000" latency="5E-4"/>  
+     <router id="central_router"/>
+     <router id="AS_2_gateway"/>
+     <!-- routes providing topological information --> 
+     <route src="central_router" dst="AS_2_host1"><link_ctn id="AS_2_link1"/></route>  
+     <route src="central_router" dst="AS_2_host2"><link_ctn id="AS_2_link2"/></route>  
+     <route src="central_router" dst="AS_2_host3"><link_ctn id="AS_2_link3"/></route>  
+     <route src="central_router" dst="AS_2_gateway"><link_ctn id="AS_2_link4"/></route>        
+  </AS>
+    <link id="backbone" bandwidth="1250000000" latency="5E-4"/>        
+
+     <ASroute src="AS_1" dst="AS_2" 
+        gw_src="AS_1_gateway" 
+        gw_dst="AS_2_gateway">
+               <link_ctn id="backbone"/>
+     </ASroute>   
+</AS>
+\endverbatim
 
 \section pf_other_tags Tags not (directly) describing the platform
 
@@ -872,11 +977,11 @@ Coordinates are then used to calculate latency between two hosts by calculating
 Choosing wisely the routing model to use can significantly fasten your simulation/save your time when writing the platform/save tremendeous disk space. Here is the list of available model and their characteristics (lookup : time to resolve a route):
 
 \li <b>Full</b>: Full routing data (fast, large memory requirements, fully expressive)
-\li <b>Floyd</b>: Floyd routing data (slow initialization, fast lookup, lesser memory requirements, shortest path routing only)
-\li <b>Dijkstra</b>: Dijkstra routing data (fast initialization, slow lookup, small memory requirements, shortest path routing only)
-\li <b>DijkstraCache</b>: Dijkstra routing data (fast initialization, fast lookup, small memory requirements, shortest path routing only) 
-\li <b>none</b>: No routing (usable with Constant network only)
-\li <b>RuleBased</b>: Rule-Based routing data (...)
+\li <b>Floyd</b>: Floyd routing data (slow initialization, fast lookup, lesser memory requirements, shortest path routing only). Calculates all routes at once at the beginning.
+\li <b>Dijkstra</b>: Dijkstra routing data (fast initialization, slow lookup, small memory requirements, shortest path routing only). Calculates a route when necessary.
+\li <b>DijkstraCache</b>: Dijkstra routing data (fast initialization, fast lookup, small memory requirements, shortest path routing only). Same as Dijkstra, except it handles a cache for latest used routes.
+\li <b>none</b>: No routing (usable with Constant network only). Defines that there is no routes, so if you try to determine a route without constant network within this AS, SimGrid will raie an exception.
+\li <b>RuleBased</b>: Rule-Based routing data (fast initialisation, relatively slow lookup, moderate memory requirements, fully expressive): uses regexp to define routes;
 \li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates
 \li <b>Cluster</b>: Cluster routing, specific to cluster tag, should not be used.
 
index d0bbc68..4b13333 100644 (file)
@@ -32,7 +32,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file,
 
 int host(int argc, char *argv[])
 {
-  m_file_t file;
+  msg_file_t file = NULL;
+  s_msg_stat_t stat;
+
   char* mount = bprintf("C:");
   size_t read,write;
   if(!strcmp(MSG_process_get_name(MSG_process_self()),"0"))
@@ -56,8 +58,8 @@ int host(int argc, char *argv[])
   read = MSG_file_read(mount,NULL,10000000,sizeof(char*),file);     // Read for 10Mo
   XBT_INFO("\tHaving read  %Zu \ton %s",read,file->name);
 
-//  res = MSG_file_stat(mount,0,NULL);
-//  XBT_INFO("Host '%s' stat %d",MSG_host_get_name(MSG_host_self()), res);
+  MSG_file_stat(mount,file,&stat);
+  XBT_INFO("\tFile %s Size %d",file->name,(int)stat.size);
 
   XBT_INFO("\tClose file '%s'",file->name);
   MSG_file_close(mount,file);
index db881dc..54aeb22 100644 (file)
                <storage_type id="samsung" model="RAID5" content="content/storage_content.txt">
                        <prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
                        <prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
-                       <prop id="Bconnexion" value="6000000000" /> <!-- 6Go/s -->
+                       <prop id="Bconnection" value="6000000000" /> <!-- 6Go/s -->
                </storage_type>
 
                <storage_type id="crucial" model="SSD" content="content/storage_content.txt">
                        <prop id="Bwrite" value="30000000" />
                        <prop id="Bread" value="100000000" />
-                       <prop id="Bconnexion" value="6000000000" />
+                       <prop id="Bconnection" value="6000000000" />
                </storage_type>
 
                <storage_type id="wdigital" model="RAID0" content="content/storage_content.txt">
                        <prop id="Bwrite" value="30000000" />
                        <prop id="Bread" value="100000000" />
-                       <prop id="Bconnexion" value="6000000000" />
+                       <prop id="Bconnection" value="6000000000" />
                </storage_type>
 
                <storage id="Disk1" typeId="crucial"/>
index 5b171c1..4741045 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef MSG_DATATYPE_H
 #define MSG_DATATYPE_H
 #include "xbt/misc.h"
+#include "xbt/file_stat.h"
 #include "simgrid_config.h"     // for HAVE_TRACING
 
 SG_BEGIN_DECL()
@@ -66,6 +67,24 @@ typedef struct m_task {
   @{ */
 typedef struct m_task *m_task_t;
 
+/* ******************************** File ************************************ */
+
+typedef struct simdata_file *simdata_file_t;
+
+/** @brief File datatype
+    @ingroup m_datatypes_management_details */
+typedef struct msg_file {
+  char *name;                   /**< @brief file name */
+  simdata_file_t simdata;                /**< @brief simulator data  */
+  void *data;                   /**< @brief user data */
+} s_msg_file_t;
+/** @brief File datatype
+    @ingroup m_datatypes_management_details */
+
+typedef struct msg_file *msg_file_t;
+
+typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
+
 
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task *simdata_gpu_task_t;
index 89b94ff..c1c2d1d 100644 (file)
@@ -38,11 +38,11 @@ XBT_PUBLIC(unsigned long int) MSG_get_sent_msg(void);
 
 
 /************************** File handling ***********************************/
-XBT_PUBLIC(size_t) MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(size_t) MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(m_file_t) MSG_file_open(const char* storage, const char* path, const char* mode);
-XBT_PUBLIC(int) MSG_file_close(const char* storage, m_file_t fp);
-XBT_PUBLIC(int) MSG_file_stat(const char* storage, int fd, void* buf);
+XBT_PUBLIC(size_t) MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, msg_file_t stream);
+XBT_PUBLIC(size_t) MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, msg_file_t stream);
+XBT_PUBLIC(msg_file_t) MSG_file_open(const char* storage, const char* path, const char* mode);
+XBT_PUBLIC(int) MSG_file_close(const char* storage, msg_file_t fp);
+XBT_PUBLIC(int) MSG_file_stat(const char* storage, msg_file_t fd, s_msg_stat_t *buf);
 
 
 /************************** Host handling ***********************************/
index 093cbbd..1ed5a6a 100644 (file)
@@ -46,12 +46,15 @@ typedef enum {
 
 typedef struct s_smx_timer* smx_timer_t;
 
-
 /* ******************************** Synchro ************************************ */
 typedef struct s_smx_mutex *smx_mutex_t;
 typedef struct s_smx_cond *smx_cond_t;
 typedef struct s_smx_sem *smx_sem_t;
 
+/********************************** File *************************************/
+typedef struct s_smx_file *smx_file_t;
+typedef struct s_smx_stat *smx_stat_t;
+
 /********************************** Action *************************************/
 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
 
index 8cfbd08..2de942e 100644 (file)
@@ -10,6 +10,7 @@
 #include "xbt/misc.h"
 #include "xbt/fifo.h"
 #include "xbt/dict.h"
+#include "xbt/file_stat.h"
 #include "xbt/function_types.h"
 #include "simix/datatypes.h"
 #include "simix/context.h"
@@ -244,11 +245,11 @@ XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem,
 XBT_PUBLIC(unsigned int) simcall_sem_acquire_any(xbt_dynar_t sems);
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
-XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-XBT_PUBLIC(m_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
-XBT_PUBLIC(int) simcall_file_close(const char* storage, m_file_t fp);
-XBT_PUBLIC(int) simcall_file_stat(const char* storage, int fd, void* buf);
+XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(smx_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
+XBT_PUBLIC(int) simcall_file_close(const char* storage, smx_file_t fp);
+XBT_PUBLIC(int) simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf);
 
 SG_END_DECL()
 #endif                          /* _SIMIX_SIMIX_H */
diff --git a/include/xbt/file_stat.h b/include/xbt/file_stat.h
new file mode 100644 (file)
index 0000000..b4ee8c7
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * file_stat.h
+ *
+ *  Created on: 3 avr. 2012
+ *      Author: navarro
+ */
+
+#ifndef _FILE_STAT_H
+#define _FILE_STAT_H
+
+#include "xbt/sysdep.h"
+
+typedef struct file_stat {
+  char *user_rights;
+  char *user;
+  char *group;
+  char *date; /* FIXME: update to time_t or double */
+  char *time; /* FIXME: update to time_t or double */
+  size_t size;
+} s_file_stat_t, *file_stat_t;
+
+static XBT_INLINE void file_stat_copy(s_file_stat_t *src, s_file_stat_t *dst)
+{
+    dst->date = xbt_strdup(src->date);
+    dst->group = xbt_strdup(src->group);
+    dst->size = src->size;
+    dst->time = xbt_strdup(src->time);
+    dst->user = xbt_strdup(src->user);
+    dst->user_rights = xbt_strdup(src->user_rights);
+}
+
+#endif /* _FILE_STAT_H */
index a77a7fe..ed4bc8a 100644 (file)
 #define TRUE  1
 #define FALSE 0
 
-#define XBT_MAX_CHANNEL 10      /* FIXME: killme */
 /*! C++ users need love */
 #ifndef SG_BEGIN_DECL
 # ifdef __cplusplus
@@ -218,16 +217,5 @@ XBT_PUBLIC(const char *) xbt_procname(void);
 
 #define XBT_BACKTRACE_SIZE 10   /* FIXME: better place? Do document */
 
-/** @brief File datatype
-    @ingroup m_datatypes_management_details */
-typedef struct m_file {
-  char *name;                   /**< @brief file name */
-  void *content;                   /**< @brief user data */
-} s_m_file_t;
-/** @brief File datatype
-    @ingroup m_datatypes_management_details */
-typedef struct m_file *m_file_t;
-
-
 SG_END_DECL()
 #endif                          /* XBT_MISC_H */
index f51895a..e7764f1 100644 (file)
@@ -22,7 +22,8 @@ typedef struct surf_model *surf_model_t;
  * It is represented as a cost, a priority, a duration and a state.
  */
 typedef struct surf_action *surf_action_t;
-
+typedef struct surf_file *surf_file_t;
+typedef struct surf_stat *surf_stat_t;
 
 typedef struct lmm_element *lmm_element_t;
 typedef struct lmm_variable *lmm_variable_t;
index d8f73c5..309e5ac 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
 #include "xbt/misc.h"
+#include "xbt/file_stat.h"
 #include "portable.h"
 #include "xbt/config.h"
 #include "surf/datatypes.h"
@@ -93,8 +94,8 @@ typedef struct surf_action {
 #ifdef HAVE_TRACING
   char *category;               /**< tracing category for categorized resource utilization monitoring */
 #endif
-  void* file;        /**< m_file_t for storage model */
-  size_t read_write;
+  surf_file_t file;        /**< surf_file_t for storage model */
+  s_file_stat_t stat;        /**< surf_file_t for storage model */
 } s_surf_action_t;
 
 typedef struct surf_action_lmm {
@@ -218,10 +219,10 @@ typedef struct surf_network_model_extension_public {
 
 typedef struct surf_storage_model_extension_public {
   surf_action_t(*open) (void *storage, const char* path, const char* mode);
-  surf_action_t(*close) (void *storage, m_file_t fp);
-  surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*stat) (void *storage, int fd, void* buf);
+  surf_action_t(*close) (void *storage, surf_file_t fp);
+  surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*stat) (void *storage, surf_file_t stream);
   void* (*create_resource) (const char* id, const char* model,const char* type_id);
 } s_surf_model_extension_storage_t;
 
@@ -251,10 +252,10 @@ typedef struct surf_workstation_model_extension_public {
   double (*get_link_bandwidth) (const void *link);                                         /**< Return the current bandwidth of a network link */
   double (*get_link_latency) (const void *link);                                           /**< Return the current latency of a network link */
   surf_action_t(*open) (void *workstation, const char* storage, const char* path, const char* mode);
-  surf_action_t(*close) (void *workstation, const char* storage, m_file_t fp);
-  surf_action_t(*read) (void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*write) (void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
-  surf_action_t(*stat) (void *workstation, const char* storage, int fd, void* buf);
+  surf_action_t(*close) (void *workstation, const char* storage, surf_file_t fp);
+  surf_action_t(*read) (void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*write) (void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
+  surf_action_t(*stat) (void *workstation, const char* storage, surf_file_t stream);
   int (*link_shared) (const void *link);
    xbt_dict_t(*get_properties) (const void *resource);
   void* (*link_create_resource) (const char *name,
@@ -349,30 +350,6 @@ typedef struct surf_resource {
   xbt_dict_t properties;
 } s_surf_resource_t, *surf_resource_t;
 
-/**
- * Storage struct
- */
-typedef struct s_storage_type {
-  char *model;
-  xbt_dict_t content;
-  char *type_id;
-  xbt_dict_t properties;
-} s_storage_type_t, *storage_type_t;
-
-typedef struct s_mount {
-  void *id;
-  char *name;
-} s_mount_t, *mount_t;
-
-typedef struct s_content {
-  char *user_rights;
-  char *user;
-  char *group;
-  char *date;
-  char *time;
-  size_t size;
-} s_content_t, *content_t;
-
 /**
  * Resource which have a metric handled by a maxmin system
  */
index aa72c4c..dc66869 100644 (file)
@@ -20,21 +20,6 @@ static XBT_INLINE
   res->properties = props;
   return res;
 }
-static XBT_INLINE void routing_storage_type_free(void *r)
-{
-  storage_type_t stype = r;
-  free(stype->model);
-  free(stype->type_id);
-  xbt_dict_free(&(stype->properties));
-  xbt_dict_free(&(stype->content));
-  free(stype);
-}
-
-static XBT_INLINE void routing_storage_host_free(void *r)
-{
-  xbt_dynar_t dyn = r;
-  xbt_dynar_free(&dyn);
-}
 
 static XBT_INLINE void surf_resource_free(void *r)
 {
index ce36bb4..c9de3a3 100644 (file)
@@ -264,7 +264,7 @@ void TRACE_global_init(int *argc, char **argv)
                    NULL, NULL);
 
   /* tracing buffer */
-  int default_buffer = 0;
+  int default_buffer = 1;
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_BUFFER,
                    "Buffer trace events to put them in temporal order.",
                    xbt_cfgelm_int, &default_buffer, 0, 1,
index 9146943..fc96c0c 100644 (file)
@@ -47,11 +47,6 @@ void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host, m_hos
     //create new container on the new_host location
     msg = PJ_container_new(instr_process_id(process, str, len), INSTR_MSG_PROCESS, PJ_container_get(new_host->name));
 
-    //set the state of this new container
-    type = PJ_type_get ("MSG_PROCESS_STATE", msg->type);
-    val_t value = PJ_value_get ("executing", type);
-    new_pajeSetState (MSG_get_clock(), msg, type, value);
-
     //end link
     msg = PJ_container_get(instr_process_id(process, str, len));
     type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
@@ -66,11 +61,7 @@ void TRACE_msg_process_create (const char *process_name, int process_pid, m_host
     char str[INSTR_DEFAULT_STR_SIZE];
 
     container_t host_container = PJ_container_get (host->name);
-    container_t msg = PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
-
-    type_t type = PJ_type_get ("MSG_PROCESS_STATE", msg->type);
-    val_t value = PJ_value_get ("executing", type);
-    new_pajeSetState (MSG_get_clock(), msg, type, value);
+    PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
   }
 }
 
index fa8b22c..28e3871 100644 (file)
@@ -307,7 +307,6 @@ static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host)
     if (msg_process == NULL){
       msg_process = PJ_type_container_new("MSG_PROCESS", new->type);
       type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process);
-      PJ_value_new ("executing", "0 1 0", state);
       PJ_value_new ("suspend", "1 0 1", state);
       PJ_value_new ("sleep", "1 1 0", state);
       PJ_value_new ("receive", "1 0 0", state);
index f689fe6..c8b64de 100644 (file)
@@ -5,12 +5,16 @@
  * under the terms of the license (GNU LGPL) which comes with this package.              */
 
 #include "msg_private.h"
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, simix,
+                                "Logging specific to MSG (io)");
 
 /** @addtogroup m_file_management
  *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="File" --> \endhtmlonly
- * (#m_file_t) and the functions for managing it.
+ * (#msg_file_t) and the functions for managing it.
  *
- *  \see #m_file_t
+ *  \see #msg_file_t
  */
 
 /********************************* File **************************************/
@@ -25,9 +29,9 @@
  * \param stream to read
  * \return the number of items successfully read
  */
-size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,  m_file_t stream)
+size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,  msg_file_t stream)
 {
-  return simcall_file_read(storage, ptr, size, nmemb, (m_file_t)stream);
+  return simcall_file_read(storage, ptr, size, nmemb, stream->simdata->smx_file);
 }
 
 /** \ingroup m_file_management
@@ -40,9 +44,9 @@ size_t MSG_file_read(const char* storage, void* ptr, size_t size, size_t nmemb,
  * \param stream to write
  * \return the number of items successfully write
  */
-size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, msg_file_t stream)
 {
-  return simcall_file_write(storage, ptr, size, nmemb, (m_file_t)stream);
+  return simcall_file_write(storage, ptr, size, nmemb, stream->simdata->smx_file);
 }
 
 /** \ingroup m_file_management
@@ -60,11 +64,15 @@ size_t MSG_file_write(const char* storage, const void* ptr, size_t size, size_t
  *      a+     Open for reading and appending (writing at end of file).  The file is created if it does not exist.  The initial file position for  reading
  *             is at the beginning of the file, but output is always appended to the end of the file.
  *
- * \return An #m_file_t associated to the file
+ * \return An #msg_file_t associated to the file
  */
-m_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
+msg_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
 {
-  return (m_file_t) simcall_file_open(storage, path, mode);
+  msg_file_t file = xbt_new(s_msg_file_t,1);
+  file->name = strdup(path);
+  file->simdata = xbt_new0(s_simdata_file_t,1);
+  file->simdata->smx_file = simcall_file_open(storage, path, mode);
+  return file;
 }
 
 /** \ingroup m_file_management
@@ -74,20 +82,22 @@ m_file_t MSG_file_open(const char* storage, const char* path, const char* mode)
  * \param fp is the file to close
  * \return 0 on success or 1 on error
  */
-int MSG_file_close(const char* storage, m_file_t fp)
+int MSG_file_close(const char* storage, msg_file_t fp)
 {
-  return simcall_file_close(storage, (m_file_t)fp);
+  return simcall_file_close(storage, fp->simdata->smx_file);
 }
 
 /** \ingroup m_file_management
  * \brief Stats the file pointed by fd
  *
  * \param storage is the name where find the stream
- * \param fd is the file descriptor
+ * \param fd is the file descriptor (#msg_file_t)
  * \param buf is the return structure with informations
  * \return 0 on success or 1 on error
  */
-int MSG_file_stat(const char* storage, int fd, void* buf)
+int MSG_file_stat(const char* storage, msg_file_t fd, s_msg_stat_t *buf)
 {
-  return simcall_file_stat(storage, fd, buf);
+  int res;
+  res = simcall_file_stat(storage, fd->simdata->smx_file, buf);
+  return res;
 }
index 317a5d8..c43de1e 100644 (file)
@@ -45,6 +45,10 @@ typedef struct simdata_task {
   double *comm_amount;
 } s_simdata_task_t;
 
+/********************************* File **************************************/
+typedef struct simdata_file {
+  smx_file_t smx_file;
+} s_simdata_file_t;
 
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task {
index 209d825..6c7868c 100644 (file)
@@ -25,10 +25,9 @@ void SIMIX_pre_file_read(smx_simcall_t simcall)
       simcall->file_read.stream);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
-  simcall->file_read.result = (action->io.surf_io)->read_write;
 }
 
-smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -48,7 +47,7 @@ smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* p
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.read(host->host, storage, ptr, size, nmemb, stream),
+  action->io.surf_io = surf_workstation_model->extension.workstation.read(host->host, storage, ptr, size, nmemb, stream->surf_file),
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -67,10 +66,9 @@ void SIMIX_pre_file_write(smx_simcall_t simcall)
       simcall->file_write.stream);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
-  simcall->file_write.result = (action->io.surf_io)->read_write;
 }
 
-smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -90,7 +88,7 @@ smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.write(host->host, storage, ptr, size, nmemb, stream);
+  action->io.surf_io = surf_workstation_model->extension.workstation.write(host->host, storage, ptr, size, nmemb, stream->surf_file);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -107,7 +105,6 @@ void SIMIX_pre_file_open(smx_simcall_t simcall)
       simcall->file_open.mode);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
-  simcall->file_open.result = (action->io.surf_io)->file;
 }
 
 smx_action_t SIMIX_file_open(smx_process_t process ,const char* storage, const char* path, const char* mode)
@@ -146,10 +143,9 @@ void SIMIX_pre_file_close(smx_simcall_t simcall)
       simcall->file_close.fp);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
-  simcall->file_close.result = 0;
 }
 
-smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, m_file_t fp)
+smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, smx_file_t fp)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -169,7 +165,7 @@ smx_action_t SIMIX_file_close(smx_process_t process ,const char* storage, m_file
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.close(host->host, storage, fp);
+  action->io.surf_io = surf_workstation_model->extension.workstation.close(host->host, storage, fp->surf_file);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -186,14 +182,12 @@ void SIMIX_pre_file_stat(smx_simcall_t simcall)
       simcall->file_stat.buf);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
-  simcall->file_stat.result = 0;
 }
 
-smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, int fd, void* buf)
+smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, smx_file_t fd, s_file_stat_t buf)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
-
   /* check if the host is active */
   if (surf_workstation_model->extension.
       workstation.get_state(host->host) != SURF_RESOURCE_ON) {
@@ -209,7 +203,7 @@ smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, int fd,
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.stat(host->host, storage, fd, buf);
+  action->io.surf_io = surf_workstation_model->extension.workstation.stat(host->host, storage, fd->surf_file);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -219,6 +213,35 @@ smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, int fd,
 
 void SIMIX_post_io(smx_action_t action)
 {
+  xbt_fifo_item_t i;
+  smx_simcall_t simcall;
+
+  xbt_fifo_foreach(action->simcalls,i,simcall,smx_simcall_t) {
+    switch (simcall->call) {
+    case SIMCALL_FILE_OPEN:
+      simcall->file_open.result = xbt_new(s_smx_file_t,1);
+      simcall->file_open.result->surf_file = (action->io.surf_io)->file;
+      break;
+    case SIMCALL_FILE_CLOSE:
+      simcall->file_read.result = 0;
+      break;
+    case SIMCALL_FILE_WRITE:
+      simcall->file_write.result = (action->io.surf_io)->cost;
+      break;
+    case SIMCALL_FILE_READ:
+      simcall->file_read.result = (action->io.surf_io)->cost;
+      break;
+    case SIMCALL_FILE_STAT:
+      simcall->file_stat.result = 0;
+      s_file_stat_t *dst = &(simcall->file_stat.buf);
+      s_file_stat_t *src = &((action->io.surf_io)->stat);
+      file_stat_copy(src,dst);
+      break;
+    default:
+      break;
+    }
+  }
+
   switch (surf_workstation_model->action_state_get(action->io.surf_io)) {
 
     case SURF_ACTION_FAILED:
index 861f6ea..f38cd9b 100644 (file)
@@ -16,11 +16,11 @@ void SIMIX_pre_file_open(smx_simcall_t simcall);
 void SIMIX_pre_file_close(smx_simcall_t simcall);
 void SIMIX_pre_file_stat(smx_simcall_t simcall);
 
-smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream);
-smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream);
+smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage, const char* path, const char* mode);
-smx_action_t SIMIX_file_close(smx_process_t process, const char* storage, m_file_t fp);
-smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, int fd, void* buf);
+smx_action_t SIMIX_file_close(smx_process_t process, const char* storage, smx_file_t fp);
+smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, smx_file_t fd, s_file_stat_t buf);
 
 void SIMIX_post_io(smx_action_t action);
 void SIMIX_io_destroy(smx_action_t action);
index 13dca2f..28cbd06 100644 (file)
@@ -57,6 +57,15 @@ extern unsigned long simix_process_maxpid;
 
 #define SMX_THROW() RETHROW
 
+/* ******************************** File ************************************ */
+typedef struct s_smx_file {
+  surf_file_t surf_file;
+} s_smx_file_t;
+
+typedef struct s_smx_stat {
+  s_file_stat_t surf_stat;
+} s_smx_stat_t, *smx_stat_t;
+
 /*********************************** Time ************************************/
 
 /** @brief Timer datatype */
@@ -84,6 +93,13 @@ typedef enum {
   SIMIX_COMM_DONE
 } e_smx_comm_type_t;
 
+typedef enum {
+  SIMIX_IO_OPEN,
+  SIMIX_IO_WRITE,
+  SIMIX_IO_READ,
+  SIMIX_IO_STAT
+} e_smx_io_type_t;
+
 /** @brief Action datatype */
 typedef struct s_smx_action {
 
index d828e5b..a0888c1 100644 (file)
@@ -512,7 +512,7 @@ typedef struct s_smx_simcall {
       void *ptr;
       size_t size;
       size_t nmemb;
-      m_file_t stream;
+      smx_file_t stream;
       size_t result;
     } file_read;
 
@@ -521,7 +521,7 @@ typedef struct s_smx_simcall {
       const void *ptr;
       size_t size;
       size_t nmemb;
-      m_file_t stream;
+      smx_file_t stream;
       size_t result;
     } file_write;
 
@@ -529,20 +529,19 @@ typedef struct s_smx_simcall {
       const char* storage;
       const char* path;
       const char* mode;
-      m_file_t result;
+      smx_file_t result;
     } file_open;
 
     struct {
       const char* storage;
-      m_file_t fp;
+      smx_file_t fp;
       int result;
     } file_close;
 
     struct {
       const char* storage;
-      int fd;
-      //Next should be struct stat* buf
-      void* buf;
+      smx_file_t fd;
+      s_file_stat_t buf;
       int result;
     } file_stat;
 
index c0957ba..1f5f4b4 100644 (file)
@@ -1177,7 +1177,7 @@ int simcall_sem_get_capacity(smx_sem_t sem)
   return simcall->sem_get_capacity.result;
 }
 
-size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1192,7 +1192,7 @@ size_t simcall_file_read(const char* storage, void* ptr, size_t size, size_t nme
   return simcall->file_read.result;
 }
 
-size_t simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+size_t simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1207,7 +1207,7 @@ size_t simcall_file_write(const char* storage, const void* ptr, size_t size, siz
   return simcall->file_write.result;
 }
 
-m_file_t simcall_file_open(const char* storage, const char* path, const char* mode)
+smx_file_t simcall_file_open(const char* storage, const char* path, const char* mode)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1220,7 +1220,7 @@ m_file_t simcall_file_open(const char* storage, const char* path, const char* mo
   return simcall->file_open.result;
 }
 
-int simcall_file_close(const char* storage, m_file_t fp)
+int simcall_file_close(const char* storage, smx_file_t fp)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1232,16 +1232,17 @@ int simcall_file_close(const char* storage, m_file_t fp)
   return simcall->file_close.result;
 }
 
-int simcall_file_stat(const char* storage, int fd, void* buf)
+int simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
-
   simcall->call = SIMCALL_FILE_STAT;
   simcall->file_stat.storage = storage;
   simcall->file_stat.fd = fd;
-  simcall->file_stat.buf = buf;
+
   SIMIX_simcall_push(simcall->issuer);
 
+  *buf = simcall->file_stat.buf;
+
   return simcall->file_stat.result;
 }
 
index 539b677..db79c6f 100644 (file)
@@ -23,6 +23,11 @@ typedef struct lmm_element {
 #define make_elem_active(elem) xbt_swag_insert_at_head(elem,&(elem->constraint->active_element_set))
 #define make_elem_inactive(elem) xbt_swag_remove(elem,&(elem->constraint->active_element_set))
 
+//typedef struct lmm_constraint_light {
+//  double remaining_over_usage;
+//  lmm_constraint_t cnst;
+//} s_lmm_constraint_light_t;
+
 typedef struct lmm_constraint {
   /* hookup to system */
   s_xbt_swag_hookup_t constraint_set_hookup;
@@ -32,14 +37,14 @@ typedef struct lmm_constraint {
 
   s_xbt_swag_t element_set;     /* a list of lmm_element_t */
   s_xbt_swag_t active_element_set;      /* a list of lmm_element_t */
-  double bound;
-  double lambda;
-  double new_lambda;
   double remaining;
   double usage;
+  double bound;
+  int shared;
   void *id;
   int id_int;
-  int shared;
+  double lambda;
+  double new_lambda;
 } s_lmm_constraint_t;
 
 typedef struct lmm_variable {
index e926151..7ee05ee 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "xbt/ex.h"
 #include "xbt/dict.h"
+#include "xbt/file_stat.h"
 #include "portable.h"
 #include "surf_private.h"
 #include "storage_private.h"
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
 
+xbt_lib_t storage_lib;
+int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
+int ROUTING_STORAGE_HOST_LEVEL;
+int SURF_STORAGE_LEVEL;
+xbt_lib_t storage_type_lib;
+int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
+
+xbt_dynar_t mount_list = NULL;  /* temporary store of current mount storage */
+
 surf_model_t surf_storage_model = NULL;
 lmm_system_t storage_maxmin_system = NULL;
 static int storage_selective_update = 0;
@@ -23,12 +33,6 @@ static xbt_swag_t
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 
-typedef enum {
-  READ = 0,
-  WRITE = 1,
-  DEFAULT = 2
-} STORAGE_execute_type_t;
-
 typedef struct surf_storage {
   s_surf_resource_t generic_resource;
   const char* type;
@@ -36,8 +40,15 @@ typedef struct surf_storage {
 } s_surf_storage_t, *surf_storage_t;
 
 static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
-static surf_action_t storage_action_sleep (void *storage, double duration);
-static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE_execute_type_t type);
+static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_action_storage_type_t type);
+
+static surf_action_t storage_action_stat(void *storage, surf_file_t stream)
+{
+  surf_action_t action = storage_action_execute(storage,0, STAT);
+  action->file = stream;
+  action->stat = stream->content->stat;
+  return action;
+}
 
 static surf_action_t storage_action_open(void *storage, const char* path, const char* mode)
 {
@@ -48,59 +59,51 @@ static surf_action_t storage_action_open(void *storage, const char* path, const
       ROUTING_STORAGE_LEVEL);
   storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, storage_type_id,ROUTING_STORAGE_TYPE_LEVEL);
   xbt_dict_t content_dict = storage_type->content;
-  content_t content = xbt_dict_get(content_dict,path);
+  surf_stat_t content = xbt_dict_get(content_dict,path);
 
-  m_file_t file = xbt_new0(s_m_file_t,1);
+  surf_file_t file = xbt_new0(s_surf_file_t,1);
   file->name = xbt_strdup(path);
   file->content = content;
 
-  surf_action_t action = storage_action_execute(storage,0, DEFAULT);
+  surf_action_t action = storage_action_execute(storage,0, OPEN);
   action->file = (void *)file;
   return action;
 }
 
-static surf_action_t storage_action_close(void *storage, m_file_t fp)
+static surf_action_t storage_action_close(void *storage, surf_file_t fp)
 {
   char *filename = fp->name;
   free(fp->name);
   fp->content = NULL;
   xbt_free(fp);
-  surf_action_t action = storage_action_execute(storage,0, DEFAULT);
+  surf_action_t action = storage_action_execute(storage,0, CLOSE);
   XBT_DEBUG("\tClose file '%s'",filename);
   return action;
 }
 
-static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
-  content_t content = (content_t)(stream->content);
-  XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->size);
-  if(size > content->size)
-    size = content->size;
+  surf_stat_t content = stream->content;
+  XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->stat.size);
+  if(size > content->stat.size)
+    size = content->stat.size;
   surf_action_t action = storage_action_execute(storage,size,READ);
-  action->read_write = size;
   return action;
 }
 
-static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
-  content_t content = (content_t)(stream->content);
-  XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->size);
+  surf_stat_t content = stream->content;
+  XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->stat.size);
 
   surf_action_t action = storage_action_execute(storage,size,WRITE);
-  action->read_write = size;
-  content->size += size;
+  content->stat.size += size;
   return action;
 }
 
-static surf_action_t storage_action_stat(void *storage, int fd, void* buf)
-{
-  THROW_UNIMPLEMENTED;
-  return NULL;
-}
-
-static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE_execute_type_t type)
+static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_action_storage_type_t type)
 {
   surf_action_storage_t action = NULL;
   storage_t STORAGE = storage;
@@ -116,44 +119,23 @@ static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE
   GENERIC_LMM_ACTION(action).variable =
       lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 3);
 
-  if(type == DEFAULT)
-  lmm_expand(storage_maxmin_system, STORAGE->constraint,
-             GENERIC_LMM_ACTION(action).variable, 1.0);
-  else if(type == READ)
+  switch(type) {
+  case OPEN:
+  case CLOSE:
+  case STAT:
+    lmm_expand(storage_maxmin_system, STORAGE->constraint,
+               GENERIC_LMM_ACTION(action).variable, 1.0);
+    break;
+  case READ:
     lmm_expand(storage_maxmin_system, STORAGE->constraint_read,
                GENERIC_LMM_ACTION(action).variable, 1.0);
-  else if(type == WRITE)
+    break;
+  case WRITE:
     lmm_expand(storage_maxmin_system, STORAGE->constraint_write,
                GENERIC_LMM_ACTION(action).variable, 1.0);
-  else xbt_die("storage_action_execute with type '%d'",(int) type);
-
-  XBT_OUT();
-  return (surf_action_t) action;
-}
-
-static surf_action_t storage_action_sleep (void *storage, double duration)
-{
-  surf_action_storage_t action = NULL;
-
-  if (duration > 0)
-    duration = MAX(duration, MAXMIN_PRECISION);
-
-  XBT_IN("(%s,%g)", surf_resource_name(storage), duration);
-  action = (surf_action_storage_t) storage_action_execute(storage, 1.0, DEFAULT);
-  GENERIC_ACTION(action).max_duration = duration;
-  GENERIC_LMM_ACTION(action).suspended = 2;
-  if (duration == NO_MAX_DURATION) {
-    /* Move to the *end* of the corresponding action set. This convention
-       is used to speed up update_resource_state  */
-    xbt_swag_remove(action, ((surf_action_t) action)->state_set);
-    ((surf_action_t) action)->state_set =
-        storage_running_action_set_that_does_not_need_being_checked;
-    xbt_swag_insert(action, ((surf_action_t) action)->state_set);
+    break;
   }
 
-  lmm_update_variable_weight(storage_maxmin_system,
-                             GENERIC_LMM_ACTION(action).variable, 0.0);
-
   XBT_OUT();
   return (surf_action_t) action;
 }
@@ -173,9 +155,9 @@ static void* storage_create_resource(const char* id, const char* model,const cha
   storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
   size_t Bread  = atof(xbt_dict_get(storage_type->properties,"Bread"));
   size_t Bwrite = atof(xbt_dict_get(storage_type->properties,"Bwrite"));
-  size_t Bconnexion   = atof(xbt_dict_get(storage_type->properties,"Bconnexion"));
-  XBT_INFO("Create resource with Bconnexion '%Zu' Bread '%Zu' Bwrite '%Zu'",Bconnexion,Bread,Bwrite);
-  storage->constraint       = lmm_constraint_new(storage_maxmin_system, storage, Bconnexion);
+  size_t Bconnection   = atof(xbt_dict_get(storage_type->properties,"Bconnection"));
+  XBT_INFO("Create resource with Bconnection '%Zu' Bread '%Zu' Bwrite '%Zu'",Bconnection,Bread,Bwrite);
+  storage->constraint       = lmm_constraint_new(storage_maxmin_system, storage, Bconnection);
   storage->constraint_read  = lmm_constraint_new(storage_maxmin_system, storage, Bread);
   storage->constraint_write = lmm_constraint_new(storage_maxmin_system, storage, Bwrite);
 
@@ -209,8 +191,8 @@ static void storage_update_actions_state(double now, double delta)
   surf_action_storage_t action = NULL;
   surf_action_storage_t next_action = NULL;
   xbt_swag_t running_actions = surf_storage_model->states.running_action_set;
-  xbt_swag_foreach_safe(action, next_action, running_actions) {
 
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
     double_update(&(GENERIC_ACTION(action).remains),
                   lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable) * delta);
     if (GENERIC_LMM_ACTION(action).generic_action.max_duration != NO_MAX_DURATION)
@@ -399,3 +381,179 @@ void surf_storage_model_init_default(void)
 
   xbt_dynar_push(model_list, &surf_storage_model);
 }
+
+static void storage_parse_storage(sg_platf_storage_cbarg_t storage)
+{
+  xbt_assert(!xbt_lib_get_or_null(storage_lib, storage->id,ROUTING_STORAGE_LEVEL),
+               "Reading a storage, processing unit \"%s\" already exists", storage->id);
+
+  // Verification of an existing type_id
+#ifndef NDEBUG
+  void* storage_type = xbt_lib_get_or_null(storage_type_lib, storage->type_id,ROUTING_STORAGE_TYPE_LEVEL);
+#endif
+  xbt_assert(storage_type,"Reading a storage, type id \"%s\" does not exists", storage->type_id);
+
+  XBT_DEBUG("ROUTING Create a storage name '%s' with type_id '%s'",
+      storage->id,
+      storage->type_id);
+
+  xbt_lib_set(storage_lib,
+      storage->id,
+      ROUTING_STORAGE_LEVEL,
+      (void *) xbt_strdup(storage->type_id));
+}
+
+static void free_storage_content(void *p)
+{
+  surf_stat_t content = p;
+  free(content->stat.date);
+  free(content->stat.group);
+  free(content->stat.time);
+  free(content->stat.user);
+  free(content->stat.user_rights);
+  free(content);
+}
+
+static xbt_dict_t parse_storage_content(const char *filename)
+{
+  if ((!filename) || (strcmp(filename, "") == 0))
+    return NULL;
+
+  xbt_dict_t parse_content = xbt_dict_new_homogeneous(free_storage_content);
+  FILE *file = NULL;
+
+  file = surf_fopen(filename, "r");
+  xbt_assert(file != NULL, "Cannot open file '%s' (path=%s)", filename,
+              xbt_str_join(surf_path, ":"));
+
+  char *line = NULL;
+  size_t len = 0;
+  ssize_t read;
+  char user_rights[12];
+  char user[100];
+  char group[100];
+  char date[12];
+  char time[12];
+  char path[1024];
+  int nb, size;
+
+  surf_stat_t content;
+
+  while ((read = getline(&line, &len, file)) != -1) {
+    content = xbt_new0(s_surf_stat_t,1);
+    if(sscanf(line,"%s %d %s %s %d %s %s %s",user_rights,&nb,user,group,&size,date,time,path)==8) {
+      content->stat.date = xbt_strdup(date);
+      content->stat.group = xbt_strdup(group);
+      content->stat.size = size;
+      content->stat.time = xbt_strdup(time);
+      content->stat.user = xbt_strdup(user);
+      content->stat.user_rights = xbt_strdup(user_rights);
+      xbt_dict_set(parse_content,path,content,NULL);
+    } else {
+      xbt_die("Be sure of passing a good format for content file.\n");
+      // You can generate this kind of file with command line:
+      // find /path/you/want -type f -exec ls -l {} \; 2>/dev/null > ./content.txt
+    }
+  }
+  if (line)
+      free(line);
+
+  fclose(file);
+  return parse_content;
+}
+
+static void storage_parse_storage_type(sg_platf_storage_type_cbarg_t storage_type)
+{
+  xbt_assert(!xbt_lib_get_or_null(storage_type_lib, storage_type->id,ROUTING_STORAGE_TYPE_LEVEL),
+               "Reading a storage type, processing unit \"%s\" already exists", storage_type->id);
+
+  storage_type_t stype = xbt_new0(s_storage_type_t, 1);
+  stype->model = xbt_strdup(storage_type->model);
+  stype->properties = storage_type->properties;
+  stype->content = parse_storage_content(storage_type->content);
+  stype->type_id = xbt_strdup(storage_type->id);
+
+  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s' content '%s' and properties '%p'",
+      stype->type_id,
+      stype->model,
+      storage_type->content,
+      stype->properties);
+
+  xbt_lib_set(storage_type_lib,
+      stype->type_id,
+      ROUTING_STORAGE_TYPE_LEVEL,
+      (void *) stype);
+}
+static void storage_parse_mstorage(sg_platf_mstorage_cbarg_t mstorage)
+{
+  THROW_UNIMPLEMENTED;
+//  mount_t mnt = xbt_new0(s_mount_t, 1);
+//  mnt->id = xbt_strdup(mstorage->type_id);
+//  mnt->name = xbt_strdup(mstorage->name);
+//
+//  if(!mount_list){
+//    XBT_DEBUG("Creata a Mount list for %s",A_surfxml_host_id);
+//    mount_list = xbt_dynar_new(sizeof(char *), NULL);
+//  }
+//  xbt_dynar_push(mount_list,(void *) mnt);
+//  free(mnt->id);
+//  free(mnt->name);
+//  xbt_free(mnt);
+//  XBT_DEBUG("ROUTING Mount a storage name '%s' with type_id '%s'",mstorage->name, mstorage->id);
+}
+
+static void mount_free(void *p)
+{
+  mount_t mnt = p;
+  xbt_free(mnt->name);
+}
+
+static void storage_parse_mount(sg_platf_mount_cbarg_t mount)
+{
+  // Verification of an existing storage
+#ifndef NDEBUG
+  void* storage = xbt_lib_get_or_null(storage_lib, mount->id,ROUTING_STORAGE_LEVEL);
+#endif
+  xbt_assert(storage,"Disk id \"%s\" does not exists", mount->id);
+
+  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->id, mount->name);
+
+  s_mount_t mnt;
+  mnt.id = surf_storage_resource_by_name(mount->id);
+  mnt.name = xbt_strdup(mount->name);
+
+  if(!mount_list){
+    XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
+    mount_list = xbt_dynar_new(sizeof(s_mount_t), mount_free);
+  }
+  xbt_dynar_push(mount_list,&mnt);
+}
+
+static XBT_INLINE void routing_storage_type_free(void *r)
+{
+  storage_type_t stype = r;
+  free(stype->model);
+  free(stype->type_id);
+  xbt_dict_free(&(stype->properties));
+  xbt_dict_free(&(stype->content));
+  free(stype);
+}
+
+static XBT_INLINE void routing_storage_host_free(void *r)
+{
+  xbt_dynar_t dyn = r;
+  xbt_dynar_free(&dyn);
+}
+
+void storage_register_callbacks() {
+
+  ROUTING_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,xbt_free);
+  ROUTING_STORAGE_HOST_LEVEL = xbt_lib_add_level(storage_lib,routing_storage_host_free);
+  ROUTING_STORAGE_TYPE_LEVEL = xbt_lib_add_level(storage_type_lib,routing_storage_type_free);
+  SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_resource_free);
+
+  sg_platf_storage_add_cb(storage_parse_storage);
+  sg_platf_mstorage_add_cb(storage_parse_mstorage);
+  sg_platf_storage_type_add_cb(storage_parse_storage_type);
+  sg_platf_mount_add_cb(storage_parse_mount);
+}
index ca7b6cd..c5ae4d2 100644 (file)
@@ -8,6 +8,28 @@
 #ifndef STORAGE_PRIVATE_H_
 #define STORAGE_PRIVATE_H_
 
+typedef struct s_storage_type {
+  char *model;
+  xbt_dict_t content; /* char * -> s_surf_stat_t */
+  char *type_id;
+  xbt_dict_t properties;
+} s_storage_type_t, *storage_type_t;
+
+typedef struct s_mount {
+  void *id;
+  char *name;
+} s_mount_t, *mount_t;
+
+typedef struct surf_stat { /* file status structure */
+  s_file_stat_t stat;
+  /* possible additionnal fields (e.g., popularity, last access time to know whether the file is in cache, ...) */
+} s_surf_stat_t, *surf_stat_t;
+
+typedef struct surf_file {
+  char *name;
+  surf_stat_t content;
+} s_surf_file_t;
+
 typedef struct storage {
   s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interate with SURF */
   e_surf_resource_state_t state_current;        /*< STORAGE current state (ON or OFF) */
@@ -16,9 +38,13 @@ typedef struct storage {
   lmm_constraint_t constraint_read;    /* Constraint for maximum write bandwidth*/
 } s_storage_t, *storage_t;
 
+typedef enum {
+  READ, WRITE, STAT, OPEN, CLOSE
+} e_surf_action_storage_type_t;
+
 typedef struct surf_action_storage {
   s_surf_action_lmm_t generic_lmm_action;
-  int index_heap;
+  e_surf_action_storage_type_t type;
 } s_surf_action_storage_t, *surf_action_storage_t;
 
 #endif /* STORAGE_PRIVATE_H_ */
index 49eb817..709eb29 100644 (file)
@@ -308,15 +308,11 @@ void surf_init(int *argc, char **argv)
   XBT_DEBUG("ADD ROUTING LEVEL");
   ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,routing_asr_host_free);
   ROUTING_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,routing_asr_host_free);
-  ROUTING_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,xbt_free);
-  ROUTING_STORAGE_HOST_LEVEL = xbt_lib_add_level(storage_lib,routing_storage_host_free);
-  ROUTING_STORAGE_TYPE_LEVEL = xbt_lib_add_level(storage_type_lib,routing_storage_type_free);
 
   XBT_DEBUG("ADD SURF LEVELS");
   SURF_CPU_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
   SURF_WKS_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
   SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,surf_resource_free);
-  SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_resource_free);
 
   xbt_init(argc, argv);
   if (!model_list)
index a50e6cc..ff8b6b0 100644 (file)
@@ -185,6 +185,7 @@ struct s_routing_global {
 
 XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback);
 XBT_PUBLIC(void) routing_exit(void);
+XBT_PUBLIC(void) storage_register_callbacks(void);
 XBT_PUBLIC(void) routing_register_callbacks(void);
 XBT_PUBLIC(void) generic_free_route(route_t route); // FIXME rename to routing_route_free
  // FIXME: make previous function private to routing again?
index 6ce1552..737a545 100644 (file)
@@ -43,21 +43,14 @@ int NS3_ASR_LEVEL;              //host node for ns3
 
 static xbt_dict_t random_value = NULL;
 
-xbt_lib_t storage_lib;
-int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
-int ROUTING_STORAGE_HOST_LEVEL;
-int SURF_STORAGE_LEVEL;
-
-xbt_lib_t storage_type_lib;
-int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
-
 /* Global vars */
 routing_global_t global_routing = NULL;
 AS_t current_routing = NULL;
 
 /* global parse functions */
 xbt_dynar_t parsed_link_list = NULL;   /* temporary store of current list link of a route */
-xbt_dynar_t mount_list = NULL;  /* temporary store of current mount storage */
+extern xbt_dynar_t mount_list;
+
 static const char *src = NULL;  /* temporary store the source name of a route */
 static const char *dst = NULL;  /* temporary store the destination name of a route */
 static char *gw_src = NULL;     /* temporary store the gateway source name of a route */
@@ -747,153 +740,6 @@ void routing_model_create(size_t size_of_links, void *loopback)
 /* ************************************************************************** */
 /* ************************* GENERIC PARSE FUNCTIONS ************************ */
 
-static void routing_parse_storage(sg_platf_storage_cbarg_t storage)
-{
-  xbt_assert(!xbt_lib_get_or_null(storage_lib, storage->id,ROUTING_STORAGE_LEVEL),
-               "Reading a storage, processing unit \"%s\" already exists", storage->id);
-
-  // Verification of an existing type_id
-#ifndef NDEBUG
-  void* storage_type = xbt_lib_get_or_null(storage_type_lib, storage->type_id,ROUTING_STORAGE_TYPE_LEVEL);
-#endif
-  xbt_assert(storage_type,"Reading a storage, type id \"%s\" does not exists", storage->type_id);
-
-  XBT_DEBUG("ROUTING Create a storage name '%s' with type_id '%s'",
-      storage->id,
-      storage->type_id);
-
-  xbt_lib_set(storage_lib,
-      storage->id,
-      ROUTING_STORAGE_LEVEL,
-      (void *) xbt_strdup(storage->type_id));
-}
-
-static void free_storage_content(void *p)
-{
-  content_t content = p;
-  free(content->date);
-  free(content->group);
-  free(content->time);
-  free(content->user);
-  free(content->user_rights);
-  free(content);
-}
-
-static xbt_dict_t parse_storage_content(const char *filename)
-{
-  if ((!filename) || (strcmp(filename, "") == 0))
-    return NULL;
-
-  xbt_dict_t parse_content = xbt_dict_new_homogeneous(free_storage_content);
-  FILE *file = NULL;
-
-  file = surf_fopen(filename, "r");
-  xbt_assert(file != NULL, "Cannot open file '%s' (path=%s)", filename,
-              xbt_str_join(surf_path, ":"));
-
-  char *line = NULL;
-  size_t len = 0;
-  ssize_t read;
-  char user_rights[12];
-  char user[100];
-  char group[100];
-  char date[12];
-  char time[12];
-  char path[1024];
-  int nb, size;
-
-  content_t content;
-
-  while ((read = getline(&line, &len, file)) != -1) {
-    content = xbt_new0(s_content_t,1);
-    if(sscanf(line,"%s %d %s %s %d %s %s %s",user_rights,&nb,user,group,&size,date,time,path)==8) {
-      content->date = xbt_strdup(date);
-      content->group = xbt_strdup(group);
-      content->size = size;
-      content->time = xbt_strdup(time);
-      content->user = xbt_strdup(user);
-      content->user_rights = xbt_strdup(user_rights);
-      xbt_dict_set(parse_content,path,content,NULL);
-    } else {
-      xbt_die("Be sure of passing a good format for content file.\n");
-      // You can generate this kind of file with command line:
-      // find /path/you/want -type f -exec ls -l {} \; 2>/dev/null > ./content.txt
-    }
-  }
-  if (line)
-      free(line);
-
-  fclose(file);
-  return parse_content;
-}
-
-static void routing_parse_storage_type(sg_platf_storage_type_cbarg_t storage_type)
-{
-  xbt_assert(!xbt_lib_get_or_null(storage_type_lib, storage_type->id,ROUTING_STORAGE_TYPE_LEVEL),
-               "Reading a storage type, processing unit \"%s\" already exists", storage_type->id);
-
-  storage_type_t stype = xbt_new0(s_storage_type_t, 1);
-  stype->model = xbt_strdup(storage_type->model);
-  stype->properties = storage_type->properties;
-  stype->content = parse_storage_content(storage_type->content);
-  stype->type_id = xbt_strdup(storage_type->id);
-
-  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s' content '%s' and properties '%p'",
-      stype->type_id,
-      stype->model,
-      storage_type->content,
-      stype->properties);
-
-  xbt_lib_set(storage_type_lib,
-      stype->type_id,
-      ROUTING_STORAGE_TYPE_LEVEL,
-      (void *) stype);
-}
-static void routing_parse_mstorage(sg_platf_mstorage_cbarg_t mstorage)
-{
-  THROW_UNIMPLEMENTED;
-//  mount_t mnt = xbt_new0(s_mount_t, 1);
-//  mnt->id = xbt_strdup(mstorage->type_id);
-//  mnt->name = xbt_strdup(mstorage->name);
-//
-//  if(!mount_list){
-//    XBT_DEBUG("Creata a Mount list for %s",A_surfxml_host_id);
-//    mount_list = xbt_dynar_new(sizeof(char *), NULL);
-//  }
-//  xbt_dynar_push(mount_list,(void *) mnt);
-//  free(mnt->id);
-//  free(mnt->name);
-//  xbt_free(mnt);
-//  XBT_DEBUG("ROUTING Mount a storage name '%s' with type_id '%s'",mstorage->name, mstorage->id);
-}
-
-static void mount_free(void *p)
-{
-  mount_t mnt = p;
-  xbt_free(mnt->name);
-}
-
-static void routing_parse_mount(sg_platf_mount_cbarg_t mount)
-{
-  // Verification of an existing storage
-#ifndef NDEBUG
-  void* storage = xbt_lib_get_or_null(storage_lib, mount->id,ROUTING_STORAGE_LEVEL);
-#endif
-  xbt_assert(storage,"Disk id \"%s\" does not exists", mount->id);
-
-  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->id, mount->name);
-
-  s_mount_t mnt;
-  mnt.id = surf_storage_resource_by_name(mount->id);
-  mnt.name = xbt_strdup(mount->name);
-
-  if(!mount_list){
-    XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
-    mount_list = xbt_dynar_new(sizeof(s_mount_t), mount_free);
-  }
-  xbt_dynar_push(mount_list,&mnt);
-}
-
 static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
 {
   char *host_id, *groups, *link_id = NULL;
@@ -1314,11 +1160,6 @@ void routing_register_callbacks()
   sg_platf_peer_add_cb(routing_parse_peer);
   sg_platf_postparse_add_cb(routing_parse_postparse);
 
-  sg_platf_storage_add_cb(routing_parse_storage);
-  sg_platf_mstorage_add_cb(routing_parse_mstorage);
-  sg_platf_storage_type_add_cb(routing_parse_storage_type);
-  sg_platf_mount_add_cb(routing_parse_mount);
-
   /* we care about the ASes while parsing the platf. Incredible, isnt it? */
   sg_platf_AS_end_add_cb(routing_AS_end);
   sg_platf_AS_begin_add_cb(routing_AS_begin);
index 8fc6756..2736aa9 100644 (file)
@@ -471,6 +471,19 @@ void model_dijkstra_both_end(AS_t as)
 void model_dijkstra_both_parse_route (AS_t asg, const char *src,
                      const char *dst, route_t route)
 {
+    int as_route = 0;
+    if(!route->dst_gateway && !route->src_gateway)
+      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
+    else{
+      XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+             route->src_gateway->name, dst, route->dst_gateway->name);
+      as_route = 1;
+      if(route->dst_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
+          xbt_die("The dst_gateway '%s' does not exist!",route->dst_gateway->name);
+      if(route->src_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
+          xbt_die("The src_gateway '%s' does not exist!",route->src_gateway->name);
+    }
+
        as_dijkstra_t as = (as_dijkstra_t) asg;
     network_element_t src_net_elm, dst_net_elm;
 
@@ -493,21 +506,36 @@ void model_dijkstra_both_parse_route (AS_t asg, const char *src,
        if (as->cached && !as->route_cache)
        as->route_cache = xbt_dict_new_homogeneous(&route_cache_elem_free);
 
-       if( A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES
-               || A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES )
-               xbt_die("Route symmetrical not supported on model dijkstra");
-
-       if(!route->dst_gateway && !route->src_gateway)
-         XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
-       else{
-         XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
-                        route->src_gateway->name, dst, route->dst_gateway->name);
-         if(route->dst_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
-                 xbt_die("The dst_gateway '%s' does not exist!",route->dst_gateway->name);
-         if(route->src_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
-                 xbt_die("The src_gateway '%s' does not exist!",route->src_gateway->name);
-       }
-
        route_t e_route = generic_new_extended_route(asg->hierarchy, route, 1);
        route_new_dijkstra(as, src_net_elm->id, dst_net_elm->id, e_route);
+
+       // Symmetrical YES
+    if ( (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES && as_route == 0)
+         || (A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES && as_route == 1)
+       )
+    {
+      if(!route->dst_gateway && !route->src_gateway)
+        XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dst, src);
+      else
+        XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
+               route->dst_gateway->name, src, route->src_gateway->name);
+
+      xbt_dynar_t nodes = xbt_graph_get_nodes(as->route_graph);
+      xbt_node_t node_s_v = xbt_dynar_get_as(nodes, src_net_elm->id, xbt_node_t);
+      xbt_node_t node_e_v = xbt_dynar_get_as(nodes, dst_net_elm->id, xbt_node_t);
+      xbt_edge_t edge =
+          xbt_graph_get_edge(as->route_graph, node_e_v, node_s_v);
+
+      if (edge)
+        THROWF(arg_error,0,"(AS)Route from '%s' to '%s' already exists",src,dst);
+
+      if (route->dst_gateway && route->src_gateway) {
+        network_element_t gw_tmp;
+        gw_tmp = route->src_gateway;
+        route->src_gateway = route->dst_gateway;
+        route->dst_gateway = gw_tmp;
+      }
+      route_t link_route_back = generic_new_extended_route(asg->hierarchy, route, 0);
+      route_new_dijkstra(as, dst_net_elm->id, src_net_elm->id, link_route_back);
+    }
 }
index 540b5ef..0e770ca 100644 (file)
@@ -250,7 +250,8 @@ static int floyd_pointer_resource_cmp(const void *a, const void *b) {
 void model_floyd_parse_route(AS_t rc, const char *src,
         const char *dst, route_t route)
 {
-       as_floyd_t as = (as_floyd_t) rc;
+    int as_route = 0;
+    as_floyd_t as = (as_floyd_t) rc;
 
        /* set the size of table routing */
        size_t table_size = xbt_dynar_length(rc->index_network_elm);
@@ -282,14 +283,21 @@ void model_floyd_parse_route(AS_t rc, const char *src,
                  TO_FLOYD_LINK(i, j) = NULL;       /* fixed, missing in the previous version */
                }
        }
+    if(!route->dst_gateway && !route->src_gateway)
+      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
+    else{
+        as_route = 1;
+        XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+             route->src_gateway->name, dst, route->dst_gateway->name);
+        if(route->dst_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
+            xbt_die("The dst_gateway '%s' does not exist!",route->dst_gateway->name);
+        if(route->src_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
+            xbt_die("The src_gateway '%s' does not exist!",route->src_gateway->name);
+    }
 
        if(TO_FLOYD_LINK(src_net_elm->id, dst_net_elm->id))
        {
-               if(!route->dst_gateway && !route->src_gateway)
-                       XBT_DEBUG("See Route from \"%s\" to \"%s\"", src, dst);
-               else
-                       XBT_DEBUG("See ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
-                                route->src_gateway->name, dst, route->dst_gateway->name);
+
                char * link_name;
                unsigned int cpt;
                xbt_dynar_t link_route_to_test = xbt_dynar_new(global_routing->size_of_link, NULL);
@@ -307,16 +315,6 @@ void model_floyd_parse_route(AS_t rc, const char *src,
        }
        else
        {
-               if(!route->dst_gateway && !route->src_gateway)
-                 XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
-               else{
-                       XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
-                                route->src_gateway->name, dst, route->dst_gateway->name);
-                       if(route->dst_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
-                               xbt_die("The dst_gateway '%s' does not exist!",route->dst_gateway->name);
-                       if(route->src_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
-                               xbt_die("The src_gateway '%s' does not exist!",route->src_gateway->name);
-               }
            TO_FLOYD_LINK(src_net_elm->id, dst_net_elm->id) =
                        generic_new_extended_route(rc->hierarchy, route, 1);
            TO_FLOYD_PRED(src_net_elm->id, dst_net_elm->id) = src_net_elm->id;
@@ -324,8 +322,9 @@ void model_floyd_parse_route(AS_t rc, const char *src,
                        ((TO_FLOYD_LINK(src_net_elm->id, dst_net_elm->id))->link_list)->used;   /* count of links, old model assume 1 */
        }
 
-       if( A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES
-               || A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES )
+    if ( (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES && as_route == 0)
+         || (A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES && as_route == 1)
+       )
        {
                if(TO_FLOYD_LINK(dst_net_elm->id, src_net_elm->id))
                {
index acee99d..431c3d3 100644 (file)
@@ -160,7 +160,7 @@ void model_full_set_route(AS_t rc, const char *src,
                           const char *dst, route_t route)
 {
   network_element_t src_net_elm, dst_net_elm;
-
+  int as_route = 0;
   src_net_elm = xbt_lib_get_or_null(host_lib, src, ROUTING_HOST_LEVEL);
   dst_net_elm = xbt_lib_get_or_null(host_lib, dst, ROUTING_HOST_LEVEL);
   if (!src_net_elm)
@@ -232,7 +232,7 @@ void model_full_set_route(AS_t rc, const char *src,
 //                         "in a sub-sub-AS is not allowed), "
 //                         "but '%s' is not in '%s'.",
 //                         route->dst_gateway, subas->name);
-
+      as_route = 1;
       XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"",
                 src, route->src_gateway->name, dst, route->dst_gateway->name);
       if (route->dst_gateway->rc_type == SURF_NETWORK_ELEMENT_NULL)
@@ -245,8 +245,9 @@ void model_full_set_route(AS_t rc, const char *src,
     xbt_dynar_shrink(TO_ROUTE_FULL(src_net_elm->id, dst_net_elm->id)->link_list, 0);
   }
 
-  if (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES
-      || A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES) {
+  if ( (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES && as_route == 0)
+       || (A_surfxml_ASroute_symmetrical == A_surfxml_ASroute_symmetrical_YES && as_route == 1)
+     ) {
     if (route->dst_gateway && route->src_gateway) {
       network_element_t gw_tmp;
       gw_tmp = route->src_gateway;
index ca7cd66..4e5a4a7 100644 (file)
@@ -138,6 +138,7 @@ void parse_platform_file(const char *file)
 
   /* Register classical callbacks */
   surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties);
+  storage_register_callbacks();
   routing_register_callbacks();
 
   /* init the flex parser */
index 0df7149..1ff033d 100644 (file)
@@ -311,7 +311,7 @@ static surf_action_t ws_action_open(void *workstation, const char* storage, cons
   return model->extension.storage.open(st, path, mode);
 }
 
-static surf_action_t ws_action_close(void *workstation, const char* storage, m_file_t fp)
+static surf_action_t ws_action_close(void *workstation, const char* storage, surf_file_t fp)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
@@ -319,7 +319,7 @@ static surf_action_t ws_action_close(void *workstation, const char* storage, m_f
   return model->extension.storage.close(st, fp);
 }
 
-static surf_action_t ws_action_read(void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t ws_action_read(void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("READ on disk '%s'",st->generic_resource.name);
@@ -327,7 +327,7 @@ static surf_action_t ws_action_read(void *workstation, const char* storage, void
   return model->extension.storage.read(st, ptr, size, nmemb, stream);
 }
 
-static surf_action_t ws_action_write(void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, m_file_t stream)
+static surf_action_t ws_action_write(void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("WRITE on disk '%s'",st->generic_resource.name);
@@ -335,12 +335,12 @@ static surf_action_t ws_action_write(void *workstation, const char* storage, con
   return model->extension.storage.write(st,  ptr, size, nmemb, stream);
 }
 
-static surf_action_t ws_action_stat(void *workstation, const char* storage, int fd, void* buf)
+static surf_action_t ws_action_stat(void *workstation, const char* storage, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("STAT on disk '%s'",st->generic_resource.name);
   surf_model_t model = st->generic_resource.model;
-  return model->extension.storage.stat(st,  fd, buf);
+  return model->extension.storage.stat(st,  stream);
 }
 
 static void surf_workstation_model_init_internal(void)
index fe7fc39..a22e515 100755 (executable)
@@ -409,10 +409,10 @@ foreach my $file (@allfiles) {
                                $tmp_buff .= '          <li><a href="modules.html"><span>Modules&#160;API</span></a></li>'."\n";
                        $tmp_buff .= '          <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>'."\n";
                                $tmp_buff .= '          <li><a href="options.html"><span>Options & configurations</span></a></li>'."\n";
-                               $tmp_buff .= '          <li><a href="platform.html"><span>Platform description</span></a></li>'."\n";
+                               $tmp_buff .= '          <li><a href="platform.html"><span>Platform Description</span></a></li>'."\n";
                                $tmp_buff .= '          <li><a href="tracing.html"><span>Tracing Simulations</span></a></li>'."\n";
                                $tmp_buff .= '          <li><a href="bindings.html"><span>Bindings</span></a></li>'."\n";
-                               $tmp_buff .= '          <li><a href="pls.html"><span>Packet level simulation</span></a></li>'."\n";
+                               $tmp_buff .= '          <li><a href="pls.html"><span>Packet Level Simulation</span></a></li>'."\n";
                                $tmp_buff .= '          </ul></div>'."\n";
                                $tmp_buff .= '      </div>'."\n";
                                
index a3526ed..877d527 100644 (file)
@@ -14,7 +14,6 @@ struct s_smx_process_t {
   smx_action_t waiting_action;  
   xbt_fifo_t comms;       
   xbt_dict_t properties;
-  s_smx_simcall_t simcall;
   
 
 } s_smx_process_t;
index 4de4567..9c78251 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "xbt.h"
 #include "xbt/datadesc.h"
+#include "xbt/file_stat.h"
 #include "../../src/xbt/datadesc/datadesc_private.h" // RAAAAH! ugly relative path, but it's late, I want it to be done NOW.
 #include "simix/datatypes.h"
 #include "../../src/simix/smx_smurf_private.h" // RAAAAH! ugly relative path, but it's even later and it still doesn't work
@@ -126,7 +127,7 @@ int main(int argc, char** argv) {
     exit(1);
   }
 
-  parse_from_file("s_smx_simcall_t");
+//  parse_from_file("s_smx_simcall_t");
   parse_from_file(argv[1]);
 
   int cpt;