Overview of the brokering implemented in ngsub Preprocess the input xrsls 1. Split any input xrsl containing the + rsl operator into single xrsls. 2. Add cluster attributes to each xrsl to take the cluster option into account. Obtain a list of available clusters from a central GIIS 1. Query the first GIIS in the giislist for a list of available clusters. 2. If a list of clusters has been obtained goto 8. 3. If there are no more GIISes in the giislist goto 6. 4. Query the next GIIS in the giislist for a list of available clusters. 5. Goto 2. 6. If every GIIS in the giislist has been queried 5 times exit with error "could not retrieve cluster list from giis". 7. Goto 1. 8. Query the GRIS on each cluster for information about available queues. For each xrsl in the list of xrsls do the following 1. Loop over the queues and accept a queue as a possible submission target if 1. The queue status is active. 2. The user is authurized to use the queue. 3. The number of queued jobs is smaller than the queuing limit. 4. The xrsl matches the queue properties. The following attributes are checked: 1. cluster 2. queue 3. maxcputime 4. maxmemory 5. maxdisk 6. architechure 7. middleware 8. runtimeenvironment 2. If there is no possible submission target exit with error "no cluster found". 3. If there are submission targets for which there are free CPU's available for the user, consider those that require the least amount of data to be downloaded from files in a replica catalog and choose between these randomly using the number of free CPU's as a weight and goto 5. 4. Select the submission target for which the ratio (number of queued jobs)/(number of CPU's) is the greatest. The number of CPU's is taken as the assigned number of CPU's if defined, otherwise as the maximum number of running jobs. 5. Submit the job to the selected submission target. If submission fails, reject the submission target and goto 2. 6. For the seleced submission target: 1. if the number of running jobs is smaller than the maximum number of running jobs, increase the number of running jobs by one, otherwise increase the number of queued jobs by one. 2. if the number of free CPU's for the user id greater than zero, decrease this number by one. 7. Process next xrsl (goto 1).