Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7876 Discussions

Large Pages for C/C++ or Fortran Code

New Contributor I

I was wondering if an Intel compiler (under 64--bit Linux) can be instructed to generate a binary that can use large pages (2 or 4 MiB) upon loading. Ideally, it should be possible to request, for instance, to let the system allocate 2MiB pages to say the stak or heap segments.

If this is not possible at compile time, is there any linker option which can accomplish this ? Or even better, can any binary request that it would like to use large pages via some environment variable upon execution? I am familiar with platforms wherer all of the above can be accoplished but I was unable to find something similar with Intel compilers.

I am familiar with the Linux approach where SHM or the shared file mmaped to a process with the large page attribute set can request large pages for that particular segment. Unfortunately this does not say how to let code use large pages for stack or data segments.

thanks ....

0 Kudos
1 Reply
Black Belt
As icc doesn't supply its own malloc, but uses the whatever malloc is available at link time, it requires hugetlbfs support and malloc to accomplish this. In the unusual case where a single huge page can take care of all the requests, it may have some advantage if you are lucky.
0 Kudos