Jump to content

SAGA C++ Reference Implementation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Peahihawaii (talk | contribs) at 18:44, 3 March 2011. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
SAGA C++ Reference Implementation
Developer(s)Center for Computation and Technology
Stable release
1.5.3 / January 9, 2011
Written inC++, Python
PlatformCross-platform
TypeGrid computing Library
LicenseBoost Software License
Websitehttp://saga.cct.lsu.edu

SAGA C++/Python is a set of free cross-platform libraries which provide a set of high-level interfaces and runtime components that allow the development of distributed computing and grid computing applications, frameworks and tools. SAGA is the first complete implementation of the Open Grid Forum Simple API for Grid Applications standard GFD-R-P.90 [1]. It is available for all major operating systems, including Linux and other Unix-like systems, Microsoft Windows and Mac OS X. SAGA++ is open source and licensed under the Boost Software License.

Examples

Job Submission

C++:

#include <saga/saga.hpp>

int main (int argc, char** argv)
{
  namespace sa  = saga::attributes;
  namespace sja = saga::job::attributes;

  try 
  {
    saga::job::description jd;

    jd.set_attribute (sja::description_executable, "/home/user/hello-mpi");
    jd.set_attribute (sja::description_output, "/home/user/hello.out");
    jd.set_attribute (sja::description_error, "/home/user/hello.err");

    // Declare this as an MPI-style job
    jd.set_attribute (sja::description_spmd_variation, "mpi");

    // Name of the queue we want to use 
    jd.set_attribute (sja::description_queue, "checkpt");
    jd.set_attribute (sja::description_spmd_variation, "mpi");
    // Number of processors to request 
    jd.set_attribute (sja::description_number_of_processes, "32");

    saga::job::service js("gram://qb1.loni.org/jobmanager-pbs");
    saga::job::job j = js.create_job(jd);

    j.run()
  } 
  catch(saga::exception const & e) 
  {
    std::cerr << "SAGA exception caught: " << e.what() << std::endl;
  }
}

Python:

import saga

try:
  jd = saga.job.description()
  
  jd.executable = "/home/user/hello-mpi"
  jd.error  = "/home/user/hello.err"
  jd.output = "/home/user/hello.out"
  
  # Declar this as an MPI-style job
  jd.spmd_variation = "mpi"
  
  # Name of the queue we want to use 
  jd.queue = "checkpt"              
  jd.job_project = ["TG-XXXxxxXXX"]  
  # Number of processors to request
  jd.number_of_processes = "32"
  
  # URL of the resource manager. In this case Globus GRAM
  js = saga.job.service("gram://qb1.loni.org/jobmanager-pbs")

  job = js.create_job(jd)
  job.run()
  
except saga.exception, e:
  print e.get_all_messages()

References

  1. ^ OGF GFD-R-P.90 A Simple API for Grid Applications (SAGA) [1].