Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 11:26:50 +0000 (13:26 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 11:26:50 +0000 (13:26 +0200)
NEWS
examples/gras/mmrpc/mmrpc_client.c
examples/gras/mmrpc/mmrpc_server.c
src/bindings/lua/lua_state_cloner.h
src/bindings/lua/lua_utils.h
src/bindings/lua/simgrid_lua.h
tools/tesh/basic.tesh
tools/tesh/basic2.tesh
tools/tesh/run_context.c

diff --git a/NEWS b/NEWS
index 275c32f..7c856bf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,38 +1,39 @@
-     _____ _ __ ___(_) ___  _ __   |___ /|___  |
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   / / 
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | / /  
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_/   
-                                                
+                    _               ____  _____
+__   _____ _ __ ___(_) ___  _ __   |___ /|___  |
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   / /
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | / /
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_/
+
  (still to be done)
-                    _               _____  __    ____  
-__   _____ _ __ ___(_) ___  _ __   |___ / / /_  |___ \ 
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \   __) | 
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) | / __/  
+                    _               _____  __    ____
+__   _____ _ __ ___(_) ___  _ __   |___ / / /_  |___ \
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \   __) |
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) | / __/
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___(_)_____|
                 Oct 5 2011
 
 The "Not coding new stuff allows to polish old things" release.
 
  * Portability to Mac and Windows improved.
- * Possible misconfigurations (contextes, libPCRE) made impossible by 
+ * Possible misconfigurations (contextes, libPCRE) made impossible by
    removing the option or providing sane default value.
  * Exerimental support to NS3 simulator as a backend.
-                    _               _____  __    _ 
+
+                    _               _____  __    _
 __   _____ _ __ ___(_) ___  _ __   |___ / / /_  / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \ | |
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) || |  
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) || |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___(_)_|
-                Jun 27 2011  
-                                                   
-The "Oops, we broke Macs too" release. 
+                Jun 27 2011
+
+The "Oops, we broke Macs too" release.
 Bug fix to an issue preventing SimGrid from working on Mac OSX.
 
-                    _               _____  __   
-__   _____ _ __ ___(_) ___  _ __   |___ / / /_  
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \ 
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) |         
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___/ 
+                    _               _____  __
+__   _____ _ __ ___(_) ___  _ __   |___ / / /_
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) |
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___/
                 Jun 21 2011
 
 The "OMG! They Killed Kenny!" version. Major changes:
@@ -49,12 +50,12 @@ The "OMG! They Killed Kenny!" version. Major changes:
  * Improved SMPI: Faster Fortran, automatic privatization of C globals
  * Tracing: trace contains the full platform hierarchy
    exactly as declared using the ASes of the platform file
+
 Plus numerous other goodies (check the ChangeLog for details)
 
-                    _               _____  ____                    
-__   _____ _ __ ___(_) ___  _ __   |___ / | ___| 
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ |___ \ 
+                    _               _____  ____
+__   _____ _ __ ___(_) ___  _ __   |___ / | ___|
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ |___ \
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/
                 01 Dec 2010
@@ -77,7 +78,7 @@ Major changes are:
     - Windows port: should be usable now but still considered experimental
     - Autotools have now been completely removed
 
-                    _               _____ _  _    _ 
+                    _               _____ _  _    _
 __   _____ _ __ ___(_) ___  _ __   |___ /| || |  / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| || |_ | |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) |__   _|| |
@@ -85,28 +86,28 @@ __   _____ _ __ ___(_) ___  _ __   |___ /| || |  / |
                 04 May 2010
 
 The "Polishing easter eggs is probably a good idea" release.
-This is a bug fixes release only. 
-                    _               _____ _  _   
-__   _____ _ __ ___(_) ___  _ __   |___ /| || |  
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| || |_ 
+This is a bug fixes release only.
+                    _               _____ _  _
+__   _____ _ __ ___(_) ___  _ __   |___ /| || |
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| || |_
  \ V /  __/ |  \__ \ | (_) | | | |  ___) |__   _|
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_) |_|  
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_) |_|
                 28 Apr 2010
 
 The "Easter in Cargese" release. Also known as (major changes):
+
  * the "se habla Java, Ruby 話せます, fala-se Lua (and deaf-friendly)"
    ~> bindings were greatly improved
    ~> new tracing infrastructure for better visualization introduced
-    
+
  * the "Welcome to configury modernity" release.
    ~> we switched from autotools to cmake, and improved our cdash
-   
-                    _               _____  _____ _  _   
-__   _____ _ __ ___(_) ___  _ __   |___ / |___ /| || |  
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \| || |_ 
+
+                    _               _____  _____ _  _
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ /| || |
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \| || |_
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |__   _|
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_) |_|  
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_) |_|
                 24 Dec 2009
 
 The "Desktop Grid needs love too" release (also called "Xmas release").
@@ -116,24 +117,24 @@ Most important changes:
  * Simix network module for internal cleanups
  * Load DAX of applications into SimDag
  * Lot of small cleanups and other bug fixes
