Scalasca  (Scalasca 2.6, revision 748ac9e9)
Scalable Performance Analysis of Large-Scale Applications
Instrumentation

To generate measurements which can be used as input for the Scalasca Trace Tools, user application programs first need to be instrumented. That is, special measurement calls have to be inserted into the program code which are then executed at specific important points (events) during the application run. Unlike previous versions of Scalasca which used a custom measurement system, this task is now accomplished by the community instrumentation and measurement infrastructure Score-P.

As already mentioned in the previous section, use of the scalasca -instrument and skin commands is discouraged, and therefore not discussed in this guide. Instead, all the necessary instrumentation of user routines, OpenMP constructs, MPI functions, etc. should be handled by the Score-P instrumenter, which is accessed through the scorep command. Therefore, the compile and link commands to build the application that is to be analyzed should be prefixed with scorep (e.g., in a Makefile).

For example, to instrument the MPI application executable myapp generated from the two Fortran source files foo.f90 and bar.f90, the following compile and link commands

  $ mpif90 -c foo.f90
  $ mpif90 -c bar.f90
  $ mpif90 -o myapp foo.o bar.o

have to be replaced by corresponding commands involving the Score-P instrumenter:

  $ scorep  mpif90 -c foo.f90
  $ scorep  mpif90 -c bar.f90
  $ scorep  mpif90 -o myapp foo.o bar.o

This will automatically instrument every routine entry and exit seen by the compiler, intercept MPI function calls to gather message-passing information, and link the necessary Score-P measurement libraries to the application executable.

Alternatively, the Score-P compiler wrapper commands (e.g., scorep-mpif90) can be used as a compiler replacement. These commands allow to control instrumentation via an environment variable, which may be required during the configuration step with certain build systems such as CMake or GNU Autotools. Please refer to the Section "Score-P Compiler Wrapper Usage" in the Score-P User Manual [17] for details.

Attention
The Score-P instrumenter commands (scorep prefix or compiler wrapper) must be used with the link command to ensure that all required Score-P measurement libraries are linked with the executable. However, not all object files need to be instrumented, thereby avoiding measurements and data collection for routines and OpenMP constructs defined in those files. Nevertheless, for the Scalasca trace analysis to work correctly, instrumenting files defining OpenMP parallel regions is essential.

Although generally most convenient, automatic compiler-based function instrumentation as used by default may result in too many and/or too disruptive measurements, which can be addressed by selective instrumentation and measurement filtering. While the most basic steps will be briefly covered in Section Optimizing the measurement configuration, please also consult the Score-P manual [17] for details on the available instrumentation and filtering options.




Scalasca    Copyright © 1998–2021 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming