... like non-breaking spaces and ligatures, that broke the LaTeX doc.
\section bindings_binding_lua Lua Binding
Most of Simgrid modules require a good level in C programming, since simgrid is used to be as standard C library.
- Sometime users prefer using some kind of « easy scripts » or a language easier to code with, for their works,
+ Sometime users prefer using some kind of “easy scripts” or a language easier to code with, for their works,
which avoid dealing with C errors, and sometime an important gain of time.
Besides Java Binding, Lua and Ruby bindings are available since version 3.4 of Simgrid
for MSG Module, and we are currenlty working on bindings for other modules.
the full example is distributed in the file examples/lua/master_slave_bypass.lua
- */
\ No newline at end of file
+ */
Another strange thing is that you should actually free the memory allocated
to the exception with xbt_ex_fres() if you manage to deal with them. There
is a bit more than this on the picture (#TRY_CLEANUP blocks, for example), and
-you should check the section \ref XBT_ex for more details.
+you should check the section \ref XBT_ex for more details.
You should be <b>very carfull</b> when using the exceptions. They work great
when used correctly, but there is a few golden rules you should never break.
<b>host</b> attributes :
\li <b>id (mandatory)</b>: the identifier of the host to be used when referring to it.
-\li <b>power (mandatory)</b>:the peak number FLOPS the CPU can manage. Expressed in flop/s.
+\li <b>power (mandatory)</b>:the peak number FLOPS the CPU can manage. Expressed in flop/s.
\li <b>core</b>: The number of core of this host. If setted, the power gives the power of one core. The specified computing power will be available to up to 6 sequential
tasks without sharing. If more tasks are placed on this host, the
resource will be shared accordingly. For example, if you schedule 12
\endverbatim
<b>Expressing sharing policy</b>
-By default a network link is SHARED, that is if more than one flow go through
+By default a network link is SHARED, that is if more than one flow go through
a link, each gets a share of the available bandwidth similar to the share TCP connections offers.
-Conversely if a link is defined as a FATPIPE, each flow going through this link will get all the available bandwidth, whatever the number of flows. The FATPIPE
+Conversely if a link is defined as a FATPIPE, each flow going through this link will get all the available bandwidth, whatever the number of flows. The FATPIPE
behavior allows to describe big backbones that won't affect performances (except latency). Finally a link can be considered as FULLDUPLEX, that means that in the simulator, 2 links (one named UP and the other DOWN) will be created for each link, so as the transfers from one side to the other will interact similarly as TCP when ACK returning packets circulate on the other direction. More discussion about it is available in <b>link_ctn</b> description.
\verbatim
<b>Expressing dynamicity and failures</b>
- As for hosts, it is possible to declare links whose state, bandwidth or latency change over the time. In this case, the bandwidth and latency attributes are respectively replaced by the bandwidth file and latency file attributes and the corresponding text files.
+ As for hosts, it is possible to declare links whose state, bandwidth or latency change over the time. In this case, the bandwidth and latency attributes are respectively replaced by the bandwidth file and latency file attributes and the corresponding text files.
\verbatim
<link id="LINK1" state_file="link1.fail" bandwidth="80000000" latency=".0001" bandwidth_file="link1.bw" latency_file="link1.lat" />
\endverbatim
-It has to be noted that even if the syntax is the same, the semantic of bandwidth and latency trace files
-differs from that of host availability files. Those files do not express availability as a fraction of the available
+It has to be noted that even if the syntax is the same, the semantic of bandwidth and latency trace files
+differs from that of host availability files. Those files do not express availability as a fraction of the available
capacity but directly in bytes per seconds for the bandwidth and in seconds for the latency. This is because
most tools allowing to capture traces on real platforms (such as NWS ) express their results this way.
Routers are naturally an important concept in GTNetS or ns-3 since the way they run the packet routing algorithms is actually simulated. Instead, the
SimGrid’s analytical models aggregate the routing time with the transfer time.
-Rebuilding a graph representation only from the route information turns to be a very difficult task, because
+Rebuilding a graph representation only from the route information turns to be a very difficult task, because
of the missing information about how routes intersect. That is why we introduced a \<router\> tag, which is
simply used to express these intersection points. The only attribute accepted by this tag an id.
It is important to understand that the \<router\> tag is only used to provide topological information.
#! /usr/bin/perl
# L.Bobelin (Perl newbie) 25th of November
-# Quick script to generate hierarchical clusters. Usage : <the script> p s d where :
+# Quick script to generate hierarchical clusters. Usage : <the script> p s d where :
# - p : 2^p gives the total number of hosts.
-# - s : cluster size
-# - d : degree of inner nodes.
+# - s : cluster size
+# - d : degree of inner nodes.
+#
+# output is the standard one.
#
-# output is the standard one.
-#
#
#Each node is numbered by a DFS in the tree. Each cluster is numbered by the DFS number of the leaf it is attached to and the number of cluster for each leaf.
# Other infos :
# - Same bb_lat used for any routers inside (not that complicated to modify too).
# - constants defined in the first part of the script corresponding to classic cluster parameters. links_bw and links_lat added for the inner tree links
# - bb_lat and bb_bw used in any backbone of the tree.
-# - fails if you set an obviously too small total number of hosts compared to the cluster size (generates a lot of stuff for nothing actually).
-#
+# - fails if you set an obviously too small total number of hosts compared to the cluster size (generates a lot of stuff for nothing actually).
+#
use Math::BigInt;
# print STDERR "totalnumberofcluster: " . $totalnumberofCluster . "\n";
# print STDERR "last cluster size (if equals to cluster size, then all clusters will be homogeneous) : " . $last . "\n";
-# Counter for giving unique IDs to ASes.
+# Counter for giving unique IDs to ASes.
$ASnumber;
$ASnumber = 0;
-# Printing preamble
+# Printing preamble
print "<?xml version='1.0'?>\n";
print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
print "<platform version=\"3\">\n\n";
sub DF_creation {
my($currDepth) = @_;
- # Curr AS creation
+ # Curr AS creation
print "<AS id=\"". $prefix . "AS_" . $ASnumber . $suffix . "\" routing=\"Full\">\n";
- # Curr router AS creation stuff
+ # Curr router AS creation stuff
print "<AS id=\"". $prefix . "exitAS_" . $ASnumber . $suffix . "\" routing=\"Full\">\n";
print " <router id=\"" . $prefix . "router_" . $ASnumber . $suffix . "\"/>\n";
print "</AS>\n";
- # Saving my current number to return it to my father
+ # Saving my current number to return it to my father
my $toReturn = $ASnumber;
$ASnumber++;
if ($currDepth<=$height && $totalnumberofCluster > 0)
}
$totalnumberofCluster--;
}
- # Creating links to clusters
+ # Creating links to clusters
for(my $i = 1; $i <= $lastNumberOfClusterCreated ; $i++) {
print "<link id=\"". $prefix . $toReturn . "_" . $i . $suffix . "\" bandwidth=\"" . $links_bw . "\" latency=\"" . $links_lat . "\"/>\n";
}
# curr backbone creation
print "<link id=\"". $prefix . "bb_" . $toReturn . $suffix . "\" bandwidth=\"" . $bb_bw . "\" latency=\"" . $bb_lat . "\"/>\n";
- # I must create routes between clusters now
+ # I must create routes between clusters now
for (my $i =1; $i<=$lastNumberOfClusterCreated ; $i++)
{
for (my $j =$i+1; $j<=$lastNumberOfClusterCreated ; $j++)
{
print "<ASroute src=\"" . $prefix . "cl_" . $toReturn . "_" . $i . $suffix . "\"\n";
print " dst=\"" . $prefix . "exitAS_" . $toReturn . $suffix . "\"\n";
- # SAME HERE !!
+ # SAME HERE !!
print " gw_src=\"" . $prefix . "c_" . $toReturn . "_" . $i . "-" . $prefix . "cl_" . $toReturn . "_" . $i . $suffix . "_router" . $suffix ."\"\n";
print " gw_dst=\"" . $prefix . "router_" . $toReturn . $suffix . "\"\n";
print " symmetrical=\"YES\">\n";
print "</ASroute>\n";
}
print "</AS>\n";
- # Should be done with it...
+ # Should be done with it...
return $toReturn;
}
#! /usr/bin/perl
# L.Bobelin (Perl newbie) 24th of November
-# Quick script to generate hierarchical clusters. Usage : add the special cluster tag (description below) in your "normal" platform file. Then run the script :
+# Quick script to generate hierarchical clusters. Usage : add the special cluster tag (description below) in your "normal" platform file. Then run the script :
# - First arg : the input file where you midified your cluster tag
-# - Second one : the output file where all the stuff will be generated.
-# Builds a complete tree to access clusters ; each node of the tree is inclosed in an AS, where full routing applies.
+# - Second one : the output file where all the stuff will be generated.
+# Builds a complete tree to access clusters ; each node of the tree is inclosed in an AS, where full routing applies.
#
# Number of cluster per leaf is given by cabinetnodes attr.
#
# - nbsons : degree of inner
# - height : tree heigth
# - cabinetnodes : cluster per leaf
-#
-# Each node is numbered by a DFS in the tree. Each cluster is numbered by the DFS number of the leaf it is attached to and the number of cluster for each leaf.
-#
-#
+#
+# Each node is numbered by a DFS in the tree. Each cluster is numbered by the DFS number of the leaf it is attached to and the number of cluster for each leaf.
+#
+#
# Example syntax for hierarchical cluster creation :
# <cluster id="AS_cb1" prefix="cb1-" suffix=".dc1.acloud.com" power="5.2297E9" bw="1.25E8" lat="1.0E-4 bb_bw="1.25E9" bb_lat="1.0E-4" radical="0-99" cabinetnodes="4" height="3" nbsons="2" links_lat="1.0E-4" links_bw="1.25E9"/>
# Other infos :
-# - special tag has to be on one line because I don't want to bother with parsing issues
+# - special tag has to be on one line because I don't want to bother with parsing issues
# - Same bb_lat used for any routers inside (not that complicated to modify too)
# - lame perl ? I'm a script kiddie in perl, it may well be my first perl stuff.
# - Don't try to check or validate the modified file with the DTD, of course, as this is not a part of it.
-# Counter for giving unique IDs to ASes.
+# Counter for giving unique IDs to ASes.
$ASnumber;
$ASnumber = 0;
sub DF_creation {
my($currDepth) = @_;
- # Curr AS creation
+ # Curr AS creation
print OUT "<AS id=\"". $prefix . "AS_" . $ASnumber . $suffix . "\" routing=\"Full\">\n";
- # Curr router AS creation stuff
+ # Curr router AS creation stuff
print OUT "<AS id=\"". $prefix . "exitAS_" . $ASnumber . $suffix . "\" routing=\"Full\">\n";
print OUT " <router id=\"" . $prefix . "router_" . $ASnumber . $suffix . "\"/>\n";
print OUT "</AS>\n";
- # Saving my current number to return it to my father
+ # Saving my current number to return it to my father
my $toReturn = $ASnumber;
$ASnumber++;
if ($currDepth<$height)
print OUT "<cluster id=\"". $prefix . "cluster_" . $toReturn . $i . $suffix . "\" prefix=\"" . $prefix . "c_" . $toReturn. $i . "-\" suffix=\"" . $suffix . "\" radical=\""
. $radical . "\" power=\"" . $power . "\" bw=\"" . $bw . "\" lat=\"" . $lat . "\" bb_bw=\"" . $bb_bw . "\" bb_lat=\"" . $bb_lat . "\"/>\n";
}
- # Creating links to clusters
+ # Creating links to clusters
for(my $i = 1; $i <= $cabinetnodes; $i++) {
print OUT "<link id=\"". $prefix . $toReturn . "_" . $i . $suffix . "\" bandwidth=\"" . $links_bw . "\" latency=\"" . $links_lat . "\"/>\n";
}
# curr backbone creation
print OUT "<link id=\"". $prefix . "bb_" . $toReturn . $suffix . "\" bandwidth=\"" . $bb_bw . "\" latency=\"" . $bb_lat . "\"/>\n";
- # I must create routes between clusters now
+ # I must create routes between clusters now
for (my $i =1; $i<=$cabinetnodes ; $i++)
{
for (my $j =$i+1; $j<=$cabinetnodes ; $j++)
{
print OUT "<ASroute src=\"" . $prefix . "cluster_" . $toReturn . $i . $suffix . "\"\n";
print OUT " dst=\"" . $prefix . "exitAS_" . $toReturn . $suffix . "\"\n";
- # SAME HERE !!
+ # SAME HERE !!
print OUT " gw_src=\"" . $prefix . "c_" . $toReturn. $i . "-" . $prefix . "cluster_" . $toReturn . $i . $suffix . "_router" . $suffix ."\"\n";
print OUT " gw_dst=\"" . $prefix . "router_" . $toReturn . $suffix . "\"\n";
print OUT " symmetrical=\"YES\">\n";
print OUT "</ASroute>\n";
}
print OUT "</AS>\n";
- # Should be done with it...
+ # Should be done with it...
return $toReturn;
}
SG_END_DECL()
-/** @} */
+/** @} */
#endif /* __XBT_EX_H__ */
XBT_PUBLIC(char *) xbt_str_from_file(FILE * file);
-/** @brief Classical alias to (char*)
+/** @brief Classical alias to (char*)
*
* This of almost no use, beside cosmetics and the XBT datadesc parsing macro (see \ref XBT_dd_auto).
*/
"\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) -c -o $@ $<\n" "\n");
fprintf(OUT,
- "## Rules for tarballs and cleaning\n"
+ "## Rules for tarballs and cleaning\n"
"DIST_FILES= $(EXTRA_DIST) $(GENERATED_C_FILES) $(PRECIOUS_C_FILES) "
MAKEFILE_FILENAME_LOCAL " " /*MAKEFILE_FILENAME_REMOTE */ "\n"
"distdir: $(DIST_FILES)\n" "\trm -rf $(DISTDIR)\n"
* r Open text file for reading. The stream is positioned at the beginning of the file.
* r+ Open for reading and writing. The stream is positioned at the beginning of the file.
* w Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.
- * w+ Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the begin‐
- * ning of the file.
+ * w+ Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the
+ * beginning of the file.
* a Open for appending (writing at end of file). The file is created if it does not exist. The stream is positioned at the end of the file.
* 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.
}
/**
- * \brief Returns the latency of the route between two workstations, i.e. the sum of all link latencies
+ * \brief Returns the latency of the route between two workstations, i.e. the sum of all link latencies
* between the workstations.
*
* \param src the first workstation
}
/**
- * \brief Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all
+ * \brief Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all
* between the workstations.
*
* \param src the first workstation
}
-/** @brief remove the given node from the given graph */
+/** @brief remove the given node from the given graph */
void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n,
void_f_pvoid_t node_free_function,
void_f_pvoid_t edge_free_function)
return;
}
-/** @brief remove the given edge from the given graph */
+/** @brief remove the given edge from the given graph */
void xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e,
void_f_pvoid_t free_function)
{
}
-/** \brief Creates a new matrix of double filled with zeros */
+/** \brief Creates a new matrix of double filled with zeros */
xbt_matrix_t xbt_matrix_double_new_zeros(int lines, int rows)
{
xbt_matrix_t res = xbt_matrix_new(lines, rows, sizeof(double), NULL);
return res;
}
-/** \brief Creates a new matrix of double being the identity matrix */
+/** \brief Creates a new matrix of double being the identity matrix */
xbt_matrix_t xbt_matrix_double_new_id(int lines, int rows)
{
xbt_matrix_t res = xbt_matrix_double_new_zeros(lines, rows);
return res;
}
-/** \brief Creates a new matrix of double randomly filled */
+/** \brief Creates a new matrix of double randomly filled */
xbt_matrix_t xbt_matrix_double_new_rand(int lines, int rows)
{
xbt_matrix_t res = xbt_matrix_new(lines, rows, sizeof(double), NULL);
return res;
}
-/** \brief Creates a new matrix of double containing the sequence of numbers in order */
+/** \brief Creates a new matrix of double containing the sequence of numbers in order */
xbt_matrix_t xbt_matrix_double_new_seq(int lines, int rows)
{
xbt_matrix_t res = xbt_matrix_new(lines, rows, sizeof(double), NULL);
return res;
}
-/** \brief Checks whether the matrix contains the sequence of numbers */
+/** \brief Checks whether the matrix contains the sequence of numbers */
int xbt_matrix_double_is_seq(xbt_matrix_t mat)
{
int i;
"\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) -c -o $@ $<\n" "\n");
fprintf(FICOUT,
- "## Rules for tarballs and cleaning\n"
+ "## Rules for tarballs and cleaning\n"
"DIST_FILES= $(EXTRA_DIST) $(GENERATED_C_FILES) $(PRECIOUS_C_FILES) "
MAKEFILE_FILENAME_LOCAL " " /*MAKEFILE_FILENAME_REMOTE */ "\n"
"distdir: $(DIST_FILES)\n" "\trm -rf $(DISTDIR)\n"
last if /SGU: BEGIN SUITES DECLARATION/;
}
- ### Done with prototypes. And now, the actual code
+ ### Done with prototypes. And now, the actual code
# search my prototype
while (<IN>) {