-                    _               _____  _____  _____ 
-__   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ / 
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \   |_ \ 
+
+                    _               _____  _____  _____
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ /
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \   |_ \
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) | ___) |
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)____/ 
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)____/
                 20 Aug 2009
-               
+
 The "Need for Speed" release.
 Big speedup through some function inlining.
 
-                    _               _____  _____  ____  
-__   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ \ 
+                    _               _____  _____  ____
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \   __) |
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) | / __/ 
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) | / __/
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)_____|
                 19 Aug 2009
-               
+
 The "Simplicity does not preceed complexity, but follows it" release.
 Most important changes:
  * surf and simix modules reworked for simplification.
@@ -142,7 +143,7 @@ Most important changes:
 
 On the way, we gained a bit more than 5% on the classical master/slave
 example. More to come on this in future releases.
-                    _               _____  _____  _ 
+                    _               _____  _____  _
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ / / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ | |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) || |
@@ -151,10 +152,10 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ / / |
 
 This dot release is mainly a maintainance one. Most important changes:
  * We fixed a large amount of bugs all around
+
  * We sanitized the way configuration is handled internally.
    Try passing --cfg-help to binaries compiled against this version.
-   
+
  * SMPI is in better shape: lot of bugs fixing & usability improvements
    It may be worth trying it (even if all bugs are not gone yet)
 
@@ -162,17 +163,17 @@ This version may have a bit more of memleaks than 3.3. This will be
 fixed in a latter release.
 
 
