Click or drag to resize

TaskEnvironmentWorkingDirectory Property

Gets or sets the custom working directory of the task environment.

Namespace:  AGI.Parallel.Infrastructure
Assembly:  AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 2.9.0.1601 (2.9.0.1601)
Syntax
public string WorkingDirectory { get; set; }

Property Value

Type: String
The working directory.
Examples
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();
            }
        }
    }
}
See Also

STK Parallel Computing Server 2.9 API for .NET