|
|
|
|
|
a bit of patience, please ... while the text is mostly written, you will notice that the links to actual code don't work. But I'm working on that, honest!
Compiling MAJIC is also not a walk in the park. There are two basic
options: compiling with, or without, JIT support. Without JIT support
you only get the interpreter. There might be several reasons why you
would need an interpreter that can tinker with MATLAB code; Vijay uses this
option to build his vectorizer.
As a general rule, for benchmark X the driver routine (the one you
call from the command line) is called drv_X, and the algorithm (which
actually does the processing) is called tst_X. But there are other,
anciliary, files that do not conform to this protocol.
Some routines display a running count of the iterations, some
don't. In many routines you will find the print statements commented
out. This means that MAJIC was already getting speedups to the
point where the print statement was taking up a sizable portion of the
routine's runtime.
Running the benchmarks: all benchmarks can be run separately by typing
the name of their driver into matlab. The benchmark will display its
own runtime. If the environment variable DEBUG is set, some of the
benchmarks will display a graphic of the results. The graphs will
appear on the website for comparison.
If you want to run all benchmarks just call the function
Downloading MAJIC code:
It is not as easy as you might think. The code and the benchmarks
are free for the asking, but due to all kinds of legal
restrictions, you need to
or by snail mail:
MAJIC Project
c/o George Almasi
3315 Digital Computer Lab
1304 West Springfield Avenue
Urbana, IL 61801
MAJIC Source Code
Instructions MAJIC source code with STLport
(about 1MB gzipped tar file) tcc (my version) source code my tcc patches for version
1.0b9 MAJIC Benchmarks
Instructions code (130 kB gzipped tar file) Instructions for downloading and building MAJIC
MAJIC is not 100% compatible with MATLAB. We were primarily interested
in showing how computation can be sped up, and so we stuck to MATLAB 4
kinds of expressions; we do not support cell arrays or object-oriented
features of MATLAB. MAJIC doesn't do any graphics either, although it
can call up MATLAB to do some rudimentary graphics (mainly for
the purpose of checking that the results are correct). There are many
other gotchas, too. Compiling MAJIC without JIT support
Without JIT support MAJIC can be built on almost any architecture. You
will need:
When you have all of these, install MAJIC into a directory and type
"configure" and it should auto-configure itself (I hope).
Compiling MAJIC with JIT support
In addition to all of the things listed above, you will a tcc distribution. However, not
all versions will work; I have had to jazz up tcc a little bit to make
it work. Even so, I can only make it work on the Solaris platform. I
don't have access to DEC MIPS machines, and the SGI MIPS version of
tcc fails because of a stupid assembler bug which I haven't had time
to fix yet. x86 ... well, just forget it for now. vcode (the part of
tcc which generates machine code, originally written by Dawson Engler) is not
functional on x86 platforms yet, despite the considerable effort Max
put into it.
Compile tcc according to instructions found in the package, and make
the compiled tcc executable into your path. Then reconfigure MAJIC -
it will detect the presence of tcc and compile with JIT support. The Benchmarks
Some of these benchmarks have been taken from the book "NUMERICAL
METHODS for Mathematics" by John H. Mathews. I have yet to tell him
about this! I hope he won't mind. Other benchmarks are courtesy of
Richard Bramley of Indiana University, and the same applies
there. There are benchmarks whose source I can't find - if you
wrote the benchmark and would like to have it removed from this
website, please email me!
The programs have been mangled to make them compatible with FALCON;
the MAJIC project kept the programs mangled because we want to know
how we fare compared to FALCON. The program descriptions, however,
have not been all changed, which means that you have to take
all commments with a pinch of salt.run_bmrk
. Description of individual benchmarks
ADAPT: adaptive quadrature of a fixed function
drv_adapt.m
tst_adapt.m
CGOPT: preconditioned conjugate gradient method (diagonal preconditioner)
drv_cgopt.m (driver)
tst_mat.mat (contains A and b for solving Ax=b; problem size 420x420)
tst_cgopt.m (algorithm)
CRNICH: Crank-Nicholson method for solving heat equation (parabolic PDE)
drv_crnich.m (driver)
tst_cn.mat (input parameters: problem size m x n = 321 x 321)
tst_crnich.m (algorithm)
trisys.m (subroutine to solve a triangular system of equations)
DIRICH: iterative method for solving laplace's equation
drv_dirich.m (driver)
tst_dirich.mat (input parameters: limits and tolerances)
f_dirich.m (boundary conditions, sort of. Ugly hack)
tst_dirich.m (algorithm)
FINEDIF: simple solution to wave equation (hypebolic PDE)
drv_finedif.m (driver)
tst_pde.mat (input parameters: problem size 451 x 451)
tst_finedif.m (algorithm)
GALRKN: solves Poisson's equation for a two-dimensional dipole
drv_galrkn.m (driver)
tst_galrkn.mat (input parameters: number of points etc)
tst_galrkn.m (algorithm)
ICN: our good friend, the Cholesky factorization
drv_icn.m (driver)
tst_A.mat (matrix to factorize: 400 x 400)
tst_icn.m (algorithm)
MEI: generates a surface, physical meaning unknown.
drv_mei.m (driver)
tst_mei.mat (input parameters: limits and resolution)
tst_mei.m (algorithm)
ORBEC: "one-body problem": plots e.g. the orbit of a comet around the sun.
drv_orbec.m (driver)
INP_orbec.mat (input parameters: initial position, speed, n. of time steps)
tst_orbec.m (algorithm)
ORBRK: same problem as above, but uses a 4th order Runge-Kutta method
drv_orbrk.m (driver)
INP_orbe.mat (input parameters)
tst_orbrk.m (algorithm)
rk4_orb.m (calculates next state ... RK formula)
gravrk.m (simulates the gravity pit)
QMR: quasi-minimal relaxation method, for solving linear equations.
drv_qmr.m (driver)
tst_qmr.m (input data)
tst_qmr.mat (algorithm)
SOR: successive overrelaxation method for solving a linear system of equations
drv_sor.m (driver)
tst_mat.mat (input data)
tst_sor.m (algorithm)