neuronsimulator / ringtest

Ring network model test to demonstrate the use of CoreNEURON
12 stars 6 forks source link

Building a network of astrocytes via a gap junction #12

Closed ikitayama closed 3 years ago

ikitayama commented 4 years ago

How do I re-use the gid in ParallelContext::source_var(), which in my understanding, does not allow it?

ikitayama commented 4 years ago

Can you @pramodk jump in also and make comments?

nrnhines commented 4 years ago

From https://neuronsimulator.github.io/nrn/py_doc/modelspec/programmatic/network/parcon.html#ParallelContext.source_var

Associates the source voltage variable with an integer. This integer has nothing to do with and does not conflict with the discrete event gid used by the Parallel Network methods.

So you don't need to be concerned with overlapping gid and sgid. However, gap junctions are generally simulated with a pair of reciprocal voltage locations and POINT_PROCESSes on opposite sides of the gap, and thus there are often twice as many sgid as there are gap junctions. (not always the case. eg. for single compartment heart cells with many adjacent heart cells, only a single sgid is needed for each cell, and each cell has as many Gap point processes as there are adjacent cells.) gapspec

ikitayama commented 4 years ago

Thank you, @nrnhines! In the simple ring network case, mk_halfgap should be called only once in mk_gap in ring.py.

nrnhines commented 4 years ago

There are several examples, tests, that have the word "ring" in them. If you are referring to the ringtest repository, then mk_gap in the right circumstances (soma and dend both exist on the same rank) properly calls mk_halfgap twice.

ikitayama commented 3 years ago

Is this applicable to pass source Calcium concentration as well? Could this be used with gid_connect()?

ikitayama commented 3 years ago

@nrnhines I will file this question in nrn GitHub Issue Tracker.

nrnhines commented 3 years ago

The intention is to support transfer of Calcium concentration using the same methods as for voltage transfer. I.e.

pc.source_var(section(x)._ref_cai, sgid)

I'll check this out and make sure it is working.

ikitayama commented 3 years ago

@nrnhines here sgid means a split global ID, or source global ID?

nrnhines commented 3 years ago

It means source global identifier. An sgid value is unique in source_var and can be sent to any number of target_var. It is a completely different integer space than the set_gid2node space. i.e a sgid=1 is in no way necessarily associated with gid=1

ikitayama commented 3 years ago

@nrnhines so, are you saying source global identifiers need to be prepared uniquely for membrane potential, and ion variants a user wants to transfer to the target respectively?

ikitayama commented 3 years ago

I must admit that I never separately managed them in my Python analysis script.

nrnhines commented 3 years ago

Yes. In other words a 1-1 correspondence between source variable references and sgid.

pramodk commented 3 years ago

@ikitayama : If there are no outstanding questions, this can be closed?

ikitayama commented 3 years ago

Yes, please go ahead.