Skip to content

Commit 151bfbf

Browse files
committed
Some fixes
1 parent 8a6f3e8 commit 151bfbf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Simulation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ def _split_machine_among_cores(self):
446446
myid = self.ring_of_CPUs.myid
447447
i_start_part, i_end_part = sharing.my_part(myid)
448448
self.mypart = self.machine.one_turn_map[i_start_part:i_end_part]
449+
self.i_start_part = i_start_part
449450
if self.ring_of_CPUs.I_am_a_worker:
450451
print(
451452
"I am id=%d/%d (worker) and my part is %d long"
@@ -555,7 +556,7 @@ def _switch_to_footprint_mode(self):
555556

556557
pp = self.pp
557558

558-
print("Proc. %d computing maps" % myid)
559+
print("Proc. %d computing maps" % self.ring_of_CPUs.myid)
559560
# generate a bunch
560561
bunch_for_map = self.machine.generate_6D_Gaussian_bunch_matched(
561562
n_macroparticles=pp.n_macroparticles_for_footprint_map,
@@ -572,7 +573,7 @@ def _switch_to_footprint_mode(self):
572573
slices_list_for_map = bunch_for_map.extract_slices(slicer_for_map)
573574

574575
# Track the previous part of the machine
575-
for ele in self.machine.one_turn_map[:i_start_part]:
576+
for ele in self.machine.one_turn_map[:self.i_start_part]:
576577
for ss in slices_list_for_map:
577578
ele.track(ss)
578579

@@ -598,9 +599,9 @@ def _switch_to_footprint_mode(self):
598599
else:
599600
for ss in slices_list_for_map:
600601
ele.track(ss)
601-
print("Proc. %d done with maps" % myid)
602+
print("Proc. %d done with maps" % self.ring_of_CPUs.myid)
602603

603-
with open("measured_optics_%d.pkl" % myid, "wb") as fid:
604+
with open("measured_optics_%d.pkl" % self.ring_of_CPUs.myid, "wb") as fid:
604605
pickle.dump(
605606
{
606607
"ele_type": list_ele_type,

examples/005_footprint_octupoles/000_run_serial.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
export PYTHONPATH=$PYTHONPATH:../../../
44

55
# Run Serial
6-
../../../PyPARIS/serialexec.py sim_class=PyPARIS_sim_class.Simulation.Simulation
7-
6+
python -m PyPARIS.serialexec sim_class=PyPARIS_sim_class.Simulation.Simulation

examples/005_footprint_octupoles/001_check_footprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
print('Saving footprint.png.')
1919
plt.savefig('footprint.png')
2020

21-
plt.show(False)
21+
plt.show()

0 commit comments

Comments
 (0)