6
6
THREADS=1
7
7
GPUS=
8
8
HOST_PREFIX=" node-"
9
- CPUSET_PREFIX=
10
- NO_CPUSET_PREFIX=
11
9
YAML=
12
10
CREATE_PROPERTIES=1
13
11
USE_THREADS=
@@ -41,12 +39,10 @@ Options:
41
39
--cpusets <#> # of cpusets/host (useful for fake setups only)
42
40
--cputopo <list|RR> topology of the cpus: ordered list of the cpuset ids or RR for round robin
43
41
--gpudevices <#> # of gpu devices/host (useful for fake setups only)
44
- --gpudevices -prefix <str> path prefix to use for the GPU device (e.g.: /dev/nvidia)
42
+ --gpudevice -prefix <str> path prefix to use for the GPU device (e.g.: /dev/nvidia)
45
43
--gputopo <list> topology of the gpus: ordered list of the gpudevice ids
46
44
--host-prefix <str> hostname prefix (default: "node-")
47
45
--host-suffix <str> hostname suffix (e.g. ".domain")
48
- --cpuset-prefix <str> use a custom cpuset resource prefix instead of node: (or pu: if threads)
49
- --no-cpuset-prefix no cpuset resource prefix, just a number
50
46
-a, --auto-offset guess next host/cpu/core/thread/gpu ids
51
47
-p, --no-create-properties do not generate oarproperty commands
52
48
-A, --append <str> append a text string (extra properties)
@@ -71,7 +67,7 @@ debug() {
71
67
[ -n " $DEBUG " ] && echo " DEBUG: $@ " 1>&2
72
68
}
73
69
74
- LONG_OPTS=" hosts:,cpus:,cores:,threads:,gpus:,host-prefix:,host-suffix:,cpuset-prefix:, gpudevice-prefix:,host0:,cpu0:,core0:,thread0:,gpu0:,cpuset:,cpusets:,cputopo:,gpudevices:,gputopo:,append:,use-threads,write-to:,auto-offset,yaml,no-create-properties,repair,no-cpuset-prefix ,help,debug"
70
+ LONG_OPTS=" hosts:,cpus:,cores:,threads:,gpus:,host-prefix:,host-suffix:,gpudevice-prefix:,host0:,cpu0:,core0:,thread0:,gpu0:,cpuset:,cpusets:,cputopo:,gpudevices:,gputopo:,append:,use-threads,write-to:,auto-offset,yaml,no-create-properties,repair,help,debug"
75
71
SHORT_OPTS=" H:C:c:t:g:P:S:A:o:TRaYph"
76
72
args=$( getopt -l $LONG_OPTS -o $SHORT_OPTS -q -- " $@ " )
77
73
[ $? -gt 0 ] && die " Syntax error, $( getopt -l $LONG_OPTS -o $SHORT_OPTS -Q -- " $@ " 2>&1 ) ."
@@ -113,13 +109,6 @@ while [ $# -ge 1 ]; do
113
109
HOST_SUFFIX=$2
114
110
shift
115
111
;;
116
- --cpuset-prefix)
117
- CPUSET_PREFIX=$2
118
- shift
119
- ;;
120
- --no-cpuset-prefix)
121
- NO_CPUSET_PREFIX=1
122
- ;;
123
112
--gpudevice-prefix)
124
113
GPUDEVICE_PREFIX=$2
125
114
shift
@@ -221,14 +210,6 @@ debug "GPUS=$GPUS"
221
210
CPUSETS=${CPUSETS:- $((CPUS* CORES* THREADS))}
222
211
debug " CPUSETS=$CPUSETS "
223
212
224
- if [ -z " $NO_CPUSET_PREFIX " -a -z " $CPUSET_PREFIX " ]; then
225
- if [ -n " $USE_THREADS " ]; then
226
- CPUSET_PREFIX=" pu:"
227
- else
228
- CPUSET_PREFIX=" core:"
229
- fi
230
- fi
231
-
232
213
declare -a CPUTOPO
233
214
if [ -n " $CPUTOPO " ]; then
234
215
if [ " $CPUTOPO " == " RR" ]; then
345
326
346
327
while [ $host -le $HOSTS ]; do
347
328
debug " Host loop $host <= $HOSTS "
348
- hostname=" ' $HOST_PREFIX $(( host+ HOST0 - 1 )) $HOST_SUFFIX ' "
329
+ hostname=" $HOST_PREFIX $(( host+ HOST0 - 1 )) $HOST_SUFFIX "
349
330
cpuset=0
350
331
gpudevice=0
351
332
while [ $cpu -lt $(( CPUS* host)) ]; do
@@ -385,15 +366,15 @@ EOF
385
366
else
386
367
if [ -z " $DO_REPAIR " ]; then
387
368
if [ -z " $USE_THREADS " ]; then
388
- echo " oarnodesetting -a -h $hostname -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p cpuset=$CPUSET_PREFIX $ {CPUTOPO[$cpuset]} ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
369
+ echo " oarnodesetting -a -h $hostname -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p cpuset=${CPUTOPO[$cpuset]} ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
389
370
else
390
- echo " oarnodesetting -a -h $hostname -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p thread=$(( thread+ THREAD0 )) -p cpuset=$CPUSET_PREFIX $ {CPUTOPO[$cpuset]} ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
371
+ echo " oarnodesetting -a -h $hostname -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p thread=$(( thread+ THREAD0 )) -p cpuset=${CPUTOPO[$cpuset]} ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
391
372
fi
392
373
else
393
374
if [ -z " $USE_THREADS " ]; then
394
- echo " oarnodesetting --sql \" network_address = $hostname and cpuset = $CPUSET_PREFIX $ {CPUTOPO[$cpuset]}\" -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
375
+ echo " oarnodesetting --sql \" network_address = ' $hostname ' and cpuset = ' $ {CPUTOPO[$cpuset]}' \" -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
395
376
else
396
- echo " oarnodesetting --sql \" network_address = $hostname and cpuset = $CPUSET_PREFIX $ {CPUTOPO[$cpuset]}\" -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p thread=$(( thread+ THREAD0 )) ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
377
+ echo " oarnodesetting --sql \" network_address = ' $hostname ' and cpuset = ' $ {CPUTOPO[$cpuset]}' \" -p host=$hostname -p cpu=$(( cpu+ CPU0 )) -p core=$(( core+ CORE0 )) -p thread=$(( thread+ THREAD0 )) ${DO_GPUS: +-p gpu=$((gpu+GPU0)) -p gpudevice=$GPUDEVICE_PREFIX ${GPUTOPO[$gpudevice]} } $APPEND "
397
378
fi
398
379
fi
399
380
fi
0 commit comments