• 9.1
  • 07/08/2015
  • Public Content

Instrument Your Code


Insert the
MPI_Pcontrol
function call into your application to turn the trace collection on and off.
To collect the data on the
exchange
function of the
poisson
application, do the following:
  1. Go to
    <installdir>/examples/poisson/pardat.f90
  2. Edit the
    pardat.f90
    file:
    1. Right after the
      MPI_Init
      call, turn the trace collection off:
      MPI_Pcontrol(0);
    2. At the beginning of the
      poisson_red_black
      subroutine, turn the trace collection on:
      MPI_Pcontrol(1);
    3. At the end of the
      poisson_red_black
      subroutine, turn the trace collection off
  3. Save the
    pardat.f90
    file.
  4. Rebuild the application.
  5. Run the application.
    Linux* OS:
    $ mpirun -trace -n 4 ./poisson
    Windows* OS:
    > mpiexec -n 4 poisson.exe
Check your work:
  1. Open the resulting trace file
    poisson.stf
    in Intel® Trace Analyzer.
  2. In the Function Profile, right-click
    Group MPI
    and select
    Ungroup Group MPI
    from the context menu.
  3. Go to the
    Load Balance
    tab of the Function Profile to see how the
    MPI_Finalize
    ,
    MPI_Sendrecv
    and
    MPI_Allreduce
    functions are distributed among the four processes.
  4. Go to
    Charts > Event Timeline
    to see the activities in each of the four processes individually.
You can see that the trace data was collected only for a particular part of the code. Note the
VT_API
group: it stands for the part of the code where trace data collection was turned off:
Key Terms

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804