Skip to content

Commit 694bc7e

Browse files
Merge remote-tracking branch 'ColasDroin/error_tracker_bb_configuration' into release/v0.52.0
2 parents d00127b + cf1531c commit 694bc7e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

xtrack/multiline/multiline.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,17 @@ def configure_beambeam_interactions(self, num_particles,
480480
481481
'''
482482

483+
# Check that the context in which the trackers are built is on CPU
484+
for nn in ["clockwise", "anticlockwise"]:
485+
if self._bb_config[f"{nn}_line"] is None:
486+
continue
487+
line = self.lines[self._bb_config[f"{nn}_line"]]
488+
if not isinstance(line.tracker._context, xo.ContextCpu):
489+
raise ValueError(
490+
"The trackers need to be built on CPU before "
491+
"configuring the beam-beam elements."
492+
)
493+
483494
if self._bb_config['dataframes']['clockwise'] is not None:
484495
bb_df_cw = self._bb_config['dataframes']['clockwise'].copy()
485496
else:

0 commit comments

Comments
 (0)