mpiexec -n 1 /mypath/nrniv -mpi mycode.hoc
mpiexec -n 2 /mypath/nrniv -mpi mycode.hoc
Now, I have added a function 'performanceinfo()' to my code, and I call it in the rrun statement:
Code: Select all
proc rrun(){
pnm.want_all_spikes()
pc.set_maxstep(10)
runtime = startsw()
{waittime = pc.wait_time}
stdinit()
pc.psolve(tstop)
waittime = pc.wait_time - waittime
runtime = startsw() - runtime
simtime = startsw() - simstart
performanceinfo()
}
proc performanceinfo() {
w_avg = pc.allreduce(1, waittime)/pc.nhost
w_max = pc.allreduce(2, waittime)
w_min = pc.allreduce(3, waittime)
comp_avg = pc.allreduce(1, pc.step_time)/pc.nhost
comp_max = pc.allreduce(2, pc.step_time)
comp_min = pc.allreduce(3, pc.step_time)
if (pc.id==0) {printf("comp avg = %g max = %g min = %g\n", comp_avg, comp_max, comp_min)}
if (pc.id==0) {printf("wait avg = %g max = %g min = %g\n", w_avg, w_max, w_min)}
}
1 processor:
comp avg = 1 max = 2 min = 3
wait avg = 1 max = 2 min = 3
2 processors:
, )
)
)
0 /mypath/nrniv: Arg out of range in user function
0 in mycode.hoc near line 751
0 rrun()
0 ParallelContext[0].allreduce(14.5180 performanceinfo(0 rrun(application called MPI_Abort(MPI_COMM_WORLD, -1) - process 0
, )
)
)
1 /mypath/nrniv: Arg out of range in user function
1 in mycode.hoc near line 751
1 rrun()
1 ParallelContext[0].allreduce(10.004000191 performanceinfo(1 rrun(application called MPI_Abort(MPI_COMM_WORLD, -1) - process 1
rank 1 in job 12 MYPC caused collective abort of all ranks
exit status of rank 1: killed by signal 9
rank 0 in job 12 MYPC caused collective abort of all ranks
exit status of rank 0: killed by signal 9
Not sure what I am doing wrong... Let me know if I should send the code directly. Thanks for your assistance.