Author Topic: qbsub-Setting environment vars?  (Read 7577 times)

instinct-vfx

  • Full Member
  • ***
  • Posts: 16
qbsub-Setting environment vars?
« on: August 20, 2012, 01:59:08 PM »
Hey there,

now that our final licenses have arrived we're knee-deep in getting things up and running at cruise speed :D

One of the things i didn't manage so far is setting environment variables as available via the QubeGUi when submitting jobs via qsub.

Is this possible at all?

Regards,
Thorsten

jburk

  • Administrator
  • *****
  • Posts: 493
Re: qbsub-Setting environment vars?
« Reply #1 on: August 20, 2012, 06:07:39 PM »
Unfortunately, there's currently no "--env" type of flag, (which sounds like a good idea, and I'll look into adding it, you could use it multiple times, like

--env foo=bar --env fubar=baz

But for now, there's 2 ways to do this:

There's the job_flag "export_environment" which will duplicate the entire submitting environment, but it's a brute-force way to get where you want.

If you're building cmdline or cmdrange jobs, you can prefix the commands with the explicit "set" commands, which will be OS- or shell-specific:

Windows:
set FOO=bar && <my cmdline>

Linux/OS X (note that the default shell is 'sh')
export FOO=bar && <my cmdline>