If you know the cluster ID, you do something like this (taken directly from the manual:
http://research.cs.wisc.edu/htcondor/manual/current/condor_wait.html)
"
condor_wait logfile 40
This command waits for all jobs that exist in logfile with a job ClassAd attribute ClusterId of 40 to complete.
"
I have code that does something similar but i just wait for any job to get back to post process it. I utilize "condor_wait -num" (also described int he manual). In that case, i have a loop that is something like this (in psuedo-ish c++)
submitAllJobs(); // use MyCondorLog.txt as the log
for(int i=0;i<numJobs;i++)
{
string command = "condor_wait " + intToString(i) + " MyCondorLog.txt";
system(command);
postProcess(getCluster(i));
}
All jobs will be running, when the first one comes back, it post processes it and continues in that fashion. If 5 jobs have finished and your code calls condor_wait -num 2, it does not "wait" at all since 5 jobs have already come back and you are telling it to wait until 2 jobs are done.