X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fb1bec45d6f1bf8ec6e487b68d8c505d87a4e251..8344f32ee2339f2b53a6e79ac0e9aa3a93384f58:/tools/simgrid-monkey diff --git a/tools/simgrid-monkey b/tools/simgrid-monkey index d5cd721a21..c5699eaa8f 100755 --- a/tools/simgrid-monkey +++ b/tools/simgrid-monkey @@ -1,6 +1,6 @@ #! /usr/bin/env python3 -# The goal is to introduce random failures in a simulation, to test simgrid under extreme conditions. +# The goal is to introduce random failures in a simulation, to test SimGrid under extreme conditions. # # It is made of several components. # @@ -13,15 +13,15 @@ # Kill the link #0 after 42 seconds (using a kernel::Timer) # # * a python script: tools/simgrid-monkey (this file) -# * It takes a regular simgrid simulation as a parameter, use the cmonkey plugin to get the information about it, +# * It takes a regular SimGrid simulation as a parameter, use the cmonkey plugin to get the information about it, # and then restart many runs, with one resource being turn_off() + turn_on() in each run. # * Each resource gets killed between each timestamps, and on each timestamp. # * So the amount of simulations is: 1 + (host_c+link_c) * timestamps * 2 # # * Test program, written to resist these extreme conditions: -# * teshsuite/s4u/monkey-masterworkers: tests synchronous comms and execs +# * teshsuite/s4u/monkey-masterworkers: tests synchronous comms and execs (C++ and python) +# * teshsuite/s4u/monkey-semaphore: tests async semaphores (C++ only) -import multiprocessing as mp import sys import os import argparse @@ -65,7 +65,7 @@ def get_info(cmd): #print(f"hosts:{host_count} links:{link_count} timestamps:{' '.join(([str(i) for i in timestamps]))}") return (host_count, link_count, timestamps) -parser = argparse.ArgumentParser(description='Run a simgrid simulation, and turn off/on resources at random.') +parser = argparse.ArgumentParser(description='Run a SimGrid simulation, and turn off/on resources at random.') parser.add_argument('--valgrind', help="Run the simulations in valgrind") parser.add_argument('command', nargs='*') args = parser.parse_args() @@ -93,7 +93,7 @@ def do_run(cmd, extra_params, test_todo): msg = f"ERROR (retcode: {run.returncode}). Output:\n" msg += out print(msg) - os.exit(1) + sys.exit(1) for line in out.split("\n"): if re.match("==.* in use at exit: ", line) and not re.match("==.* in use at exit: 0 bytes in 0 blocks", line): m = re.match("==.* in use at exit: (.*)", line) @@ -110,7 +110,6 @@ def do_run(cmd, extra_params, test_todo): def doit(): prev_time = 0 - test_count = 0 test_todo = 2 * len(timestamps) * (host_count + link_count) for pos in range(len(timestamps)): now = timestamps[pos]