Compile and Use DROPS by Visual Studio 2010


DROPS can be compiled and executed on Windows OS systems using the Visual Studio 2010 (VS) compiler and environment. Therefore, all necessary files for VS10 are located in the directory DROPS_HOME\arch\VS2010. As a main entry, load the solution file DropsPackage.sln. The solution DropsPackage consists of (right now) four projects: drops, ddd, metis, and parmetis.The corresponding libraries are assumed to be located in the directory DROPS_HOME\.. After you set up this project to your environment, you can compile DROPS by pressing F7 and execute drops by Ctrl+F5 (no Debug mode) or F5 (Debug mode).To distinguish betweenthe parallel and serial version of drops and the debug and serial version of drops, you can chose the configuration via the configuration pull-down menu (as shown in the attached figure ChoseConfig.png). The current setting builds and executes the program twophasedrops in the directory levelset and uses the parameter file risingbutanoldroplet.param. To change the executable or the parameter file, cf. section "Debug and Execute."

Obtaining Visual Studio and HPC Pack 2008 SDK

Obviously, you need to install Visual Studio 2010 to compile, run, and debug drops by Visual Studio. In order to use MPI and debug parallel programs you additionally need the HPC Pack 2008 SDK. For members of RWTH Aachen University, you can connect to a server, e.g., cluster-win-lab.rz.rwth-aachen.de or cluster-win.rz.rwth-aachen.de, where these programs and libraries are installed.

Visual Studio 2010
A basic version of Visual Studio 2010 is available without any fee. For example, you may want to download the Visual C++ 2010 Express. You can also download the Visual Studio 2010 Professional version via the MSDNAA Server, if you are member of a university which is member of this service agreement.

HPC Pack 2008 SDK
Before you start compiling and using DROPS, you have to install an MPI version on your system. The DROPS package is predefined for the Microsoft HPC Pack 2008 SDK. For the installation directory, the default directory <C:\Program Files\Microsoft HPC Pack 2008 SDK> has been chosen.

Debug and Execute

By default, the executable twophasedrops in the directory levelset is generated. Depending on your configuration setting the corresponding executable (drops.exe) is placed by VS in the directory DROPS_HOME\arch\VS2010\<ConfigurationName>, which then can be executed manually or within the IDE of VS. Therefore, two tyoes are available, "Start Debugging" or "Start Without Debugging" which can be selected from the menu Debug or alternatively by pressing F5 or Ctrl+F5. Per default the parameter file risingbutanoldroplet.param is taken. Please make sure to create the subdirectory ensight and/or vtk in DROPS_HOME\levelset to write out the results. If you want to specify another parameter file, you have to set the "Command Arguments" to your parameter file, i.e., Project -> Properties -> Configuration Properties -> Debugging -> Command Arguments. Additionally, you may choose here an alternative working directory - instead of DROPS_HOME\levelset. (For a picture of the dialog, see attachment ChangeCommandArguments.png). To debug another executable, you have to specify the executable which should be build. Therefore, you have to exclude the target twophasedrop.cpp from the build by right-clicking it and select Properties -> Exclude From Build -> yes. Afterwards, you can select another source code be included in the build via the same procedure. For debugging a parallel MPI program in VS you have to modify the debugging setting via Project -> Properties -> Debugging. As debugger, you have to specify the MPI Cluster Debugger. For instance, the settings for debugging with 2 MPI processes are illustrated in the attached picture Debug.png. The number of processes is specified in the line "Run Environment".

Parallel MPI Version of DROPS

To use the parallel MPI version of DROPS, please choose the configuration "Release" or "Debug", depending on your objective. If you have installed the HPC Pack 2008 SDK in the default directory, all settings should be appropriately set. You can compile your version of DROPS by hitting F7 and run the application by Ctrl+F5 or F5.

Serial Version of DROP

Just decide weather you want to use the Debug or Release version of DROPS, choose the corresponding configuration, DebugSerial or ReleaseSerial (drop down menu on the top), press F7 and Ctrl+F5 to execute drops. Unfortunately, the project dependencies cannot be set for different configurations. So, even for the serial versions the libraries DDD, Metis, and ParMetis are generated. To avoid the generation, you have to delete the dependencies DDD, Metis, and ParMetis for drops via Project -> Project Dependencies.

Differences to Linux Version

There are some differences in using drops and Visual Studio and the use of Makefiles. Besides more "mouse work," here is a list of main differences:

Building Executables
Visual Studio assumes only one executable to be generated. Therefore, the DropsPackage solution contains a filte, named target, where all source codes are located which contain the code for executables. In order to change the executable, you have to exclude the default executable twophasedrops from the build and add another source code to the build.

Names of Files
In Visual Studio each file may only occurs once. In contrast to the Makefile-oriented build, VS does not distinguish between different directories, where the files are located. To make the directory structure of drops visible in VS so-called filters are used. This may result in problems since the file params.cpp is located at least three times in drops.

Time Measurements
The OpenMP runtime library provides the function omp_get_wtime. Calling this function does not depend on the operating system. Therefore, in V, we use this function to measure the time. To make use of the function the OpenMP support has to be enabled in VS.

Compiler Warnings
Since the VS Compile is far more restrictive than the gcc compiler, the warnings are turned of for DROPS. If you want to see the warnings you can enable the warnings by increasing the warning level via Project -> Properties ->Configuration Properties-> C/C++ ->General -> Warning Level.


Patrick Esser,
last update: May 17th, 2010