We’ve Grown!

This compiler is just one component of the complete PToolsWin development environment. PToolsWin supports parallel applications with MPI and OpenMP in addition to serial applications. Please visit thePToolsWin page for the latest tools, downloads, and the information.

ParaTools has developed a system for porting and tuning parallel POSIX applications on Microsoft Windows 64-bit with Microsoft MPI. This system 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.

TAU is a portable profiling and tracing toolkit for performance analysis of parallel programs that can help you improve the performance of your application. For example, TAU will show you which routines are taking the longest to complete on any or all cluster nodes, or it can precisely measure the overhead of MPI communication in your application. The 64-bit MinGW cross compiler generates native Windows code that does not require an intermediate POSIX layer, so your application will perform as well as a native Windows application.

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

Download

Install

$TOOLS_ROOT in these instructions is the installation destination. /opt is a good value for $TOOLS_ROOT for an “all users” installation, or $HOME/software is good for a “single user” installation.

MinGW-w64

This distribution of the MinGW-w64 cross compiler includes additional headers and libraries TAU needs for complete functionality. TAU can be used with a different MinGW distribution, but some TAU features may be disabled. We recommend you use this distribution, even if you already have a MinGW installation.

  1. Download the MinGW -w64 cross compiler

  2. Install the cross compiler package:
       mkdir -p $TOOLS_ROOT
       cd $TOOLS_ROOT
       tar xvjf /path/to/paratools-mingw32-w64-bin_x86_64-linux_20110831.tar.bz2
  3. Add the MinGW-w64 cross compiler to your path:
    • Borne Shell:
      export =$PATH:$TOOLS_ROOT/mingw/bin
    • C Shell:
      setenv PATH $PATH:$TOOLS_ROOT/mingw/bin

Microsoft MPI

  1. On your Windows 64-bit machine:
    1. Install the free Microsoft HPC SDK
    2. Copy C:\Program Files\Microsoft HPC Pack 2008 SDK to a temporary location (e.g. D:\ms-hpc-2008-sp2)
    3. Copy C:\Windows\System32\msmpi.dll to D:\ms-hpc-2008-sp2\Lib\amd64
    4. Transfer D:\ms-hpc-2008-sp2 to $TOOLS_ROOT
  2. Execute these commands on your POSIX machine:
       cd $TOOLS_ROOT/ms-hpc-2008-sp2
       ln -s Include Inc
       cd Lib/amd64
       $TOOLS_ROOT/mingw/bin/gendef msmpi.dll
       x86_64-w64-mingw32-dlltool -d msmpi.def -l libmsmpi.a -D msmpi.dll
  3. Download this patch for Microsoft’s mpi.h file to $TOOLS_ROOT
  4. Apply the patch:
       cd $TOOLS_ROOT/ms-hpc-2008-sp2
       gunzip -c $TOOLS_ROOT/paratools-v2-msmpi.patch.gz | patch -p0

TAU

  1. Download TAU and PDT from the TAU website

  2. Unpack TAU:
       cd $TOOLS_ROOT
       tar xvzf /path/to/tau2.tgz
  3. Unpack PDT:
    cd $TOOLS_ROOT
    tar xvzf /path/to/pdt.tgz
  4. Configure and install TAU:
    cd $TOOLS_ROOT/tau2
    ./configure \
        -c++=x86_64-w64-mingw32-g++ \
        -cc=x86_64-w64-mingw32-gcc \
        -pdt=$TOOLS_ROOT/pdtoolkit-3.17 \
        -pdt_c++=g++ \
        -bfd=class="ID">$TOOLS_ROOT/mingw/binutils \
        -mpiinc=$TOOLS_ROOT/ms-hpc-2008-sp2/Include \
        -mpilib=$TOOLS_ROOT/ms-hpc-2008-sp2/Lib/amd64 \
        -mpilibrary=-lmsmpi \
        -tag=mingw-w64
    make install -j
  5. Add TAU to your path:
    • Borne Shell:
      export PATH=$PATH:$TOOLS_ROOT/tau2/x86_64/bin
      
    • C Shell:
      setenv PATH $PATH:$TOOLS_ROOT/tau2/x86_64/bin

Using TAU and the MinGW-w64 Cross Compiler

To instrument your application with TAU as you cross compile for Windows 64-bit, simply use the appropriate TAU compiler script and TAU makefile. For example, to instrument a C++ application use “tau_cxx.sh” as your compiler. The TAU_MAKEFILEenvironment variable will typically be set to $TOOLS_ROOT/tau2/x86_64/lib/Makefile.tau-mingw-w64-mpi-pdt. Please see the TAU documentation for more information.

To cross-compile your application for Windows 64-bit without TAU instrumentation, simply add the prefix “x86_64-w64-mingw32-” to your compiler name. For example, if your application builds with gcc and links statically with ar and ranlib, then replace “gcc” with “x86_64-w64-mingw32-gcc”, “ar” with “x86_64-w64-mingw32-ar”, and “ranlib” with “x86_64-w64-mingw32-ranlib” in your build scripts or makefiles.

Examples