Parallel in NetLogo

441 views
Skip to first unread message

Karina Santos

unread,
Jun 8, 2021, 7:57:39 AM6/8/21
to netlogo-users
Hello everyone,

I have a question and I don't know where I can look for this answer and if there is a possibility of doing what I'm thinking.

Does anyone know how I can do parallel simulations in NetLogo?

Is it possible to run simulations on multiple processor cores?

Sorry for the beginner's question.

I appreciate any help and suggestions.

Thanks!

jeremy...@northwestern.edu

unread,
Jun 8, 2021, 9:11:08 AM6/8/21
to netlogo-users
Hey Karina,

As the FAQ says, you can use BehaviorSpace to run multiple simulations at once across multiple processor cores (one simulation per core).  This is the most common use case for NetLogo users who want to use multiple cores, as you're typically interested in the results from multiple runs with different starting parameter values.  See the BehaviorSpace docs for more info on using it. 

Using multiple cores to try to speed up a single simulation run is not possible in the current version of NetLogo.  It's a daunting technical challenge to let multiple cores help out in a simulation for an agent-based system like NetLogo, with some of the difficulties laid out in this post to the developers group.  

There are some small things you can do to speed up a single simulation run in the graphical UI, such as turning off monitors, plots, and view updates.  You can do that manually by editing your model or BehaviorSpace provides an option for it when you start a run inside the app.

I hope that helps.

-Jeremy

Volker Grimm

unread,
Jun 9, 2021, 11:07:01 AM6/9/21
to jeremy...@northwestern.edu, netlogo-users

Dear Karina,

 

As for speeding up NetLogo programs, please see also this article: http://jasss.soc.surrey.ac.uk/20/1/3.html.

 

Best regards,

 

Volker

(Volker Grimm, Leipzig)

--
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/4cdc56ca-419c-405a-bd89-db9fc22d1b78n%40googlegroups.com.

Wade Schuette

unread,
Jun 9, 2021, 1:05:08 PM6/9/21
to Volker Grimm, jeremy...@northwestern.edu, netlogo-users
Also,  don't forget that a better algorithm can often be worth a factor of 100 in brute force processor speed.
Seriously.

Maybe you don't need to be computing everything you're computing.     Eliminating code entirely is the ultimate execution-speedup.   As the lesson of data-cleaning shows, don't take pride in how efficiently you do a step that could have been eliminated entirely with a tweak further upstream.

Maybe a two-step process for a loop, such as a short pass to find an agent-set then a longer pass over that agent-set, can be much faster than a loop over all agents. 

Check especially loops of loops, or worse loops of loops of loops for wasted effort because of the potentially huge multiplier factor in whatever payload snippet of code you execute each loop-to-the-nth.

The "profiler" extension is easy to use and a glance at the number of times particular portions of code are run can be eye-opening.

Wade




 


Reply all
Reply to author
Forward
0 new messages