120 likes | 205 Views
Bug Elimination. Ghislain Roy MAD-X Meeting 09 May 2014. REFPOS…. Follow up of bug on sequence expansion fixed in summer 2013. Subsequence with REFPOS does not expand according to documented rules . Reported : email V. Kain 13/03/2014, TRAC# 257 Fixed : r4728 on 26/03/2014
E N D
Bug Elimination Ghislain Roy MAD-X Meeting 09 May 2014
REFPOS… • Follow up of bug on sequence expansion fixed in summer 2013. Subsequencewith REFPOS does not expandaccording to documentedrules. • Reported: email V. Kain13/03/2014, TRAC# 257 • Fixed: r4728 on 26/03/2014 • Origin: no test for refpos. • Solution: add test for refpos and adjust position accordingly.
if (p->p_sequ == NULL){ // simple element, not a subsequence p->share = top_sequ->share; add_to_node_list(p, 0, top_sequ->ex_nodes); } else { // subsequence if (p->p_sequ->refpos != NULL) { // REFPOS given for subsequence, ignore REFER of currentsequence p = expand_node(p, top_sequ, p->p_sequ, p->position - nodesequ->ref_flag*p->p_sequ->length/2. ); } else { // no REFPOS given p = expand_node(p, top_sequ, p->p_sequ, p->position); } }
Circularsequences • In two instances, the sequenceswereassumed to becircular and seq_lengthwasadded to node_pos if node_poswasnegative. • Solution: remove test and addition statement.Twofailed tests werecorrected in MAD files by addingflattenstatementbeforefurthersequence manipulations. • Reported: ghislainduring investigation of REFPOS bug. Not in TRAC.
THREADER… • Trajectory or closedorbitthreaderreported as non-functional. • Origin: threaderwas active during all steps of closedorbitsearch in subroutinetmclor, ie over manyturnswith accumulation of kicks turnafterturn. • Solution: switch off the threader option as soon as first turnisfinished, ieafter first call to tmfrst. • Reported: priv. comm. Bernhard Holzer and J. Wenninger, 24 March 2014. TRAC# 260 • Fixed: r4739 on April 7th 2014
!---- Iteration for closedorbit. iterate: do itra = 1, itmax !---- Trackorbit and transfer matrix. call tmfrst(orbit0,orbit,fsec,ftrk,rt,tt,eflag,0,0,thr_on) if (eflag.ne.0) return ! 2014-Mar-28 20:41:21 ghislain: turn off the threaderimmediatelyafter first iteration, ! ie first turn thr_on = 0 …
BEAM… • BEAM, npart=1.e10;not only sets npart to 1.e10 but alsoresets CIRC and FREQ0 to zero. • Origin: badlyformed test in update_beam to extract CIRC fromsequencelengthwasalwaysfailing and CIRC and FREQ0 were reset to default zero values. • Solution: removedattempt to extract CIRC fromsequence and only update of CIRC and FREQ0 when one of the twoisexplicitlygiven • Reported: email frs 16/10/2013, TRAC# 259 • Fixed:rev. 4745 on April 9th 2014
// namecontains the particlename (ieelectron, proton…) if (nlc->inform[name_list_pos("circ", nlc)]) { circ = command_par_value("circ", comm); if (circ > zero) freq0 = (beta * clight) / (ten_p_6 * circ); } else if (nlc->inform[name_list_pos("freq0", nlc)]) { freq0 = command_par_value("freq0", comm); if (freq0 > zero) circ = (beta * clight) / (ten_p_6 * freq0); } else if ((pos = name_list_pos(name, sequences->list)) >= 0) { circ = sequence_length(sequences->sequs[pos]); freq0 = (beta * clight) / (ten_p_6 * circ); } … store_comm_par_value("npart", npart, current_beam); store_comm_par_value("bcurrent", bcurrent, current_beam); store_comm_par_value("freq0", freq0, current_beam); store_comm_par_value("circ", circ, current_beam); store_comm_par_value("beta", beta, current_beam); … if (nlc->inform[name_list_pos("circ", nlc)]) { circ = command_par_value("circ", comm); if (circ > zero) freq0 = (beta * clight) / (ten_p_6 * circ); // 2014-Apr-09 15:45:51 ghislain: update freq0 and circonly as necessary store_comm_par_value("freq0", freq0, current_beam); store_comm_par_value("circ", circ, current_beam); } else if (nlc->inform[name_list_pos("freq0", nlc)]) { freq0 = command_par_value("freq0", comm); if (freq0 > zero) circ = (beta * clight) / (ten_p_6 * freq0); // 2014-Apr-09 15:45:51 ghislain: update freq0 and circonly as necessary store_comm_par_value("freq0", freq0, current_beam); store_comm_par_value("circ", circ, current_beam); } … store_comm_par_value("npart", npart, current_beam); store_comm_par_value("bcurrent", bcurrent, current_beam); // store_comm_par_value("beta", beta, current_beam); …
PLOT axes • Display of axis label workswell for a single variable in a PLOT command but givesinconsistentresultswhen multiple variables are plotted, sometimes not showinganything and sometimesshowing a part of an obviouslyvery long string. • Origin:traced to a type mismatchbetweentwosubroutines • Fixed:rev 4765 on 25th April
PLOT, interpolate • Origin: INTERPOLATE option was not active for X, PX, Y, PY twiss table parameters. Insteadcubicsplineswereused but onlybased on one variable. Eg: for plottingorbit, the constraint on slopeswas not takenintoaccountleading to « distorted » trajectories. • Solution:addpropertwissparameter codes in interpolate table. • Fixed: r4785 on May 5th • Not the end of the story… problemwith correctors…