haskell - How to set the number of threads at run time (avoiding +RTS -N#) -
i wish run parallel programs as
$ myprogram <args> -n 4 <args>
instead
$ myprogram <args> +rts -n4 -rts <args>
the main reason normalize argument format on programs.
i know can as
$ myprogramwrapper <args> -n 4 <args> $ cat myprogramwrapper #!/bin/bash arg1=parse args arg2=... ncores=.... myprogram $arg1 ... +rts -n$ncores
but it's ugly.
thanks lot! :)
you can use function setnumcapabilities @ runtime.
Comments
Post a Comment