Merging the .dyn Files

To merge the .dyn files, use the profmerge utility.

The profmerge Utility

The compiler executes profmerge automatically during the feedback compilation phase when you specify -prof_use.

The command-line usage for profmerge is as follows:

profmerge [-nologo] [-prof_dirdirname]

where -prof_dirdirname  is a profmerge utility option.

This merges all .dyn files in the current directory or the directory specified by -prof_dir, and produces the summary file pgopti.dpi.

The -prof_filefilename option enables you to specify the name of the .dpi file.

The command-line usage for profmerge with -prof_filefilename is as follows:

profmerge [-nologo] [-prof_filefilename]

where /prof_filefilename is a profmerge utility option.

Note

The profmerge tool merges all the .dyn files that exist in the given directory. It is very important to  make sure that unrelated .dyn files, oftentimes from previous runs, are not present in that directory. Otherwise, profile information will be based on invalid profile data. This can negatively impact the performance of optimized code as well as generate misleading coverage information.

Note

The .dyn files can be merged to a .dpi file by the profmerge tool without recompiling the application.

Dumping Profile Data

This subsection provides an example of how to call the C PGO API routines from Fortran. For complete description of the PGO API support routines, see PGO API: Profile Information Generation Support.

As part of the instrumented execution phase of profile-guided optimization, the instrumented program writes profile data to the dynamic information file (.dyn file). The file is written after the instrumented program returns normally from main() or calls the standard exit function. Programs that do not terminate normally, can use the _PGOPTI_Prof_Dump function. During the instrumentation compilation
(-prof_gen) you can add a call to this function to your program. Here is an example:

INTERFACE
SUBROUTINE PGOPTI_PROF_DUMP()
!DEC$ ATTRIBUTES C, ALIAS:'PGOPTI_Prof_Dump'::PGOPTI_PROF_DUMP
END SUBROUTINE
END INTERFACE
CALL PGOPTI_PROF_DUMP()

Note
You must remove the call or comment it out prior to the feedback compilation with -prof_use.