Ejemplo n.º 1
0
        /// <summary>
        /// Attempts to connect the the scheduler specified by Cluster and retrieve the Job specified by JobID. Will throw a SchedulerException if either of those fails.
        /// </summary>
        /// <returns></returns>
        public v2.ISchedulerJob GetV2Job()
        {
            v2.ISchedulerJob job;

            v2.IScheduler scheduler;
            HpcLib.TryConnect(Cluster, out scheduler).Enforce <SchedulerException>("Unable to connect to head node {0}", Cluster);
            HpcLib.TryGetJob(scheduler, Username, JobID, out job).Enforce <SchedulerException>("Unable to load jobID {0} for user {1}", JobID, Username);

            return(job);
        }
Ejemplo n.º 2
0
 private ISchedulerJob GetJob()
 {
     lock (_getJobLocker)
     {
         HpcLib.TryGetJob(_scheduler, ClusterArgs.Username, ClusterArgs.JobID, out _job);
         return(_job);
     }
     //IFilterCollection filter = _scheduler.CreateFilterCollection();
     //filter.Add(FilterOperator.Equal, PropId.Job_Name, ClusterArgs.RunName);
     //IIntCollection potentialIDs = _scheduler.GetJobIdList(filter, null);
     //var matchingIDs = potentialIDs.Where(id => id == ClusterArgs.JobID);
     //if (matchingIDs.Count() == 1)
     //{
     //    int id = matchingIDs.First();
     //    ISchedulerJob job = _scheduler.OpenJob(id);
     //    return job;
     //}
     //return null;
 }