~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/hed/libs/compute/Submitter.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-11-29 13:39:10 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20131129133910-altaxrfowczzl2ev
Tags: 4.0.0-1
4.0.0 Release (Closes: #715131) (LP: #1049798)

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
    ClearAll();
153
153
    
154
154
    std::list<JobDescription> descs_to_submit = descs;
 
155
    std::list<const JobDescription*> descs_to_submit_ptr;
 
156
    for (std::list<JobDescription>::const_iterator itJ = descs.begin();
 
157
         itJ != descs.end(); ++itJ) {
 
158
      descs_to_submit_ptr.push_back(&*itJ);
 
159
    }
155
160
    
156
161
    SubmissionStatus ok;
157
162
    for (std::list<Endpoint>::const_iterator it = endpoints.begin();
177
182
       * check whether it was submitted or not, and then only keep the submitted
178
183
       * ones. The latter algorithm is implemented below.
179
184
       */
180
 
      for (std::list<JobDescription>::iterator itJ = descs_to_submit.begin();
181
 
           itJ != descs_to_submit.end();) {
 
185
      std::list<JobDescription>::iterator itJ = descs_to_submit.begin();
 
186
      std::list<const JobDescription*>::iterator itJPtr = descs_to_submit_ptr.begin();
 
187
      for (; itJ != descs_to_submit.end();) {
182
188
        std::list<JobDescription const *>::iterator itNotS = notsubmitted.begin();
183
189
        for (; itNotS != notsubmitted.end(); ++itNotS) if (*itNotS == &*itJ) break;
184
190
 
185
191
        if (itNotS == notsubmitted.end()) { // No match found - job description was submitted.
186
192
          // Remove entry from descs_to_submit list, now that it was submitted.
187
 
          itJ = descs_to_submit.erase(itJ);
 
193
          itJ    = descs_to_submit.erase(itJ);
 
194
          itJPtr = descs_to_submit_ptr.erase(itJPtr);
188
195
        }
189
196
        else { // Match found - job not submitted.
190
197
          // Remove entry from notsubmitted list, now that entry was found.
194
201
      }
195
202
    }
196
203
    
 
204
    for (std::list<const JobDescription*>::const_iterator itJ = descs_to_submit_ptr.begin();
 
205
         itJ != descs_to_submit_ptr.end(); ++itJ) {
 
206
      notsubmitted.push_back(*itJ);
 
207
    }
 
208
    
197
209
    if (!notsubmitted.empty()) {
198
210
      ok |= SubmissionStatus::DESCRIPTION_NOT_SUBMITTED;
199
211
    }