I have开发者_Go百科 this code:
static void Main(string[] args)
{
Microsoft.Hpc.Scheduler.Scheduler scheduler =
new Microsoft.Hpc.Scheduler.Scheduler();
Console.Write(scheduler.ClusterParameters + "\n" +
scheduler.EnvironmentVariables + "\n");
}
This is generating an exception. After the scheduler object is created, the properties ClusterParameters and EnvironmentVariables are holding exceptions.
The exception is, "Microsoft.Hpc.Scheduler.SchedulerException - The operation failed because you are not connected to the scheduler"
Any ideas?
The docs suggest you do not use the Scheduler
class directly. Do this instead:
IScheduler scheduler = new Scheduler();
Once you've done this you would have to Connect to be able to use the properties. That's why you get that exception.
After creating an instance of this interface, call the IScheduler.Connect method to connect to a cluster. You can then create and schedule jobs, run commands, and retrieve information about nodes in the cluster.
精彩评论