PToolsWin is a complete development environment for porting and tuning parallel Linux applications on Microsoft Windows 64-bit with Microsoft MPI. It combines a customized MinGW-w64 distribution with the TAU Performance System and is ideal for porting high-performance applications from Linux/Unix environments to Windows Azure or your Windows-based cluster. The 64-bit MinGW cross compiler generates native Windows code, so your application will perform as well as a native Windows application.

MPI applications are fully supported by PToolsWin. ParaTools has developed MPI cross-compilers that produce Windows 64-bit executables that link with Microsoft MPI. Many Linux MPI applications can be cross compiled without any change to the code or build scripts.

This work was sponsored by the Microsoft Developer and Platform Evangelism team.

Download

PToolsWin is distributed as part of HPC Linux. Please visit the downloads section of the HPC Linux page to get started with HPC Linux.

Using ptoolswin to generate Windows binaries

Execute this command from a shell prompt in HPC Linux:

% module load ptoolswin

and compile your Linux applications to generate Windows 64-bit binaries. Applications that follow the GNU automake build process (./configure && make && make install) will benefit from passing the –host=x86_64-w64-mingw32 flag to ./configure.

In general, porting an HPC application from Linux to Windows follows this recipe:

  1. Begin by building and running your application on Linux to familiarize yourself with your application’s compilation process and its run time requirements.
  2. Understand your application’s dependencies. For example, does it use ATLAS or NetCDF? Does it access files that are operating system specific, like the /proc file system on Linux?

  3. Port all required libraries to Windows before porting your application. Remember, many common libraries are supported on a variety of platforms, so search the web for pre-built binary packages before you recompile from scratch.
  4. After the required libraries are installed, compile your application with PToolsWin. Build and run your application with only the most necessary features enabled to ease the porting process. For example, you may want to do a serial-only build before you do the MPI build.
  5. Once you’re satisfied that your application’s core features are working, enable any optional features you need and recompile if necessary.

PToolsWin includes Microsoft MPI

Microsoft MPI is highly compatible with the popular MPICH2 MPI implementation, however there are some minor differences. See the Using Microsoft Message Passing Interface whitepaper for details. For more information about MPI, see the Message Passing Interface Tutorial from Lawrence Livermore National Laboratory (LLNL).

Many Linux applications can be built for Windows just by passing the –host=x86_64-w64-mingw32 flag to the configure script. If your application does not have a configure script, you will need to learn about your application’s build system and make the appropriate changes.

In some cases your application will require code modifications before it will compile. The Unix to Windows Porting Dictionary for HPC is an excellent online resource that can help you rewrite your code to be Windows compatible.

Accessing the native compilers

Many applications use the system’s native compiler suite to build utility programs. WRF and OpenFOAM are two examples. To access the native compilers when the PToolsWin module is loaded, use the full path to the program executable. The available native compilers and utilities are:

  • Serial & OpenMP:
    • /usr/bin/gcc
    • /usr/bin/g++
    • /usr/bin/gfortran
  • MPI:
    • /usr/local/packages/openmpi/bin/mpicc
    • /usr/local/packages/openmpi/bin/mpic++
    • /usr/local/packages/openmpi/bin/mpif77
    • /usr/local/packages/openmpi/bin/mpif90
  • Utilities:
    • /usr/bin/ld
    • /usr/bin/ar
    • /usr/bin/ranlib