I am doing a grid-like set of simulations on a single-neuron model (python/neuron) with increasing holding currents (i.e. using IClamp at the soma; all spike-generating current levels) and increasing synaptic input frequencies (i.e. using Exp2Syn processes at various dendritic locations). I've parallelized my code in a bulletin board style way as follows:
Code: Select all
# Load the model and initiate functions # "getMeasures" is a function written in python that calls to a hoc function to run the model and analyze the output traces from that simulation numsteps = 50 modfreqs = numpy.array([0,0.5,1,2,3,4,5,8,9,10,12,15,16,20,25,30]) # Hz currsteps = numpy.arange(rheobase,rheobase+0.0025*numsteps,0.0025) # nA pc = h.ParallelContext() pc.runworker() if pc.nhost() == 1: for y in range(0,numsteps): for modfreq in range(0,len(modfreqs)): results = getMeasures(y,modfreqs[modfreq],modfreq,currsteps[y]) # RECORD VARIABLES FROM RESULTS INTO LISTS USING "y" AND "modfreq" TO INDEX else: for y in range(0,numsteps): for modfreq in range(0,len(modfreqs)): pc.submit(getMeasures,y,modfreqs[modfreq],modfreq,currsteps[y]) while pc.working(): results = pc.pyret() # RECORD VARIABLES FROM RESULTS INTO LISTS USING "y" AND "modfreq" TO INDEX pc.done()
A few additional points:
-I run the parallel simulations on NSG, and I have received similar indexing mix-ups when running it on two different HPC resources (Stampede2 and Comet).
-The indexing mix-up is not consistent across repeated runs, and it seems like less indexing mix-ups occur when I have a closer 1:1 spread of simulations:processors (i.e. instead of multiple simulations on a smaller number of processors).
-From the troubleshooting I've done, it seems to me that the indexing mix-ups occur because of how I've parallelized my code, but I am having trouble pin-pointing where exactly I went wrong. Any input would be appreciated.