Exemple #1
0
void jd_dump (saga::job::description & jd)
{
  std::vector <std::string> attr = jd.list_attributes ();

  for ( int i = 0; i < attr.size (); i++ )
  {
    std::cout << "  " << attr[i] << "\t : ";

    if ( ! jd.attribute_is_vector (attr[i]) )
    {
      std::cout << jd.get_attribute (attr[i]);
    }
    else
    {
      std::vector <std::string> vals = jd.get_vector_attribute (attr[i]);

      for ( int j = 0; j < vals.size (); j++ )
      {
        std::cout << vals[j] << " ";
      }
    }

    std::cout << std::endl;
  }
}  
Exemple #2
0
// handle staging attributes
void 
omii_gridsam_job::initialize_staging (saga::job::description jd, 
    JobSubmission& submit)
{
    if (!jd.attribute_exists(saga::job::attributes::description_file_transfer))
        return;

    // get the staging specifications
    std::vector<std::string> specs (
        jd.get_vector_attribute(saga::job::attributes::description_file_transfer));

    std::vector<std::string>::iterator end = specs.end();
    for (std::vector<std::string>::iterator it = specs.begin(); it != end; ++it)
    {
        using namespace saga::adaptors;
        std::string left_url, right_url;
        saga::adaptors::file_transfer_operator mode;
        if (!parse_file_transfer_specification(*it, left_url, mode, right_url))
        {
            SAGA_ADAPTOR_THROW(
                "omii_gridsam_job::initialize_staging: "
                    "ill formatted file transfer specification: " + *it,
                saga::BadParameter);
        }

        switch (mode) {
        case copy_local_remote:
            submit.add_StageInStep(left_url, right_url, true);
            break;

        case append_local_remote:
            submit.add_StageInStep(left_url, right_url, false);
            break;

        case copy_remote_local:
            submit.add_StageOutStep(left_url, right_url, true);
            break;

        case append_remote_local:
            submit.add_StageOutStep(left_url, right_url, false);
            break;

        default:
            SAGA_ADAPTOR_THROW(
                "omii_gridsam_job::initialize_staging: "
                    "ill formatted file transfer mode: " + *it,
                saga::BadParameter);
        }
    }
}