Explorar el Código

Fix fast script too

Vecna hace 3 meses
padre
commit
29427f8d6b
Se han modificado 1 ficheros con 14 adiciones y 3 borrados
  1. 14 3
      run-fast.sh

+ 14 - 3
run-fast.sh

@@ -1,15 +1,26 @@
 #!/bin/sh
 
-ncpus=$(nproc)
+ncpus=""
+cpurange=""
 
-while -n "$1"; do
+while [ -n "$1" ]; do
     if [ "$1" == "--fast" ]; then
         fast=true
     elif [ "$1" == "-n" ]; then
         ncpus="$2"
         shift
+    elif [ "$1" == "-N" ]; then
+        cpurange="$2"
+        shift
     fi
     shift
 done
 
-./run.sh --fast -n "$ncpus"
+if [ -z "$ncpus" ]; then
+    ncpus=$(nproc)
+fi
+if [ -z "$cpurange" ]; then
+    cpurange="0-$((ncpus - 1))"
+fi
+
+./run.sh --fast -n "$ncpus" -N "$cpurange"