Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
GridScheduler::MatchSelector Class Reference
Inheritance diagram for GridScheduler::MatchSelector:
Inheritance graph
[legend]
Collaboration diagram for GridScheduler::MatchSelector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MatchSelector (Arc::XMLNode &rd)
bool match_application_environment (Arc::Job *j)
virtual bool match (Arc::Job *j)

Private Attributes

Arc::XMLNode resource_desc_
Arc::Logger logger_

Detailed Description

Definition at line 9 of file ibes.cpp.


Constructor & Destructor Documentation

Definition at line 15 of file ibes.cpp.

:logger_(Arc::Logger::rootLogger, "MatchSelector") { resource_desc_ = rd; };

Member Function Documentation

Reimplemented from Arc::JobSelector.

Definition at line 63 of file ibes.cpp.

{
    Arc::SchedJobStatus status = j->getStatus();
    if (status != Arc::JOB_STATUS_SCHED_NEW 
        && status != Arc::JOB_STATUS_SCHED_RESCHEDULED) {
        return false;
    }
    return match_application_environment(j);
}

Here is the call graph for this function:

Definition at line 21 of file ibes.cpp.

{
    // match runtime environment
    Arc::XMLNode job_resources = j->getJSDL()["JobDescription"]["Resources"];
    Arc::XMLNode job_rt;
    Arc::XMLNode app_envs = resource_desc_["AdminDomain"]["Services"]["ComputingService"]["ComputingManager"]["ApplicationEnvironments"];
    {
        std::string s;
        resource_desc_.GetXML(s);
        logger_.msg(Arc::VERBOSE, s);
        s = "";
        job_resources.GetXML(s);
        logger_.msg(Arc::VERBOSE, s);
        s = "";
        app_envs.GetXML(s);
        logger_.msg(Arc::VERBOSE, s);
    }
    int match_req = job_resources.Size();
    int matched = 0;
    Arc::XMLNode ae;
    for (int i = 0; (job_rt = job_resources["RunTimeEnvironment"][i]) != false; i++)
    {
        std::string name = (std::string)job_rt["Name"];
        std::string version = (std::string)job_rt["Version"];
        for (int j = 0; (ae = app_envs["ApplicationEnvironment"][j]) != false; j++) {
            std::string ae_name = (std::string)ae["Name"];
            std::string ae_version = (std::string)ae["Version"];
            if (ae_name == name && ae_version == version) {
                matched++;
            }
        }
    }

    logger_.msg(Arc::VERBOSE, "%d <> %d", match_req, matched);
    if (match_req == matched) {
        return true;
    }

    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 13 of file ibes.cpp.

Definition at line 12 of file ibes.cpp.


The documentation for this class was generated from the following file: