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 16:28, 7 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.

SAGA can be used to develop scalable and portable large-scale distributed applications, frameworks and tools. SAGA supports many of the widely used distributed grid middleware systems, like Globus, Condor, UNICORE and gLite as well as cloud computing services like Amazon EC2 and Eucalyptus.

Architecture

The SAGA C++/Python architecture: a light-weight runtime system dispatches API calls from the application to the middleware through a set of plug-ins or adaptors.

SAGA is designed as an object oriented interface. It encapsulates related functionality in a set of objects, that are grouped in functional namespaces, which are called packages in SAGA. The SAGA core implementation defines the following packages: [2]

  • saga::advert - interface for advert service access
  • saga::filesystem - interface for file and directory access
  • saga::job - interface for job definition, management and control
  • saga::namespace - abstract interface (used by advert, filesystem and replica interfaces)
  • saga::replica - interface for replica management
  • saga::rpc - interface for remote procedure calls client and servers
  • saga::sd- interface for service discovery in distributed environments
  • saga::stream - interface for data stream client and servers

The overal architecture of SAGA follows the adaptor pattern, a software design pattern which is used for translating one interface into another. In SAGA it translates the calls from the API packages to the interfaces of the underlying middleware. The SAGA run-time system uses late-binding to decide at run-time which plug-in (middleware adaptor) to load and bind to an API

Supported Middleware

The following table lists the distributed middleware systems that are currently supported by SAGA. The column labeled Adaptor Suite names the collection (release package) of the (set of) middleware adaptors that provides support for the middleware system.

Middleware System SAGA Adaptor Suite SAGA API Namespace
Globus GridFTP saga-adaptors-globus saga::filesystem
Globus GRAM saga-adaptors-globus saga::job
Globus RLS saga-adaptors-globus saga::replica
TORQUE saga-adaptors-torque saga::job
PBS (Pro) saga-adaptors-pbs saga::job
Platform LSF saga-adaptors-lsf saga::job
Eucalyptus saga-adaptors-aws saga::job
Amazon EC2 saga-adaptors-aws saga::job
Nimbus saga-adaptors-aws saga::job
HDFS saga-adaptors-hdfs saga::file
Condor saga-adaptors-condor saga::job
SQL Advert Service part of saga-core saga::advert
SQL Replica Service part of saga-core saga::replica
SSH saga-adaptors-ssh saga::job
SSHFS saga-adaptors-ssh saga::file
Local File system part of saga-core saga::file
Local Fork part of saga-core saga::job

Examples

Job Submission

A typical 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 simple examples show how the SAGA job package API can be used to submit a 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://my.globus.host/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://my.globus.host/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 [1].
  2. ^ The SAGA C++ Reference API (Documentation) [2].