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

Re: [HTCondor-users] getting/passing the SlotID



Indeed!  Slot names are quite tricky for partitionable slot configurations as the name in the job ad refers to the parent partitionable slot (slot1), not the child dynamic slot (slot1_1).

Here's a one-liner if you've been installing the python plugins:

python -c 'print __import__("classad").parseOld(open(__import__("os").environ["_CONDOR_MACHINE_AD"]))["Name"].split("@")[0]'

As in,

$ condor_run python -c \''print __import__("classad").parseOld(open(__import__("os").environ["_CONDOR_MACHINE_AD"]))["Name"].split("@")[0]'\'
slot1_2

This is going to always be a string attribute, so munging around in bash is probably also going to work.

Enjoy!

Brian

On Dec 31, 2013, at 4:01 PM, Imre Pólik <imre.polik@xxxxxxxxx> wrote:

On 29/12/2013 13:35, Imre Pólik wrote:
"can a process get its own SlotID?
Look at the files pointed to by environment variables _CONDOR_MACHINE_AD and _CONDOR_JOB_AD
cmd = /bin/sh
transfer_executable = false
args = "-c 'head -1000 $_CONDOR_MACHINE_AD $_CONDOR_JOB_AD'"
output = test.out
error = test.err
queue

"Name" or "SlotID" in the machine Ad may be what you want. There's also "RemoteHost" and "RemoteSlotID" in the job Ad."


Thanks. I was hoping to have something similar to $(Process), but alas $(SlotID) did not work. Nor did a few of your suggestions:

RemoteSlotID = 1

and 

SlotID = 1

So it seems like the dynamic slot information is not in those ads. But:

Name = "slot1_1@orgrd001"

in the machine ad has what I need. On the other hand the job ad doesn't have this:

RemoteHost = "slot1@orgrd001"

I'll just search the machine ad then.
Thanks,
Imre

--
http://imre.polik.net
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/