Comments (4)
Dear Valerii,
Thanks for your interest in neurolib!
Unfortunately, due to some breaking changes related to forking a process, python3.8 is not currently supported on macOS systems. Our dependency on the pypet
package and its multiprocessing scheme is the culprit. We thought of migrating for some different solutions, but for now, please use a lower version of Python. Pythons 3.6 and 3.7 are tested regularly and working as they should on MacOS. Myself, I am running 11.3 and python 3.7.10 for development.
Just as a good measure, I successfully ran the code you posted with python 3.7.10 with a fresh install of neurolib in a temporary virtual environment:
I hope this intermediate solution works for you and you are able to accommodate python 3.7 for now :)
Thanks again and happy brain simulating!
from neurolib.
Hey,
no problem, glad to help:)
Well, yes. For this particular use case, the single processing will always be faster, since one simulation of the ALN 1 node model for 2seconds can be done in a tiny fraction of a second, and then the overhead caused by forking a process and then waiting for them to synchronize is much much larger than the simulation itself. The more complex the model is (therefore, the more a single simulation would take), the more multiprocessing makes sense.
You can try to do the same thing with the brain network instead of one node, e.g. do something like:
# make 20-node brain network
model = ALNModel(Cmat=np.random.rand(20,20))
# simulate for one minute
model.params["duration"] = 60.0 * 1e3 # in ms
to create a brain network with 20 nodes, connected randomly. Now the simulation of a single time will be significantly longer, and you'll benefit from multiprocessing on exploration. In general, multiprocessing always comes with an overhead of forking a process and waiting for them to sync, so it is not always the best option to use it.
By the way, I am also using an M1 machine and instead of the non-existing gcc
for arm64, I didn't encounter any problems so far:)
Best,
N.
from neurolib.
Dear @jajcayn,
Thank you for your quick reply and your help!
I've changed python to 3.7.10, and everything works fine, although I've noticed that with multiproc=False
it works much faster. Maybe this is because I am using Apple M1...
from neurolib.
Hey,
no problem, glad to help:)
Well, yes. For this particular use case, the single processing will always be faster, since one simulation of the ALN 1 node model for 2seconds can be done in a tiny fraction of a second, and then the overhead caused by forking a process and then waiting for them to synchronize is much much larger than the simulation itself. The more complex the model is (therefore, the more a single simulation would take), the more multiprocessing makes sense.You can try to do the same thing with the brain network instead of one node, e.g. do something like:
# make 20-node brain network model = ALNModel(Cmat=np.random.rand(20,20)) # simulate for one minute model.params["duration"] = 60.0 * 1e3 # in msto create a brain network with 20 nodes, connected randomly. Now the simulation of a single time will be significantly longer, and you'll benefit from multiprocessing on exploration. In general, multiprocessing always comes with an overhead of forking a process and waiting for them to sync, so it is not always the best option to use it.
By the way, I am also using an M1 machine and instead of the non-existing
gcc
for arm64, I didn't encounter any problems so far:)Best,
N.
Alright! Thank you very much for the explanation!
I think I will close the issue because everything works fine on my computer.
Thank you for your help!
from neurolib.
Related Issues (20)
- Allow `continue_run` for `MultiModel`
- excessive memory use with evolution? HOT 2
- Citation HOT 1
- Better error catching in exploration
- There are 0 valid individuals Mean score across population: nan HOT 7
- If set explicitly, local connectivity weights for ALNNode change after running the model HOT 3
- Try to make MultiModel faster HOT 1
- Neurolib satellite tutorial session at CNS*2022 HOT 20
- Testing: test_models with dynamic loading HOT 1
- TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class HOT 3
- Help Using Neurolib: Finding an easy way to load new data for the model implementation HOT 1
- Question about the animation HOT 1
- Parameter exploration bug: PicklingError HOT 5
- Cmat is the same in two model instances, but models themselves are not HOT 1
- WW model is missing in example and test
- Documentation pipeline fails HOT 1
- model parameters and stimulation
- Parameters provided in examples (and default parameters) does not perform BOLD simulation correctly HOT 1
- Possible deprecation issues in the example file of multimodel_custom_model HOT 1
- Example files appear to be broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neurolib.