How do I pass a SectionList() to the master?

General issues of interest both for network and
individual cell parallelization.

Moderator: hines

Post Reply
vivi
Posts: 1
Joined: Fri Dec 03, 2010 4:12 pm

How do I pass a SectionList() to the master?

Post by vivi »

In my parallel simulation I have a Vector() stvec containing the start times of nsyn
NetStim() and each worker creates its own set of nsyn synapses syn[nsyn]. I pass
the start times to the master with a pc.post() as follows:

Code: Select all

      func superrun(){local id
         id = hoc_ac_
         [ ...]
         stvec.resize(0)
         sl=new SectionList()
         for zz=0, nsyn-1 {
         stvec.append(s[zz].start)
         x=syn[zz].get_loc()
         sl.append()
         }
        [...]
        pc.post(stvec)
        return id
         }
and I get it with pc.upkvec with:

Code: Select all

     while ((id = pc.working) != 0) {
       stvec = pc.upkvec
        [...]
       }
How do I pass the sl SectionList(), which contains the syn locations?
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How do I pass a SectionList() to the master?

Post by ted »

Wouldn't even try. What guarantee is there that the pointers in such a SectionList on one host will be valid on another host? In the context of bulletin-board style parallelization (which to me seems the only context in which the question makes sense), I would suggest that during model setup each host appends each section to a SectionList called allsecs. If each host executes the same model setup code, the sequence in which sections are created will be identical across all hosts, and the sequence of the sections in allsecs will also be identical. Then if you need to pass section subset information from one host to another, just pass a vector whose elements are the indices into the allsecs list that correspond to the sections of interest.
Post Reply