Skip to content

Commit

Permalink
some mods and launch.sh to help with performance testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nrnhines committed Apr 26, 2024
1 parent b3815a0 commit c57abdb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
27 changes: 27 additions & 0 deletions Morphology_1/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -ex

# 8.2 build
# 8.2 buildclang
# temp build
# temp buildclang

source $HOME/neuron/prefixenv $1/$2/install
mkdir -p $1-$2
cd $1-$2
#nrnivmodl -incflags "-I/home/hines/soft/Caliper/build/install/include" ../mod_files
nrnivmodl ../mod_files

export PYTHONPATH=`pwd`/..:$PYTHONPATH
#CALI_CONFIG=runtime-report,calc.inclusive nrniv -c 'mycpu=1' -c 'chdir("..")' protocols/01_SS.py

#perf record nrniv -c 'mycpu=8' -c 'chdir("..")' protocols/01_SS.py
#nrniv -c 'mycpu=4' -c 'chdir("..")' protocols/01_SS.py
perf stat nrniv -c 'mycpu=8' -c 'chdir("..")' protocols/01_SS.py

if false ; then
$ cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=install \
-DPYTHON_EXECUTABLE=`pyenv which python` -DNRN_ENABLE_RX3D=OFF \
-DNRN_ENABLE_PROFILING=ON -DNRN_PROFILER=caliper \
-DCMAKE_PREFIX_PATH=$HOME/soft/Caliper/build/install/share/cmake/caliper
fi
19 changes: 15 additions & 4 deletions Morphology_1/protocols/01_SS.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
cpu = multiprocessing.cpu_count()
h.load_file("parcom.hoc")
p = h.ParallelComputeTool()
p.change_nthread(cpu,1)
p.multisplit(1)
print(cpu)
if h.mycpu > 1.0:
p.change_nthread(h.mycpu,1)
p.multisplit(1)
print(h.mycpu)

#Voltage graph
h('load_file("vm.ses")')
Expand All @@ -37,13 +38,23 @@
h.tstop = 1000
h.v_init = -65

pc = h.ParallelContext()
pc.set_gid2node(0, 0)
pc.cell(0, cell.nc_spike)
pc.set_maxstep(10)
#from neuron import coreneuron
#coreneuron.enable = 0
#coreneuron.file_mode = 0
#Initialization
def initialize():
h.finitialize()
h.run()
# h.stdinit()
# pc.psolve(h.tstop)

initialize()

'''
#Save the results into an image
fig, ax = plt.subplots()
ax.plot(np.array(cell.time_vector), np.array(cell.vm), 'b', label='spikes')
Expand All @@ -59,4 +70,4 @@ def initialize():
plt.savefig('01_SS_trace.eps')
plt.close()

'''

0 comments on commit c57abdb

Please sign in to comment.