A hint on debugging
Your program will probably not work on the first try. How should you
debug
it? There are several different things one can do to simplify the
process.
- Don't write the whole code at once. Write it in pieces and
compile now and then. It will be easier to find syntax errors that way.
Use
implicit none
in Fortran.
- If you are using Fortran it may be possible to switch on
index control.
- Check the definitions of functions and subroutines and the how
they are used. Specifically, check the number of, type of and order of
parameters. For functions, you should check the return type as well.
- Test your program without using the OpenMP-directives
first (i.e. the OMP-directives are ignored). Then you can test using
the omp-compilers but with only one thread.
- Test your program on a short input file first, so you can check
the results produced by the program.