-     ____  _            ____      _     _ 
+     ____  _            ____      _     _
     / ___|(_)_ __ ___  / ___|_ __(_) __| |
     \___ \| | '_ ` _ \| |  _| '__| |/ _` |
      ___) | | | | | | | |_| | |  | | (_| |
-    |____/|_|_| |_| |_|\____|_|  |_|\__,_|                                       
-                    _               _____  _____ 
-__   _____ _ __ ___(_) ___  _ __   |___ / |___ / 
-\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ 
- \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |  
+    |____/|_|_| |_| |_|\____|_|  |_|\__,_|
+                    _               _____  _____
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ /
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/
-               _             _           _ 
+               _             _           _
      _  _ _ _ | |___ __ _ __| |_  ___ __| |
     | || | ' \| / -_) _` (_-< ' \/ -_) _` |
      \_,_|_||_|_\___\__,_/__/_||_\___\__,_|
@@ -184,22 +185,22 @@ download: http://gforge.inria.fr/frs/?group_id=12
 At least, after 2 years of hard work, we managed to release the 3.3
 version of the SimGrid framework. There is so many changes that the
 changelog only lists the most important ones, leaving alone the small
-improvements, bug fixing and new gadgets. 
+improvements, bug fixing and new gadgets.
 
 In short:
  * Java bindings
  * New simulation models, and improvement of the GTNetS wrapper
+
  * Large memory savings (mainly in parser)
  * Faster (twice faster is not uncommon, and from 20 hours to 2
            minutes on very large scenarios)
  * Much better scalability (tested up to 250,000 processes)
+
  * Complete regression testing framework so that you can trust the tool
  * Lot of neat new modules in the XBT toolbox
+
 This version was throughfully tested on linux 32bits and 64bits
-(debian), as well as Mac OSX (leopard). 
+(debian), as well as Mac OSX (leopard).
 
 Unfortunately, our windows-guy left, and we cannot release the windows
 version at the same time than the other archs. Any help would be
@@ -209,7 +210,7 @@ Some of the 96 included test suites are known to fail, but everything
 should work anyway (don't panic):
  * The amok module does not work in real deployment ATM, but I don't
    see this as release critical since I'm not aware of anyone needing
-   this right now   
+   this right now
  * Some tests about the ability of GRAS to receive messages from
    exotic platforms fail because I've lost access to these platforms
    (such as AIX)
@@ -218,7 +219,7 @@ should work anyway (don't panic):
  * the tesh auto-tests "fail" on Mac OSX. This is because "rm -rf" is
    sometimes too verbose (when the OS creates hidden files, I
    suspect), but tesh definitly work as the rest on this arch.
-   
+
 We hope to manage to do more timely releases in the future, even if
 that may turn out difficult since big stuff is comming (I don't say
 much here for the suspense ;)
index ec62e36..4719e1d 100644 (file)
@@ -37,7 +37,10 @@ int client(int argc, char *argv[])
 
   XBT_INFO("Launch client (server on %s:%d)", host, port);
 
-  /* 3. Create a socket to speak to the server */
+  /* 3. Register the messages (before use) */
+  mmrpc_register_messages();
+
+  /* 4. Create a socket to speak to the server */
   while (!connected) {
     TRY {
       toserver = gras_socket_client(host, port);
@@ -52,10 +55,6 @@ int client(int argc, char *argv[])
   }
   XBT_INFO("Connected to %s:%d.", host, port);
 
-
-  /* 4. Register the messages (before use) */
-  mmrpc_register_messages();
-
   /* 5. Keep the user informed of what's going on */
   XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
index 7784d04..bcaf5f1 100644 (file)
@@ -51,7 +51,13 @@ int server(int argc, char *argv[])
     port = atoi(argv[1]);
   }
 
-  /* 3. Create my master socket */
+  /* 3. Register the known messages and payloads. */
+  mmrpc_register_messages();
+
+  /* 4. Register my callback */
+  gras_cb_register("request", &server_cb_request_handler);
+
+  /* 5. Create my master socket */
   XBT_INFO("Launch server (port=%d)", port);
   TRY {
     sock = gras_socket_server(port);
@@ -60,12 +66,6 @@ int server(int argc, char *argv[])
     RETHROWF("Unable to establish a server socket: %s");
   }
 
-  /* 4. Register the known messages and payloads. */
-  mmrpc_register_messages();
-
-  /* 5. Register my callback */
-  gras_cb_register("request", &server_cb_request_handler);
-
   /* 6. Wait up to 10 minutes for an incomming message to handle */
   gras_msg_handle(600.0);
 
index 194cbb1..57b8599 100644 (file)
@@ -4,6 +4,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#ifndef LUA_STATE_CLONER_H
+#define LUA_STATE_CLONER_H
+
 /* SimGrid Lua state management                                             */
 #include <lua.h>
 
@@ -11,3 +14,5 @@ int sglua_is_maestro(lua_State* L);
 lua_State* sglua_get_maestro(void);
 lua_State* sglua_clone_maestro(void);
 void sglua_move_value(lua_State* src, lua_State* dst);
+
+#endif  /* LUA_STATE_CLONER_H */
index 49f8e4d..a57eebc 100644 (file)
@@ -6,6 +6,9 @@
 
 /* SimGrid Lua helper functions                                             */
 
+#ifndef LUA_UTILS_H
+#define LUA_UTILS_H
+
 #include <lua.h>
 
 /**
@@ -24,3 +27,5 @@ const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index
 void sglua_stack_dump(const char *msg, lua_State* L);
 const char* sglua_get_spaces(int length);
 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
+
+#endif  /* LUA_UTILS_H */
index 4a04ae8..527e4b8 100644 (file)
@@ -1,8 +1,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef GRAS_STUB_GENERATOR_H
-#define GRAS_STUB_GENERATOR_H
+#ifndef SIMGRID_LUA_H
+#define SIMGRID_LUA_H
 
 #include <stdio.h>
 #include <lauxlib.h>
@@ -110,4 +110,4 @@ int console_parse_platform(void);
 int console_parse_application(void);
 int console_parse_platform_wsL07(void);
 
-#endif
+#endif  /* SIMGRID_LUA_H */
index d26a68e..d8c8f68 100644 (file)
@@ -34,12 +34,18 @@ $ ${bindir:=.}/tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' basi
 > Enable coverage
 > Test suite `basic2'
 > [basic2:3] Test sorting and filtering of output
-> [basic2:5] printf 'a\\nb\\nc\\nd\\n'
-> [basic2:11] printf 'a\\nb\\nc\\nd'
-> [basic2:18] printf 'c\\nd\\nb\\na\\n'
-> [basic2:25] printf 'c\\nd\\nb\\na'
-> [basic2:31] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n'
-> [basic2:37] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz'
-> [basic2:44] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n'
-> [basic2:51] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz'
+> [basic2:5] true
+> [basic2:8] true
+> [basic2:10] printf 'profiling: foo\\n'
+> [basic2:12] printf 'profiling: foo'
+> [basic2:15] printf 'profiling: foo\\n'
+> [basic2:18] printf 'profiling: foo'
+> [basic2:20] printf 'a\\nb\\nc\\nd\\n'
+> [basic2:26] printf 'a\\nb\\nc\\nd'
+> [basic2:33] printf 'c\\nd\\nb\\na\\n'
+> [basic2:40] printf 'c\\nd\\nb\\na'
+> [basic2:46] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n'
+> [basic2:52] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz'
+> [basic2:59] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n'
+> [basic2:66] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz'
 > Test suite `basic2' OK
index 9e08b11..b95065e 100644 (file)
@@ -2,6 +2,21 @@
 
 p Test sorting and filtering of output
 
+$ true
+
+! output sort
+$ true
+
+$ printf 'profiling: foo\\n'
+
+$ printf 'profiling: foo'
+
+! output sort
+$ printf 'profiling: foo\\n'
+
+! output sort
+$ printf 'profiling: foo'
+
 $ printf 'a\\nb\\nc\\nd\\n'
 > a
 > b
index fa0c8ac..f734a41 100644 (file)
@@ -727,7 +727,7 @@ void *rctx_wait(void *r)
     if (rctx->output_sort) {
       xbt_dynar_sort(b, cmpstringp);
       /* If empty lines moved in first position, remove them */
-      while (*xbt_dynar_getfirst_as(b, char *) == '\0')
+      while (!xbt_dynar_is_empty(b) && *xbt_dynar_getfirst_as(b, char*) == '\0')
         xbt_dynar_shift(b, NULL);
     }