Git Product home page Git Product logo

Comments (6)

nrnhines avatar nrnhines commented on May 29, 2024 1

the workhorse for transferring python objects is
destlist = pc.py_alltoall(srclist)
where the length of srclist and destlist must be pc.nhost()
None entries are allowed and a send from I to j is just that everyone except I and j fill their array
with None and the only non None object on rank I is the jth element and
https://www.neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/network/parcon.html?highlight=alltoall#ParallelContext.py_alltoall

from nrn.

nrnhines avatar nrnhines commented on May 29, 2024

That suggestion is reasonable and I'll look into whether it can happen early enough in the process
of getting things properly setup. Til then you might try the environment variable
export NEURON_INIT_MPI=1

from nrn.

ferdonline avatar ferdonline commented on May 29, 2024

Taking this use case a bit further, it could be interesting to support MPI actions with Python objects, namely numpy arrays.
At the moment, when doing something like

pc = h.ParallelContext()
numbers = numpy.arange(100) if pc.id() == 0 else numpy.empty(10, dtype='int32')
pc.broadcast(numbers, 0)

one gets

NEURON: object type is PythonObject instead of Vector

Would it make sense to support such use case and generally serialize Python objects for MPI actions?
@pramodk

from nrn.

nrnhines avatar nrnhines commented on May 29, 2024

The ParallelContext.py_alltoall collective that takes any pickleable python object now has the
.py_[allgather, gatther, scatter, broadcast] companions.

from nrn.

ferdonline avatar ferdonline commented on May 29, 2024

@nrnhines that sounds great! Thanks for the info.

Regarding the first comment, on the initialization of MPI via a specific call, any news?

from nrn.

nrnhines avatar nrnhines commented on May 29, 2024

I'm toying with
test0.py

from neuron import h
pc = h.ParallelContext()
pc.mpi_init()

id = int(pc.id())
nhost = int(pc.nhost())

print ('I am %d of %d'%(id, nhost))

pc.barrier()
h.quit()

and

 mpiexec -n 2 python3 test0.py

works on the desktop with my mpich-3.3
but my openmpi 2.1.1 gives the message
(though it works with mpiexec -n 2 nrniv -python -nobanner test0.py

$ mpiexec -n 2 python3 test0.py
[hines-T7500:53222] mca_base_component_repository_open: unable to open mca_patcher_overwrite: /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_patcher_overwrite.so: undefined symbol: mca_patcher_base_patch_t_class (ignored)
...

from nrn.

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.