locked
ISchedulerTask.SetEnvironmentVariable didn't work -- but does now :-) RRS feed

  • Question

  • Having created the task, called SetEnvironmentVariable("TEST_VAR", "test value") and set the commandLine to "SET" it's clear that SetEnvironmentVariable doesn't set the specified environment variable on the compute node as the stdout files don't contain any reference to this environment variable 

     

    ===========================================================

    Update:

     

    In fact this doesn't seem to be the case any more

    I swear my core code failed to set the env var, but my NUNIT tests are succeeding

    Please put this down to the phase of the moon

     

    Thanks

     

    Andy

    Wednesday, April 9, 2008 5:12 PM

Answers

  •  

    We couldn't repro this internally, and it worked for me when I used the following code, so we're considering this issue closed.  Please let us know if you see it again.

     

    Code Snippet

    private static void setEnvTest(String headNodeName)

    {

    // Connect to the head node

    Scheduler scheduler = new Scheduler();

    scheduler.Connect(headNodeName);

     

    // Create a job

    ISchedulerJob job = scheduler.CreateJob();

    job.Name = "Set Env Test";

     

    // Create a task with an environment variable

    ISchedulerTask task = job.CreateTask();

    task.SetEnvironmentVariable("This", "Works");

    task.CommandLine = "Set This";

    job.AddTask(task);

     

    // Submit the job

    scheduler.SubmitJob(job, null, null);

    }

     

     

     

    Thanks,
    Josh

    Wednesday, April 30, 2008 9:33 PM
    Moderator

All replies

  •  

    Thanks for all of the feedback, Maxitone!  I'm forwarding this on to Dev to take a look at.

     

    -Josh

    Wednesday, April 9, 2008 5:52 PM
    Moderator
  •  

    We couldn't repro this internally, and it worked for me when I used the following code, so we're considering this issue closed.  Please let us know if you see it again.

     

    Code Snippet

    private static void setEnvTest(String headNodeName)

    {

    // Connect to the head node

    Scheduler scheduler = new Scheduler();

    scheduler.Connect(headNodeName);

     

    // Create a job

    ISchedulerJob job = scheduler.CreateJob();

    job.Name = "Set Env Test";

     

    // Create a task with an environment variable

    ISchedulerTask task = job.CreateTask();

    task.SetEnvironmentVariable("This", "Works");

    task.CommandLine = "Set This";

    job.AddTask(task);

     

    // Submit the job

    scheduler.SubmitJob(job, null, null);

    }

     

     

     

    Thanks,
    Josh

    Wednesday, April 30, 2008 9:33 PM
    Moderator
  • Is there any way to customize execution of windows workflow inside HPC? is there any out of the box support?

     

     

    Thanks

    Jobs

    Tuesday, June 10, 2008 6:30 AM