posted Sunday, May 28, 2006 11:52 PM by NileshL | 1 Comments

Just finished installing another brand new cluster running the release candidate binaries of CCS I downloaded via links through http://www.microsoft.com/hpc So, the next logical step that comes to mind is to exercise the cluster witha simple application...like the example to calculate PI in parallel using Microsoft MPI. To initiate this PI calculation exercise, I would need to submit a job to the CCS. The CCS includes Microsoft Job Scheduler which provides at least three simple ways of submitting a job to the CCS.

1.       via command line

2.       using .NET APIs

3.       using COM APIs

Although submitting a job via the command line is trivially simple, ala,

c:\workdir> job submit sample.exe

my personal favorite is submitting job through the .NET API using C#. Here is a simple code that I prefer.

The following code submits a "PI.exe" job.
----------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ComputeCluster;

namespace test
{
  class Program
  {
    static void Main(string[] args)
    {
      try
      {
        ICluster cluster = new Cluster();
        cluster.Connect("Nilesh-HeadNode");
        IJob job = new Job();
        ITask task = new Task();
        task.CommandLine = "PI.exe";
        job.AddTask(task);
        cluster.AddJob(job);
        cluster.SubmitJob(job.Id, null, null, true, 0);
      }
      catch (Exception e)
      {
        Console.WriteLine(e.Message);
      }
    }
  }
}