Re: [HTCondor-devel] how to add a new attribute and post to condor_q


Date: Tue, 2 Sep 2014 14:37:35 -0400
From: Bing X <xiebingbing@xxxxxxxxx>
Subject: Re: [HTCondor-devel] how to add a new attribute and post to condor_q
thanks for your answer.Â

I think my requirement might be a little specific, which is not a stable input attribute, but closer to the variable evaluate at run time.Â

e.g. similar to evaluate the image size. I'm running a workflow through Dagman, in which I want to evaluate the input data size for each task. Thus, I need to read in all output data size before submitting the task. I saw the dynamic image size evaluation has already been done in condor_submit/submit.cpp. I want to add a similar attribute.

any suggestion?


On Tue, Sep 2, 2014 at 1:36 PM, Todd Tannenbaum <tannenba@xxxxxxxxxxx> wrote:
On 9/1/2014 11:07 AM, Bing X wrote:
I'm working on condor-8.0.6,

I noticed that ATTR_IMAGE_SIZE, is defined in
condor_includes/condor_attributes; assigned value at
condor_submit/submit.cpp; and print at condor_q/queue.cpp

Now I want to add a new attribute, similar to image_size, assign value at
condor_submit/, and print to condor_q. But seems I missed some magic part
on handling ATTR_IMAGE_SIZE. so these 3 steps don't work for my
self-defined attribute.

does anyone know the whole process on handling ATTR_IMAGE_SIZE? any other
part involved in the process from defining attribute, assigning value to
printing to condor_q ?



No need to change the source code, HTCondor already supports adding custom job (and machine) attributes. These custom attributes can then be viewed with tools like condor_q and even used in scheduling expressions (like START, PREEMPT, etc).

Lets says you want to add a custom job attribute "department". In your submit file, insert a new custom attribute via pre-pending a "+" character, i.e.

exectuable = foo
universe = vanilla
+department = "Sales"
queue

Then you can view the "department" attribute via condor_q. You will want to use either the "-l" (to view all job attributes), or "-format" or "-autoformat" (to view a list of specific attributes) command-line arguments arguments to condor_q. Take a look at this URL for ideas:

https://htcondor-wiki.cs.wisc.edu/index.cgi/wiki?p=HowToWriteaCondorqWrapper

Hope the above helps,
Todd



_______________________________________________
HTCondor-devel mailing list
HTCondor-devel@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-devel



--
Todd Tannenbaum <tannenba@xxxxxxxxxxx> University of Wisconsin-Madison
Center for High Throughput Computing ÂDepartment of Computer Sciences
HTCondor Technical Lead        1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132Â Â Â Â Â Â Â Â Â Madison, WI 53706-1685



--
Thanks
Bing
[← Prev in Thread] Current Thread [Next in Thread→]