(Dr.R.K.) bchop Utility - Collected Slides

Go to Top Go to Bottom blank blank Go up one level R.K.'s Home Page Keyword Index Site Map Help Linux


Slide 1
1 Title bchop Utility - Title

R.K.Owen,Ph.D.,


National Energy Research Scientific Computer Center

NERSC / MS 50C
One Cyclotron Road
Berkeley, CA 94720

(510)604-5935

rk@owen.sj.ca.us
rkowen@nersc.gov


TITLE

"So Optimization Breaks Your Code ..."



Slide 2
1.1 Abstract bchop Utility - Abstract

TITLE

"So Optimization Breaks Your Code ..."

ABSTRACT

Many compiler options can have an adverse affect on a code. Most notably, various levels of optimization can "break" a code, such that the program gives erroneous results. One option is to compile for the lowest common denominator. The other option is to identify which routines are adversely affected. The local utility, bchop performs a binary chop between object files in two directories (./good and ./bad) compares the output and isolates which object files are causing the differences in output. This helps isolate problems due to changing compiler or preprocessor options. The number of runs performed is approximately 2 E log2(N), where N is the number of object files and E is the number of object modules causing errors. This utility, bchop, is similar to CRI's atchop for isolating multitasking problems.


Slide 3
1.2 Why? bchop Utility - Why?

Scenario

Other Scenarios

Solution



Slide 4
1.3 Atchop bchop Utility - atchop

bchop just a atchop knock-off?

atchop bchop
  • Finds multitasking problems only
  • Can isolate problem loops
  • Recompiles & loads code each time
  • Specific to cf77
  • CPU intensive
  • Not easy to use
  • Finds which modules are bad
  • Modules compiled only once
  • Loads code each time
  • Independent of compiler
  • Less CPU intensive
  • easier to use
  • Portable


Slide 5
2 Binary Decomposition bchop Utility - Binary Decomposition

AKA "interval halving"


Slide 6
2.1 Simple Example bchop Utility - Binary Decomposition Example



Slide 7
2.2 Single Error bchop Utility - Single Error



Slide 8
2.3 Multiple Errors bchop Utility - Multiple Errors



Slide 9
3 Number of Trials bchop Utility - Number of Trials

Generally,

Number of Trials <= 2Elog2(N)
Where Efficient if E << N



Slide 10
3.1 Data plot bchop Utility - Data


Slide 11
4 How to Use bchop Utility - How to Use

Compare the "good" and the "bad"

The "good" The "bad" The "ugly"

Slide 12
4.1 Options bchop Utility - Options

Can specify the following:



Slide 13
4.2 Command Synopsis bchop Utility - Command Synopsis
 

usage: bchop [-v][-V][-1][-d diff_script] \
	[-o outfile][-i infile] \
        [-C cmd_line][-c load_cmd] \
	[-l libs][-L libdirs][-O okobjects] \
        -f objlistfile

 -v              verbose output
 -V              print version
 -1              no binary chopping...go one-by-one
 -d diff_script  script file takes 2 arguments and
                 exits 0 if no difference.
                 def: "diff -b $1 $2 > /dev/null"
 -o outfile      output file to compare.
                 def: stdout
 -i infile       stdin file for runs.
                 e.g. "./a.out < infile"
 -C cmd_line     command line arguments for runs
 -c load_cmd     command to link objects.
                 def: "cc -o "
 -llibs          added libraries for linking objects
 -Llibdirs       additional directories to search
                 for libraries
 -O okobjects    added objects to link with
 -f objlistfile  list of objects to link together
 


Slide 14
5 Implementation bchop Utility - Implementation

Written in "Standard C"
Compiles on

Heavy use of system() function
bchop

Slide 15
5.1 Future Work bchop Utility - Future Work
Send suggestions (or code patches) to
rk@owen.sj.ca.us

Source available by anonymous ftp at

ftp://ftp.owentrek.com/


Slide 16
6 Conclusion bchop Utility - Conclusion
In original task ... found an object that caused differences not even considered by user.

Last Modified:
Brought to you by: R.K. Owen, Ph.D.
This page is http://rkowen.owentrek.com/howto/bchop/slides/ALL.html