Intel® Fortran Compiler 17.0 Developer Guide and Reference
The Intel compiler implements the following group of routines as extensions to the OpenMP* run-time library:
Get and set the execution environment
Get and set the stack size for parallel threads
Memory allocation
Get and set the thread sleep time for the throughput execution mode
The Intel extension routines described in this section can be used for low-level tuning to verify that the library code and application are functioning as intended. These routines are generally not recognized by other OpenMP-compliant compilers, which may cause the link stage to fail in the other compiler. To execute these OpenMP* routines, use the [Q]openmp-stubs option.
In most cases, environment variables can be used in place of the extension library routines. For example, the stack size of the parallel threads may be set using the OMP_STACKSIZE environment variable rather than the KMP_SET_STACKSIZE_S() library routine.
A run-time call to an Intel extension routine takes precedence over the corresponding environment variable setting.
Function |
Description |
---|---|
SUBROUTINE |
Sets OpenMP* environment variables defined as a list of variables separated by "|" in the argument. |
SUBROUTINE KMP_SET_LIBRARY_THROUGHPUT() |
Sets execution mode to throughput, which is the default. Allows the application to determine the runtime environment. Use in multi-user environments. |
SUBROUTINE KMP_SET_LIBRARY_TURNAROUND() |
Sets execution mode to turnaround. Use in dedicated parallel (single user) environments. |
SUBROUTINE KMP_SET_LIBRARY_SERIAL() |
Sets execution mode to serial. |
SUBROUTINE KMP_SET_LIBRARY(LIBNUM) |
Sets execution mode indicated by the value passed to the function. Valid values are:
Call this routine before the first parallel region is executed. |
FUNCTION KMP_GET_LIBRARY() |
Returns a value corresponding to the current execution mode:
|
Function |
Description |
---|---|
FUNCTION KMP_GET_STACKSIZE_S() |
Returns the number of bytes that will be allocated for each parallel thread to use as its private stack. This value can be changed with KMP_SET_STACKSIZE_S() routine, prior to the first parallel region or via the KMP_STACKSIZE environment variable. |
FUNCTION KMP_GET_STACKSIZE() |
Provided for backwards compatibility only. Use KMP_GET_STACKSIZE_S() routine for compatibility across different families of Intel processors. |
SUBROUTINE KMP_SET_STACKSIZE_S(size) |
Sets to size the number of bytes that will be allocated for each parallel thread to use as its private stack. This value can also be set via the KMP_STACKSIZE environment variable. In order for KMP_SET_STACKSIZE_S() to have an effect, it must be called before the beginning of the first (dynamically executed) parallel region in the program. |
SUBROUTINE KMP_SET_STACKSIZE_S(size) |
Provided for backward compatibility only. Use KMP_SET_STACKSIZE_S(size) for compatibility across different families of Intel® processors. |
The Intel compiler implements a group of memory allocation routines as an extension to the OpenMP* run-time library to enable threads to allocate memory from a heap local to each thread. These routines are: KMP_MALLOC(), KMP_CALLOC(), and KMP_REALLOC().
The memory allocated by these routines must also be freed by the KMP_FREE() routine. While you can allocate memory in one thread and then free that memory in a different thread, this mode of operation incurs a slight performance penalty.
Working with the local heap might lead to improved application performance because synchronization is not required.
Function |
Description |
---|---|
FUNCTION KMP_MALLOC(size) |
Allocate memory block of size bytes from thread-local heap. |
FUNCTION KMP_CALLOC(nelem,elsize) |
Allocate array of nelem elements of size elsize from thread-local heap. |
FUNCTION KMP_REALLOC(ptr,
size) |
Reallocate memory block at address ptr and size bytes from thread-local heap. |
SUBROUTINE KMP_FREE(ptr) |
Free memory block at address ptr from thread-local heap. Memory must have been previously allocated with KMP_MALLOC(), KMP_CALLOC(), or KMP_REALLOC(). |
In the throughput OpenMP* Support Libraries, threads wait for new parallel work at the ends of parallel regions, and then sleep, after a specified period of time. This time interval can be set by the KMP_BLOCKTIME environment variable or by the KMP_SET_BLOCKTIME() function.
Function |
Description |
---|---|
FUNCTION KMP_GET_BLOCKTIME( |
Returns the number of milliseconds that a thread should wait, after completing the execution of a parallel region, before sleeping, as set either by the KMP_BLOCKTIME environment variable or by KMP_SET_BLOCKTIME(). |
FUNCTION KMP_SET_BLOCKTIME(msec) |
Sets the number of milliseconds that a thread should wait, after completing the execution of a parallel region, before sleeping. This routine affects the block time setting for the calling thread and any OpenMP* team threads formed by the calling thread. The routine does not affect the block time for any other threads. |