Code Monkey home page Code Monkey logo

Comments (4)

jajcayn avatar jajcayn commented on August 22, 2024 1

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:
Screenshot 2021-05-04 at 12 26 49 AM
Screenshot 2021-05-04 at 12 26 57 AM

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.

jajcayn avatar jajcayn commented on August 22, 2024 1

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.

vagechirkov avatar vagechirkov commented on August 22, 2024

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.

vagechirkov avatar vagechirkov commented on August 22, 2024

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.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.