Skip to content

Commit

Permalink
Fix gpuglmem pointer in bb3d
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlopaciuk committed Oct 25, 2024
1 parent 213023d commit b19b3fc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion xfields/beam_elements/beambeam_src/beambeam3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void do_luminosity(BeamBeamBiGaussian3DData el, LocalParticle *part,
lumi_table_index = LumiTableData_getp__index(lumi_table);

const int at_turn = LocalParticle_get_at_turn(part);
double* lumi_address = LumiTableData_getp1_luminosity(lumi_table, at_turn); // double pointer
/*gpuglmem*/ double* lumi_address = LumiTableData_getp1_luminosity(lumi_table, at_turn); // double pointer
atomicAdd(lumi_address, *wgt);
}
}
Expand Down
4 changes: 0 additions & 4 deletions xfields/headers/bhabha_spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ void compt_do(LocalParticle *part, BeamBeamBiGaussian3DRecordData bhabha_record,
BhabhaTableData_set_photon_energy( bhabha_table, i_slot, e_photon_prime*1e9);
BhabhaTableData_set_photon_px( bhabha_table, i_slot, px_photon_prime);
BhabhaTableData_set_photon_py( bhabha_table, i_slot, py_photon_prime);
//BhabhaTableData_set_photon_pzeta( bhabha_table, i_slot, pzeta_photon_prime);
BhabhaTableData_set_primary_scattering_angle(bhabha_table, i_slot, theta_e);
BhabhaTableData_set_photon_scattering_angle( bhabha_table, i_slot, theta_g);
}
Expand All @@ -378,16 +377,13 @@ void compt_do(LocalParticle *part, BeamBeamBiGaussian3DRecordData bhabha_record,
if (e_loss_primary == 0.0){
printf("0 energy loss: %g", e_loss_primary);
}else{
//printf("[%d] lost %g [GeV]\n", (int)part->ipart, e_loss_primary);
if (-1.0 * e_loss_primary >= e_primary){ // macropart dies
LocalParticle_set_state(part, XT_LOST_ALL_E_IN_SYNRAD); // used to flag this kind of loss
return;
}else{ // macropart doesnt die
*vx = px_e_prime / e_e_prime;
*vy = py_e_prime / e_e_prime;
//*vzeta = pzeta_e_prime / e_e_prime;
e_primary += e_loss_primary;
//LocalParticle_update_pzeta(part, *vzeta); // changes energy vars
LocalParticle_add_to_energy(part, e_loss_primary*1e9, 0); // changes pzeta
}
}
Expand Down

0 comments on commit b19b3fc

Please sign in to comment.