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

« back to all changes in this revision

Viewing changes to src/services/a-rex/jura/JobLogFile.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:
12
12
#include <string.h>
13
13
#include <list>
14
14
#include <vector>
 
15
#include <algorithm>
15
16
 
16
17
#include <arc/Logger.h>
17
18
#include <arc/StringConv.h>
201
202
        ur.NewChild("JobIdentity").NewChild("GlobalJobId")=
202
203
          (*this)["globalid"];
203
204
        
204
 
        if (find("localid")!=end())
205
 
          ur["JobIdentity"].NewChild("LocalJobId")=
206
 
            (*this)["localid"];
 
205
        if (find("localid")!=end()) {
 
206
          std::string prefix = "";
 
207
          if (find("jobreport_option_localid_prefix")!=end())
 
208
            prefix = (*this)["jobreport_option_localid_prefix"] +"-";
 
209
          ur["JobIdentity"].NewChild("LocalJobId")=prefix + (*this)["localid"];
 
210
        }
207
211
      }
208
212
    else
209
213
    {
428
432
      }
429
433
    
430
434
    //Headnode
431
 
    if (find("headnode")!=end())
 
435
    /* Unhandled UR element by SGAS
 
436
     if (find("headnode")!=end())
432
437
      {
433
438
        ur.NewChild("Headnode")=(*this)["headnode"];
434
 
      }
 
439
      }*/
435
440
 
436
441
    //Queue
437
442
    if (find("queue")!=end())
452
457
        ur.NewChild("NodeCount")=(*this)["nodecount"];
453
458
      }
454
459
 
455
 
    //Processors?
 
460
    //Processors
 
461
    if (find("processors")!=end())
 
462
      {
 
463
        ur.NewChild("Processors")=(*this)["processors"];
 
464
      }
 
465
 
456
466
 
457
467
    //Extra:
458
 
    //RunTimeEnvironment
 
468
    //RuntimeEnvironment
459
469
 
460
470
    for(std::list<std::string>::iterator jt=rtes.begin();
461
471
        jt!=rtes.end();
462
472
        ++jt)
463
473
      {
464
 
        ur.NewChild("arc:RunTimeEnvironment")=*jt;
 
474
        ur.NewChild("arc:RuntimeEnvironment")=*jt;
465
475
      }
466
476
 
467
477
 
757
767
    std::string type = "local";
758
768
    if (find("headnode")!=end() && (*this)["lrms"] != "fork" ){
759
769
        type = "grid";
760
 
        infran.NewAttribute("urf:description")=(*this)["lrms"];
 
770
        std::string lrms = (std::string)(*this)["lrms"];
 
771
        std::transform(lrms.begin(), lrms.end(), lrms.begin(), ::toupper);
 
772
        infran.NewAttribute("urf:description")="JURA-ARC-"+lrms;  //Prefix required to the APEL
761
773
    }
762
774
    infran.NewAttribute("urf:type")=type;
763
775
 
914
926
      }
915
927
 
916
928
    //Processors
 
929
    if (find("processors")!=end())
 
930
      {
 
931
        ur.NewChild("Processors")=(*this)["processors"];
 
932
      }
917
933
 
918
934
    //EndTime
919
935
    if (find("endtime")!=end())