[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] assigned gpu oddity



> From: Michael Di Domenico <mdidomenico4@xxxxxxxxx>
> Date: 12/21/2015 05:53 PM
>
> If there's no way to pass the assigned gpus in as a parameter to a
> program we'll have to update our documentation, but this does seem a
> bit limiting.  we write our own code so pulled the environ isn't a big
> deal, but how do people handle binary programs that only take the
> assigned gpu device as an argument  are they not using dynamic slots?

I've used a USER_JOB_WRAPPER. Since it's applied to every job, I
set up a Perl script framework to parse the job and machine ads into hashes,
and then the appropriate wrapper operation is triggered by looking for
appropriate job classad conditions in those hashes.

In this case, you'd maybe look for the executable name to trigger the
argument rewrite for the GPU, and then pull in the GPU argument from
the environment variable which is available to the wrapper, and then
exec the command line with the appropriate list of arguments including
the GPU.

Another alternative may be a prepare-job hook - if you return a classad
with a modified "Args" attribute from the hook based on what the prepare-
job hook finds in the job classad, the job's arguments will be modified.
But I'm not sure if you'd have access to the environment variable with
the GPU directly in the prepare-job environment, or wind up stuck in
the same position as you're in now. Maybe it would appear in the job
classad's Environment attribute?

Check out page 492 of the 8.2.9 manual for hook details.

        -Michael Pelletier.