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 22:56, 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 / Distributed Computing library
LicenseBoost Software License
Websitehttp://saga.cct.lsu.edu

The SAGA C++ Reference Implementation is a set of free cross-platform libraries written in C++ and Python 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]. SAGA 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.

Architecture

The SAGA C++/Python architecture.


Examples

Job Submission

One very common task in a distributed application is to submit a job to a local or remote distributed resource manager. SAGA provides a high-level API called the job package for this. The following two examples show how the SAGA job package API can be used to submit a simple MPI job to a remote Globus GRAM resource manager.

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].