Difference between revisions of "Roborumble/MassiveRun.sh"
Jump to navigation
Jump to search
(Initial commit) |
m (fix) |
||
Line 23: | Line 23: | ||
for i in `seq 1 ${cores}`; do | for i in `seq 1 ${cores}`; do | ||
− | + | pushd robocode-$i > /dev/null | |
− | + | log="../logs/${rumble}-$i.log" | |
− | + | echo "["`date`"]" >> ${log} | |
− | + | nohup java ${params} ./roborumble/${rumble}.txt >> ${log} 2>&1 & | |
− | + | popd > /dev/null | |
done | done | ||
Line 35: | Line 35: | ||
tail -f logs/${rumble}-1.log | tail -f logs/${rumble}-1.log | ||
+ | |||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 10:25, 20 July 2019
I'm running 8 instances of roborumble@home now, and here is a util script for managing them, provided for whom wanted to run many instances at once. The code below should be self-documented.
#!/usr/bin/env bash
params='-Xmx512M -cp libs/robocode.jar:libs/roborumble.jar:libs/bcel-6.2.jar:libs/codesize-1.2.jar -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED roborumble.RoboRumbleAtHome'
rumble='roborumble'
cores=8
cd "${0%/*}"
echo Copying rumble config...
for i in `seq 1 ${cores}`; do
rm -rf robocode-$i/roborumble;
cp -r rumble_config robocode-$i/roborumble;
done
echo Launching ${rumble}...
mkdir -p logs
for i in `seq 1 ${cores}`; do
pushd robocode-$i > /dev/null
log="../logs/${rumble}-$i.log"
echo "["`date`"]" >> ${log}
nohup java ${params} ./roborumble/${rumble}.txt >> ${log} 2>&1 &
popd > /dev/null
done
echo Displaying log...
tail -f logs/${rumble}-1.log