-
Notifications
You must be signed in to change notification settings - Fork 24
World MultiThreadTemplate
THIS WORLD DOES NOT SHIP WITH DEFAULT MABE, it exists simply to demonstrate how multithreading can be implemented. If you are interested in getting the code for this world, please contact us.
There are multiple ways how you could speed up your runs. One simple option is to use multithreading (by using the commonly available pthread.h library). However, now that you are multithreading things, you need to be thread save in what you are doing. To ensure this, we recommend changing this template world in which you can evaluate multiple organisms in parallel. In essence, you create a function evaluateSoloMultiThread which will then be executed in such a way that you can now evaluate multiple organisms at the same time. However there are a couple of caveats that you MUST take into account:
- you can not have agents interact with each other since you are not guaranteed to have both agents on the same thread, hence the evaluateSolo idea.
- you should use a population size that can be divided equally over all threads you want to use. In theory, we could call one thread that computes the dangling organisms, but we think that this is silly. So if you use 4 threads your population size must be dividable by 4 without any remainder.
- dataMap and all your other pointers are threadsave, so if you mess with those elsewhere you might interfear with this feature.
- pthread forces us to use a static function and thus you currently can't use multiple worlds in parallel, that would mess with the multithreading in a very bad way.
home
welcome
MABE Parameter Widget
Installation and quick start
license
citations
release notes
developer contributions
consistency testing
Using MABE
Using Settings Files
Output Files
Creating Graphs with python
MABE framework
Defining Update
Brains
Markov Brain
Neuron Gate
Wire Brain
Human Brain
ConstantValues Brain
CGP Brain
Genetic Programing Brain
Artificial Neural Networks
Brains Structure and Connectome
Genomes
Circular Genome
Multi Genome
Genome Handlers
Genome Value Conversions
Organisms
Groups
Archivists
popFileColumns
Optimizers
Lexicase Optimizer
Worlds
Berry World
ComplexiPhi World
MultiThreadTemplate World
Utilities
DataMap
Parameters
Parameters Name Space
Adding Parameters to Code
ParametersTable
MTree
sequence function
Population Loading
PythonTools
MBuild
MGraph
MQ
findRelatedness
generatePhylogeny
Information Theory Tools
Brain States and Life Times
TimeSeries
Entropy Functions
Smearing
Fragmentation
State to State
Brain Infomation Tools
ProcessingTools