Skip to content

Commit

Permalink
Merge pull request #2 from CNS-OIST/py2py3
Browse files Browse the repository at this point in the history
[py2py3-patch] cannot open unbuffered io stream in py3
  • Loading branch information
FrancescoCasalegno authored Sep 18, 2017
2 parents 537dd78 + 617f030 commit 25bd149
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,19 +698,19 @@
if cap_m0_count<round(CaP_ro*surfarea*CaP_m0_p):
sim.setTriCount(i, 'CaP_m0', sim.getTriCount(i, 'CaP_m0') + 1)
cap_m0_count = cap_m0_count + 1
count = count +1
count = count +1
elif cap_m1_count<round(CaP_ro*surfarea*CaP_m1_p):
sim.setTriCount(i, 'CaP_m1', sim.getTriCount(i, 'CaP_m1') + 1)
cap_m1_count = cap_m1_count + 1
count = count +1
count = count +1
elif cap_m2_count<round(CaP_ro*surfarea*CaP_m2_p):
sim.setTriCount(i, 'CaP_m2', sim.getTriCount(i, 'CaP_m2') + 1)
cap_m2_count = cap_m2_count + 1
count = count +1
count = count +1
elif cap_m3_count<round(CaP_ro*surfarea*CaP_m3_p):
sim.setTriCount(i, 'CaP_m3', sim.getTriCount(i, 'CaP_m3') + 1)
cap_m3_count = cap_m3_count + 1
count = count +1
count = count +1
else:
print('Cluster size is larger than the number of CaP channels available')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
sim.run(SIM_TIME)
time_cost = (time.time() - start_time)

proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 0)
proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 1)
proc_file.write("SimTime,CompTime,SyncTime,IdleTime,nIteration\n")
proc_file.write("%f,%f,%f,%f,%i\n" % (time_cost, sim.getCompTime(), sim.getSyncTime(), sim.getIdleTime(), sim.getNIteration()))
proc_file.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
ca_conc_preset_file.close()

if steps.mpi.rank == 0:
conc_result = open(RESULT_DIR + '/calcium_conc_%iprocs.dat' % (steps.mpi.nhosts), 'w', 0)
conc_result = open(RESULT_DIR + '/calcium_conc_%iprocs.dat' % (steps.mpi.nhosts), 'w', 1)
conc_result.write('#Entries: Time ')
for roi in rois:
conc_result.write('%s ' % (roi))
Expand Down Expand Up @@ -150,7 +150,7 @@
time_cost = (time.time() - start_time)
conc_result.close()

proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 0)
proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 1)
proc_file.write("SimTime,CompTime,SyncTime,IdleTime,nIteration\n")
proc_file.write("%f,%f,%f,%f,%i\n" % (time_cost, sim.getCompTime(), sim.getSyncTime(), sim.getIdleTime(), sim.getNIteration()))
proc_file.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
sim.run(SIM_TIME)
time_cost = (time.time() - start_time)

proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 0)
proc_file = open(RESULT_DIR + '/proc_%i.csv' % (steps.mpi.rank), 'w', 1)
proc_file.write("SimTime,CompTime,SyncTime,IdleTime,nIteration\n")
proc_file.write("%f,%f,%f,%f,%i\n" % (time_cost, sim.getCompTime(), sim.getSyncTime(), sim.getIdleTime(), sim.getNIteration()))
proc_file.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
try: os.mkdir(RESULT_DIR)
except: pass

conc_result = open(RESULT_DIR + '/ssa_calcium_conc.dat', 'w', 0)
conc_result = open(RESULT_DIR + '/ssa_calcium_conc.dat', 'w', 1)
conc_result.write('#Entries: Time ')
for roi in rois:
conc_result.write('%s ' % (roi))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def gen_geom():
sim_result_dir = RESULT_DIR + "/%e_%s_%ihosts" % (MOLECULE_RATIO, MESHFILE, steps.mpi.nhosts)
try: os.mkdir(sim_result_dir)
except: pass
summary_file = open(sim_result_dir + "/result.csv", 'w', 0)
summary_file = open(sim_result_dir + "/result.csv", 'w', 1)
summary_file.write("Simulation Time,")

########################################################################
Expand All @@ -144,7 +144,7 @@ def gen_geom():
start_time = time.time()
sim.run(ENDTIME)
end_time = (time.time() - start_time)
proc_file = open(sim_result_dir + "/proc_%i.csv" % (steps.mpi.rank), 'w', 0)
proc_file = open(sim_result_dir + "/proc_%i.csv" % (steps.mpi.rank), 'w', 1)
proc_file.write("SimTime,CompTime,SyncTime,IdleTime,nIteration\n")
proc_file.write("%f,%f,%f,%f,%i\n" % (end_time, sim.getCompTime(), sim.getSyncTime(), sim.getIdleTime(), sim.getNIteration()))
proc_file.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def gen_geom():
except: pass
try: os.mkdir(sim_result_dir)
except: pass
summary_file = open(sim_result_dir + "/result.csv", 'w', 0)
summary_file = open(sim_result_dir + "/result.csv", 'w', 1)
summary_file.write("Simulation Time,")

########################################################################
Expand Down

0 comments on commit 25bd149

Please sign in to comment.