Skip to content
Snippets Groups Projects
Commit 6795360f authored by erwan's avatar erwan
Browse files

Fix: the step number during fault injection was wrong + wrong nodes were enabled

parent 8eca03d9
No related branches found
No related tags found
No related merge requests found
Pipeline #46841 passed
......@@ -79,7 +79,7 @@ let (simustep: int -> int -> SasArg.t -> string ->
let pl = fst(List.split p_nl_l) in
List.iter (List.iter (fun b -> if b then incr moves)) enab_ll;
let e =
let e, all, enab_ll =
if
not (args.rif) && List.for_all (fun b -> not b) (List.flatten enab_ll)
then (
......@@ -92,10 +92,13 @@ let (simustep: int -> int -> SasArg.t -> string ->
print_step n i args e pl activate_val enab_ll;
let str = if args.rif then "#" else "" in
Printf.eprintf "\n%sThis algo is silent after %i moves, %i steps, %i rounds.\n"
str !moves i !rounds;
Printf.eprintf "==> Inject a fault\n%!";
inject_fault ff p_nl_l e
) else if legitimate p_nl_l e then (
str !moves (n-i+1) !rounds;
Printf.eprintf "%s==> Inject a fault\n%!" str;
let e = inject_fault ff p_nl_l e in
let all, enab_ll = Sasacore.Main.get_enable_processes p_nl_l e in
e, all, enab_ll
)
else if legitimate p_nl_l e then (
match Register.get_fault () with
| None ->
print_step n i args e pl activate_val enab_ll;
......@@ -104,13 +107,15 @@ let (simustep: int -> int -> SasArg.t -> string ->
print_step n i args e pl activate_val enab_ll;
let str = if args.rif then "#" else "" in
Printf.eprintf
"\n%sThis algo Reached a legitimate configuration after %i moves, %i steps, %i rounds.\n"
str !moves i !rounds;
Printf.eprintf "==> Inject a fault\n%!";
inject_fault ff p_nl_l e
"\n%sThis algo reached a legitimate configuration after %i moves, %i steps, %i rounds.\n"
str !moves (n-i+1) !rounds;
Printf.eprintf "%s==> Inject a fault\n%!" str;
let e = inject_fault ff p_nl_l e in
let all, enab_ll = Sasacore.Main.get_enable_processes p_nl_l e in
e, all, enab_ll
)
else
e
e, all, enab_ll
in
if args.daemon = Daemon.Custom then
print_step n i args e pl activate_val enab_ll;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment