[{"data":1,"prerenderedAt":2850},["ShallowReactive",2],{"/hpc":3,"/hpc-surround":2839},{"id":4,"title":5,"body":6,"description":2807,"extension":2808,"meta":2809,"navigation":227,"path":2835,"seo":2836,"stem":2837,"__hash__":2838},"content/hpc.md","Cluster Computing (HPC)",{"type":7,"value":8,"toc":2795},"minimark",[9,21,30,67,75,78,92,131,134,141,144,160,169,179,186,193,207,212,501,510,513,530,533,606,609,651,654,659,688,693,786,1534,1541,1544,1547,1550,1559,1562,1570,1583,1592,1602,1609,1612,1644,1648,1665,1669,2261,2270,2280,2282,2354,2357,2394,2398,2425,2429,2740,2750,2783,2791],[10,11,15],"h1",{"id":12,"className":13},"cluster-computing-hpc",[14],"section-heading",[16,17,5],"a",{"className":18,"href":20},[19],"section-anchor","#cluster-computing-hpc",[22,23,24,25,29],"p",{},"This document is an advanced guide that provides examples of how to run NetLogo BehaviorSpace experiments on a High-Performance Computing (HPC) cluster. The scripts provided in this guide are specifically for ",[26,27,28],"strong",{},"Slurm",", a popular open-source workload manager and job scheduler, but they can be adapted for use with other schedulers.",[31,32,35,45],"div",{"className":33},[34],"toc",[36,37,40],"h4",{"id":38,"className":39},"table-of-contents",[14],[16,41,44],{"className":42,"href":43},[19],"#table-of-contents","Table of Contents",[46,47,48,55,61],"ul",{},[49,50,51],"li",{},[16,52,54],{"href":53},"#installing-netlogo-on-a-cluster","Installing NetLogo on a Cluster",[49,56,57],{},[16,58,60],{"href":59},"#submitting-a-job","Submitting a Job",[49,62,63],{},[16,64,66],{"href":65},"#advanced-usage","Advanced Usage",[68,69,72],"h2",{"id":70,"className":71},"installing-netlogo-on-a-cluster",[14],[16,73,54],{"className":74,"href":53},[19],[22,76,77],{},"To run BehaviorSpace experiments, NetLogo must be installed on your HPC in a location accessible to the user.",[46,79,80,89],{},[49,81,82,83,88],{},"The easiest method is to download the desired NetLogo version (for most clusters this is the 64-bit Linux installation, available at ",[16,84,85],{"href":85,"rel":86},"https://www.netlogo.org/downloads/linux/",[87],"nofollow",") , unzip and move the entire folder to a directory on your HPC.",[49,90,91],{},"Alternatively, you can install NetLogo from the command line if your HPC allows it. For example, you can download and unzip the 64-bit Linux version of NetLogo 7.0.0 with:",[93,94,99],"pre",{"className":95,"code":96,"language":97,"meta":98,"style":98},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","curl -O https://ccl.northwestern.edu/netlogo/7.0.0/NetLogo-7.0.0-64.tgz\ntar zxf NetLogo-7.0.0-64.tgz\n","bash","",[100,101,102,119],"code",{"__ignoreMap":98},[103,104,107,111,115],"span",{"class":105,"line":106},"line",1,[103,108,110],{"class":109},"sbgvK","curl",[103,112,114],{"class":113},"stzsN"," -O",[103,116,118],{"class":117},"s_sjI"," https://ccl.northwestern.edu/netlogo/7.0.0/NetLogo-7.0.0-64.tgz\n",[103,120,122,125,128],{"class":105,"line":121},2,[103,123,124],{"class":109},"tar",[103,126,127],{"class":117}," zxf",[103,129,130],{"class":117}," NetLogo-7.0.0-64.tgz\n",[22,132,133],{},"Note: Although NetLogo comes with a bundled Java installation, some HPC clusters require users to run only approved Java Runtime Environments (JREs). If that is the case, you must ensure that your HPC has a compatible JRE (Java 17 or higher). Please consult your HPC documentation or system administrator if unsure.",[68,135,138],{"id":136,"className":137},"submitting-a-job",[14],[16,139,60],{"className":140,"href":59},[19],[22,142,143],{},"This section provides two examples of how to run a BehaviorSpace experiment on an HPC using Slurm.",[145,146,147,154],"ol",{},[49,148,149,150,153],{},"A ",[26,151,152],{},"simple script",", which must be customized for each experiment and model.",[49,155,149,156,159],{},[26,157,158],{},"general script",", which takes arguments to automatically generate and submit a Slurm job script.",[22,161,162,163,168],{},"The simple script is easier to debug, while the general script is more convenient for repeated use. Both approaches are valid, and the scripts can also be found ",[16,164,167],{"href":165,"rel":166},"https://github.com/umit1010/slurm-scripts-for-netlogo",[87],"here on GitHub",".",[170,171,174],"h3",{"id":172,"className":173},"a-simple-example",[14],[16,175,178],{"className":176,"href":177},[19],"#a-simple-example","A simple example",[22,180,181,182,185],{},"The script below is a simple Slurm job submission template for NetLogo. Lines beginning with ",[100,183,184],{},"###"," provide explanations.",[22,187,188,189,192],{},"Save this script as ",[100,190,191],{},"simple_standalone_job.sh",". After updating it to match your HPC configuration, model, and experiment, you can submit it with:",[22,194,195],{},[100,196,197,203,204],{},[103,198,202],{"className":199},[200,201],"token","variable","sbatch"," ",[103,205,191],{"className":206},[200,201],[22,208,209],{},[26,210,211],{},"Script:",[93,213,215],{"className":95,"code":214,"language":97,"meta":98,"style":98},"#!/bin/sh\n\n### ---\n### simple_standalone_job.sh\n### ---\n\n### Template standalone Slurm job submission script for NetLogo BehaviorSpace experiments\n\n#SBATCH --account=PROJECTID       ### replace PROJECTID with your allocation/project ID number.\n#SBATCH --partition=short         ### replace short with desired parition: medium, long, gengpu, etc.\n#SBATCH --time=1:30:00            ### time format is hh:mm:ss\n#SBATCH --nodes=1                 ### leave the --nodes as 1 because NetLogo can run into problems when trying to use multiple nodes\n#SBATCH --ntasks-per-node=16      ### replace 16 with the number of CPU cores you will request\n#SBATCH --mem=4G                  ### replace 4G with the amount of memory you will request; do not forget to put specify the units.\n#SBATCH --job-name=EXAMPLE_JOB    ### replace EXAMPLE_JOB with the name of your job (can be anything)\n#SBATCH --output=%x-%j.out        ### automatically generates an output file. Slurm replaces %x with job name you provided in the previous instruction and %j with the unique job id.\n#SBATCH --error=%x-%j.err         ### automatically generates an error file.\n#SBATCH --mail-type=ALL           ### replace ALL with BEGIN, END, or FAIL if you'd like to.\n#SBATCH --mail-user=U@SCHOOL.EDU  ### Replace U@SCHOOL.edu with your own email address so that Slurm can send you emails when your job is queried, started, completed, or terminated due to an error.\n\nmodule purge all\nmodule load java/jdk-17.0.2+8     ### You may need to update this line if your HPC doesn't have the jdk-17.0.2+8 module available.\n\nJVM_OPTS=(-Xmx1024m -server -XX:+UseParallelGC -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=\"${BASE_DIR}/extensions\")\n\n### Make sure to update the NetLogo installation path, experiment name, model filename, experiment name and output filename variables in the following command.\njava ${JVM_OPTS[@]} -classpath PATH/TO/NETLOGO/lib/app/netlogo-7.0.0.jar org.nlogo.headless.Main --model \"MODELFILE.nlogo\" --experiment \"EXPERIMENT_NAME\" --threads 16 --table PATH/TO/OUT/FOLDER/OUTPUTFILE.csv\n",[100,216,217,223,229,235,241,246,251,257,262,268,274,280,286,292,298,304,310,316,322,328,333,345,359,364,427,432,438],{"__ignoreMap":98},[103,218,219],{"class":105,"line":106},[103,220,222],{"class":221},"sutJx","#!/bin/sh\n",[103,224,225],{"class":105,"line":121},[103,226,228],{"emptyLinePlaceholder":227},true,"\n",[103,230,232],{"class":105,"line":231},3,[103,233,234],{"class":221},"### ---\n",[103,236,238],{"class":105,"line":237},4,[103,239,240],{"class":221},"### simple_standalone_job.sh\n",[103,242,244],{"class":105,"line":243},5,[103,245,234],{"class":221},[103,247,249],{"class":105,"line":248},6,[103,250,228],{"emptyLinePlaceholder":227},[103,252,254],{"class":105,"line":253},7,[103,255,256],{"class":221},"### Template standalone Slurm job submission script for NetLogo BehaviorSpace experiments\n",[103,258,260],{"class":105,"line":259},8,[103,261,228],{"emptyLinePlaceholder":227},[103,263,265],{"class":105,"line":264},9,[103,266,267],{"class":221},"#SBATCH --account=PROJECTID       ### replace PROJECTID with your allocation/project ID number.\n",[103,269,271],{"class":105,"line":270},10,[103,272,273],{"class":221},"#SBATCH --partition=short         ### replace short with desired parition: medium, long, gengpu, etc.\n",[103,275,277],{"class":105,"line":276},11,[103,278,279],{"class":221},"#SBATCH --time=1:30:00            ### time format is hh:mm:ss\n",[103,281,283],{"class":105,"line":282},12,[103,284,285],{"class":221},"#SBATCH --nodes=1                 ### leave the --nodes as 1 because NetLogo can run into problems when trying to use multiple nodes\n",[103,287,289],{"class":105,"line":288},13,[103,290,291],{"class":221},"#SBATCH --ntasks-per-node=16      ### replace 16 with the number of CPU cores you will request\n",[103,293,295],{"class":105,"line":294},14,[103,296,297],{"class":221},"#SBATCH --mem=4G                  ### replace 4G with the amount of memory you will request; do not forget to put specify the units.\n",[103,299,301],{"class":105,"line":300},15,[103,302,303],{"class":221},"#SBATCH --job-name=EXAMPLE_JOB    ### replace EXAMPLE_JOB with the name of your job (can be anything)\n",[103,305,307],{"class":105,"line":306},16,[103,308,309],{"class":221},"#SBATCH --output=%x-%j.out        ### automatically generates an output file. Slurm replaces %x with job name you provided in the previous instruction and %j with the unique job id.\n",[103,311,313],{"class":105,"line":312},17,[103,314,315],{"class":221},"#SBATCH --error=%x-%j.err         ### automatically generates an error file.\n",[103,317,319],{"class":105,"line":318},18,[103,320,321],{"class":221},"#SBATCH --mail-type=ALL           ### replace ALL with BEGIN, END, or FAIL if you'd like to.\n",[103,323,325],{"class":105,"line":324},19,[103,326,327],{"class":221},"#SBATCH --mail-user=U@SCHOOL.EDU  ### Replace U@SCHOOL.edu with your own email address so that Slurm can send you emails when your job is queried, started, completed, or terminated due to an error.\n",[103,329,331],{"class":105,"line":330},20,[103,332,228],{"emptyLinePlaceholder":227},[103,334,336,339,342],{"class":105,"line":335},21,[103,337,338],{"class":109},"module",[103,340,341],{"class":117}," purge",[103,343,344],{"class":117}," all\n",[103,346,348,350,353,356],{"class":105,"line":347},22,[103,349,338],{"class":109},[103,351,352],{"class":117}," load",[103,354,355],{"class":117}," java/jdk-17.0.2+8",[103,357,358],{"class":221},"     ### You may need to update this line if your HPC doesn't have the jdk-17.0.2+8 module available.\n",[103,360,362],{"class":105,"line":361},23,[103,363,228],{"emptyLinePlaceholder":227},[103,365,367,371,375,379,382,385,388,391,395,397,400,403,406,408,412,415,418,421,424],{"class":105,"line":366},24,[103,368,370],{"class":369},"su5hD","JVM_OPTS",[103,372,374],{"class":373},"smGrS","=",[103,376,378],{"class":377},"sP7_E","(",[103,380,381],{"class":117},"-Xmx1024m",[103,383,384],{"class":117}," -server",[103,386,387],{"class":117}," -XX:+UseParallelGC",[103,389,390],{"class":117}," -Dfile.",[103,392,394],{"class":393},"s9AJx","encoding",[103,396,374],{"class":373},[103,398,399],{"class":117},"UTF-8",[103,401,402],{"class":117}," -Dnetlogo.extensions.",[103,404,405],{"class":393},"dir",[103,407,374],{"class":373},[103,409,411],{"class":410},"sjJ54","\"${",[103,413,414],{"class":369},"BASE_DIR",[103,416,417],{"class":410},"}",[103,419,420],{"class":117},"/extensions",[103,422,423],{"class":410},"\"",[103,425,426],{"class":377},")\n",[103,428,430],{"class":105,"line":429},25,[103,431,228],{"emptyLinePlaceholder":227},[103,433,435],{"class":105,"line":434},26,[103,436,437],{"class":221},"### Make sure to update the NetLogo installation path, experiment name, model filename, experiment name and output filename variables in the following command.\n",[103,439,441,444,447,449,452,455,458,461,464,467,470,473,476,478,481,483,486,488,491,495,498],{"class":105,"line":440},27,[103,442,443],{"class":109},"java",[103,445,446],{"class":377}," ${",[103,448,370],{"class":369},[103,450,451],{"class":377},"[",[103,453,454],{"class":373},"@",[103,456,457],{"class":377},"]}",[103,459,460],{"class":113}," -classpath",[103,462,463],{"class":117}," PATH/TO/NETLOGO/lib/app/netlogo-7.0.0.jar",[103,465,466],{"class":117}," org.nlogo.headless.Main",[103,468,469],{"class":113}," --model",[103,471,472],{"class":410}," \"",[103,474,475],{"class":117},"MODELFILE.nlogo",[103,477,423],{"class":410},[103,479,480],{"class":113}," --experiment",[103,482,472],{"class":410},[103,484,485],{"class":117},"EXPERIMENT_NAME",[103,487,423],{"class":410},[103,489,490],{"class":113}," --threads",[103,492,494],{"class":493},"srdBf"," 16",[103,496,497],{"class":113}," --table",[103,499,500],{"class":117}," PATH/TO/OUT/FOLDER/OUTPUTFILE.csv\n",[170,502,505],{"id":503,"className":504},"a-more-general-example",[14],[16,506,509],{"className":507,"href":508},[19],"#a-more-general-example","A more general example",[22,511,512],{},"Editing a submission file for each experiment can be tedious. The following scripts automate the process by generating a temporary job script with your chosen arguments and then submitting it.",[22,514,515,516,519,520,523,524,526,527,529],{},"Save the following as ",[100,517,518],{},"config.sh"," and ",[100,521,522],{},"generate_and_submit.sh",". Update ",[100,525,518],{}," with your account details, and adjust ",[100,528,522],{}," as needed for your HPC.",[22,531,532],{},"Run the script with:",[93,534,536],{"className":95,"code":535,"language":97,"meta":98,"style":98},"bash generate_and_submit.sh \u003Cmodel-file> \u003Cexperiment-name> \u003Ccategory> \u003Cmaxtime> \u003Cthreads> \u003Cram>\n",[100,537,538],{"__ignoreMap":98},[103,539,540,542,545,548,551,554,557,559,562,564,566,568,571,574,576,578,581,583,585,587,590,593,595,597,600,603],{"class":105,"line":106},[103,541,97],{"class":109},[103,543,544],{"class":117}," generate_and_submit.sh",[103,546,547],{"class":373}," \u003C",[103,549,550],{"class":117},"model-fil",[103,552,553],{"class":369},"e",[103,555,556],{"class":373},">",[103,558,547],{"class":373},[103,560,561],{"class":117},"experiment-nam",[103,563,553],{"class":369},[103,565,556],{"class":373},[103,567,547],{"class":373},[103,569,570],{"class":117},"categor",[103,572,573],{"class":369},"y",[103,575,556],{"class":373},[103,577,547],{"class":373},[103,579,580],{"class":117},"maxtim",[103,582,553],{"class":369},[103,584,556],{"class":373},[103,586,547],{"class":373},[103,588,589],{"class":117},"thread",[103,591,592],{"class":369},"s",[103,594,556],{"class":373},[103,596,547],{"class":373},[103,598,599],{"class":117},"ra",[103,601,602],{"class":369},"m",[103,604,605],{"class":373},">\n",[22,607,608],{},"Where the command-line arguments are:",[46,610,611,617,622,628,639,645],{},[49,612,613,616],{},[100,614,615],{},"model-file"," (including the file extension)",[49,618,619],{},[100,620,621],{},"experiment-name",[49,623,624,627],{},[100,625,626],{},"category"," (which partition to use: short, normal, long, gpu, etc.)",[49,629,630,633,634,638],{},[100,631,632],{},"maxtime"," (in ",[635,636,637],"em",{},"hh:mm:ss"," format)",[49,640,641,644],{},[100,642,643],{},"threads"," (number of CPU cores to request)",[49,646,647,650],{},[100,648,649],{},"ram"," (in megabytes)",[22,652,653],{},"This will automatically generate an intermediary bash script and then use it to submit the job. It will also delete the intermediary file after submission to prevent folder pollution.",[22,655,656],{},[26,657,658],{},"Example:",[93,660,662],{"className":95,"code":661,"language":97,"meta":98,"style":98},"bash generate_and_submit.sh fire.nlogo densityexp short 1:00:00 32 4096\n",[100,663,664],{"__ignoreMap":98},[103,665,666,668,670,673,676,679,682,685],{"class":105,"line":106},[103,667,97],{"class":109},[103,669,544],{"class":117},[103,671,672],{"class":117}," fire.nlogo",[103,674,675],{"class":117}," densityexp",[103,677,678],{"class":117}," short",[103,680,681],{"class":117}," 1:00:00",[103,683,684],{"class":493}," 32",[103,686,687],{"class":493}," 4096\n",[22,689,690],{},[26,691,692],{},"Scripts:",[93,694,696],{"className":95,"code":695,"language":97,"meta":98,"style":98},"#!/bin/bash\n\n### ---\n### config.sh\n### ---\n\n# Update this script with your Slurm account information\n\n# your email address to receive notifications\nemail=youremail@yourinstitution.edu\n\n# The following variable should match your Slurm Allocation/Project ID\nproject=p00000\n\n# the experiment directory (absolute path)\npath=/home/username/projectfolder\n",[100,697,698,703,707,711,716,720,724,729,733,738,748,752,757,767,771,776],{"__ignoreMap":98},[103,699,700],{"class":105,"line":106},[103,701,702],{"class":221},"#!/bin/bash\n",[103,704,705],{"class":105,"line":121},[103,706,228],{"emptyLinePlaceholder":227},[103,708,709],{"class":105,"line":231},[103,710,234],{"class":221},[103,712,713],{"class":105,"line":237},[103,714,715],{"class":221},"### config.sh\n",[103,717,718],{"class":105,"line":243},[103,719,234],{"class":221},[103,721,722],{"class":105,"line":248},[103,723,228],{"emptyLinePlaceholder":227},[103,725,726],{"class":105,"line":253},[103,727,728],{"class":221},"# Update this script with your Slurm account information\n",[103,730,731],{"class":105,"line":259},[103,732,228],{"emptyLinePlaceholder":227},[103,734,735],{"class":105,"line":264},[103,736,737],{"class":221},"# your email address to receive notifications\n",[103,739,740,743,745],{"class":105,"line":270},[103,741,742],{"class":369},"email",[103,744,374],{"class":373},[103,746,747],{"class":117},"youremail@yourinstitution.edu\n",[103,749,750],{"class":105,"line":276},[103,751,228],{"emptyLinePlaceholder":227},[103,753,754],{"class":105,"line":282},[103,755,756],{"class":221},"# The following variable should match your Slurm Allocation/Project ID\n",[103,758,759,762,764],{"class":105,"line":288},[103,760,761],{"class":369},"project",[103,763,374],{"class":373},[103,765,766],{"class":117},"p00000\n",[103,768,769],{"class":105,"line":294},[103,770,228],{"emptyLinePlaceholder":227},[103,772,773],{"class":105,"line":300},[103,774,775],{"class":221},"# the experiment directory (absolute path)\n",[103,777,778,781,783],{"class":105,"line":306},[103,779,780],{"class":369},"path",[103,782,374],{"class":373},[103,784,785],{"class":117},"/home/username/projectfolder\n",[93,787,789],{"className":95,"code":788,"language":97,"meta":98,"style":98},"#!/bin/bash\n\n### ---\n### generate_and_submit.sh\n### ---\n\n### A script to automate the slurm job submission process for NetLogo BehaviorSpace experiments\n\nmodel=$1\nexperiment=$2\ncategory=$4\nmaxtime=$5\nthreads=$6\nram=$7\n\n# NetLogo struggles to divide experiments between multiple physical processors\nmachines=1\n\n# load the config file to pull the shared variables\nsource config.sh\n\n### AUTO GENERATE A TEMPORARY SCRIPT TO RUN THE EXPERIMENT\n### This approach minimizes the repetitive editing and potential errors\n### that may arise from trying to manually edit long scripts\n\ntotalram=$((ram*threads+4096))\nmodelpath=${path}/${model}\n\nrunfile=run_${experiment}.sh\n\n# if a file with the same name exists, just delete it\nif test -f $runfile ; then\n    rm $runfile\nfi\n\n# create the slurm job definition within the run file\necho \"#!/bin/sh\" >> $runfile\necho \"#SBATCH --account=\"${project} >> $runfile\necho \"#SBATCH --partition=\"${category} >> $runfile\necho \"#SBATCH --time=\"${maxtime} >> $runfile\necho \"#SBATCH --nodes=\"${machines} >> $runfile\necho \"#SBATCH --ntasks-per-node=\"${threads} >> $runfile\necho \"#SBATCH --mem=\"$((totalram/1024))G >> $runfile\necho \"#SBATCH --job-name=\"${experiment} >> $runfile\necho \"#SBATCH --output=output_%x-%j.out\" >> $runfile\necho \"#SBATCH --mail-type=\"ALL >> $runfile\necho \"#SBATCH --mail-user=\"${email} >> $runfile\n\necho \"module purge all\" >> $runfile\necho \"module load java/jdk-17.0.2+8\" >> $runfile\n\necho \"JVM_OPTS=(-Xmx${totalram}m -server -XX:+UseParallelGC -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=\"${BASE_DIR}/extensions\")\" >> $runfile\n\necho \"java ${JVM_OPTS[@]} -classpath ${path}/netlogo/lib/app/netlogo-7.0.0.jar org.nlogo.headless.Main --model ${modelpath} --setup-file ${path}/xml/${experiment}.xml --threads $threads --table ${path}/csv/${experiment}.csv\" >> $runfile\n\necho \"Job ID: \"\n\n# submit the job and print the job number\nsbatch --parsable $runfile\n\n# remove the temporary run file to keep things clean\nrm $runfile\n",[100,790,791,795,799,803,808,812,816,821,825,836,846,855,864,873,882,886,891,901,905,910,919,923,928,933,938,942,958,982,987,1007,1012,1018,1040,1049,1055,1060,1066,1084,1106,1128,1150,1172,1194,1221,1243,1259,1278,1300,1305,1321,1337,1342,1382,1387,1476,1481,1494,1499,1505,1515,1520,1526],{"__ignoreMap":98},[103,792,793],{"class":105,"line":106},[103,794,702],{"class":221},[103,796,797],{"class":105,"line":121},[103,798,228],{"emptyLinePlaceholder":227},[103,800,801],{"class":105,"line":231},[103,802,234],{"class":221},[103,804,805],{"class":105,"line":237},[103,806,807],{"class":221},"### generate_and_submit.sh\n",[103,809,810],{"class":105,"line":243},[103,811,234],{"class":221},[103,813,814],{"class":105,"line":248},[103,815,228],{"emptyLinePlaceholder":227},[103,817,818],{"class":105,"line":253},[103,819,820],{"class":221},"### A script to automate the slurm job submission process for NetLogo BehaviorSpace experiments\n",[103,822,823],{"class":105,"line":259},[103,824,228],{"emptyLinePlaceholder":227},[103,826,827,830,832],{"class":105,"line":264},[103,828,829],{"class":369},"model",[103,831,374],{"class":373},[103,833,835],{"class":834},"s99_P","$1\n",[103,837,838,841,843],{"class":105,"line":270},[103,839,840],{"class":369},"experiment",[103,842,374],{"class":373},[103,844,845],{"class":834},"$2\n",[103,847,848,850,852],{"class":105,"line":276},[103,849,626],{"class":369},[103,851,374],{"class":373},[103,853,854],{"class":834},"$4\n",[103,856,857,859,861],{"class":105,"line":282},[103,858,632],{"class":369},[103,860,374],{"class":373},[103,862,863],{"class":834},"$5\n",[103,865,866,868,870],{"class":105,"line":288},[103,867,643],{"class":369},[103,869,374],{"class":373},[103,871,872],{"class":834},"$6\n",[103,874,875,877,879],{"class":105,"line":294},[103,876,649],{"class":369},[103,878,374],{"class":373},[103,880,881],{"class":834},"$7\n",[103,883,884],{"class":105,"line":300},[103,885,228],{"emptyLinePlaceholder":227},[103,887,888],{"class":105,"line":306},[103,889,890],{"class":221},"# NetLogo struggles to divide experiments between multiple physical processors\n",[103,892,893,896,898],{"class":105,"line":312},[103,894,895],{"class":369},"machines",[103,897,374],{"class":373},[103,899,900],{"class":117},"1\n",[103,902,903],{"class":105,"line":318},[103,904,228],{"emptyLinePlaceholder":227},[103,906,907],{"class":105,"line":324},[103,908,909],{"class":221},"# load the config file to pull the shared variables\n",[103,911,912,916],{"class":105,"line":330},[103,913,915],{"class":914},"sptTA","source",[103,917,918],{"class":117}," config.sh\n",[103,920,921],{"class":105,"line":335},[103,922,228],{"emptyLinePlaceholder":227},[103,924,925],{"class":105,"line":347},[103,926,927],{"class":221},"### AUTO GENERATE A TEMPORARY SCRIPT TO RUN THE EXPERIMENT\n",[103,929,930],{"class":105,"line":361},[103,931,932],{"class":221},"### This approach minimizes the repetitive editing and potential errors\n",[103,934,935],{"class":105,"line":366},[103,936,937],{"class":221},"### that may arise from trying to manually edit long scripts\n",[103,939,940],{"class":105,"line":429},[103,941,228],{"emptyLinePlaceholder":227},[103,943,944,947,949,952,955],{"class":105,"line":434},[103,945,946],{"class":369},"totalram",[103,948,374],{"class":373},[103,950,951],{"class":377},"$((",[103,953,954],{"class":109},"ram*threads+4096",[103,956,957],{"class":377},"))\n",[103,959,960,963,965,968,970,972,975,977,979],{"class":105,"line":440},[103,961,962],{"class":369},"modelpath",[103,964,374],{"class":373},[103,966,967],{"class":377},"${",[103,969,780],{"class":369},[103,971,417],{"class":377},[103,973,974],{"class":117},"/",[103,976,967],{"class":377},[103,978,829],{"class":369},[103,980,981],{"class":377},"}\n",[103,983,985],{"class":105,"line":984},28,[103,986,228],{"emptyLinePlaceholder":227},[103,988,990,993,995,998,1000,1002,1004],{"class":105,"line":989},29,[103,991,992],{"class":369},"runfile",[103,994,374],{"class":373},[103,996,997],{"class":117},"run_",[103,999,967],{"class":377},[103,1001,840],{"class":369},[103,1003,417],{"class":377},[103,1005,1006],{"class":117},".sh\n",[103,1008,1010],{"class":105,"line":1009},30,[103,1011,228],{"emptyLinePlaceholder":227},[103,1013,1015],{"class":105,"line":1014},31,[103,1016,1017],{"class":221},"# if a file with the same name exists, just delete it\n",[103,1019,1021,1025,1028,1031,1034,1037],{"class":105,"line":1020},32,[103,1022,1024],{"class":1023},"sVHd0","if",[103,1026,1027],{"class":914}," test",[103,1029,1030],{"class":113}," -f",[103,1032,1033],{"class":369}," $runfile ",[103,1035,1036],{"class":377},";",[103,1038,1039],{"class":1023}," then\n",[103,1041,1043,1046],{"class":105,"line":1042},33,[103,1044,1045],{"class":109},"    rm",[103,1047,1048],{"class":369}," $runfile\n",[103,1050,1052],{"class":105,"line":1051},34,[103,1053,1054],{"class":1023},"fi\n",[103,1056,1058],{"class":105,"line":1057},35,[103,1059,228],{"emptyLinePlaceholder":227},[103,1061,1063],{"class":105,"line":1062},36,[103,1064,1065],{"class":221},"# create the slurm job definition within the run file\n",[103,1067,1069,1072,1074,1077,1079,1082],{"class":105,"line":1068},37,[103,1070,1071],{"class":914},"echo",[103,1073,472],{"class":410},[103,1075,1076],{"class":117},"#!/bin/sh",[103,1078,423],{"class":410},[103,1080,1081],{"class":373}," >>",[103,1083,1048],{"class":369},[103,1085,1087,1089,1091,1094,1096,1098,1100,1102,1104],{"class":105,"line":1086},38,[103,1088,1071],{"class":914},[103,1090,472],{"class":410},[103,1092,1093],{"class":117},"#SBATCH --account=",[103,1095,423],{"class":410},[103,1097,967],{"class":377},[103,1099,761],{"class":369},[103,1101,417],{"class":377},[103,1103,1081],{"class":373},[103,1105,1048],{"class":369},[103,1107,1109,1111,1113,1116,1118,1120,1122,1124,1126],{"class":105,"line":1108},39,[103,1110,1071],{"class":914},[103,1112,472],{"class":410},[103,1114,1115],{"class":117},"#SBATCH --partition=",[103,1117,423],{"class":410},[103,1119,967],{"class":377},[103,1121,626],{"class":369},[103,1123,417],{"class":377},[103,1125,1081],{"class":373},[103,1127,1048],{"class":369},[103,1129,1131,1133,1135,1138,1140,1142,1144,1146,1148],{"class":105,"line":1130},40,[103,1132,1071],{"class":914},[103,1134,472],{"class":410},[103,1136,1137],{"class":117},"#SBATCH --time=",[103,1139,423],{"class":410},[103,1141,967],{"class":377},[103,1143,632],{"class":369},[103,1145,417],{"class":377},[103,1147,1081],{"class":373},[103,1149,1048],{"class":369},[103,1151,1153,1155,1157,1160,1162,1164,1166,1168,1170],{"class":105,"line":1152},41,[103,1154,1071],{"class":914},[103,1156,472],{"class":410},[103,1158,1159],{"class":117},"#SBATCH --nodes=",[103,1161,423],{"class":410},[103,1163,967],{"class":377},[103,1165,895],{"class":369},[103,1167,417],{"class":377},[103,1169,1081],{"class":373},[103,1171,1048],{"class":369},[103,1173,1175,1177,1179,1182,1184,1186,1188,1190,1192],{"class":105,"line":1174},42,[103,1176,1071],{"class":914},[103,1178,472],{"class":410},[103,1180,1181],{"class":117},"#SBATCH --ntasks-per-node=",[103,1183,423],{"class":410},[103,1185,967],{"class":377},[103,1187,643],{"class":369},[103,1189,417],{"class":377},[103,1191,1081],{"class":373},[103,1193,1048],{"class":369},[103,1195,1197,1199,1201,1204,1206,1208,1211,1214,1217,1219],{"class":105,"line":1196},43,[103,1198,1071],{"class":914},[103,1200,472],{"class":410},[103,1202,1203],{"class":117},"#SBATCH --mem=",[103,1205,423],{"class":410},[103,1207,951],{"class":377},[103,1209,1210],{"class":109},"totalram/1024",[103,1212,1213],{"class":377},"))",[103,1215,1216],{"class":117},"G",[103,1218,1081],{"class":373},[103,1220,1048],{"class":369},[103,1222,1224,1226,1228,1231,1233,1235,1237,1239,1241],{"class":105,"line":1223},44,[103,1225,1071],{"class":914},[103,1227,472],{"class":410},[103,1229,1230],{"class":117},"#SBATCH --job-name=",[103,1232,423],{"class":410},[103,1234,967],{"class":377},[103,1236,840],{"class":369},[103,1238,417],{"class":377},[103,1240,1081],{"class":373},[103,1242,1048],{"class":369},[103,1244,1246,1248,1250,1253,1255,1257],{"class":105,"line":1245},45,[103,1247,1071],{"class":914},[103,1249,472],{"class":410},[103,1251,1252],{"class":117},"#SBATCH --output=output_%x-%j.out",[103,1254,423],{"class":410},[103,1256,1081],{"class":373},[103,1258,1048],{"class":369},[103,1260,1262,1264,1266,1269,1271,1274,1276],{"class":105,"line":1261},46,[103,1263,1071],{"class":914},[103,1265,472],{"class":410},[103,1267,1268],{"class":117},"#SBATCH --mail-type=",[103,1270,423],{"class":410},[103,1272,1273],{"class":117},"ALL",[103,1275,1081],{"class":373},[103,1277,1048],{"class":369},[103,1279,1281,1283,1285,1288,1290,1292,1294,1296,1298],{"class":105,"line":1280},47,[103,1282,1071],{"class":914},[103,1284,472],{"class":410},[103,1286,1287],{"class":117},"#SBATCH --mail-user=",[103,1289,423],{"class":410},[103,1291,967],{"class":377},[103,1293,742],{"class":369},[103,1295,417],{"class":377},[103,1297,1081],{"class":373},[103,1299,1048],{"class":369},[103,1301,1303],{"class":105,"line":1302},48,[103,1304,228],{"emptyLinePlaceholder":227},[103,1306,1308,1310,1312,1315,1317,1319],{"class":105,"line":1307},49,[103,1309,1071],{"class":914},[103,1311,472],{"class":410},[103,1313,1314],{"class":117},"module purge all",[103,1316,423],{"class":410},[103,1318,1081],{"class":373},[103,1320,1048],{"class":369},[103,1322,1324,1326,1328,1331,1333,1335],{"class":105,"line":1323},50,[103,1325,1071],{"class":914},[103,1327,472],{"class":410},[103,1329,1330],{"class":117},"module load java/jdk-17.0.2+8",[103,1332,423],{"class":410},[103,1334,1081],{"class":373},[103,1336,1048],{"class":369},[103,1338,1340],{"class":105,"line":1339},51,[103,1341,228],{"emptyLinePlaceholder":227},[103,1343,1345,1347,1349,1352,1354,1356,1358,1361,1363,1365,1367,1369,1371,1373,1376,1378,1380],{"class":105,"line":1344},52,[103,1346,1071],{"class":914},[103,1348,472],{"class":410},[103,1350,1351],{"class":117},"JVM_OPTS=(-Xmx",[103,1353,967],{"class":410},[103,1355,946],{"class":369},[103,1357,417],{"class":410},[103,1359,1360],{"class":117},"m -server -XX:+UseParallelGC -Dfile.encoding=UTF-8 -Dnetlogo.extensions.dir=",[103,1362,423],{"class":410},[103,1364,967],{"class":377},[103,1366,414],{"class":369},[103,1368,417],{"class":377},[103,1370,420],{"class":117},[103,1372,423],{"class":410},[103,1374,1375],{"class":117},")",[103,1377,423],{"class":410},[103,1379,1081],{"class":373},[103,1381,1048],{"class":369},[103,1383,1385],{"class":105,"line":1384},53,[103,1386,228],{"emptyLinePlaceholder":227},[103,1388,1390,1392,1394,1397,1399,1401,1403,1405,1407,1410,1412,1414,1416,1419,1421,1423,1425,1428,1430,1432,1434,1437,1439,1441,1443,1446,1449,1452,1454,1456,1458,1461,1463,1465,1467,1470,1472,1474],{"class":105,"line":1389},54,[103,1391,1071],{"class":914},[103,1393,472],{"class":410},[103,1395,1396],{"class":117},"java ",[103,1398,967],{"class":410},[103,1400,370],{"class":369},[103,1402,451],{"class":410},[103,1404,454],{"class":373},[103,1406,457],{"class":410},[103,1408,1409],{"class":117}," -classpath ",[103,1411,967],{"class":410},[103,1413,780],{"class":369},[103,1415,417],{"class":410},[103,1417,1418],{"class":117},"/netlogo/lib/app/netlogo-7.0.0.jar org.nlogo.headless.Main --model ",[103,1420,967],{"class":410},[103,1422,962],{"class":369},[103,1424,417],{"class":410},[103,1426,1427],{"class":117}," --setup-file ",[103,1429,967],{"class":410},[103,1431,780],{"class":369},[103,1433,417],{"class":410},[103,1435,1436],{"class":117},"/xml/",[103,1438,967],{"class":410},[103,1440,840],{"class":369},[103,1442,417],{"class":410},[103,1444,1445],{"class":117},".xml --threads ",[103,1447,1448],{"class":369},"$threads",[103,1450,1451],{"class":117}," --table ",[103,1453,967],{"class":410},[103,1455,780],{"class":369},[103,1457,417],{"class":410},[103,1459,1460],{"class":117},"/csv/",[103,1462,967],{"class":410},[103,1464,840],{"class":369},[103,1466,417],{"class":410},[103,1468,1469],{"class":117},".csv",[103,1471,423],{"class":410},[103,1473,1081],{"class":373},[103,1475,1048],{"class":369},[103,1477,1479],{"class":105,"line":1478},55,[103,1480,228],{"emptyLinePlaceholder":227},[103,1482,1484,1486,1488,1491],{"class":105,"line":1483},56,[103,1485,1071],{"class":914},[103,1487,472],{"class":410},[103,1489,1490],{"class":117},"Job ID: ",[103,1492,1493],{"class":410},"\"\n",[103,1495,1497],{"class":105,"line":1496},57,[103,1498,228],{"emptyLinePlaceholder":227},[103,1500,1502],{"class":105,"line":1501},58,[103,1503,1504],{"class":221},"# submit the job and print the job number\n",[103,1506,1508,1510,1513],{"class":105,"line":1507},59,[103,1509,202],{"class":109},[103,1511,1512],{"class":113}," --parsable",[103,1514,1048],{"class":369},[103,1516,1518],{"class":105,"line":1517},60,[103,1519,228],{"emptyLinePlaceholder":227},[103,1521,1523],{"class":105,"line":1522},61,[103,1524,1525],{"class":221},"# remove the temporary run file to keep things clean\n",[103,1527,1529,1532],{"class":105,"line":1528},62,[103,1530,1531],{"class":109},"rm",[103,1533,1048],{"class":369},[68,1535,1538],{"id":1536,"className":1537},"advanced-usage",[14],[16,1539,66],{"className":1540,"href":65},[19],[22,1542,1543],{},"NetLogo includes built-in parallelization, but this often does not integrate well with multi-node HPC architectures. Large BehaviorSpace experiments with many parameter combinations and repetitions that require hundreds or thousands of runs may crash if distributed directly across multiple nodes.",[22,1545,1546],{},"A better strategy is to split the experiment into many small jobs (one per parameter combination and repetition).",[22,1548,1549],{},"To do so, first we need to subdivide our NetLogo BehaviorSpace experiment into separate BehaviorSpace experiment files (xml files) for each parameter combination.",[170,1551,1554],{"id":1552,"className":1553},"dividing-behaviorspace-experiments-into-smaller-sub-experiments",[14],[16,1555,1558],{"className":1556,"href":1557},[19],"#dividing-behaviorspace-experiments-into-smaller-sub-experiments","Dividing BehaviorSpace experiments into smaller sub-experiments",[22,1560,1561],{},"This step can be performed on your local machine, not necessarily on an HPC.",[145,1563,1564],{},[49,1565,1566,1567,168],{},"Export your BehaviorSpace experiment as an XML file. In BehaviorSpace, select your experiment and click ",[635,1568,1569],{},"Export",[22,1571,1572],{},[1573,1574],"img",{"alt":1575,"className":1576,"src":1578,"width":1579,"height":1580,"style":1581},"hpc/export.png",[1577],"netlogo-image","/_content/images/hpc/export.png",410,327,{"aspectRatio":1582},"410/327",[46,1584,1585],{},[49,1586,1587,1588,1591],{},"For maximum parallelization, set repetitions to ",[26,1589,1590],{},"1"," before exporting. This allows submitting a separate job for each repetition.",[145,1593,1594],{"start":121},[49,1595,1596,1597,168],{},"Use the exported XML file to generate individual experiment files. Instructions and a Jupyter notebook can be found ",[16,1598,1601],{"href":1599,"rel":1600},"https://github.com/can-gurkan/BehaviorSpace_exp_split",[87],"here",[22,1603,1604,1605,1608],{},"Alternatively, you can run the Python script below (",[100,1606,1607],{},"split_bspace_exps.py",") if you have Python installed on your machine. It is the same script linked above which generates one XML experiment file per parameter combination.",[22,1610,1611],{},"Run as:",[93,1613,1615],{"className":95,"code":1614,"language":97,"meta":98,"style":98},"python split_bspace_exps.py \u003Cinput_file_name> \u003Coutput_folder_path>\n",[100,1616,1617],{"__ignoreMap":98},[103,1618,1619,1622,1625,1627,1630,1632,1634,1636,1639,1642],{"class":105,"line":106},[103,1620,1621],{"class":109},"python",[103,1623,1624],{"class":117}," split_bspace_exps.py",[103,1626,547],{"class":373},[103,1628,1629],{"class":117},"input_file_nam",[103,1631,553],{"class":369},[103,1633,556],{"class":373},[103,1635,547],{"class":373},[103,1637,1638],{"class":117},"output_folder_pat",[103,1640,1641],{"class":369},"h",[103,1643,605],{"class":373},[22,1645,1646],{},[26,1647,658],{},[93,1649,1651],{"className":95,"code":1650,"language":97,"meta":98,"style":98},"python split_bspace_exps.py /path/to/example-experiment.xml /path/to/output/folder/\n",[100,1652,1653],{"__ignoreMap":98},[103,1654,1655,1657,1659,1662],{"class":105,"line":106},[103,1656,1621],{"class":109},[103,1658,1624],{"class":117},[103,1660,1661],{"class":117}," /path/to/example-experiment.xml",[103,1663,1664],{"class":117}," /path/to/output/folder/\n",[22,1666,1667],{},[26,1668,211],{},[93,1670,1673],{"className":1671,"code":1672,"language":1621,"meta":98,"style":98},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","\"\"\"split_bspace_exps.py\n\nThis script splits a NetLogo BehaviorSpace experiment into multiple experiments, each with a different set of parameters.\nThe inputs are a BehaviorSpace experiment xml file and the output folder path.\nThe output is a folder with the new experiments, one for each combination of parameters.\n\nUsage: python split_bspace_exps.py \u003Cinput_file_name> \u003Coutput_folder_path>\nExample: python split_bspace_exps.py /path/to/example-experiment.xml /path/to/output/folder/\n\"\"\"\n\nimport sys\nimport xml.etree.ElementTree as ET\nfrom itertools import product\nfrom pathlib import Path\n\ndef dict_product(d):\n    \"\"\"\n    Given a dictionary of parameters and their values, return a generator that yields a dictionary for each combination of parameters.\n    \"\"\"\n    keys = d.keys()\n    for element in product(*d.values()):\n        yield dict(zip(keys, element))\n\ndef construct_pdict(file_name):\n    \"\"\"\n    Given a BehaviorSpace experiment xml file, return a dictionary of parameters and their values.\n    \"\"\"\n    tree = ET.parse(file_name)\n    root = tree.getroot()\n    pdict = {}\n    for node in root.findall('.//enumeratedValueSet'):\n        plist = []\n        for child in node:\n            plist.append(child.attrib.get('value'))\n        if len(plist) > 1:\n            pdict[node.get('variable')] = plist\n    for node in root.findall('.//steppedValueSet'):\n        rstart = node.attrib.get('first')\n        rend = node.attrib.get('last')\n        rstep = node.attrib.get('step')\n        plist = range(int(rstart), int(rend)+int(rstep), int(rstep))\n        pdict[node.get('variable')] = [str(num) for num in plist]\n    print(pdict)\n    return pdict\n\ndef process_xml(file, dict, new_folder):\n    \"\"\"\n    Given a BehaviorSpace experiment xml file, a dictionary of parameters and their values, and a new folder,\n    create a new experiment xml file for each combination of parameters and save it to the new folder.\n    \"\"\"\n    tree = ET.parse(file)\n    root = tree.getroot()\n    counter = 0\n    name_list = []\n    Path(new_folder).mkdir(parents=True, exist_ok=True)\n    for cd in dict_product(dict):\n        exp_name_str = 'exp' + str(counter)\n        name_list.append([exp_name_str,list(cd.values())])\n        root[0].set('name', exp_name_str)\n\n        for k,v in cd.items():\n            # first delete all elements matching the tag\n            elements_to_remove = root.findall('.//*[@variable=\"'+k+'\"]')\n            for element in elements_to_remove:\n                # Iterate through the entire tree to find the parent of the current element\n                for parent in root.iter():\n                    if element in parent:\n                        parent.remove(element)\n                        break\n            # Now insert the appropriate elements\n            target_item = root.find('.//constants')\n            new_element_str = f'\u003CenumeratedValueSet variable=\"{k}\">\u003Cvalue value=\"{v}\">\u003C/value>\u003C/enumeratedValueSet>'\n            new_element = ET.fromstring(new_element_str)\n            target_item.append(new_element)\n\n        with open(new_folder+exp_name_str+'.xml', 'wb') as f:\n            ET.indent(root, space=\"  \")\n            tree.write(f, 'utf-8', xml_declaration=True)\n        counter += 1\n    print(f'{counter} experiments created')\n    print('\\nexp_name', list(cd.keys()))\n    for i in name_list:\n        print(i)\n\ndef split_exps(file_name,new_folder):\n    \"\"\"\n    Given a BehaviorSpace experiment xml file and a new folder,\n    construct a dictionary of parameters and their values,\n    and create a new experiment xml file for each combination of parameters and save it to the new folder.\n    \"\"\"\n    pdict = construct_pdict(file_name)\n    process_xml(file_name, pdict, new_folder)\n\ndef check_args(args):\n    \"\"\"\n    Given a list of arguments, check if the arguments are valid.\n    \"\"\"\n    if len(args) != 3:\n        print('Error: Invalid number of arguments')\n        print('Usage: python split_bspace_exps.py \u003Cinput_file_name> \u003Coutput_folder_path>')\n        print('Example: python split_bspace_exps.py /path/to/example-experiment.xml /path/to/output/folder/')\n        sys.exit(1)\n    if not Path(args[1]).exists():\n        print('Error: input_file_name does not exist')\n        sys.exit(1)\n\n\nif __name__ == '__main__':\n\n    check_args(sys.argv)\n    split_exps(sys.argv[1], sys.argv[2])\n    print('Done')\n",[100,1674,1675,1680,1684,1689,1694,1699,1703,1708,1713,1718,1722,1727,1732,1737,1742,1746,1751,1756,1761,1765,1770,1775,1780,1784,1789,1793,1798,1802,1807,1812,1817,1822,1827,1832,1837,1842,1847,1852,1857,1862,1867,1872,1877,1882,1887,1891,1896,1900,1905,1910,1914,1919,1923,1928,1933,1938,1943,1948,1953,1958,1962,1967,1972,1978,1984,1990,1996,2002,2008,2014,2020,2026,2032,2038,2044,2049,2055,2061,2067,2073,2079,2085,2091,2097,2102,2108,2113,2119,2125,2131,2136,2142,2148,2153,2159,2164,2170,2175,2181,2187,2193,2199,2205,2211,2217,2222,2227,2232,2238,2243,2249,2255],{"__ignoreMap":98},[103,1676,1677],{"class":105,"line":106},[103,1678,1679],{},"\"\"\"split_bspace_exps.py\n",[103,1681,1682],{"class":105,"line":121},[103,1683,228],{"emptyLinePlaceholder":227},[103,1685,1686],{"class":105,"line":231},[103,1687,1688],{},"This script splits a NetLogo BehaviorSpace experiment into multiple experiments, each with a different set of parameters.\n",[103,1690,1691],{"class":105,"line":237},[103,1692,1693],{},"The inputs are a BehaviorSpace experiment xml file and the output folder path.\n",[103,1695,1696],{"class":105,"line":243},[103,1697,1698],{},"The output is a folder with the new experiments, one for each combination of parameters.\n",[103,1700,1701],{"class":105,"line":248},[103,1702,228],{"emptyLinePlaceholder":227},[103,1704,1705],{"class":105,"line":253},[103,1706,1707],{},"Usage: python split_bspace_exps.py \u003Cinput_file_name> \u003Coutput_folder_path>\n",[103,1709,1710],{"class":105,"line":259},[103,1711,1712],{},"Example: python split_bspace_exps.py /path/to/example-experiment.xml /path/to/output/folder/\n",[103,1714,1715],{"class":105,"line":264},[103,1716,1717],{},"\"\"\"\n",[103,1719,1720],{"class":105,"line":270},[103,1721,228],{"emptyLinePlaceholder":227},[103,1723,1724],{"class":105,"line":276},[103,1725,1726],{},"import sys\n",[103,1728,1729],{"class":105,"line":282},[103,1730,1731],{},"import xml.etree.ElementTree as ET\n",[103,1733,1734],{"class":105,"line":288},[103,1735,1736],{},"from itertools import product\n",[103,1738,1739],{"class":105,"line":294},[103,1740,1741],{},"from pathlib import Path\n",[103,1743,1744],{"class":105,"line":300},[103,1745,228],{"emptyLinePlaceholder":227},[103,1747,1748],{"class":105,"line":306},[103,1749,1750],{},"def dict_product(d):\n",[103,1752,1753],{"class":105,"line":312},[103,1754,1755],{},"    \"\"\"\n",[103,1757,1758],{"class":105,"line":318},[103,1759,1760],{},"    Given a dictionary of parameters and their values, return a generator that yields a dictionary for each combination of parameters.\n",[103,1762,1763],{"class":105,"line":324},[103,1764,1755],{},[103,1766,1767],{"class":105,"line":330},[103,1768,1769],{},"    keys = d.keys()\n",[103,1771,1772],{"class":105,"line":335},[103,1773,1774],{},"    for element in product(*d.values()):\n",[103,1776,1777],{"class":105,"line":347},[103,1778,1779],{},"        yield dict(zip(keys, element))\n",[103,1781,1782],{"class":105,"line":361},[103,1783,228],{"emptyLinePlaceholder":227},[103,1785,1786],{"class":105,"line":366},[103,1787,1788],{},"def construct_pdict(file_name):\n",[103,1790,1791],{"class":105,"line":429},[103,1792,1755],{},[103,1794,1795],{"class":105,"line":434},[103,1796,1797],{},"    Given a BehaviorSpace experiment xml file, return a dictionary of parameters and their values.\n",[103,1799,1800],{"class":105,"line":440},[103,1801,1755],{},[103,1803,1804],{"class":105,"line":984},[103,1805,1806],{},"    tree = ET.parse(file_name)\n",[103,1808,1809],{"class":105,"line":989},[103,1810,1811],{},"    root = tree.getroot()\n",[103,1813,1814],{"class":105,"line":1009},[103,1815,1816],{},"    pdict = {}\n",[103,1818,1819],{"class":105,"line":1014},[103,1820,1821],{},"    for node in root.findall('.//enumeratedValueSet'):\n",[103,1823,1824],{"class":105,"line":1020},[103,1825,1826],{},"        plist = []\n",[103,1828,1829],{"class":105,"line":1042},[103,1830,1831],{},"        for child in node:\n",[103,1833,1834],{"class":105,"line":1051},[103,1835,1836],{},"            plist.append(child.attrib.get('value'))\n",[103,1838,1839],{"class":105,"line":1057},[103,1840,1841],{},"        if len(plist) > 1:\n",[103,1843,1844],{"class":105,"line":1062},[103,1845,1846],{},"            pdict[node.get('variable')] = plist\n",[103,1848,1849],{"class":105,"line":1068},[103,1850,1851],{},"    for node in root.findall('.//steppedValueSet'):\n",[103,1853,1854],{"class":105,"line":1086},[103,1855,1856],{},"        rstart = node.attrib.get('first')\n",[103,1858,1859],{"class":105,"line":1108},[103,1860,1861],{},"        rend = node.attrib.get('last')\n",[103,1863,1864],{"class":105,"line":1130},[103,1865,1866],{},"        rstep = node.attrib.get('step')\n",[103,1868,1869],{"class":105,"line":1152},[103,1870,1871],{},"        plist = range(int(rstart), int(rend)+int(rstep), int(rstep))\n",[103,1873,1874],{"class":105,"line":1174},[103,1875,1876],{},"        pdict[node.get('variable')] = [str(num) for num in plist]\n",[103,1878,1879],{"class":105,"line":1196},[103,1880,1881],{},"    print(pdict)\n",[103,1883,1884],{"class":105,"line":1223},[103,1885,1886],{},"    return pdict\n",[103,1888,1889],{"class":105,"line":1245},[103,1890,228],{"emptyLinePlaceholder":227},[103,1892,1893],{"class":105,"line":1261},[103,1894,1895],{},"def process_xml(file, dict, new_folder):\n",[103,1897,1898],{"class":105,"line":1280},[103,1899,1755],{},[103,1901,1902],{"class":105,"line":1302},[103,1903,1904],{},"    Given a BehaviorSpace experiment xml file, a dictionary of parameters and their values, and a new folder,\n",[103,1906,1907],{"class":105,"line":1307},[103,1908,1909],{},"    create a new experiment xml file for each combination of parameters and save it to the new folder.\n",[103,1911,1912],{"class":105,"line":1323},[103,1913,1755],{},[103,1915,1916],{"class":105,"line":1339},[103,1917,1918],{},"    tree = ET.parse(file)\n",[103,1920,1921],{"class":105,"line":1344},[103,1922,1811],{},[103,1924,1925],{"class":105,"line":1384},[103,1926,1927],{},"    counter = 0\n",[103,1929,1930],{"class":105,"line":1389},[103,1931,1932],{},"    name_list = []\n",[103,1934,1935],{"class":105,"line":1478},[103,1936,1937],{},"    Path(new_folder).mkdir(parents=True, exist_ok=True)\n",[103,1939,1940],{"class":105,"line":1483},[103,1941,1942],{},"    for cd in dict_product(dict):\n",[103,1944,1945],{"class":105,"line":1496},[103,1946,1947],{},"        exp_name_str = 'exp' + str(counter)\n",[103,1949,1950],{"class":105,"line":1501},[103,1951,1952],{},"        name_list.append([exp_name_str,list(cd.values())])\n",[103,1954,1955],{"class":105,"line":1507},[103,1956,1957],{},"        root[0].set('name', exp_name_str)\n",[103,1959,1960],{"class":105,"line":1517},[103,1961,228],{"emptyLinePlaceholder":227},[103,1963,1964],{"class":105,"line":1522},[103,1965,1966],{},"        for k,v in cd.items():\n",[103,1968,1969],{"class":105,"line":1528},[103,1970,1971],{},"            # first delete all elements matching the tag\n",[103,1973,1975],{"class":105,"line":1974},63,[103,1976,1977],{},"            elements_to_remove = root.findall('.//*[@variable=\"'+k+'\"]')\n",[103,1979,1981],{"class":105,"line":1980},64,[103,1982,1983],{},"            for element in elements_to_remove:\n",[103,1985,1987],{"class":105,"line":1986},65,[103,1988,1989],{},"                # Iterate through the entire tree to find the parent of the current element\n",[103,1991,1993],{"class":105,"line":1992},66,[103,1994,1995],{},"                for parent in root.iter():\n",[103,1997,1999],{"class":105,"line":1998},67,[103,2000,2001],{},"                    if element in parent:\n",[103,2003,2005],{"class":105,"line":2004},68,[103,2006,2007],{},"                        parent.remove(element)\n",[103,2009,2011],{"class":105,"line":2010},69,[103,2012,2013],{},"                        break\n",[103,2015,2017],{"class":105,"line":2016},70,[103,2018,2019],{},"            # Now insert the appropriate elements\n",[103,2021,2023],{"class":105,"line":2022},71,[103,2024,2025],{},"            target_item = root.find('.//constants')\n",[103,2027,2029],{"class":105,"line":2028},72,[103,2030,2031],{},"            new_element_str = f'\u003CenumeratedValueSet variable=\"{k}\">\u003Cvalue value=\"{v}\">\u003C/value>\u003C/enumeratedValueSet>'\n",[103,2033,2035],{"class":105,"line":2034},73,[103,2036,2037],{},"            new_element = ET.fromstring(new_element_str)\n",[103,2039,2041],{"class":105,"line":2040},74,[103,2042,2043],{},"            target_item.append(new_element)\n",[103,2045,2047],{"class":105,"line":2046},75,[103,2048,228],{"emptyLinePlaceholder":227},[103,2050,2052],{"class":105,"line":2051},76,[103,2053,2054],{},"        with open(new_folder+exp_name_str+'.xml', 'wb') as f:\n",[103,2056,2058],{"class":105,"line":2057},77,[103,2059,2060],{},"            ET.indent(root, space=\"  \")\n",[103,2062,2064],{"class":105,"line":2063},78,[103,2065,2066],{},"            tree.write(f, 'utf-8', xml_declaration=True)\n",[103,2068,2070],{"class":105,"line":2069},79,[103,2071,2072],{},"        counter += 1\n",[103,2074,2076],{"class":105,"line":2075},80,[103,2077,2078],{},"    print(f'{counter} experiments created')\n",[103,2080,2082],{"class":105,"line":2081},81,[103,2083,2084],{},"    print('\\nexp_name', list(cd.keys()))\n",[103,2086,2088],{"class":105,"line":2087},82,[103,2089,2090],{},"    for i in name_list:\n",[103,2092,2094],{"class":105,"line":2093},83,[103,2095,2096],{},"        print(i)\n",[103,2098,2100],{"class":105,"line":2099},84,[103,2101,228],{"emptyLinePlaceholder":227},[103,2103,2105],{"class":105,"line":2104},85,[103,2106,2107],{},"def split_exps(file_name,new_folder):\n",[103,2109,2111],{"class":105,"line":2110},86,[103,2112,1755],{},[103,2114,2116],{"class":105,"line":2115},87,[103,2117,2118],{},"    Given a BehaviorSpace experiment xml file and a new folder,\n",[103,2120,2122],{"class":105,"line":2121},88,[103,2123,2124],{},"    construct a dictionary of parameters and their values,\n",[103,2126,2128],{"class":105,"line":2127},89,[103,2129,2130],{},"    and create a new experiment xml file for each combination of parameters and save it to the new folder.\n",[103,2132,2134],{"class":105,"line":2133},90,[103,2135,1755],{},[103,2137,2139],{"class":105,"line":2138},91,[103,2140,2141],{},"    pdict = construct_pdict(file_name)\n",[103,2143,2145],{"class":105,"line":2144},92,[103,2146,2147],{},"    process_xml(file_name, pdict, new_folder)\n",[103,2149,2151],{"class":105,"line":2150},93,[103,2152,228],{"emptyLinePlaceholder":227},[103,2154,2156],{"class":105,"line":2155},94,[103,2157,2158],{},"def check_args(args):\n",[103,2160,2162],{"class":105,"line":2161},95,[103,2163,1755],{},[103,2165,2167],{"class":105,"line":2166},96,[103,2168,2169],{},"    Given a list of arguments, check if the arguments are valid.\n",[103,2171,2173],{"class":105,"line":2172},97,[103,2174,1755],{},[103,2176,2178],{"class":105,"line":2177},98,[103,2179,2180],{},"    if len(args) != 3:\n",[103,2182,2184],{"class":105,"line":2183},99,[103,2185,2186],{},"        print('Error: Invalid number of arguments')\n",[103,2188,2190],{"class":105,"line":2189},100,[103,2191,2192],{},"        print('Usage: python split_bspace_exps.py \u003Cinput_file_name> \u003Coutput_folder_path>')\n",[103,2194,2196],{"class":105,"line":2195},101,[103,2197,2198],{},"        print('Example: python split_bspace_exps.py /path/to/example-experiment.xml /path/to/output/folder/')\n",[103,2200,2202],{"class":105,"line":2201},102,[103,2203,2204],{},"        sys.exit(1)\n",[103,2206,2208],{"class":105,"line":2207},103,[103,2209,2210],{},"    if not Path(args[1]).exists():\n",[103,2212,2214],{"class":105,"line":2213},104,[103,2215,2216],{},"        print('Error: input_file_name does not exist')\n",[103,2218,2220],{"class":105,"line":2219},105,[103,2221,2204],{},[103,2223,2225],{"class":105,"line":2224},106,[103,2226,228],{"emptyLinePlaceholder":227},[103,2228,2230],{"class":105,"line":2229},107,[103,2231,228],{"emptyLinePlaceholder":227},[103,2233,2235],{"class":105,"line":2234},108,[103,2236,2237],{},"if __name__ == '__main__':\n",[103,2239,2241],{"class":105,"line":2240},109,[103,2242,228],{"emptyLinePlaceholder":227},[103,2244,2246],{"class":105,"line":2245},110,[103,2247,2248],{},"    check_args(sys.argv)\n",[103,2250,2252],{"class":105,"line":2251},111,[103,2253,2254],{},"    split_exps(sys.argv[1], sys.argv[2])\n",[103,2256,2258],{"class":105,"line":2257},112,[103,2259,2260],{},"    print('Done')\n",[170,2262,2265],{"id":2263,"className":2264},"submitting-separate-jobs-for-each-experiment-file",[14],[16,2266,2269],{"className":2267,"href":2268},[19],"#submitting-separate-jobs-for-each-experiment-file","Submitting separate jobs for each experiment file",[22,2271,2272,2273,2276,2277,2279],{},"Once you have a directory of XML files, you can use the script below (",[100,2274,2275],{},"deployment.bash",") to submit each as a separate job. It uses the ",[100,2278,522],{}," script described earlier.",[22,2281,1611],{},[93,2283,2285],{"className":95,"code":2284,"language":97,"meta":98,"style":98},"bash deployment.bash \u003Cexperiment-directory> \u003Cnetlogo-model> \u003Cnum-repetitions> \u003Ccategory> \u003Cmaxtime> \u003Cthreads> \u003Cram>\n",[100,2286,2287],{"__ignoreMap":98},[103,2288,2289,2291,2294,2296,2299,2301,2303,2305,2308,2311,2313,2315,2318,2320,2322,2324,2326,2328,2330,2332,2334,2336,2338,2340,2342,2344,2346,2348,2350,2352],{"class":105,"line":106},[103,2290,97],{"class":109},[103,2292,2293],{"class":117}," deployment.bash",[103,2295,547],{"class":373},[103,2297,2298],{"class":117},"experiment-director",[103,2300,573],{"class":369},[103,2302,556],{"class":373},[103,2304,547],{"class":373},[103,2306,2307],{"class":117},"netlogo-mode",[103,2309,2310],{"class":369},"l",[103,2312,556],{"class":373},[103,2314,547],{"class":373},[103,2316,2317],{"class":117},"num-repetition",[103,2319,592],{"class":369},[103,2321,556],{"class":373},[103,2323,547],{"class":373},[103,2325,570],{"class":117},[103,2327,573],{"class":369},[103,2329,556],{"class":373},[103,2331,547],{"class":373},[103,2333,580],{"class":117},[103,2335,553],{"class":369},[103,2337,556],{"class":373},[103,2339,547],{"class":373},[103,2341,589],{"class":117},[103,2343,592],{"class":369},[103,2345,556],{"class":373},[103,2347,547],{"class":373},[103,2349,599],{"class":117},[103,2351,602],{"class":369},[103,2353,605],{"class":373},[22,2355,2356],{},"Where the arguments are:",[46,2358,2359,2365,2370,2376,2380,2386,2390],{},[49,2360,2361,2364],{},[100,2362,2363],{},"experiment-directory"," (path to directory that contains the xml files)",[49,2366,2367],{},[100,2368,2369],{},"netlogo-model",[49,2371,2372,2375],{},[100,2373,2374],{},"num-repetitions"," (how many repetitions to run for each experiment. note that this should be 1 if you did not edit the number of repetitions in your experiment before exporting)",[49,2377,2378,627],{},[100,2379,626],{},[49,2381,2382,633,2384,638],{},[100,2383,632],{},[635,2385,637],{},[49,2387,2388,644],{},[100,2389,643],{},[49,2391,2392,650],{},[100,2393,649],{},[22,2395,2396],{},[26,2397,658],{},[93,2399,2401],{"className":95,"code":2400,"language":97,"meta":98,"style":98},"bash deployment.bash /directory/of/xmls/ fire.nlogo 1 short 1:00:00 1 4096\n",[100,2402,2403],{"__ignoreMap":98},[103,2404,2405,2407,2409,2412,2414,2417,2419,2421,2423],{"class":105,"line":106},[103,2406,97],{"class":109},[103,2408,2293],{"class":117},[103,2410,2411],{"class":117}," /directory/of/xmls/",[103,2413,672],{"class":117},[103,2415,2416],{"class":493}," 1",[103,2418,678],{"class":117},[103,2420,681],{"class":117},[103,2422,2416],{"class":493},[103,2424,687],{"class":493},[22,2426,2427],{},[26,2428,211],{},[93,2430,2432],{"className":95,"code":2431,"language":97,"meta":98,"style":98},"### ---\n### deployment.bash\n### ---\n\nif [ $# -ne 7 ]\nthen\n  echo \"Usage 'bash deployment.bash /directory/of/xmls/ /path/to/model.nlogo number-of-reps partition max-time threads memory'\"\n  exit 1\nfi\n\n#XML_DIR= directory of BehaviorSpace exoeriment files\nXML_DIR=$1\n#MODEL= path to NetLogo model\nMODEL=$2\n#REPS= number of repetitions for each experiment\nREPS=$3\n#CATEGORY= partition\nCATEGORY=$4\n#MAXTIME= time limit\nMAXTIME=$5\n#THREADS= number of cpus (should be 1 in general)\nTHREADS=$6\n#RAM= max ram for each cpu in mb\nRAM=$7\n\nfor iter in $(seq 1 $REPS); do\n  for SETUPFILE in $(ls ${XML_DIR}/*.xml); do\n    EXPR=\"$(basename ${SETUPFILE%.*})\"\n    #echo $SETUPFILE\n    #echo $EXPR\n    bash generate_and_submit.sh $MODEL $SETUPFILE $CATEGORY $MAXTIME $THREADS $RAM;\n    sleep 2 # Avoid overloading the scheduler\n  done\ndone\n",[100,2433,2434,2438,2443,2447,2451,2471,2476,2488,2496,2500,2504,2509,2518,2523,2532,2537,2547,2552,2561,2566,2575,2580,2589,2594,2603,2607,2635,2668,2696,2701,2706,2719,2730,2735],{"__ignoreMap":98},[103,2435,2436],{"class":105,"line":106},[103,2437,234],{"class":221},[103,2439,2440],{"class":105,"line":121},[103,2441,2442],{"class":221},"### deployment.bash\n",[103,2444,2445],{"class":105,"line":231},[103,2446,234],{"class":221},[103,2448,2449],{"class":105,"line":237},[103,2450,228],{"emptyLinePlaceholder":227},[103,2452,2453,2455,2458,2462,2465,2468],{"class":105,"line":243},[103,2454,1024],{"class":1023},[103,2456,2457],{"class":377}," [",[103,2459,2461],{"class":2460},"s_hVV"," $#",[103,2463,2464],{"class":373}," -ne",[103,2466,2467],{"class":493}," 7",[103,2469,2470],{"class":377}," ]\n",[103,2472,2473],{"class":105,"line":248},[103,2474,2475],{"class":1023},"then\n",[103,2477,2478,2481,2483,2486],{"class":105,"line":253},[103,2479,2480],{"class":914},"  echo",[103,2482,472],{"class":410},[103,2484,2485],{"class":117},"Usage 'bash deployment.bash /directory/of/xmls/ /path/to/model.nlogo number-of-reps partition max-time threads memory'",[103,2487,1493],{"class":410},[103,2489,2490,2493],{"class":105,"line":259},[103,2491,2492],{"class":914},"  exit",[103,2494,2495],{"class":493}," 1\n",[103,2497,2498],{"class":105,"line":264},[103,2499,1054],{"class":1023},[103,2501,2502],{"class":105,"line":270},[103,2503,228],{"emptyLinePlaceholder":227},[103,2505,2506],{"class":105,"line":276},[103,2507,2508],{"class":221},"#XML_DIR= directory of BehaviorSpace exoeriment files\n",[103,2510,2511,2514,2516],{"class":105,"line":282},[103,2512,2513],{"class":369},"XML_DIR",[103,2515,374],{"class":373},[103,2517,835],{"class":834},[103,2519,2520],{"class":105,"line":288},[103,2521,2522],{"class":221},"#MODEL= path to NetLogo model\n",[103,2524,2525,2528,2530],{"class":105,"line":294},[103,2526,2527],{"class":369},"MODEL",[103,2529,374],{"class":373},[103,2531,845],{"class":834},[103,2533,2534],{"class":105,"line":300},[103,2535,2536],{"class":221},"#REPS= number of repetitions for each experiment\n",[103,2538,2539,2542,2544],{"class":105,"line":306},[103,2540,2541],{"class":369},"REPS",[103,2543,374],{"class":373},[103,2545,2546],{"class":834},"$3\n",[103,2548,2549],{"class":105,"line":312},[103,2550,2551],{"class":221},"#CATEGORY= partition\n",[103,2553,2554,2557,2559],{"class":105,"line":318},[103,2555,2556],{"class":369},"CATEGORY",[103,2558,374],{"class":373},[103,2560,854],{"class":834},[103,2562,2563],{"class":105,"line":324},[103,2564,2565],{"class":221},"#MAXTIME= time limit\n",[103,2567,2568,2571,2573],{"class":105,"line":330},[103,2569,2570],{"class":369},"MAXTIME",[103,2572,374],{"class":373},[103,2574,863],{"class":834},[103,2576,2577],{"class":105,"line":335},[103,2578,2579],{"class":221},"#THREADS= number of cpus (should be 1 in general)\n",[103,2581,2582,2585,2587],{"class":105,"line":347},[103,2583,2584],{"class":369},"THREADS",[103,2586,374],{"class":373},[103,2588,872],{"class":834},[103,2590,2591],{"class":105,"line":361},[103,2592,2593],{"class":221},"#RAM= max ram for each cpu in mb\n",[103,2595,2596,2599,2601],{"class":105,"line":366},[103,2597,2598],{"class":369},"RAM",[103,2600,374],{"class":373},[103,2602,881],{"class":834},[103,2604,2605],{"class":105,"line":429},[103,2606,228],{"emptyLinePlaceholder":227},[103,2608,2609,2612,2615,2618,2621,2624,2626,2629,2632],{"class":105,"line":434},[103,2610,2611],{"class":1023},"for",[103,2613,2614],{"class":369}," iter ",[103,2616,2617],{"class":1023},"in",[103,2619,2620],{"class":377}," $(",[103,2622,2623],{"class":109},"seq",[103,2625,2416],{"class":493},[103,2627,2628],{"class":369}," $REPS",[103,2630,2631],{"class":377},");",[103,2633,2634],{"class":1023}," do\n",[103,2636,2637,2640,2643,2645,2647,2650,2652,2654,2656,2658,2661,2664,2666],{"class":105,"line":440},[103,2638,2639],{"class":1023},"  for",[103,2641,2642],{"class":369}," SETUPFILE ",[103,2644,2617],{"class":1023},[103,2646,2620],{"class":377},[103,2648,2649],{"class":109},"ls",[103,2651,446],{"class":377},[103,2653,2513],{"class":369},[103,2655,417],{"class":377},[103,2657,974],{"class":117},[103,2659,2660],{"class":2460},"*",[103,2662,2663],{"class":117},".xml",[103,2665,2631],{"class":377},[103,2667,2634],{"class":1023},[103,2669,2670,2673,2675,2678,2681,2683,2686,2689,2691,2693],{"class":105,"line":984},[103,2671,2672],{"class":369},"    EXPR",[103,2674,374],{"class":373},[103,2676,2677],{"class":410},"\"$(",[103,2679,2680],{"class":109},"basename",[103,2682,446],{"class":410},[103,2684,2685],{"class":369},"SETUPFILE",[103,2687,2688],{"class":373},"%",[103,2690,168],{"class":117},[103,2692,2660],{"class":373},[103,2694,2695],{"class":410},"})\"\n",[103,2697,2698],{"class":105,"line":989},[103,2699,2700],{"class":221},"    #echo $SETUPFILE\n",[103,2702,2703],{"class":105,"line":1009},[103,2704,2705],{"class":221},"    #echo $EXPR\n",[103,2707,2708,2711,2713,2716],{"class":105,"line":1014},[103,2709,2710],{"class":109},"    bash",[103,2712,544],{"class":117},[103,2714,2715],{"class":369}," $MODEL $SETUPFILE $CATEGORY $MAXTIME $THREADS $RAM",[103,2717,2718],{"class":377},";\n",[103,2720,2721,2724,2727],{"class":105,"line":1020},[103,2722,2723],{"class":109},"    sleep",[103,2725,2726],{"class":493}," 2",[103,2728,2729],{"class":221}," # Avoid overloading the scheduler\n",[103,2731,2732],{"class":105,"line":1042},[103,2733,2734],{"class":1023},"  done\n",[103,2736,2737],{"class":105,"line":1051},[103,2738,2739],{"class":1023},"done\n",[22,2741,2742,2745,2746,2749],{},[26,2743,2744],{},"Note:"," This script inserts a 2-second pause after each submission to avoid overwhelming the scheduler. For very large experiments, consider running it in the background with ",[100,2747,2748],{},"screen",". For example:",[93,2751,2753],{"className":95,"code":2752,"language":97,"meta":98,"style":98},"screen -dmS session_name bash deployment.sh /directory/of/xmls/ fire.nlogo short 1:00:00 1 4096\n",[100,2754,2755],{"__ignoreMap":98},[103,2756,2757,2759,2762,2765,2768,2771,2773,2775,2777,2779,2781],{"class":105,"line":106},[103,2758,2748],{"class":109},[103,2760,2761],{"class":113}," -dmS",[103,2763,2764],{"class":117}," session_name",[103,2766,2767],{"class":117}," bash",[103,2769,2770],{"class":117}," deployment.sh",[103,2772,2411],{"class":117},[103,2774,672],{"class":117},[103,2776,678],{"class":117},[103,2778,681],{"class":117},[103,2780,2416],{"class":493},[103,2782,687],{"class":493},[22,2784,2785,2786,168],{},"The most up-to-date versions of these scripts, along with additional utilities and scripts, can be found ",[16,2787,2790],{"href":2788,"rel":2789},"https://github.com/can-gurkan/BehaviorSpace-HPC",[87],"on BehaviorSpace HPC GitHub Repository",[2792,2793,2794],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .stzsN, html code.shiki .stzsN{--shiki-light:#91B859;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9AJx, html code.shiki .s9AJx{--shiki-light:#9C3EDA;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":98,"searchDepth":243,"depth":231,"links":2796},[2797,2798,2799,2803],{"id":38,"depth":237,"text":44},{"id":70,"depth":121,"text":54},{"id":136,"depth":121,"text":60,"children":2800},[2801,2802],{"id":172,"depth":231,"text":178},{"id":503,"depth":231,"text":509},{"id":1536,"depth":121,"text":66,"children":2804},[2805,2806],{"id":1552,"depth":231,"text":1558},{"id":2263,"depth":231,"text":2269},"An advanced guide on running NetLogo BehaviorSpace experiments on High-Performance Computing (HPC) clusters using Slurm job scheduler.","md",{"source":2810,"metadataOutputPath":2811,"projectConfig":2812,"language":2819,"inheritFrom":2827,"output":227,"version":2813,"keywords":2828,"tags":2832,"icon":2833,"assetsRoot":2834},"autogen/hpc.md","content/hpc.metadata.yaml",{"version":2813,"projectRoot":168,"scanRoot":2814,"outputRoot":2815,"defaults":2816,"engine":2822,"partials":2823,"dedupeIdenticalDiskWrites":227},"7.0.3","autogen","content",{"inheritFrom":2817,"language":2819,"output":2820,"extension":2808,"title":2821,"version":2813},[2818],0,"en",false,"NetLogo User Manual","handlebars",{"directoryPaths":2824,"extensions":2825},[168],[2826,2808],"mustache",[2818],[2829,2830,2831,28],"HPC","High-Performance Computing","Cluster Computing",[2829,2830,2831],"i-lucide-server-cog","/home/runner/work/Helio/Helio/apps/docs/autogen","/hpc",{"title":5,"description":2807},"hpc","gGzNNy7395Z0QR6Ft3G_12mP3enIZS7RcoEDJm4xxVQ",[2840,2845],{"title":2841,"path":2842,"stem":2843,"description":2844},"GoGo Extension Dictionary: talk-to-servo-ports","/gogo/talk-to-servo-ports","gogo/talk-to-servo-ports","Documentation for the talk-to-servo-ports primitive.",{"title":2846,"path":2847,"stem":2848,"description":2849},"HubNet","/hubnet","hubnet","HubNet is a technology that lets you use NetLogo to run participatory simulations in the classroom where multiple users can interact with the model.",1772648982768]