I'm running netlogo in a linux server so that I can run models from R (also running on the same linux server), but I'm having a performance issue. Models are taking a lot longer than they should. If anyone could assist with getting the models to run in the expected run time using headless on linux, that would be great, but extra special would be getting them to run with an expected run time in R using the nlrx package (so much easier for model set up and output analysis). More details below.
Appreciate any help!
Rebecca
nlrx has been taking a very long time to run models for me, and I tried to see how long only one would take to isolate the issue. The basic wolf sheep predation model with all constants specified to only one option, using only one seed, and one repetition still takes about 5 minutes in R. Based on what I saw was written previously about similar issues, the headless version (using only linux) should run in a few seconds, and a model with nlrx should take a few seconds by itself + 4seconds. I ran the default headless wolf-sheep predation netlogo model in linux, but instead of 1 minute, that takes about 5 minutes to get output. I always get the output expected in both situations though, with no errors of any kind. I kept the temp files too, csv and xml, which also look fine. I've tried increasing the memory allocated as well. System info and code below. Appreciate any assistance and please let me know if I need to provide more info.
library(nlrx)
library(progressr)
library(furrr)
library(tictoc)
wd <- "/opt/"
wd_home <- "[pathway...]"
netlogopath <- file.path(paste0(wd,"NetLogo-6.4.0-64"))
netlogopath <- file.path(paste0(wd,"NetLogo-6.4.0-64"))
modelpath <- file.path(netlogopath, "models/Sample Models/Biology/Wolf Sheep Predation.nlogo")
outpath <- file.path(wd_home)
nl <- nl(nlversion = "6.4.0-64",
nlpath = netlogopath,
modelpath = modelpath,
jvmmem = 1024)
nl@experiment <- experiment(expname="wolf-sheep",
outpath=outpath,
repetition=1,
tickmetrics="true",
idsetup="setup",
idgo="go",
runtime=50,
evalticks=seq(40,50),
metrics=c("count sheep", "count wolves"),
constants = list("model-version" = ""sheep-wolves-grass"",
"grass-regrowth-time" = 30,
"sheep-gain-from-food" = 4,
"wolf-gain-from-food" = 20,
"sheep-reproduce" = 4,
"wolf-reproduce" = 5,
"show-energy?" = "false",
"initial-number-sheep" = 100,
"initial-number-wolves" = 25))
nl@simdesign <- simdesign_simple(nl=nl,
nseeds=1)
eval_variables_constants(nl) #should print "all valid" message
Run all simulations (loop over all siminputrows and simseeds)tic()
results <- run_nl_one(nl = nl,seed = 123, siminputrow = 1,cleanup.csv = FALSE,cleanup.xml = FALSE )
toc()`
R version 4.3.2 (2023-10-31)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.9 (Ootpa)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblaso-r0.3.15.so; LAPACK version 3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/New_York
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tictoc_1.2 furrr_0.3.1 future_1.33.1 progressr_0.14.0 nlrx_0.4.4
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/ef3f22ad-ef41-487c-8c06-3092063f0ed3n%40googlegroups.com.
-- Dale Frakes Adjunct Instructor, PhD Student PSU Systems Science dfr...@pdx.edu - http://web.pdx.edu/~dfrakes/
Hi Rebecca,
We are sorry you are experiencing this problem.
I’m busy with a project this week, and will look further into it next week.
Can you clarify the following:
What kind of personal computer do you have?
When you say “linux server” does that mean you have to submit a job to a high performance computing cluster (HPC), or are you logging onto a linux server and running the code directly?
If you are using an HPC we will need more information. We have graduate students here running large NetLogo projects successfully on the Northwestern HPC, so we know it can be done.
From what you are saying this problem is separate from the nlrx problem.
I have run the basic nlrx demo problem on my MacBook Pro and I think it takes 20 minutes to run a version that winds up running 1000 single run experiments, each requiring a separate use of NetLogo via its Controlling API. I don’t think it takes advantage of parallelism on the Mac. In NetLogo 6.4.0 one can specify “non-combinatorial” experiments, so if nlrx were updated to make use of this capability it would only need to call NetLogo once.
Please include bu...@ccl.northwestern.edu bu...@ccl.northwestern.edu in future email to be sure this issue gets the appropriate attention.
--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/MN2PR05MB62536F9724F1B8F16476056B93C72%40MN2PR05MB6253.namprd05.prod.outlook.com.