Provides progress information.
This function is declared in mkl_lapack.fi for FORTRAN 77 interface and in mkl_lapack.h for C interface.
The progress routine mkl_progress is regularly called from some LAPACK routines during the computation. By default this routine does nothing but the user application can redefine it to obtain the computation progress information. A non-zero return value may be supplied by the redefined function to break the computation.
INTEGER*4.
The number of the thread the progress routine is called from. 0 is passed for sequential code.
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.
CHARACTER*(*). The name of the LAPACK routine, which the progress routine is called from.
INTEGER.
The stopping flag. A non-zero flag forces the routine to be interrupted. The zero flag is the default return value.
Note that mkl_progress
is a Fortran routine, that is, to redefine the progress routine from C, the name should be spelled 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 the following:
int mkl_progress_( int* thread, int* step, char* stage, int len ); // Linux, Mac int MKL_PROGRESS( int* thread, int* step, char* stage, int len ); // Windows
Below are the examples of printing a progress information on the standard output in Fortran and C languages:
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
#include <string.h>
#define BUFLEN 16
int mkl_progress_( int* ithr, int* step, char* stage, int len ){char buf[BUFLEN];
if( len >= BUFLEN ) len = BUFLEN-1;
strncpy( buf, stage, len );
buf[len] = '\0';
printf( 'In thread %i, at stage %s, steps passed %i\n', *ithr, buf, *step );
return 0;
}