Changeset 4311
- Timestamp:
- 06/13/08 04:04:50 (4 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
examples/threads/mtbatch/loader.lgt (modified) (1 diff)
-
examples/threads/mtbatch/mtbatch.lgt (modified) (4 diffs)
-
examples/threads/mtbatch/NOTES.txt (modified) (1 diff)
-
RELEASE_NOTES.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/threads/mtbatch/loader.lgt
r4138 r4311 10 10 logtalk_load(fft(loader)), 11 11 logtalk_load(integration(loader)), 12 logtalk_load(roots(loader), [reload(skip)]), 13 logtalk_load([ 14 searching(state_space), 15 searching(heuristic_state_space), 16 searching(salt3), 17 searching(search_strategy), 18 searching(blind_search1), 19 searching(breadth_first1), 20 searching(depth_first1), 21 searching(heuristic_search1), 22 searching(best_first1), 23 searching(hill_climbing1)], [reload(skip)]), 12 24 logtalk_load(mtbatch, [misspelt(silent)]) 13 25 )). -
trunk/examples/threads/mtbatch/mtbatch.lgt
r4182 r4311 8 8 comment is 'Multi-threading benchmarks.', 9 9 parameters is ['Prolog'- 'Prolog backend compiler. Supported compilers are SWI-Prolog (swi), YAP (yap), and XSB (xsb).']]). 10 11 :- threaded. 10 12 11 13 :- uses(integer, [between/3]). … … 173 175 )), nl 174 176 )), nl. 175 176 177 177 178 % integration benchmarks: … … 236 237 )), nl. 237 238 239 % state-space search benchmarks: 240 run(search, N) :- 241 write('State-space search benchmarks (average of '), write(N), write(' runs)'), nl, 242 loop::forto(Liters, 1, 14, 243 ( put_char('\t'), write(Liters) 244 )), nl, 245 write('DF'), put_char('\t'), 246 loop::forto(Liters, 1, 14, 247 ( catch(run(depth_first(Liters, 5, 9, 14), N, Average), Error, write_error) -> 248 ( var(Error) -> 249 write_average(Average) 250 ; true 251 ) 252 )), nl, 253 write('HF'), put_char('\t'), 254 loop::forto(Liters, 1, 14, 255 ( catch(run(hill_climbing(Liters, 5, 9, 14), N, Average), Error, write_error) -> 256 ( var(Error) -> 257 write_average(Average) 258 ; true 259 ) 260 )), nl, 261 write('BF'), put_char('\t'), 262 loop::forto(Liters, 1, 14, 263 ( catch(run(breadth_first(Liters, 5, 9, 14), N, Average), Error, write_error) -> 264 ( var(Error) -> 265 write_average(Average) 266 ; true 267 ) 268 )), nl, 269 write('COP'), put_char('\t'), 270 loop::forto(Liters, 1, 14, 271 ( catch(run(competitive(Liters, 5, 9, 14), N, Average), Error, write_error) -> 272 ( var(Error) -> 273 write_average(Average) 274 ; true 275 ) 276 )), nl. 277 238 278 run(Id, N, Average) :- 239 279 walltime_begin(Walltime1), … … 309 349 do_benchmark(quadsplit(_, _, _, _, _), _). 310 350 351 do_benchmark(depth_first(Liters, Jug1, Jug2, MaxDepth), N) :- 352 Obj = salt(Liters, Jug1, Jug2), 353 Obj::initial_state(Initial), 354 repeat(N), 355 once(depth_first(MaxDepth)::solve(Obj, Initial, _)), 356 fail. 357 do_benchmark(depth_first(_, _, _, _), _). 358 359 do_benchmark(hill_climbing(Liters, Jug1, Jug2, MaxDepth), N) :- 360 Obj = salt(Liters, Jug1, Jug2), 361 Obj::initial_state(Initial), 362 repeat(N), 363 once(hill_climbing(MaxDepth)::solve(Obj, Initial, _, _)), 364 fail. 365 do_benchmark(hill_climbing(_, _, _, _), _). 366 367 do_benchmark(breadth_first(Liters, Jug1, Jug2, MaxDepth), N) :- 368 Obj = salt(Liters, Jug1, Jug2), 369 Obj::initial_state(Initial), 370 repeat(N), 371 once(breadth_first(MaxDepth)::solve(Obj, Initial, _)), 372 fail. 373 do_benchmark(breadth_first(_, _, _, _), _). 374 375 do_benchmark(competitive(Liters, Jug1, Jug2, MaxDepth), N) :- 376 Obj = salt(Liters, Jug1, Jug2), 377 Obj::initial_state(Initial), 378 repeat(N), 379 threaded(( 380 depth_first(MaxDepth)::solve(Obj, Initial, _) 381 ; hill_climbing(MaxDepth)::solve(Obj, Initial, _, _) 382 ; breadth_first(MaxDepth)::solve(Obj, Initial, _) 383 )), 384 fail. 385 do_benchmark(competitive(_, _, _, _), _). 386 311 387 walltime_begin(Walltime) :- 312 388 parameter(1, Prolog), -
trunk/examples/threads/mtbatch/NOTES.txt
r4297 r4311 9 9 To load this example and for sample queries, please see the SCRIPT file. 10 10 11 This folder provides an object for running multi-threading benchmarks. 11 This folder provides a parametric object for running multi-threading 12 benchmarks. The object parameter must be instantiated with an atom 13 representing the back-end Prolog compiler being used: 14 15 SWI-Prolog: swi 16 YAP: yap 17 XSB: xsb 18 19 This is necessary due to the different built-in predicates used by each 20 Prolog compiler for timing statistics. 21 22 For example, the following goal will run all benchmark tests (assuming 23 we're using SWI-Prolog as the back-end compiler): 24 25 | ?- mtbatch(swi)::run. 26 27 You may also run just a single benchmark test a given number of times. 28 For example: 29 30 | ?- mtbatch(swi)::run(primes, 10). 31 32 The following tests are available: 33 34 primes 35 msort 36 qsort 37 fib 38 hanoi 39 tak 40 fft 41 integration 42 search -
trunk/RELEASE_NOTES.txt
r4308 r4311 49 49 taken into account when comparing states). Updated the "salt" example 50 50 to support heuristics. 51 52 Updated the "mtbatch" example to include a benchmark test for competitive 53 or-parallelism applied to state-space search (using the resources from the 54 "searching" example). Improved the example documentation. 51 55 52 56 Updated the syntax coloring support for the Vim text editor to properly
