Skip to main content

WinHPC System Programming

Learn how to build and run an MPI (message passing interface) program on the WinHPC system with Intel compilers from the command line.

Assuming you have a working MPI program (e.g., one that has been built on a linux cluster), the difference on WinHPC is that there is no "mpicc". You use the regular compiler, but you have to explicitly specify where the MPI header (mpi.h) and library (msmpi.lib) are. To build from the command line, run…

Start > Intel Software Development Tools > Intel C++ Compiler Professional… > C++ Build Environment for applications running on Intel 64

This starts a command shell that has its environment set up correctly.

To use the MPI libraries your compile command needs to look like:

Start > Intel Software Development Tools > Intel C++ Compiler Professional... > C++ Build Environment for applications running on Intel 64

This starts a command shell that has its environment set up correctly.

To use the MPI libraries your compile command needs to look like:

icl mpi_test.c "C:\Program  Files\Microsoft HPC Pack 2008 SDK\Lib\amd64\msmpi.lib" /I"C:\Program  Files\Microsoft HPC Pack 2008 SDK\Include" -o mpi_test.exe

"icl" is the intel C compiler.  The fortran compiler is "ifort".

To run this program via the scheduler, you need to copy it to \\winhpchn1\public\ or some subdirectory.

Then go to the scheduler program.

In your "task", the working directory should be set to point to where you put your executable, e.g. \\winhpchn1\public\<username>\mpi_test\

Then the command line of the task might be:

 mpiexec -np 16 mpi_test.exe

In this case, you are requesting 16 cores.  (You may be unable to get more than 8 cores unless you go to the task dialog and change the "resource type" to "nodes". Then, by asking for 2 nodes, you can get 16 cores.)

You may now submit the job and monitor its progress.