public void AddTask(ComputeJob computeJob, IComputeTask computeTask) { using (var client = BatchClient.Open(_credentials)) { var cloudJob = client.JobOperations.GetJob(computeJob.Id); AddTasks(client, cloudJob, computeJob.Id, new[] { computeTask }); } }
public virtual void Initialise(IComputeTask computeTask) { Parent = computeTask; }
private Future <TReduceRes> ExecuteClosures0 <TArg, TJobRes, TReduceRes>( IComputeTask <TArg, TJobRes, TReduceRes> task, IComputeJob job = null, IEnumerable <IComputeJob> jobs = null, int opId = OpUnicast, int jobsCount = 0, Action <BinaryWriter> writeAction = null) { Debug.Assert(job != null || jobs != null); var holder = new ComputeTaskHolder <TArg, TJobRes, TReduceRes>((Ignite)_prj.Ignite, this, task, default(TArg)); var taskHandle = Marshaller.Ignite.HandleRegistry.Allocate(holder); var jobHandles = new List <long>(job != null ? 1 : jobsCount); try { Exception err = null; try { var futTarget = DoOutOpObject(opId, writer => { writer.WriteLong(taskHandle); if (job != null) { writer.WriteInt(1); jobHandles.Add(WriteJob(job, writer)); } else { writer.WriteInt(jobsCount); Debug.Assert(jobs != null, "jobs != null"); jobHandles.AddRange(jobs.Select(jobEntry => WriteJob(jobEntry, writer))); } holder.JobHandles(jobHandles); if (writeAction != null) { writeAction(writer); } }); holder.Future.SetTarget(new Listenable(futTarget)); } catch (Exception e) { err = e; } if (err != null) { // Manual job handles release because they were not assigned to the task yet. foreach (var hnd in jobHandles) { Marshaller.Ignite.HandleRegistry.Release(hnd); } holder.CompleteWithError(taskHandle, err); } } catch (Exception e) { // This exception means that out-op failed. holder.CompleteWithError(taskHandle, e); } return(holder.Future); }
public override void Initialise(IComputeTask computeTask) { base.Initialise(computeTask); Parent.AddInput(Value); }
/// <summary> /// Internal routine for closure-based task execution. /// </summary> /// <param name="task">Task.</param> /// <param name="job">Job.</param> /// <param name="jobs">Jobs.</param> /// <param name="broadcast">Broadcast flag.</param> /// <returns>Future.</returns> private IFuture <TR> ExecuteClosures0 <TA, T, TR>(IComputeTask <TA, T, TR> task, IComputeJob job, ICollection <IComputeJob> jobs, bool broadcast) { return(ExecuteClosures0(task, job, jobs, broadcast ? OpBroadcast : OpUnicast, jobs == null ? 1 : jobs.Count)); }