Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_progress

Provides progress information.

Syntax

stopflag = mkl_progress( thread_process, step, stage )

Fortran Include Files/Modules

  • Include file: mkl.fi
  • Module (compiled): mkl_service.mod
  • Module (source): mkl_service.f90

Input Parameters

Name

Type

Description

thread_process

INTEGER*4

Indicates the number of thread or process the progress routine is called from:
  • The thread number for non-cluster components linked with OpenMP threading layer

  • Zero for non-cluster components linked with sequential threading layer

  • The process number (MPI rank) for cluster components

step

INTEGER*4

The linear progress indicator that shows the amount of work done. Increases from 0 to the linear size of the problem during the computation.

stage

CHARACTER*(*)

Message indicating the name of the routine or the name of the computation stage the progress routine is called from.

Description

The mkl_progress function is intended to track progress of a lengthy computation and/or interrupt the computation. By default this routine does nothing but the user application can redefine it to obtain the computation progress information. You can set it to perform certain operations during the routine computation, for instance, to print a progress indicator. A non-zero return value may be supplied by the redefined function to break the computation.

NOTE:

The user-defined mkl_progress function must be thread-safe.

Some Intel® oneAPI Math Kernel Library (oneMKL) functions from LAPACK, ScaLAPACK, DSS/PARDISO, and Parallel Direct Sparse Solver for Clusters regularly call themkl_progress function during the computation. Refer to the description of a specific function from those domains to see whether the function supports this feature or not.

If a LAPACK function returns info=-1002, the function was interrupted by mkl_progress. Because ScaLAPACK does not support interruption of the computation, Intel® oneAPI Math Kernel Library (oneMKL) ignores any value returned bymkl_progress.

While a user-supplied mkl_progress function usually redefines the default mkl_progress function automatically, some configurations require calling the mkl_set_progress function to replace the default mkl_progress function. Call mkl_set_progress to replace the default mkl_progress on Windows* in any of the following cases:

  • You are using the Single Dynamic Library (SDL) mkl_rt.lib.

  • You link dynamically with ScaLAPACK.

WARNING:

The mkl_progress function supports OpenMP*/TBB threading and sequential execution for specific routines.

Return Values

Name

Type

Description

stopflag

INTEGER

The stopping flag. A non-zero flag forces the routine to be interrupted. The zero flag is the default return value.

Example

The following example prints the progress information to the standard output device:

 integer function mkl_progress( thread_process, step, stage )
 integer*4 thread_process, step
 character*(*) stage
 print*,'Thread:',thread_process,',stage:',stage,',step:',step
 mkl_progress = 0
 return
 end