Configure a New LINQ to HPC Project in Visual Studio

After you have set up the cluster, you can create a LINQ to HPC project in Visual Studio 2010 that will run a distributed query. This topic lists the requirements for your development computer and the steps in Visual Studio to configure the required properties, references, and namespaces for a LINQ to HPC project.

Requirements on your development computer

Your development computer must have the following software installed to develop and submit LINQ to HPC jobs to a Windows HPC Server 2008 R2 cluster:

  • Microsoft Visual Studio 2010 with SP1.

  • Microsoft HPC Pack 2008 R2 with SP3 SDK installed. Download SDK here.

  • Microsoft HPC Pack 2008 R2 with SP3 client utilities installed (to submit your application to an HPC cluster from a client computer and to remotely manage your cluster). Download client utilities here.

    Note

    In the setup wizard for Microsoft HPC Pack 2008 R2 SP3, on the Select Installation Type page, click Install only the client utilities.

Configure a new project in Visual Studio for LINQ to HPC

The following steps describe how to set up a new project in Visual Studio for a LINQ to HPC application. These steps include information about the required references, namespaces, and target frameworks.

Note

It is strongly recommended that LINQ to HPC applications use 64-bit versions of the operating system. To develop client applications for deployment on 32-bit clients, use the "Any CPU" platform.

To configure a new project in Visual Studio for LINQ to HPC

  1. Open Visual Studio and create a new project for a .NET application.

  2. Add Microsoft.Hpc.Linq.dll and Microsoft.Hpc.Dsc.dll as references in the project.

  3. Import the Microsoft.Hpc.Linq namespace into each source file that executes LINQ to HPC queries by adding the following using statement:

    using Microsoft.Hpc.Linq;

  4. Optionally, if you plan to use the DSC APIs, import the Microsoft.Hpc.Dsc namespace by adding the following using statement:

    using Microsoft.Hpc.Dsc;

  5. Set the platform target of your project to x64 or to Any CPU. LINQ to HPC does not limit you to build only for 32-bit client applications. Applications that target the Any CPU platform will run on 32-bit clients.

  6. Ensure that all of the classes and methods that are referenced from a LINQ to HPC query are public. LINQ to HPC generates code that runs on compute nodes, and that code must be able to reference all classes and methods that are mentioned in the query.

When you build projects that target the x64 the platform, you may see warning CS1607 Referenced assembly targets a different processor for assemblies mscorlib.dll and System.Data.dll. You can safely ignore this warning. Disable it by adding it to the suppress warnings list in the Build tab of the project properties.

For more information about this warning, see Compiler Warning (level 1) CS1607.