Function Order List Usage Guidelines

A function order list is a text that specifies the order in which the linker should link the non-static functions of your program. This improves the performance of your program by reducing paging and improving code locality. Profile-guided optimizations support the generator of a function order list to be used by linker. The compiler determines the order using profile information.

Use the following guidelines to create a function order list.

1.  The order list only affects the order of non-static functions.

2.  Do not use -prof_genx to compile two files from the same program simultaneously. This means that you cannot use the -prof_genx option with parallel makefile utilities.

Function Order List Example

Assume you have a Fortran program that consists of files file1.f and file2.f and that you have created a directory for the profile data files in /usr/profdata. Do the following to generate and use a function order list.

1. Compile your program by specifying -prof_genx and -prof_dir:

IA-32 applications:

prompt>ifc -oMYPROG -prof_genx -prof_dir/usr/profdata file1.f file2.f

Itanium(TM)-based applications:

prompt>efc -oMYPROG -prof_genx -prof_dir/usr/profdata file1.f file2.f

2.  Run the instrumented program on one or more sets of input data.

  prompt>MYPROG

     The program produces a .dyn file each time it is executed.

3.  Merge the data from one or more runs of the instrumented program using the profmerge tool to produce the pgopti.dpi file.

prompt>profmerge -prof_dir/usr/profdata

4.  Generate the function order list using the proforder tool. By default, the function order list is produced in the file proford.txt.

prompt>proforder -prof_dir/usr/profdata -oMYPROG.txt

5.  Compile your application with profile feedback by specifying the -prof_use and the -ORDER option to the linker. Again, use the -prof_dir option to specify the location of the profile files.

IA-32 applications:

prompt>ifc -oMYPROG -prof_use -prof_dir/usr/profdata file1.f file2.f -link -ORDER:@MYPROG.txt

Itanium-based applications:

prompt>efc -oMYPROG -prof_use -prof_dir/usr/profdata file1.f file2.f -link -ORDER:@MYPROG.txt