Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • In here build a Makefile with the command:
Code Block
 FC=ifortgfortran44 ./configure 
  • type ./configure --help for detailed options; i.e to build mpi executable:
Code Block
 FC=ifortgfortran44 ./configure --with-mpi 
  • You can also use the gfortan44 compiler to build a Makefile with netcdf output:

...

Code Block
 qsub <name>.sh 

Trouble shooting

Ofcourse Of course life is not always straight forward on a linux cluster. Don't feel stupid when you type "qstat" and your name is not part of the list. Stay calm and try not to cry but instead go to your simulation directory and check for the .o file. It will tell you the error. If the error is about mpd please contact Jamie (8176) or Jaap (8363) if not contact ICT.

...

Code Block
MPD_SECRETWORD=secret

Debugging

Debugging a parallel version of XBeach using multiple processes is possible, but not as convenient as debugging in, for example, Visual Studio. This section describes a way to truly debug a parallel program like XBeach.

Compile the program without optimization

In order to prevent the debugger to randomly skip through the code, optimizations should be prevented. This can be done to alter the above mentions call to the configuration script as follows:

Code Block
 FC=gfortran44 FCFLAGS="-g -O0" ./configure --with-mpi 

The -g option makes sure debugging symbols are included in the result. The -O0 sets the optimizations to a minimum. By default these are set to -O2. Now create a binary file:

Code Block

make distclean
make

Have an X Window system available

On Microsoft Windows, make sure an X Window emulator is running. For example, start Exceed: START -> Program -> Exceed -> Exceed

Run the model

Start the just compiled XBeach binary in your model directory in a bit peculiar way:

Code Block
 mpirun -n <nr_of_processes> xterm -e gdb <path_to_binary>/xbeach 

This will start a number of command windows (xterm) equal to the number of processes you defined after the -n option. In each command window, a instance of the debugger (gdb) will be started. Each instance of the debugger will debug a specific subprocess of the XBeach program stored in the <path_to_binary> path.

Start debugging

The debugger provides at least the following commands, which can be used in each command window separately:

Command

Description

Example

r

Starts the XBeach program in the current debugger

r

b

Adds or queries a breakpoint

b <filename>.F90:<linenr>

 

 

b 1

c

Continue running after breakpoint

c

n

Continue to next line

n

p

Print variable contents

p <varname>

q

Quit running

q

Especially the commands n or p might complain about a lack of line numbers or variables. This can be due to you are still using optimizations or you use an inferior type of debugging symbols. You might want to consider using another type, like DWARF-2. How? I don't know! If you do, please provide the info here...

Anchor
compilexbeach
compilexbeach

...