19 lines
610 B
Tcsh
Executable File
19 lines
610 B
Tcsh
Executable File
#!/bin/csh
|
|
if ( x$2 == "x" ) then
|
|
echo Usage: splitnodefile total_number_of_nodes number_of_groups \[nodes_to_reserve_for_master\]
|
|
exit
|
|
endif
|
|
set nbnode=$1
|
|
set nbgroup=$2
|
|
set nbskip=0
|
|
if ( x$3 != "x" ) then
|
|
set nbskip=$3
|
|
endif
|
|
awk 'BEGIN {nbgroup='$nbgroup'; nbskip='$nbskip'; nbnode='$nbnode';\
|
|
if (nbskip>0) {print "mpirun -np "nbskip" dplace -c 0-"(nbskip-1) > "masterprefix.tmp";} \
|
|
print "set waitbetweenpoll=5"; \
|
|
for (g=0; g<nbgroup; g++) {\
|
|
a=int(nbskip+g*(nbnode-nbskip)/nbgroup); \
|
|
b=int(nbskip+(g+1)*(nbnode-nbskip)/nbgroup-1); \
|
|
print "mpirun -np "(b-a+1)" dplace -c "a"-"b;}}' >! machine.rc
|