Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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