mkl_progress

Provides progress information.

Syntax

FORTRAN:

stopflag = mkl_progress( thread, step, stage )

C:

stopflag = mkl_progress( thread, step, stage, lstage );

Include Files

Input Parameters

Name

Type

Description

thread

FORTRAN: INTEGER*4

C: const int*

FORTRAN: The number of the thread the progress routine is called from. 0 is passed for sequential code.

C: Pointer to the number of the thread the progress routine is called from. 0 is passed for sequential code.

step

FORTRAN: INTEGER*4

C: const int*

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

C: 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

FORTRAN: CHARACTER*(*)

C: const char*

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

lstage

C: int

The length of a stage string excluding the trailing NULL character.

Output Parameters

Name

Type

Description

stopflag

FORTRAN: INTEGER

C: int

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

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.

The progress function mkl_progress is regularly called from some LAPACK and DSS/PARDISO functions during the computation. Refer to a specific LAPACK or DSS/PARDISO function description to see whether the function supports this feature or not.

Application Notes

Note that mkl_progress is a Fortran routine, that is, to redefine the progress routine from C, the name should be spelt differently, parameters should be passed by reference, and an extra parameter meaning the length of the stage string should be considered. The stage string is not terminated with the NULL character. The C interface of the progress routine is as follows:


int mkl_progress_( int* thread, int* step, char* stage, int lstage ); // Linux, Mac int MKL_PROGRESS( int* thread, int* step, char* stage, int lstage ); // Windows

Below are the examples of printing a progress information on the standard output in Fortran and C languages:

Examples

Fortran example:

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

C example:

#include <stdio.h>
#include <string.h> 
#define BUFLEN 16 
int mkl_progress_( int* ithr, 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", *ithr, buf, *step );
  return 0; 
}

Submit feedback on this help topic