Back to index

nordugrid-arc-nox  1.1.0~rc6
TargetRetrieverCREAM.cpp
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil -*-
00002 
00003 #ifdef HAVE_CONFIG_H
00004 #include <config.h>
00005 #endif
00006 
00007 #include <arc/ArcConfig.h>
00008 #include <arc/Logger.h>
00009 #include <arc/StringConv.h>
00010 #include <arc/Thread.h>
00011 #include <arc/URL.h>
00012 #include <arc/XMLNode.h>
00013 #include <arc/client/ExecutionTarget.h>
00014 #include <arc/client/TargetGenerator.h>
00015 #include <arc/data/DataBuffer.h>
00016 #include <arc/data/DataHandle.h>
00017 
00018 #include "TargetRetrieverCREAM.h"
00019 
00020 namespace Arc {
00021 
00022   struct ThreadArg {
00023     TargetGenerator *mom;
00024     const UserConfig *usercfg;
00025     URL url;
00026     int targetType;
00027     int detailLevel;
00028   };
00029 
00030   ThreadArg* TargetRetrieverCREAM::CreateThreadArg(TargetGenerator& mom,
00031                                                    int targetType,
00032                                                    int detailLevel) {
00033     ThreadArg *arg = new ThreadArg;
00034     arg->mom = &mom;
00035     arg->usercfg = &usercfg;
00036     arg->url = url;
00037     arg->targetType = targetType;
00038     arg->detailLevel = detailLevel;
00039     return arg;
00040   }
00041 
00042   Logger TargetRetrieverCREAM::logger(TargetRetriever::logger, "CREAM");
00043 
00044   TargetRetrieverCREAM::TargetRetrieverCREAM(const UserConfig& usercfg,
00045                                              const URL& url, ServiceType st)
00046     : TargetRetriever(usercfg, url, st, "CREAM") {}
00047 
00048   TargetRetrieverCREAM::~TargetRetrieverCREAM() {}
00049 
00050   Plugin* TargetRetrieverCREAM::Instance(PluginArgument *arg) {
00051     TargetRetrieverPluginArgument *trarg =
00052       dynamic_cast<TargetRetrieverPluginArgument*>(arg);
00053     if (!trarg)
00054       return NULL;
00055     return new TargetRetrieverCREAM(*trarg, *trarg, *trarg);
00056   }
00057 
00058   void TargetRetrieverCREAM::GetTargets(TargetGenerator& mom, int targetType,
00059                                         int detailLevel) {
00060 
00061     logger.msg(VERBOSE, "TargetRetriverCREAM initialized with %s service url: %s",
00062                tostring(serviceType), url.str());
00063 
00064     switch (serviceType) {
00065     case COMPUTING:
00066       if (mom.AddService(url)) {
00067         ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
00068         if (!CreateThreadFunction(&InterrogateTarget, arg)) {
00069           delete arg;
00070           mom.RetrieverDone();
00071         }
00072       }
00073       break;
00074     case INDEX:
00075       if (mom.AddIndexServer(url)) {
00076         ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
00077         if (!CreateThreadFunction(&QueryIndex, arg)) {
00078           delete arg;
00079           mom.RetrieverDone();
00080         }
00081       }
00082       break;
00083     }
00084   }
00085 
00086   void TargetRetrieverCREAM::QueryIndex(void *arg) {
00087     ThreadArg *thrarg = (ThreadArg*)arg;
00088     TargetGenerator& mom = *thrarg->mom;
00089     const UserConfig& usercfg = *thrarg->usercfg;
00090 
00091     URL& url = thrarg->url;
00092     url.ChangeLDAPScope(URL::subtree);
00093     url.ChangeLDAPFilter("(|(GlueServiceType=bdii_site)"
00094                          "(GlueServiceType=bdii_top))");
00095     DataHandle handler(url, usercfg);
00096     DataBuffer buffer;
00097 
00098     if (!handler) {
00099       logger.msg(INFO, "Can't create information handle - "
00100                  "is the ARC ldap DMC plugin available?");
00101       delete thrarg;
00102       mom.RetrieverDone();
00103       return;
00104     }
00105 
00106     if (!handler->StartReading(buffer)) {
00107       delete thrarg;
00108       mom.RetrieverDone();
00109       return;
00110     }
00111 
00112     int handle;
00113     unsigned int length;
00114     unsigned long long int offset;
00115     std::string result;
00116 
00117     while (buffer.for_write() || !buffer.eof_read())
00118       if (buffer.for_write(handle, length, offset, true)) {
00119         result.append(buffer[handle], length);
00120         buffer.is_written(handle);
00121       }
00122 
00123     if (!handler->StopReading()) {
00124       delete thrarg;
00125       mom.RetrieverDone();
00126       return;
00127     }
00128 
00129     XMLNode XMLresult(result);
00130 
00131     std::list<XMLNode> topBDIIs =
00132       XMLresult.XPathLookup("//*[GlueServiceType='bdii_top']", NS());
00133 
00134     for (std::list<XMLNode>::iterator iter = topBDIIs.begin();
00135          iter != topBDIIs.end(); ++iter) {
00136 
00137       if ((std::string)(*iter)["GlueServiceStatus"] != "OK")
00138         continue;
00139 
00140       TargetRetrieverCREAM retriever(usercfg, URL((std::string)(*iter)["GlueServiceEndpoint"]), INDEX);
00141       retriever.GetTargets(mom, thrarg->targetType, thrarg->detailLevel);
00142     }
00143 
00144     std::list<XMLNode> siteBDIIs =
00145       XMLresult.XPathLookup("//*[GlueServiceType='bdii_site']", NS());
00146 
00147     for (std::list<XMLNode>::iterator iter = siteBDIIs.begin();
00148          iter != siteBDIIs.end(); ++iter) {
00149 
00150       if ((std::string)(*iter)["GlueServiceStatus"] != "OK")
00151         continue;
00152 
00153       //Should filter here on allowed VOs, not yet implemented
00154 
00155       TargetRetrieverCREAM retriever(usercfg, URL((std::string)(*iter)["GlueServiceEndpoint"]), COMPUTING);
00156       retriever.GetTargets(mom, thrarg->targetType, thrarg->detailLevel);
00157     }
00158 
00159     delete thrarg;
00160     mom.RetrieverDone();
00161   }
00162 
00163   void TargetRetrieverCREAM::InterrogateTarget(void *arg) {
00164     ThreadArg *thrarg = (ThreadArg*)arg;
00165     TargetGenerator& mom = *thrarg->mom;
00166     const UserConfig& usercfg = *thrarg->usercfg;
00167 
00168     URL url = thrarg->url;
00169     url.ChangeLDAPScope(URL::subtree);
00170     DataHandle handler(url, usercfg);
00171     DataBuffer buffer;
00172 
00173     if (!handler) {
00174       logger.msg(INFO, "Can't create information handle - "
00175                  "is the ARC ldap DMC plugin available?");
00176       delete thrarg;
00177       mom.RetrieverDone();
00178       return;
00179     }
00180 
00181     if (!handler->StartReading(buffer)) {
00182       delete thrarg;
00183       mom.RetrieverDone();
00184       return;
00185     }
00186 
00187     int handle;
00188     unsigned int length;
00189     unsigned long long int offset;
00190     std::string result;
00191 
00192     while (buffer.for_write() || !buffer.eof_read())
00193       if (buffer.for_write(handle, length, offset, true)) {
00194         result.append(buffer[handle], length);
00195         buffer.is_written(handle);
00196       }
00197 
00198     if (!handler->StopReading()) {
00199       delete thrarg;
00200       mom.RetrieverDone();
00201       return;
00202     }
00203 
00204     XMLNode XMLresult(result);
00205 
00206     // Create one ExecutionTarget per VOView record.
00207 
00208     std::list<XMLNode> VOViews =
00209       XMLresult.XPathLookup("//*[objectClass='GlueVOView']", NS());
00210 
00211     for (std::list<XMLNode>::iterator it = VOViews.begin();
00212          it != VOViews.end(); it++) {
00213 
00214       XMLNode VOView(*it);
00215 
00216       ExecutionTarget target;
00217 
00218       target.GridFlavour = "CREAM";
00219       target.Cluster = thrarg->url;
00220 
00221       std::string key;
00222       std::string::size_type pos = std::string::npos;
00223 
00224       for (XMLNode node = VOView["GlueChunkKey"]; node; ++node) {
00225         key = (std::string)node;
00226         pos = key.find('=');
00227         if (key.substr(0, pos) == "GlueCEUniqueID")
00228           break;
00229       }
00230 
00231       XMLNode CE =
00232         *XMLresult.XPathLookup("//*[GlueCEUniqueID='" +
00233                                key.substr(pos + 1) + "']", NS()).begin();
00234 
00235       for (XMLNode node = CE["GlueForeignKey"]; node; ++node) {
00236         key = (std::string)node;
00237         pos = key.find('=');
00238         if (key.substr(0, pos) == "GlueClusterUniqueID")
00239           break;
00240       }
00241 
00242       XMLNode Cluster =
00243         *XMLresult.XPathLookup("//*[objectClass='GlueCluster']"
00244                                "[GlueClusterUniqueID='" +
00245                                key.substr(pos + 1) + "']", NS()).begin();
00246 
00247       // What to do if a cluster has more than one subcluster???
00248       XMLNode SubCluster =
00249         *XMLresult.XPathLookup("//*[objectClass='GlueSubCluster']"
00250                                "[GlueChunkKey='" + key + "']", NS()).begin();
00251 
00252       for (XMLNode node = Cluster["GlueForeignKey"]; node; ++node) {
00253         key = (std::string)node;
00254         pos = key.find('=');
00255         if (key.substr(0, pos) == "GlueSiteUniqueID")
00256           break;
00257       }
00258 
00259       XMLNode Site =
00260         *XMLresult.XPathLookup("//*[objectClass='GlueSite']"
00261                                "[GlueSiteUniqueID='" +
00262                                key.substr(pos + 1) + "']", NS()).begin();
00263 
00264       /* These are the available attributes:
00265 
00266          VOView["GlueVOViewLocalID"];
00267          VOView["GlueCEAccessControlBaseRule"]; // multi
00268          VOView["GlueCEStateRunningJobs"];
00269          VOView["GlueCEStateWaitingJobs"];
00270          VOView["GlueCEStateTotalJobs"];
00271          VOView["GlueCEStateFreeJobSlots"];
00272          VOView["GlueCEStateEstimatedResponseTime"];
00273          VOView["GlueCEStateWorstResponseTime"];
00274          VOView["GlueCEInfoDefaultSE"];
00275          VOView["GlueCEInfoApplicationDir"];
00276          VOView["GlueCEInfoDataDir"];
00277          VOView["GlueChunkKey"];
00278          VOView["GlueSchemaVersionMajor"];
00279          VOView["GlueSchemaVersionMinor"];
00280 
00281          CE["GlueCEHostingCluster"];
00282          CE["GlueCEName"];
00283          CE["GlueCEUniqueID"];
00284          CE["GlueCEImplementationName"];
00285          CE["GlueCEImplementationVersion"];
00286          CE["GlueCECapability"]; // multi
00287          CE["GlueCEInfoGatekeeperPort"];
00288          CE["GlueCEInfoHostName"];
00289          CE["GlueCEInfoLRMSType"];
00290          CE["GlueCEInfoLRMSVersion"];
00291          CE["GlueCEInfoJobManager"];
00292          CE["GlueCEInfoContactString"]; // multi
00293          CE["GlueCEInfoApplicationDir"];
00294          CE["GlueCEInfoDataDir"];
00295          CE["GlueCEInfoDefaultSE"];
00296          CE["GlueCEInfoTotalCPUs"];
00297          CE["GlueCEStateEstimatedResponseTime"];
00298          CE["GlueCEStateRunningJobs"];
00299          CE["GlueCEStateStatus"];
00300          CE["GlueCEStateTotalJobs"];
00301          CE["GlueCEStateWaitingJobs"];
00302          CE["GlueCEStateWorstResponseTime"];
00303          CE["GlueCEStateFreeJobSlots"];
00304          CE["GlueCEStateFreeCPUs"];
00305          CE["GlueCEPolicyMaxCPUTime"];
00306          CE["GlueCEPolicyMaxObtainableCPUTime"];
00307          CE["GlueCEPolicyMaxRunningJobs"];
00308          CE["GlueCEPolicyMaxWaitingJobs"];
00309          CE["GlueCEPolicyMaxTotalJobs"];
00310          CE["GlueCEPolicyMaxWallClockTime"];
00311          CE["GlueCEPolicyMaxObtainableWallClockTime"];
00312          CE["GlueCEPolicyPriority"];
00313          CE["GlueCEPolicyAssignedJobSlots"];
00314          CE["GlueCEPolicyMaxSlotsPerJob"];
00315          CE["GlueCEPolicyPreemption"];
00316          CE["GlueCEAccessControlBaseRule"]; // multi
00317          CE["GlueForeignKey"];
00318          CE["GlueInformationServiceURL"];
00319          CE["GlueSchemaVersionMajor"];
00320          CE["GlueSchemaVersionMinor"];
00321 
00322          Cluster["GlueClusterName"];
00323          Cluster["GlueClusterService"];
00324          Cluster["GlueClusterUniqueID"];
00325          Cluster["GlueForeignKey"];
00326          Cluster["GlueInformationServiceURL"];
00327          Cluster["GlueSchemaVersionMajor"];
00328          Cluster["GlueSchemaVersionMinor"];
00329 
00330          SubCluster["GlueChunkKey"];
00331          SubCluster["GlueHostApplicationSoftwareRunTimeEnvironment"]; // multi
00332          SubCluster["GlueHostArchitectureSMPSize"];
00333          SubCluster["GlueHostArchitecturePlatformType"];
00334          SubCluster["GlueHostBenchmarkSF00"];
00335          SubCluster["GlueHostBenchmarkSI00"];
00336          SubCluster["GlueHostMainMemoryRAMSize"];
00337          SubCluster["GlueHostMainMemoryVirtualSize"];
00338          SubCluster["GlueHostNetworkAdapterInboundIP"];
00339          SubCluster["GlueHostNetworkAdapterOutboundIP"];
00340          SubCluster["GlueHostOperatingSystemName"];
00341          SubCluster["GlueHostOperatingSystemRelease"];
00342          SubCluster["GlueHostOperatingSystemVersion"];
00343          SubCluster["GlueHostProcessorClockSpeed"];
00344          SubCluster["GlueHostProcessorModel"];
00345          SubCluster["GlueHostProcessorVendor"];
00346          SubCluster["GlueSubClusterName"];
00347          SubCluster["GlueSubClusterUniqueID"];
00348          SubCluster["GlueSubClusterPhysicalCPUs"];
00349          SubCluster["GlueSubClusterLogicalCPUs"];
00350          SubCluster["GlueSubClusterTmpDir"];
00351          SubCluster["GlueSubClusterWNTmpDir"];
00352          SubCluster["GlueInformationServiceURL"];
00353          SubCluster["GlueSchemaVersionMajor"];
00354          SubCluster["GlueSchemaVersionMinor"];
00355 
00356          Site["GlueSiteUniqueID"];
00357          Site["GlueSiteName"];
00358          Site["GlueSiteDescription"];
00359          Site["GlueSiteEmailContact"];
00360          Site["GlueSiteUserSupportContact"];
00361          Site["GlueSiteSysAdminContact"];
00362          Site["GlueSiteSecurityContact"];
00363          Site["GlueSiteLocation"];
00364          Site["GlueSiteLatitude"];
00365          Site["GlueSiteLongitude"];
00366          Site["GlueSiteWeb"];
00367          Site["GlueSiteSponsor"];
00368          Site["GlueSiteOtherInfo"];
00369          Site["GlueSiteOtherInfo"];
00370          Site["GlueForeignKey"];
00371          Site["GlueSchemaVersionMajor"];
00372          Site["GlueSchemaVersionMinor"];
00373 
00374          ... now do the mapping */
00375 
00376       // TODO: we need to somehow query the HealthState
00377 
00378       target.HealthState = "ok";
00379 
00380 
00381       if (CE["GlueCEName"])
00382         target.ComputingShareName = (std::string)CE["GlueCEName"];
00383       if (CE["GlueCEInfoLRMSType"])
00384         target.ManagerProductName = (std::string)CE["GlueCEInfoLRMSType"];
00385       if (CE["GlueCEInfoLRMSVersion"])
00386         target.ManagerProductVersion = (std::string)CE["GlueCEInfoLRMSVersion"];
00387       if (Site["GlueSiteName"])
00388         target.DomainName = (std::string)Site["GlueSiteName"];
00389       if (Site["GlueSiteLocation"])
00390         target.Place = (std::string)Site["GlueSiteLocation"];
00391       if (Site["GlueSiteLatitude"])
00392         target.Latitude = stringtof(Site["GlueSiteLatitude"]);
00393       if (Site["GlueSiteLongitude"])
00394         target.Longitude = stringtof(Site["GlueSiteLongitude"]);
00395       if (CE["GlueCEInfoContactString"])
00396         target.url = (std::string)CE["GlueCEInfoContactString"];
00397       if (CE["GlueCEImplementationName"]) {
00398         if (CE["GlueCEImplementationVersion"])
00399           target.Implementation =
00400             Software((std::string)CE["GlueCEImplementationName"],
00401                      (std::string)CE["GlueCEImplementationVersion"]);
00402         else
00403           target.Implementation =
00404             (std::string)CE["GlueCEImplementationName"];
00405       }
00406       if (VOView["GlueCEStateTotalJobs"])
00407         target.TotalJobs = stringtoi(VOView["GlueCEStateTotalJobs"]);
00408       else if (CE["GlueCEStateTotalJobs"])
00409         target.TotalJobs = stringtoi(CE["GlueCEStateTotalJobs"]);
00410       if (VOView["GlueCEStateRunningJobs"])
00411         target.RunningJobs = stringtoi(VOView["GlueCEStateRunningJobs"]);
00412       else if (CE["GlueCEStateRunningJobs"])
00413         target.RunningJobs = stringtoi(CE["GlueCEStateRunningJobs"]);
00414       if (VOView["GlueCEStateWaitingJobs"])
00415         target.WaitingJobs = stringtoi(VOView["GlueCEStateWaitingJobs"]);
00416       else if (CE["GlueCEStateWaitingJobs"])
00417         target.WaitingJobs = stringtoi(CE["GlueCEStateWaitingJobs"]);
00418 
00419       // target.StagingJobs           - not available in schema
00420       // target.SuspendedJobs         - not available in schema
00421       // target.PreLRMSWaitingJobs    - not available in schema
00422       // target.ComputingShareName          - not available in schema
00423 
00424       if (VOView["GlueCEPolicyMaxWallClockTime"])
00425         target.MaxWallTime = stringtoi(VOView["GlueCEPolicyMaxWallClockTime"]);
00426       else if (CE["GlueCEPolicyMaxWallClockTime"])
00427         target.MaxWallTime = stringtoi(CE["GlueCEPolicyMaxWallClockTime"]);
00428 
00429       // target.MinWallTime           - not available in schema
00430       // target.DefaultWallTime       - not available in schema
00431 
00432       if (VOView["GlueCEPolicyMaxCPUTime"])
00433         target.MaxCPUTime = stringtoi(VOView["GlueCEPolicyMaxCPUTime"]);
00434       else if (CE["GlueCEPolicyMaxCPUTime"])
00435         target.MaxCPUTime = stringtoi(CE["GlueCEPolicyMaxCPUTime"]);
00436 
00437       // target.MinCPUTime            - not available in schema
00438       // target.DefaultCPUTime        - not available in schema
00439 
00440       if (VOView["GlueCEPolicyMaxTotalJobs"])
00441         target.MaxTotalJobs = stringtoi(VOView["GlueCEPolicyMaxTotalJobs"]);
00442       else if (CE["GlueCEPolicyMaxTotalJobs"])
00443         target.MaxTotalJobs = stringtoi(CE["GlueCEPolicyMaxTotalJobs"]);
00444       if (VOView["GlueCEPolicyMaxRunningJobs"])
00445         target.MaxRunningJobs =
00446           stringtoi(VOView["GlueCEPolicyMaxRunningJobs"]);
00447       else if (CE["GlueCEPolicyMaxRunningJobs"])
00448         target.MaxRunningJobs = stringtoi(CE["GlueCEPolicyMaxRunningJobs"]);
00449       if (VOView["GlueCEPolicyMaxWaitingJobs"])
00450         target.MaxWaitingJobs =
00451           stringtoi(VOView["GlueCEPolicyMaxWaitingJobs"]);
00452       else if (CE["GlueCEPolicyMaxWaitingJobs"])
00453         target.MaxWaitingJobs = stringtoi(CE["GlueCEPolicyMaxWaitingJobs"]);
00454       if (SubCluster["GlueHostMainMemoryRAMSize"])
00455         target.MaxMainMemory = stringtoi(SubCluster["GlueHostMainMemoryRAMSize"]);
00456 
00457       // target.MaxPreLRMSWaitingJobs - not available in schema
00458 
00459       // is this correct ???
00460       if (VOView["GlueCEPolicyAssignedJobSlots"])
00461         target.MaxUserRunningJobs =
00462           stringtoi(VOView["GlueCEPolicyAssignedJobSlots"]);
00463       else if (CE["GlueCEPolicyAssignedJobSlots"])
00464         target.MaxUserRunningJobs =
00465           stringtoi(CE["GlueCEPolicyAssignedJobSlots"]);
00466       if (VOView["GlueCEPolicyMaxSlotsPerJob"])
00467         target.MaxSlotsPerJob =
00468           stringtoi(VOView["GlueCEPolicyMaxSlotsPerJob"]);
00469       else if (CE["GlueCEPolicyMaxSlotsPerJob"])
00470         target.MaxSlotsPerJob =
00471           stringtoi(CE["GlueCEPolicyMaxSlotsPerJob"]);
00472 
00473       // target.MaxStageInStreams     - not available in schema
00474       // target.MaxStageOutStreams    - not available in schema
00475       // target.SchedulingPolicy      - not available in schema
00476 
00477       if (SubCluster["GlueHostMainMemoryVirtualSize"])
00478         target.MaxMainMemory =
00479           stringtoi(SubCluster["GlueHostMainMemoryVirtualSize"]);
00480 
00481       // target.MaxDiskSpace          - not available in schema
00482 
00483       if (VOView["GlueCEInfoDefaultSE"])
00484         target.DefaultStorageService =
00485           (std::string)VOView["GlueCEInfoDefaultSE"];
00486       else if (CE["GlueCEInfoDefaultSE"])
00487         target.DefaultStorageService = (std::string)CE["GlueCEInfoDefaultSE"];
00488       if (VOView["GlueCEPolicyPreemption"])
00489         target.Preemption = stringtoi(VOView["GlueCEPolicyPreemption"]);
00490       else if (CE["GlueCEPolicyPreemption"])
00491         target.Preemption = stringtoi(CE["GlueCEPolicyPreemption"]);
00492       if (VOView["GlueCEStateStatus"])
00493         target.ServingState = (std::string)VOView["GlueCEStateStatus"];
00494       else if (CE["GlueCEStateStatus"])
00495         target.ServingState = (std::string)CE["GlueCEStateStatus"];
00496       if (VOView["GlueCEStateEstimatedResponseTime"])
00497         target.EstimatedAverageWaitingTime =
00498           stringtoi(VOView["GlueCEStateEstimatedResponseTime"]);
00499       else if (CE["GlueCEStateEstimatedResponseTime"])
00500         target.EstimatedAverageWaitingTime =
00501           stringtoi(CE["GlueCEStateEstimatedResponseTime"]);
00502       if (VOView["GlueCEStateWorstResponseTime"])
00503         target.EstimatedWorstWaitingTime =
00504           stringtoi(VOView["GlueCEStateWorstResponseTime"]);
00505       else if (CE["GlueCEStateWorstResponseTime"])
00506         target.EstimatedWorstWaitingTime =
00507           stringtoi(CE["GlueCEStateWorstResponseTime"]);
00508       if (VOView["GlueCEStateFreeJobSlots"])
00509         target.FreeSlots = stringtoi(VOView["GlueCEStateFreeJobSlots"]);
00510       else if (VOView["GlueCEStateFreeCPUs"])
00511         target.FreeSlots = stringtoi(VOView["GlueCEStateFreeCPUs"]);
00512       else if (CE["GlueCEStateFreeJobSlots"])
00513         target.FreeSlots = stringtoi(CE["GlueCEStateFreeJobSlots"]);
00514       else if (CE["GlueCEStateFreeCPUs"])
00515         target.FreeSlots = stringtoi(CE["GlueCEStateFreeCPUs"]);
00516 
00517       // target.UsedSlots;
00518       // target.RequestedSlots;
00519       // target.ReservationPolicy;
00520 
00521       for (XMLNode node =
00522              SubCluster["GlueHostApplicationSoftwareRunTimeEnvironment"];
00523            node; ++node) {
00524         ApplicationEnvironment ae((std::string)node);
00525         ae.State = "UNDEFINEDVALUE";
00526         ae.FreeSlots = -1;
00527         ae.FreeUserSeats = -1;
00528         ae.FreeJobs = -1;
00529         target.ApplicationEnvironments.push_back(ae);
00530       }
00531       //Register target in TargetGenerator list
00532       mom.AddTarget(target);
00533     }
00534 
00535     delete thrarg;
00536     mom.RetrieverDone();
00537   }
00538 
00539 } // namespace Arc