TaskEnvironmentWorkingDirectory Property |
Namespace: AGI.Parallel.Infrastructure
using System; using System.IO; using AGI.Parallel.Client; using AGI.Parallel.Infrastructure; namespace CodeSamples { class Program { static void Main(string[] args) { using (IJobScheduler scheduler = new ClusterJobScheduler("localhost")) { scheduler.Connect(); Job job = scheduler.CreateJob(); job.AddTask(new ReturnsWorkingDirectory()); // Use the Windows variables to specify specific directories. job.TaskEnvironment.WorkingDirectory = "%TEMP%"; job.Submit(); job.WaitUntilDone(); Console.WriteLine("Working Directory: " + job.Tasks[0].Result); } /* * The output of the application should resemble: * Working Directory: C:\Users\jdoe\AppData\Local\Temp */ } [Serializable] class ReturnsWorkingDirectory : Task { public override void Execute() { this.Result = Directory.GetCurrentDirectory(); } } } }
STK Parallel Computing Server 2.9 API for .NET