Commit 67a2be52 authored by Doak, Peter W's avatar Doak, Peter W
Browse files

continuation example for netlogo

parent 5f6f33c7
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
to continue trajectories of 500hex*
mkdir file_test
. ./convert_ot2nt.sh
qsub run.sh
#!/bin/bash
for file in 500hex*bmc
do
python ./ot2nt.py $file cont_${file}
done
import re
import sys
with open(sys.argv[1],'r') as fin:
with open(sys.argv[2],'w') as fout:
for i in range(5):
fout.write(fin.readline())
fout.write("\"temperature: \"273.15\n")
fin.readline()
fin.readline()
fout.write(fin.readline())
line = fin.readline()
# while True:
# match = re.search("Tick",line)
# if match is not None:
# fout.write(line)
# break
# line = fin.readline()
while len(line) > 0:
match = re.search("^\s*$",line)
if match is None:
match = re.search("(\d+\s+[-\.\dEe]+\s+[-\.\dEe]+\s+[-\.\dEe]+)",line)
if match is None:
fout.write(line)
else:
fout.write("{} false false\n".format(match.group(1)))
line = fin.readline()
#!/bin/bash
#PBS -S /bin/bash
#PBS -m be
#PBS -M doakpw@ornl.gov
#PBS -N netlogo_test
#PBS -q batch
#PBS -l nodes=1:ppn=32:hw32
#PBS -l walltime=48:00:00
#PBS -l naccesspolicy=singlejob
#PBS -W group_list=cades-cnms
#PBS -l qos=condo
export OMP_NUM_THREADS=1
cd $PBS_O_WORKDIR
#this can be useful to see from outside shells
cat $PBS_NODEFILE >pbs_nodefile
module load env/cades-cnms
. $SOFTWARECNMS/spack/share/spack/setup-env.sh
spack load jdk
module load NetLogo/5.3.1
#each of these () surrounded commands launches in a subshell
(java -Xms8g -Xmx16g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model ./BMC_SelfAssembler.nlogo --experiment experiment1 2>&1 >out1) &
(java -Xms8g -Xmx16g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model ./BMC_SelfAssembler.nlogo --experiment experiment2 2>&1 >out2) &
(java -Xms8g -Xmx16g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model ./BMC_SelfAssembler.nlogo --experiment experiment3 3>&1 >out3) &
(java -Xms8g -Xmx16g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model ./BMC_SelfAssembler.nlogo --experiment experiment4 4>&1 >out4) &
(java -Xms8g -Xmx16g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model ./BMC_SelfAssembler.nlogo --experiment experiment5 5>&1 >out5) &
# (java -Xms64g -Xmx128g -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=$NETLOGOROOT/app/extensions -classpath $NETLOGOROOT/app/NetLogo.jar org.nlogo.headless.Main --model /software/user_tools/current/cades-cnms/epd_work/NetlogoBMCPackage/behavior-test.nlogo --experiment experiment2 2>&1 >out2) &
#wait for all subshells to complete
wait
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment