Developer Reference

Contents

mkl_progress

Provides progress information.

Syntax

int
mkl_progress
(
int
*
thread_process
,
int
*
step
,
char
*
stage
,
int
lstage
);
Include Files
  • mkl.h
Input Parameters
Name
Type
Description
thread_process
const int*
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 non-cluster components
step
const int*
Pointer to 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
const char*
Message indicating the name of the routine or the name of the computation stage the progress routine is called from.
lstage
int
The length of a stage string excluding the trailing
NULL
character.
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.
Some
Intel® MKL
functions from LAPACK, ScaLAPACK, DSS/PARDISO, and Parallel Direct Sparse Solver for Clusters regularly call the
mkl_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® MKL
ignores any value returned by
mkl_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.
The
mkl_progress
function only supports OpenMP* threading and sequential execution.
Return Values
Name
Type
Description
stopflag
int
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:
#include <stdio.h> #include <string.h> #define BUFLEN 16 int mkl_progress( int* thread_process, int* step, char* stage, int lstage ) {   char buf[BUFLEN]; if( lstage >= BUFLEN ) lstage = BUFLEN-1;   strncpy( buf, stage, lstage );   buf[lstage] = '\0';   printf( "In thread %i, at stage %s, steps passed %i\n", *thread_process, buf, *step );   return 0; }

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