Esempio n. 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;
  }
}  
Esempio n. 2
0
  //////////////////////////////////////////////////////////////////////
  // SAGA API functions
  void
    job_service_cpi_impl::sync_create_job (saga::job::job         & ret,
                                           saga::job::description   jd)
  {
    if (!jd.attribute_exists(sja::description_executable)
        || jd.get_attribute(sja::description_executable).empty()) {
      SAGA_ADAPTOR_THROW("Missing 'Executable' attribute in job description.",
                         saga::BadParameter);
    }

    if (jd.attribute_exists(sja::description_interactive)
	&& jd.get_attribute(sja::description_interactive) == sa::common_true) {
      SAGA_ADAPTOR_THROW("Interactive execution not implemented.",
                         saga::NotImplemented);
    }

    instance_data data(this);

    // create new job. state == saga::job::New
    saga::job::job job = saga::adaptors::job(data->rm_.get_url(),
                                             jd, proxy_->get_session());
    ret = job;
  }