Skip to content

Score-P, Scalasca, Cube#

Score-P, Scalasca, and Cube are typically used together to instrument, measure, and analyze an MPI application.



For installation follow the steps in the documentation of the corresponding component.


The usage is divided into three parts. A more detailed example can be found in the documentation of Scalasca.

  1. Instrument code with Score-P by prefixing each compile command with scorep:

    scorep mpicc ...

    • The command scalasca --instrument instead of using scorep is only provided for backward compatibility.

    See the Score-P documentation for details.

  2. Measure and profile/trace an application run with Scalasca.
    Prefix the parallel run with scalasca --analyse. This generates .cubex files that can later be visualized with Cube. For measuring you can choose between:

    • Profiling (default), just run:
      scalasca --analyse mpirun ...
    • Tracing enabled via flag -t:
      scalasca --analyse -t mpirun ...

    See Measure for more options, Filtering to reduce the amount of collected data, or consult Scalasca's documentation for all details.

  3. Analyze/examine results with Scalasca or Cube.

    • without GUI: scalasca --examine -s <experiment dir>
    • with GUI: cube <cubex file>
      • Note there are multiple cubex files inside an experiment directory.

    See the Scalasca documentation or Cube documentation


Options for measuring are specified via environment variables. Important once include:

  • SCOREP_TOTAL_MEMORY=<memory>[M|G]: Amount of memory for profile/tracing data to set aside on each process until data must be flushed to disc.
  • SCOREP_METRIC_PERF=cycles,page-faults: Add perf events cycles and page-faults. Other perf events can be specified too.
  • SCOREP_METRIC_RUSAGE=all Use all or dedicated metrics from the rusage (resource usage) system call.

Further information can be found in Score-P's Getting Started guide or Measurement Configuration .


For more details consult Score-P's documentation about Filtering.

Generating a profile or trace can amount to a lot of memory. By filtering specific functions or ranges can be included or excluded. As a starting point check the scorep.score file, located inside the experiment directory. It shows how much memory is required for Scalasca per process and which functions can be filtered.

A simple file to exclude functions by name (Fortran functions, hence the trailing underscore):


With Scalasca use a filter file with the -f <filter-file> flag:

scalasca --analyse -f <filter-file> ...

Score-P issues#

Feature test macros, that are set at the beginning of source files might be ignored, when preprocessed/compiled with Score-P.

  • Score-P prefixes some includes of the Standard C library at the beginning of each file.
  • Definition of feature test macros in your source files are then defined to late.
  • Workaround: Define feature test macros on the command command line when invoking the compiler. For example to define _GNU_SOURCE use -D_GNU_SOURCE.