Changeset 4449 for trunk/examples

Show
Ignore:
Timestamp:
08/25/08 08:36:36 (5 months ago)
Author:
pmoura
Message:

Updated the "mtbatch" example to provide multi-threading overhead data for the competitive or-parallelism benchmark.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/threads/mtbatch/mtbatch.lgt

    r4413 r4449  
    330330        write('COP'), put_char('\t'), 
    331331        loop::forto(Liters, 1, 14, 
    332             (   catch(run(competitive(Liters, 5, 9, 14), N, Average), Error, write_error) -> 
     332            (   catch(run(cop_search(Liters, 5, 9, 14), N, Average), Error, write_error) -> 
     333                (   var(Error) -> 
     334                    write_average(Average) 
     335                ;   true 
     336                ) 
     337            )), nl, 
     338        write('DF+HC+BF'), put_char('\t'), 
     339        loop::forto(Liters, 1, 14, 
     340            (   catch(run(cop_overhead(Liters, 5, 9, 14), N, Average), Error, write_error) -> 
    333341                (   var(Error) -> 
    334342                    write_average(Average) 
     
    446454    do_benchmark(breadth_first(_, _, _, _), _). 
    447455 
    448     do_benchmark(competitive(Liters, Jug1, Jug2, MaxDepth), N) :- 
     456    do_benchmark(cop_search(Liters, Jug1, Jug2, MaxDepth), N) :- 
    449457        Obj = salt(Liters, Jug1, Jug2), 
    450458        Obj::initial_state(Initial), 
     
    456464            )), 
    457465        fail. 
    458     do_benchmark(competitive(_, _, _, _), _). 
     466    do_benchmark(cop_search(_, _, _, _), _). 
     467 
     468    do_benchmark(cop_overhead(Liters, Jug1, Jug2, MaxDepth), N) :- 
     469        Obj = salt(Liters, Jug1, Jug2), 
     470        Obj::initial_state(Initial), 
     471        repeat(N), 
     472            threaded(( 
     473                catch(depth_first(MaxDepth)::solve(Obj, Initial, _), _, fail), 
     474                catch(hill_climbing(MaxDepth)::solve(Obj, Initial, _, _), _, fail), 
     475                catch(breadth_first(MaxDepth)::solve(Obj, Initial, _), _, fail) 
     476            )), 
     477        fail. 
     478    do_benchmark(cop_overhead(_, _, _, _), _). 
    459479 
    460480    walltime_begin(Walltime) :-