Get Job State in HPC
-
8 พฤษภาคม 2555 15:00
What C# code do I need to use to get the job state out of HPC? It looks like the ISchedulerjob.State property would work, but I'm not sure how to implement this in C#. I should mention that I have a job running already in HPC. I plan to run this code in parallel with the job that is currently running in HPC (i.e., MyCodeFile.exe & MyHPCJob will be on the task line).
I am going to launch them both at the same time and then have the MyCodeFile.exe update me on the progress. I just need to be able to monitor the other application that is going to be running, and I will need to know when it is finished. As I mentioned above, I did check this out http://msdn.microsoft.com/en-us/library/microsoft.hpc.scheduler.ischedulerjob.state(v=vs.85).aspx but I'm not sure how to code this into MyCodeFile.exe.
Thank you for your assistance.
- แก้ไขโดย onemadscientist 8 พฤษภาคม 2555 15:47
ตอบทั้งหมด
-
8 พฤษภาคม 2555 18:37
Hi,
Page 17 - 28 of this document http://www.clustervision.com/Windows_HPC_Server_2008_Job_Scheduler.pdf should have the code you need.
Michael
-
8 พฤษภาคม 2555 20:37
This shows what to so if you are submitting a job from within the code file. My job is being submitted from the GUI, and I would like to read the jobState from the C# code file I am running concurrently. I am getting stuck on the line:
job.OnJobState += new EventHandler<JobStateEventArg>(job_OnJobState);
I don't have the line: ISchedulerJob job = scheduler.CreateJob(); included in my code since I am not going to be creating a job, but rather just reading the status of an existing job. Any ideas where to go from here?
-
8 พฤษภาคม 2555 20:42
Yes.
When you submit your job, you will get the job id, which is what you will use in your c# code to get the job object. just call scheduler.OpenJob(id);
http://msdn.microsoft.com/en-us/library/microsoft.hpc.scheduler.ischeduler.openjob(v=vs.85).aspx
Michael