IML Users Manual

Table of Contents

What is IML?

Illinois-Intel Multithreading Library (IML) is a multithreading/multiprocessing library package developed under a joint research program between the Center for Supercomputing Research and Development (CSRD) at the University of Illinois at Urbana-Champaign (UIUC) and the Microcomputer Research Laboratories (MRL) of Intel Corporation.

IML provides a set of easy-to-use library functions, calls to which are to be inserted by hand by application programmers or high-performance library developers, or automatically by compilers. CSRD and MRL have been using IML for in-house application development. The Parafrase-2 automatic parallelizing compiler, developed at CSRD, now has a source code generator which interfaces with IML and thus automates the whole parallelization process. A prototype automatic parallelizing compiler based on Intel C/C++ and FORTRAN Compilers is developed at MRL.

IML exploits general kinds of parallelism, from loop (or DOALL/DOACROSS) and COBEGIN parallelism to DAG-functional parallelism, and from single-level parallelism to arbitrary nesting of parallelism (such as DOALL inside of COBEGIN).

IML provides the following API functions (among others):

List of all API functions is available here.

Since IML API does not make use of any special functionality of certain platforms other than shared address space between threads, it should be straight forward to port IML to other operating systems and system architectures.

Support for the OpenMP standard is under development.

Compatible Compilers and Systems

IML is compatible to the following systems and compilers:

Compile and Link Your Program

Add libiml.lib to your linker command line argument. Any object file containing calls to the IML API routines are dependent on libiml.lib which in turn depends on kernel32.lib and libcmt.lib. Typical C and FORTRAN command line would look like the following:

    cl -MT foo.c bar.c libiml.lib
    fl32 -MT -4Ya foo.f bar.f libiml.lib

You need to link to multithreaded library such as libcmt.lib as opposed to non-multithreaded libc.lib (via -MT option to the compiler or equivalent method). Otherwise, the correctness of the program may get compromised. In FORTRAN, at least some functions/subroutines need to have local variables on the stack rather than some statically allocated location (via -4Ya option or equivalent). This is because multiple instances of the subroutine passed to DOALL (as well as any functions/subroutines called from there) can become active at the same time. With static local variables used in FORTRAN77 standard, such multiple instances of the subroutine share the same local variable storage, leading to incorrect results.

With some applications (such as tomcatv.f), you may also have to increase the stack size by using the linker option /STACK:size1,size2, where size1 and size2 are the stack sizes to be allocated and committed, respectively. We used to use the following command line to compile tomcatv.f:

    fl32 -MT -4Ya tomcatv.f libiml.lib -link /STACK:20000000,20000000
Alternatively, you can compile the main routine of tomcatv using static local variables and all other routines (i.e., loop body functions) using automatic local variables. This is probably much better than increasing the stack size.

Usage for C Programmers

Usage for FORTRAN programmers