Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2016 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/66027c3399a6cea4eff35dd7247c6b60 to your computer and use it in GitHub Desktop.
Save anonymous/66027c3399a6cea4eff35dd7247c6b60 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$1" ]; then
keyspace=34359738368
else
keyspace=$1
fi
echo "Keyspace: $keyspace"
declare -a GPUNODES
# Enter in the GPU count per node seperated by spaces
GPUNODES=(8 8 4 4 4 4)
GPUTOTAL=$(IFS="+";bc<<<"${GPUNODES[*]}")
NODECOUNT="${#GPUNODES[@]}"
chunksize=$(($keyspace / $GPUTOTAL))
skipcount=0
nodecount=0
echo "Chunk size: $chunksize"
echo "Node count: $NODECOUNT"
echo ""
for i in "${GPUNODES[@]}"
do
(( nodecount++ ))
#echo $nodecount $i
echo "Node $nodecount: -s $skipcount -l $(($chunksize * $i))"
skipcount=$(($skipcount + ($chunksize * $i)))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment