Page History

Turn Off History

You may want to write a condor_q wrapper to display information specific to your installation. With condor_q's -format option, this is usually straightforward. Each call to -format allows you to write one piece of information. That information can be simple attributes from the job's ClassAd, or it can be full ClassAd expressions.

Note that all of this applies to condor_status as well.

Here is a a command that almost replicates the output of "condor_q". It does not print the "-- Submitter:" line at the start, nor does it print the summary at the bottom. Furthermore, condor_q truncates the Cmd name to just the executable itself, excluding the directory portion of the path. If #1368 is implemented, extracting just the executable will be relatively straightforward. Also of note, the RUN_TIME formatting is complicated because 7.4.x and earlier ClassAds lack the modulus (%) operator. 7.5.2 and later will likely include this operator, allowing for simpler expressions.

condor_q \
	-format '%4d.' ClusterId \
	-format '%-3d ' ProcId \
	-format '%-14s ' Owner \
	-format '%-11s ' 'formatTime(QDate,"%0m/%d %H:%M")' \
	-format '%3d+' 'int(RemoteUserCpu/(60*60*24))' \
	-format '%02d:' 'int((RemoteUserCpu-(int(RemoteUserCpu/(60*60*24))*60*60*24))/(60*60))' \
	-format '%02d:' 'int((RemoteUserCpu-(int(RemoteUserCpu/(60*60))*60*60))/(60))' \
	-format '%02d ' 'int(RemoteUserCpu-(int(RemoteUserCpu/60)*60))' \
	-format '%-2s ' 'ifThenElse(JobStatus==0,"U",ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",ifThenElse(JobStatus==3,"X",ifThenElse(JobStatus==4,"C",ifThenElse(JobStatus==5,"H",ifThenElse(JobStatus==6,"E",string(JobStatus))))))))' \
	-format '%-3d ' JobPrio \
	-format '%-4.1f ' ImageSize/1024.0 \
	-format '%-18.18s' 'strcat(Cmd," ",Arguments)' \
	-format '\n' Owner

Now, for example, lets say that a healthy chunk of your jobs are all MatLab jobs, and all have a Cmd of /path/to/matlab. You'd like to see the script file being passed in for these jobs instead of the path to matlab. That's relatively simple, just check the Cmd's path and change what you print. The -format line in question would be:

	-format '%-18.18s' 'ifThenElse(Cmd == "/path/to/matlab", Args, strcat(Cmd," ",Args))'

yielding a full command of:

condor_q \
	-format '%4d.' ClusterId \
	-format '%-3d ' ProcId \
	-format '%-14s ' Owner \
	-format '%-11s ' 'formatTime(QDate,"%0m/%d %H:%M")' \
	-format '%3d+' 'int(RemoteUserCpu/(60*60*24))' \
	-format '%02d:' 'int((RemoteUserCpu-(int(RemoteUserCpu/(60*60*24))*60*60*24))/(60*60))' \
	-format '%02d:' 'int((RemoteUserCpu-(int(RemoteUserCpu/(60*60))*60*60))/(60))' \
	-format '%02d ' 'int(RemoteUserCpu-(int(RemoteUserCpu/60)*60))' \
	-format '%-2s ' 'ifThenElse(JobStatus==0,"U",ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",ifThenElse(JobStatus==3,"X",ifThenElse(JobStatus==4,"C",ifThenElse(JobStatus==5,"H",ifThenElse(JobStatus==6,"E",string(JobStatus))))))))' \
	-format '%-3d ' JobPrio \
	-format '%-4.1f ' ImageSize/1024.0 \
	-format '%-18.18s' 'ifThenElse(Cmd == "/path/to/matlab", Args, strcat(Cmd," ",Args))'
	-format '\n' Owner