Skip to content

Argonne Leadership Computing Facility

Argonne Leadership
Computing Facility



The OpenMP API is an open standard for parallel programming. The specification document can be found here: The specification describes directives, runtime routines, and environment variables that allow an application developer to express parallelism (e.g. shared memory multiprocessing and device offloading). Many compiler vendors provide implementations of the OpenMP specification (

Using OpenMP on Polaris

  • TODO: modules available

Building on Polaris

  • TODO: instructions for different compilers

Running on Polaris

  • TODO: how to run


$ cat hello.cpp
#include <stdio.h>
#include <omp.h>

int main( int argv, char** argc ) {

  printf( "Number of devices: %d\n", omp_get_num_devices() );

  #pragma omp target
    if( !omp_is_initial_device() )
      printf( "Hello world from accelerator.\n" );
      printf( "Hello world from host.\n" );
  return 0;

$ cat hello.F90
program  main
  use omp_lib
  implicit none

  write(*,*) "Number of devices:", omp_get_num_devices()

  !$omp target 
    if( .not. omp_is_initial_device() ) then
      write(*,*) "Hello world from accelerator"
      write(*,*) "Hello world from host"
  !$omp end target

end program main

$ module load TODO
$ ...