Bug Elimination Ghislain Roy MAD-X Meeting 09 May 2014.

Slides:



Advertisements
Similar presentations
Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Advertisements

COMP 116: Introduction to Scientific Programming Lecture 37: Final Review.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Internal Documentation Conventions. Kinds of comments javadoc (“doc”) comments describe the user interface: –What the classes, interfaces, fields and.
Shared Graphics Skills Cameras and Clipping Planes
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
Memory - Registers Instruction Sets
Hash Tables1 Part E Hash Tables  
Recursion.
Hash Tables1 Part E Hash Tables  
Recursion A recursive function is a function that calls itself either directly or indirectly through another function. The problems that can be solved.
Formula Auditing, Data Validation, and Complex Problem Solving
Bag Implementations that Use Arrays Chapter 2 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Introduction Status of SC simulations at CERN
28/08/2015SJF L31 F21SF Software Engineering Foundations ASSUMPTIONS AND TESTING Monica Farrow EM G30 Material available on Vision.
Chapter 4 MATLAB Programming Combining Loops and Logic Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
EGR 2261 Unit 4 Control Structures I: Selection  Read Malik, Chapter 4.  Homework #4 and Lab #4 due next week.  Quiz next week.
Concepts and Terminology Introduction to Database.
Eric Prebys, FNAL.  Let’s look at the Hill’ equation again…  We can write the general solution as a linear combination of a “sine-like” and “cosine-like”
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection)
Chapter 4: Control Structures I (Selection). Objectives In this chapter, you will: – Learn about control structures – Examine relational operators – Discover.
Chapter 4: Control Structures I (Selection). Objectives In this chapter, you will: – Learn about control structures – Examine relational and logical operators.
Conditional Statements For computer to make decisions, must be able to test CONDITIONS IF it is raining THEN I will not go outside IF Count is not zero.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
Arrays An array is a data structure that consists of an ordered collection of similar items (where “similar items” means items of the same type.) An array.
ALG0183 Algorithms & Data Structures Lecture 6 The maximum contiguous subsequence sum problem. 8/25/20091 ALG0183 Algorithms & Data Structures by Dr Andy.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 4: Control Structures I (Selection)
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Hash Tables1   © 2010 Goodrich, Tamassia.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
EMMA Horizontal and Vertical Corrector Study David Kelliher ASTEC/CCLRC/RAL 14th April, 2007.
Chapter 11: Block References and Attributes. After completing this Chapter, you will be able to use the following features: Create and insert block references.
© 2004 Goodrich, Tamassia Hash Tables1  
General guidelines for SixTrack The code options aim at being general with no implicit assumptions to avoid misunderstanding (overhead for the user) and.
Why do we need a database?
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
J-PARC Trace3D Upgrades Christopher K. Allen Los Alamos National Laboratory.
Chapter 5 Selection Statements Mr. Dave Clausen La Cañada High School.
Chapter 4: Control Structures I (Selection). Objectives In this chapter, you will: – Learn about control structures – Examine relational and logical operators.
ElVis Improvements Summer 2008 Eric Zatz PPPL Summer Intern Mentor – Eliot Feibush August 11, 2008.
Frank SchmidtSpace Charge # 31 Style of the Meeting I have agreed with Elias that we want meetings without fear to ask any crazy question! Fancy presentations.
PTC tracking - progress report (the first month experience) Valery KAPIN D.Sc., Kyoto Univ. ITEP, Moscow Relevant background: a) Fortran-77/90 programming.
DAY 9: MICROSOFT EXCEL – CHAPTER 6 Sravanthi Lakkimsetty Sept 16, 2015.
Working with Loops, Conditional Statements, and Arrays.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
XP Tutorial 3 New Perspectives on JavaScript, Comprehensive1 Working with Arrays, Loops, and Conditional Statements Creating a Monthly Calendar.
Programming Language C++ Lecture 3. Control Structures  C++ provides control structures that serve to specify what has to be done to perform our program.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
Vacuum specifications in Linacs J-B. Jeanneret, G. Rumolo, D. Schulte in CLIC Workshop 09, 15 October 2009 Fast Ion Instability in Linacs and the simulation.
Chapter 9 Introduction to Arrays Fundamentals of Java.
Problem of the Day  Why are manhole covers round?
MADX tutorial: injection and extraction systems Dr Rob Apsimon Dr Öznur Mete.
Chapter 4: Control Structures I (Selection). Objectives In this chapter, you will: – Learn about control structures – Examine relational operators – Discover.
Matlab Training Session 4: Control, Flow and Functions
Bag Implementations that Use Arrays
11/10/2018.
Modern JavaScript Develop And Design
Starting JavaProgramming
Chapter 4: Control Structures I (Selection)
Juan, Emanuele, Natalia, Yngve, Sofia
Chapter 4 Selection.
Python programming exercise
Yan Shi CS/SE 2630 Lecture Notes
Chapter 5 Selection Statements
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
LHC An LHC OP guide… under construction J. Wenninger
Challenge Guide Grade Code Type Slides
Presentation transcript:

Bug Elimination Ghislain Roy MAD-X Meeting 09 May 2014

REFPOS… Follow up of bug on sequence expansion fixed in summer Subsequence with REFPOS does not expand according to documented rules. Reported: V. Kain 13/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 current sequence 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); }

Circular sequences In two instances, the sequences were assumed to be circular and seq_length was added to node_pos if node_pos was negative. Solution: remove test and addition statement. Two failed tests were corrected in MAD files by adding flatten statement before further sequence manipulations. Reported: ghislain during investigation of REFPOS bug. Not in TRAC.

THREADER… Trajectory or closed orbit threader reported as non-functional. Origin: threader was active during all steps of closed orbit search in subroutine tmclor, ie over many turns with accumulation of kicks turn after turn. Solution: switch off the threader option as soon as first turn is finished, ie after first call to tmfrst. Reported: priv. comm. Bernhard Holzer and J. Wenninger, 24 March TRAC# 260 Fixed: r4739 on April 7th 2014

!---- Iteration for closed orbit. iterate: do itra = 1, itmax !---- Track orbit 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 threader immediately after first iteration, ! ie first turn thr_on = 0 …

BEAM… BEAM, npart=1.e10; not only sets npart to 1.e10 but also resets CIRC and FREQ0 to zero. Origin: badly formed test in update_beam to extract CIRC from sequence length was always failing and CIRC and FREQ0 were reset to default zero values. Solution: removed attempt to extract CIRC from sequence and only update of CIRC and FREQ0 when one of the two is explicitly given Reported: frs 16/10/2013, TRAC# 259 Fixed: rev on April 9th 2014

// name contains the particle name (ie electron, 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 circ only 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 circ only 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 works well for a single variable in a PLOT command but gives inconsistent results when multiple variables are plotted, sometimes not showing anything and sometimes showing a part of an obviously very long string. Origin: traced to a type mismatch between two subroutines Fixed: rev 4765 on 25th April

PLOT, interpolate Origin: INTERPOLATE option was not active for X, PX, Y, PY twiss table parameters. Instead cubic splines were used but only based on one variable. Eg: for plotting orbit, the constraint on slopes was not taken into account leading to « distorted » trajectories. Solution: add proper twiss parameter codes in interpolate table. Fixed: r4785 on May 5th Not the end of the story… problem with correctors…