Skip to content

XSEDE 2013 SAGA Tutorial

Ole Weidner edited this page Jul 19, 2013 · 23 revisions

Preparation

This tutorial will use the TACC Virtual Machine (VM) repex1. Log-in via SSH using the username/password you received at the beginning of the tutorial:

ssh <username>@repex1.tacc.utexas.edu

Installation

Next, you need to install SAGA-Python in your user account on repex1. Since saga-python - as the name suggests - is written in Python, you can use virtualenv to create a local installation:

virtualenv $HOME/sagaenv
. $HOME/sagaenv/bin/activate

The SAGA-Python package on PyPi (Python Package Index) that we are using is called saga-python and can be installed via pip:

pip install saga-python

Code Example 1: Local Example

Preparation

  1. Take a look at the full example code on GitHub.

  2. Create a new file in your home directory, copy & paste the code into it and save it, e.g., as saga_example_local.py.

Execution

Execute the Python script:

python saga_example_local.py

The output will look something like this:

Job ID    : None
Job State : New

...starting job...

Job ID    : [fork://localhost]-[31981]
Job State : Done

...waiting for job...

Job State : Done
Exitcode  : 0

Code Example 2: Remote Example

Preparation

  1. Take a look at the full example code on GitHub.

  2. Create a new file in your home directory, copy & paste the code into it and save it, e.g., as saga_example_remote.py.

Execution

Execute the Python script:

python saga_example_remote.py

The output will look something like this:

Job ID    : None
Job State : New

...starting job...

Job ID    : [ssh://localhost]-[32704]
Job State : Done

...waiting for job...

Job State : Done
Exitcode  : 0

Discussion

If you want, try to replace ssh://localhost with another machine you have access to. Look for the saga.Context object in the code if you need to define your login credentials.

Clone this wiki locally