OPT
Compiling C Code
Compiling Fortran
Using optgui
Overview
OPT is a software profiler for application developers who want to achieve higher performance for their parallel and scalar codes - for C, C++ and Fortran applications. It can help you concentrate your effort on the parts of your code that really impact its overall performance. Statistical analysis shows areas of poor communication or computation balance across processors, allowing the behavior of parallel processes to be understood clearly. OPT can offer you useful insight into what your program is doing.
Usage
- Load the opt module with module load opt
- Compile the C or Fortran code using the opt profiling library that matches the MPI library in use.
- Run the application to completion, as you would run normally. The job will run slower due to logging of the data.
- After the application has finished, view the results using the optgui
- Repeat as needed and compare multiple jobs
Compiling for Profiling with OPT
The OPT module defines a number of environment variables used thought this compiling example that will make compiling simpler.
Compiling C/C++ Code
Change your mpi.h to optmpi.h
#include <optmpi.h>
Compile with the OPT include path and link with the opt library that matches your MPI library.
mpicc -g source.c -o myexe -I$OPT_INC -L$OPT_LINK -lopt-openmpi
Compiling Fortran Code
Compiling Fortran is very similar to C/C++, only need to link against the opt library matching your MPI library.
mpif90 -g source.f90 -o myexe -L$OPT_LINK -lopt-openmpi
At this point run the code as you normally would, ether interactively or via PBS file, both using mpirun.
OptGUI
Optgui is used to view the data from one or many jobs. It is also used to define new profiles, but is not required. It will store data from finished jobs so it may be viewed latter. To run optgui you need an X server running. If you do not have an X server use the CAEN VNC service. The use of this service and basic optgui is demonstrated in the video below.


