nim-taskpools/taskpools.nimble

50 lines
1.6 KiB
Plaintext
Raw Normal View History

mode = ScriptMode.Verbose
packageName = "taskpools"
version = "0.0.4"
author = "Status Research & Development GmbH"
description = "lightweight, energy-efficient, easily auditable threadpool"
license = "MIT"
skipDirs = @["tests"]
requires "nim >= 1.6.0"
2021-07-01 08:51:35 +00:00
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
let verbose = getEnv("V", "") notin ["", "0"]
2021-07-01 08:51:35 +00:00
let cfg =
" --styleCheck:usages --styleCheck:error" &
(if verbose: "" else: " --verbosity:0 --hints:off") &
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" &
" --stacktrace:on --linetrace:on" &
" --threads:on"
2021-07-01 08:51:35 +00:00
proc build(args, path: string) =
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
proc run(args, path: string) =
build args & " -r", path
2021-07-01 08:51:35 +00:00
task test, "Run Taskpools tests":
# Internal data structures
run "", "taskpools/channels_spsc_single.nim"
run "", "taskpools/sparsesets.nim"
2021-07-01 08:51:35 +00:00
# Examples
run "", "examples/e01_simple_tasks.nim"
run "", "examples/e02_parallel_pi.nim"
2021-07-01 08:51:35 +00:00
# Benchmarks
run "", "benchmarks/dfs/taskpool_dfs.nim"
run "", "benchmarks/heat/taskpool_heat.nim"
run "", "benchmarks/nqueens/taskpool_nqueens.nim"
when not defined(windows):
run "", "benchmarks/single_task_producer/taskpool_spc.nim"
run "", "benchmarks/bouncing_producer_consumer/taskpool_bpc.nim"
2021-07-01 08:51:35 +00:00
# TODO - generics in macro issue
# run "", "benchmarks/matmul_cache_oblivious/taskpool_matmul_co.nim"