2021-06-29 14:49:53 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
|
|
packageName = "taskpools"
|
2022-02-08 13:30:16 +00:00
|
|
|
version = "0.0.3"
|
2021-06-29 14:49:53 +00:00
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "lightweight, energy-efficient, easily auditable threadpool"
|
|
|
|
license = "MIT"
|
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
requires "nim >= 1.2.12"
|
2021-07-01 08:51:35 +00:00
|
|
|
|
|
|
|
proc test(flags, path: string) =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
# Note: we compile in release mode. This still have stacktraces
|
|
|
|
# but is much faster than -d:debug
|
|
|
|
|
|
|
|
# Compilation language is controlled by TEST_LANG
|
2022-01-03 01:31:43 +00:00
|
|
|
let lang = getEnv("TEST_LANG", "c")
|
2021-07-01 08:51:35 +00:00
|
|
|
|
|
|
|
echo "\n========================================================================================"
|
|
|
|
echo "Running [ ", lang, " ", flags, " ] ", path
|
|
|
|
echo "========================================================================================"
|
2022-04-06 12:30:09 +00:00
|
|
|
exec "nim " & lang & " -d:TP_Asserts " & getEnv("NIMFLAGS") & " " & flags &
|
2022-04-06 13:34:19 +00:00
|
|
|
" --verbosity:0 --warnings:off --threads:on -d:release" &
|
2022-04-06 12:30:09 +00:00
|
|
|
" --stacktrace:on --linetrace:on --outdir:build -r --skipParentCfg --skipUserCfg" &
|
2022-04-06 13:34:19 +00:00
|
|
|
" --styleCheck:usages --styleCheck:hint" &
|
|
|
|
" --hint[XDeclaredButNotUsed]:off --hint[Processing]:off " & path
|
2021-07-01 08:51:35 +00:00
|
|
|
|
|
|
|
task test, "Run Taskpools tests":
|
|
|
|
# Internal data structures
|
|
|
|
test "", "taskpools/channels_spsc_single.nim"
|
|
|
|
test "", "taskpools/sparsesets.nim"
|
|
|
|
|
|
|
|
# Examples
|
|
|
|
test "", "examples/e01_simple_tasks.nim"
|
2022-01-16 17:33:43 +00:00
|
|
|
test "", "examples/e02_parallel_pi.nim"
|
2021-07-01 08:51:35 +00:00
|
|
|
|
|
|
|
# Benchmarks
|
|
|
|
test "", "benchmarks/dfs/taskpool_dfs.nim"
|
|
|
|
test "", "benchmarks/heat/taskpool_heat.nim"
|
|
|
|
test "", "benchmarks/nqueens/taskpool_nqueens.nim"
|
2021-07-01 18:24:50 +00:00
|
|
|
|
|
|
|
when not defined(windows):
|
|
|
|
test "", "benchmarks/single_task_producer/taskpool_spc.nim"
|
|
|
|
test "", "benchmarks/bouncing_producer_consumer/taskpool_bpc.nim"
|
2021-07-01 08:51:35 +00:00
|
|
|
|
|
|
|
# TODO - generics in macro issue
|
|
|
|
# test "", "benchmarks/matmul_cache_oblivious/taskpool_matmul_co.nim"
|