7.3. Global access to secondary storage

This section provides examples of using the GASS API.

7.3.1. Easy file transfer by using globus_gass_copy API

The Globus GASS Copy library is motivated by the desire to provide a uniform interface to transfer files via different protocols.

The goals in doing this are to:

  • Provide a robust way to describe and apply file transfer properties for a variety of protocols: HTTP, FTP, and GSIFTP.

  • Provide a service to support non-blocking file transfer and handle asynchronous file and network events.

  • Provide a simple and portable way to implement file transfers.

The example in “ITSO_GASS_TRANSFER” on page 306 provides a complete implementation of a C++ class able to transfer files between two storage locations that could transparently be: A local file, a GASS server, a GridFTP server.

Note

The complete documentation for this API is available at:

http://www-unix.globus.org/api/c-globus-2.2/globus_gass_copy/html/index.html


The Globus Toolkit 2.2 uses a handle of type globus_gass_copy_handle_t to manage GASS copy. This handle is jointly used with three other specific handles that help to define the characteristics of the GASS operation:

  • A handle of type globus_gass_copy_attr_t used for each remote location involved in the transfer (via gsiftp or http(s) protocol).

  • A handle of type globus_gass_copy_handleattr_t used for the globus_gass_copy_handle_t initialization.

  • A handle of type globus_gass_transfer_requestattr_t (request handle) used by the gass_transfer API to associate operations with a single file transfer request. It is used in the globus_gass_copy_attr_set_gass() call that specifies that we are using the GASS protocol for the transfer. This handle is also used by the gass_transfer API to determine protocol properties. In the example we specify binary transfer by calling globus_gass_transfer_requestattr_set_file_mode().

All these handlers need to be initialized before by using a globus_gass_copy_*_init() call specific to each handler.

The Globus Toolkit 2.2 provides the following functions to submit asynchronous transfers from an application:

  • globus_gass_copy_register_handle_to_url() to copy a local file to a remote location.

  • globus_gass_copy_register_url_to_handle() to copy a remote file locally.

  • globus_gass_copy_register_url_to_url() to copy a remote file to a remote location.

This function uses a callback function that will be called when the transfer has been completed. The prototype of this function is defined by globus_gass_copy_callback_t type. A synchronization mechanism, like condition variables, must be used by the calling thread to be aware of the completion of the transfer. See Example 7-4 on page 180.

Globus Toolkit 2.2 provides blocking calls that are equivalent to those listed above:

  • globus_gass_copy_handle_to_url() to copy a local file to a remote location

  • globus_gass_copy_url_to_handle() to copy a remote file locally

  • globus_gass_copy_url_to_url() to copy a remote file to a remote location

The globus_gass_copy_url_mode() function allows the caller to find out which protocol will be used for a given URL.

globus_url_parse() determines the validity of a URL.

Note

The GASS Transfer API is defined in the header file globus_gass_copy.h, and GLOBUS_GASS_COPY_MODULE must be activated before calling any functions in this API.


GAS Copy example

The best example is the globus-url-copy.c source code provided in the Globus Toolkit 2.2. It is strongly advised to have a look at this source code to understand how to use Globus Toolkit GASS calls.

This example shows how to copy a local file remotely via a GASS server. A GASS server needs to be started on the remote location. Note that this example is incomplete in the sense that it does not check any error codes returning from the Globus calls. Consequently, any malformed URL can cause the program to hang or fail miserably.

Figure 7-4. GASS Copy example


Example 7-14. gasscopy.C
#include "globus_common.h"
#include "globus_gass_copy.h"
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <cstring>
/**********************************************
 *  For a mote complete example
 *  see globus-url-copy.c
 **********************************************/

//************************************************************************
//  GLOBUS_FILE is a class that acts as a wrapper to the globus_io_handle_t
//  globus_io_handle_t is taken as a parameter to
globus_gass_copy_register_handle_to_url
//  GLOBUS_URL is taken as a parameter to startTransfer() method of
//  the GASS_TRANSFER class
//************************************************************************
class GLOBUS_FILE {
   globus_io_handle_t *io_handle;
   int       file_fd;
      public:
   GLOBUS_FILE() {};
   GLOBUS_FILE(char* filename) {
      io_handle =(globus_io_handle_t *)
                    globus_libc_malloc(sizeof(globus_io_handle_t));
      file_fd=open(filename,O_RDONLY);
        /* Globus function that converts a file descriptor
       *   into a globus_io_handle */
       globus_io_file_posix_convert(file_fd,
                                    GLOBUS_NULL,
                                    io_handle);
   };
   ~GLOBUS_FILE(){
      close(file_fd);
      globus_libc_free(io_handle);
   }
   globus_io_handle_t * get_globus_io_handle() {
      return io_handle;
   };
};

//************************************************************************
//  GLOBUS_URL is a class that acts as a wrapper to the globus_url_t
//  globus_url_t is taken as a parameter to
//   globus_gass_copy_register_handle_to_url
//  GLOBUS_URL is taken as a parameter to startTransfer() method of
//  the GASS_TRANSFER class
//  setURL() allows to set up the URL as it is not set up in the constructor
//  globus_url_parse() is used to check the syntax of the url
//  globus_gass_copy_get_url_mode() determine the transfer mode
//    http,https,gsiftp of the url.  The type of this transfer mode
//    is globus_gass_copy_url_mode_t
//  getMode() returns this mode
//  getScheme() returns the scheme (http/https)
//  getURL() returns the string of the URL
//************************************************************************
class GLOBUS_URL {
   globus_url_t url;
   globus_gass_copy_url_mode_t url_mode;
   char*        URL;
   public:
      GLOBUS_URL() {};
      ~GLOBUS_URL() {
         free(URL);
      };
      bool setURL(char* destURL) {
          //check if this is a valid URL
          if (globus_url_parse(destURL, &url) != GLOBUS_SUCCESS) {
                    cerr << "can not parse destURL" << destURL << endl;
               return false;
          }
          //determine the transfer mode
          if (globus_gass_copy_get_url_mode(destURL, &url_mode) !=
 GLOBUS_SUCCESS) {
                cerr << "failed to determine mode for destURL" << destURL <<
 endl;
                return false;
           };
           URL=strdup(destURL);
           return true;
        };
        globus_gass_copy_url_mode_t getMode() {
           return url_mode;
        };
        char* getScheme() {
           return url.scheme;
        }
        char* getURL() {
           return URL;
        }
};

//************************************************************************
//  MONITOR implements the callback mechanism used in all the Globus
//  asynchronous mechanism: a non blocking globus call register an operation
//  and when this operation has been completed , this function is call.
//  To implement this mechanism in C++, we need to use a static function
//  that will a pointer to a MONITOR object as one argument.  This function
//  will then be able to call the callback method of this object (setDone()).
//
//  The Class ITSO_CB will be used in all other examples.  It is more complete
//  an easier to use but hide the details.
//
//  The callback implies a synchronization mechanism between the calling thread
//  and the callback.  To ensure thread safety and portability we use globus
//  function to manipulate the mutex the condition variable.
//
//  The class attributes are a mutex of type globus_mutex_t and a
//  condition variables of type globus_cond_t.  The C function globus_mutex_*
//  and globus_cond_* are used to manipulate them.  They maps the POSIX calls.
//
//  Other attributes are used to store information about the result of the ope
//  ration (done or error).
//
//  setDone() is called to indicate the operation has completed
//  (globus_gass_copy_register_handle_to_url).  It sends the signal via
//  the condition variable
//  Lock() and Unlock() locks and locks the mutex
//  Wait() waits the signal on the condition variable
//************************************************************************
class MONITOR {
     globus_mutex_t                mutex;
          globus_cond_t                 cond;
          globus_object_t *             err;
      globus_bool_t                use_err;
      globus_bool_t             done;
    public:
      MONITOR() {
       globus_mutex_init(&mutex, GLOBUS_NULL);
        globus_cond_init(&cond, GLOBUS_NULL);
       done = GLOBUS_FALSE;
       use_err = GLOBUS_FALSE;
       }
       ~MONITOR() {
                  globus_mutex_destroy(&mutex);
                  globus_cond_destroy(&mutex);
       };
       //-------------------
       void setError(globus_object_t* error) {
              use_err = GLOBUS_TRUE;
                        err = globus_object_copy(error);
       };
       //-------------------
       void setDone() {
           globus_mutex_lock(&mutex);
                done = GLOBUS_TRUE;
           globus_cond_signal(&cond);
           globus_mutex_unlock(&mutex);

       }
       //-------------------
       void Wait() {
               globus_cond_wait(&cond, &mutex);
       };
       //-------------------
       void Lock() {
        globus_mutex_lock(&mutex);
       };
       //-------------------
       void UnLock() {
        globus_mutex_unlock(&mutex);
       };
       //-------------------
       bool IsDone() {
          return done;
       };
};

//***********************************************************
//  callback calls when the copy operation has finished
//  globus_gass_copy_register_handle_to_url() takes this function as
//  a parameter.  In C++, a class method cannot be passed as
//  a parameter to this function and we must use an intermediate
//  C function that will call this method.  Consequently
//  the object is used as the callbback argument so that
//  this C function knows which method it must call: monitor->setDone()
//***********************************************************
static void
globus_l_url_copy_monitor_callback(
           void * callback_arg,
           globus_gass_copy_handle_t * handle,
           globus_object_t * error)
{
        MONITOR*               monitor;
             globus_bool_t         use_err = GLOBUS_FALSE;
        monitor = (MONITOR*)  callback_arg;

             if (error != GLOBUS_SUCCESS)
        {
             cerr << " url copy error:" <<
globus_object_printable_to_string(error) << endl;
             monitor->setError(error);
          }
       monitor->setDone();
        return;
} /* globus_l_url_copy_monitor_callback() */

//**********************************************************************
//  This Class implements the transfer from one local file to a GASS
//  url (http, https).  The class ITSO_GASS_TRANSFER implements a more
//  cmoplete set of transfer (source or destination can be either file,
//  http,https or gsiftp).  See appendix 2 for its source or
//  HelloWorld example for an example how to use it
//  To use it you must call setDestination() to register your destination
//  url.
//  setBinaryMode() wraps the globus_gass_transfer_requestattr_set_file_mode()
//  and is an example how to set up options that applies to the kind
//  of transfer.  These options are specific to the protocol
//  startTransfer() wraps the call to globus_gass_copy_register_handle_to_url()
//  that registers the asynchronous copy operation in the Globus API.  The
//  monitor object that manages the callback as well as the C function that
//  will call the callback object are passed as an arguement.
//**********************************************************************
class GASS_TRANSFER {
   globus_gass_copy_handle_t          gass_copy_handle;
   globus_gass_copy_handleattr_t      gass_copy_handleattr;
   globus_gass_transfer_requestattr_t*dest_gass_attr;
   globus_gass_copy_attr_t dest_gass_copy_attr;
   public:
   GASS_TRANSFER() {
      // handlers initialisation
      // first the attributes
      // then the gass copy handler
      globus_gass_copy_handleattr_init(&gass_copy_handleattr);
      globus_gass_copy_handle_init(&gass_copy_handle, &gass_copy_handleattr);
   };
   void setDestination(GLOBUS_URL& dest_url) {
        dest_gass_attr = (globus_gass_transfer_requestattr_t*)
         globus_libc_malloc (sizeof(globus_gass_transfer_requestattr_t));
        globus_gass_transfer_requestattr_init(dest_gass_attr,
                       dest_url.getScheme());
       // And We use GASS as transfer
       globus_gass_copy_attr_init(&dest_gass_copy_attr);
       globus_gass_copy_attr_set_gass(&dest_gass_copy_attr, dest_gass_attr);
   };
   void setBinaryMode() {
      globus_gass_transfer_requestattr_set_file_mode(
                dest_gass_attr,
                GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY);
   };
   void startTransfer(GLOBUS_FILE& globus_source_file, GLOBUS_URL destURL,
MONITOR& monitor) {
   globus_result_t result = globus_gass_copy_register_handle_to_url(
            &gass_copy_handle,
                            globus_source_file.get_globus_io_handle(),
                         destURL.getURL(),
                       &dest_gass_copy_attr,
                         globus_l_url_copy_monitor_callback,
                         (void *) &monitor);
      };
};

//***********************************************************
//
//
//***********************************************************
main(int argc, char** argv) {

      char * localFile=strdup(argv[1]);
      char * destURL=strdup(argv[2]);
      cout << localFile << endl << destURL << endl;

      //Globus modules needs always to be activated
      // return code not checked here
      globus_module_activate(GLOBUS_GASS_COPY_MODULE);

      // Callback activation to monitor data transfer
      MONITOR monitor;

           /* convert file  into a globus_io_handle */
      GLOBUS_FILE globus_source_file(localFile);

      //check if this is a valid URL
      GLOBUS_URL dest_url;
      if (!dest_url.setURL(destURL))
         exit(2);

      // we do not manage gsiftp transfer ... not yet
      // see ITSO_GASS_TRANSFER for that or globus-url-copy.c
      if (dest_url.getMode() != GLOBUS_GASS_COPY_URL_MODE_GASS) {
         cerr << "You can only use GASS copy" << endl;
         exit(1);
      }

      GASS_TRANSFER transfer;
      transfer.setDestination(dest_url);

      //Use Binary mode !
      transfer.setBinaryMode();

      transfer.startTransfer(globus_source_file, dest_url, monitor);

      // Way to wait for a cond_signal by using a mutex and a condition
      // variable.  These three calls are included in the Wait() method
      // of the ITSO_CB call but they still use a mutex and condition
      // variable the same way.
      monitor.Lock();
      //wait until it is finished !
      while(!monitor.IsDone())
           {
               monitor.Wait();
      }
      monitor.UnLock();
};

To compile this example uses the following commands:

g++ -I /usr/local/globus/include/gcc32 -L/usr/local/globus/lib -o gasscopy
gasscopy.C -lglobus_gass_copy_gcc32 -lglobus_common_gcc32

To run the program, you need to start a GASS server on the remote site, for example:

[globus@m0 globus]$ grid-proxy-init
Your identity: /O=Grid/O=Globus/OU=itso-maya.com/CN=globus
Enter GRID pass phrase for this identity:
Creating proxy ....................................... Done
Your proxy is valid until: Sat Mar 1 02:40:36 2003
[globus@m0 globus]$ globus-gass-server -p 5000
https://m0.itso-maya.com:5000

On the client side, to copy the file/tmp/TEST to m0.itso-maya.com by renaming it to NEWTEST, issue:

[globus@t1 globus]$ grid-proxy-init
Your identity: /O=Grid/O=Globus/OU=itso-maya.com/CN=globus
Enter GRID pass phrase for this identity:
Creating proxy ............................................ Done
Your proxy is valid until: Sat Mar 1 02:40:36 2003
[globus@t1 globus]$ ./gasscopy /tmp/TEST https://m0.itso-maya.com:5000/NEWTEST

On m0, you can check that NEWTEST appears in the target directory.

Note

If you use gsissh to connect from m0 to t1 after you issued grid-proxy-init, you do not need to reiterate grid-proxy-init because gsissh supports proxy delegation.


7.3.2. globus_gass_transfer API

The gass_transfer API is a core part of the GASS component of the Globus Toolkit. It provides a way to implement both client and server components.

  • Client-specific functions are provided to implement file get, put, and append operations.

  • Server-specific functions are provided to implement servers that service such requests.

The GASS Transfer API is easily extendable to support different remote data access protocols. The standard Globus distribution includes both client- and server-side support for the http and https protocols. An application that requires additional protocol support may add this through the protocol module interface.

globus_gass_transfer_request_t request handles are used by the gass_transfer API to associate operations with a single file transfer request.

The GASS transfer library provides both blocking and non-blocking versions of all its client functions.

7.3.3. Using the globus_gass_server_ez API

This API provides simple wrappers around the globus_gass_transfer API for server functionality. By using a simple function, globus_gass_server_ez_init(), you can start a GASS server that can perform the following functions:

  • Write to local files with optional line buffering.

  • Write to stdout and stderr.

  • Shut down callback so the client can stop the server.

This API is used by the globusrun shell commands to embed a GASS server within it.

The example in “gassserver.C” on page 355 implements a simple GASS server and is an example of how to use this simple API.

The class ITSO_CB in “ITSO_CB” on page 315, and the function callback_c_function are used to implement the callback mechanism invoked when a client wants to shut down the GASS server. This mechanism is activated by setting the options GLOBUS_GASS_SERVER_EZ_CLIENT_SHUTDOWN_ENABLE when starting the GASS server.

The examples in “StartGASSServer() and StopGASSServer()” on page 324 provide two functions that wrap the Globus calls.

Example 7-15. Using ITSO_CB class as a callback for globus_gass_server_ez_init()
ITSO_CB callback; //invoked when client wants to shutdown the server

void callback_c_function() {
      callback.setDone();

main() {
......
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_CLIENT_SHUTDOWN_ENABLE;
.....
int err = globus_gass_server_ez_init(&listener,
                                         &attr,
                                         scheme,
                                         GLOBUS_NULL, //purpose unknown
                                         server_ez_opts,
                 callback_c_function); //or GLOBUS_NULL otherwise
                 //GLOBUS_NULL); //or GLOBUS_NULL otherwise
....
}

Various server options can be set, as shown in Example 7-16.

Example 7-16. Server options settings
// let s define options for our GASS server
unsigned long server_ez_opts=OUL;

//Files openfor writing will be written a line at a time
//so multiple writers can access them safety.
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_LINE_BUFFER;

//URLs that have ~ character, will be expanded to the home
//directory of the user who is running the server
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_TILDE_EXPAND;

//URLs that have ~user character, will be expanded to the home
//directory of the user on the server machine
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_TILDE_USER_EXPAND;

//"get" requests will be fullfilled
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_READ_ENABLE;

//"put" requests will be fullfilled
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_WRITE_ENABLE;

// for put requets on /dev/stdout will be redirected to the standard
// output stream of the gass server
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_STDOUT_ENABLE;

// for put requets on /dev/stderr will be redirected to the standard
// output stream of the gass server
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_STDERR_ENABLE;

// "put requests" to the URL https://host/dev/globus_gass_client_shutdown
// will cause the callback function to be called. this allows
// the GASS client to communicate shutdown requests to the server
server_ez_opts |= GLOBUS_GASS_SERVER_EZ_CLIENT_SHUTDOWN_ENABLE;

Before starting the server with globus_gass_server_ez_init() a listener must be created. This is the opportunity to:

  • Define a port number on which the GASS server will listen.

  • Select the protocol as secure or unsecure.

Example 7-17. Protocol selection or scheme
// Secure
char* scheme="https";
//unsecure
//char* scheme="http";
      globus_gass_transfer_listenerattr_t attr;
      globus_gass_transfer_listenerattr_init(&attr, scheme);

      //we want to listen on post 10000
globus_gass_transfer_listenerattr_set_port(&attr, 10000);

At this point the GASS server can be started. The GLOBUS_GASS_SERVER_EZ_MODULE must already be activated. The Wait() method of ITSO_CB uses a mutex/condition variable synchronization to ensure thread safety.

GASS server example

Below is a GASS server example.

Example 7-18. Starting GASS serve
#include "globus_common.h"
#include "globus_gass_server_ez.h"
#include <iostream>
#include "itso_cb.h"

main() {
   // Never forget to activate GLOBUS module
   globus_module_activate(GLOBUS_GASS_SERVER_EZ_MODULE);

......

   //Now, we can start this gass server !
   globus_gass_transfer_listener_t    listener;
   globus_gass_transfer_requestattr_t  * reqattr   = GLOBUS_NULL; //purpose
unknown


   int err = globus_gass_server_ez_init(&listener,
                &attr,
                scheme,

                GLOBUS_NULL, //purpose unknown
                server_ez_opts,
                callback_c_function); //or GLOBUS_NULL otherwise

   if((err != GLOBUS_SUCCESS)) {
           cerr << "Error: initializing GASS (" << err << ")" << endl;
          exit(1);
   }
char *  gass_server_url=globus_gass_transfer_listener_get_base_url(listener);
   cout << "we are listening on " << gass_server_url << endl;

   //wait until it is finished !
/  /that means that the "put requests" to the URL
//https://host/dev/globus_gass_client_shutdown
   //ITSO_CB implements the symchronization mechanism by using a mutex
   //and a condition variable
        callback.Wait();  // shutdown callback

   //stop everything
   globus_gass_server_ez_shutdown(listener);
   globus_module_deactivate(GLOBUS_GASS_SERVER_EZ_MODULE);

To compile this program issue, use the following Makefile:

#globus-makefile-header --flavor gcc32 globus_gass_server_ez globus_common
globus_gass_transfer globus_io globus_gass_copy > globus_header

include globus_header

all: gassserver

%.o: %.C
   g++ -g -c $(GLOBUS_CPPFLAGS) $< -o $@

gassserver: gassserver.o itso_cb.o
   g++ -g -o $@ $(GLOBUS_CPPFLAGS) $(GLOBUS_LDFLAGS) $^ $(GLOBUS_PKG_LIBS)

This program can be launched on one node (for example, m0.itso.maya.com), and by using gasscopy from another node (for example, t2.itso-tupi.com), we will be able to copy files, display files on m0, and even shut down the GASS server.

On m0.itso-maya.com:

./gassserver

On t2.itso-tupi.com:

./gasscopy FileToBeCopied https://m0.itso-maya.com:10000/FileCopied
./gasscopy FileToBeDisplayed https://m0.itso-maya.com:10000/dev/stdout
./gasscopy None https://m0.itso-maya.com:10000/dev/globus_gass_client_shutdown

Note

On both server and client side, you need to have the same credentials. This is achieved when you submit a job via the gatekeeper that supports proxy delegation or using gsissh.


7.3.4. Using the globus-gass-server command

globus-gass-server is a simple file server that can be used by any user when necessary from a Unix shell. It uses the secure https protocol and GSI security infrastructure.

The GASS server can be started with or without GSI security. The security mode is controlled by the -i option that deactivates the GSSAPI security. This way the server will use http protocol instead of https protocol.

The -c option allows a client to shut down the server by writing to dev/globus_gass_client_shutdown. See the previous example.

The -o and -e options allow a client to write to standard output and standard error.

The -r and -w options authorize a client to respectively read and write on the local file system where the GASS server is running.

The -t option expands the tilde sign (~) in a URL expression to value of the user’s home directory.

globus-gass-server example

On m0.itso-maya.com:

[globus@m0 globus]globus-gass-server -o -e -r -w p 10001

On t2.itso-tupi.com:

[globus@m0 globus]globus-url-copy file:///home/globus/FileToBeCopied
https://m0.itso.maya.com:10001/dev/stdout

You can see the contents of the FileToBeCopied file on m0.

7.3.5. Globus cache management

The globus-gass-cache API provides an interface for management of the GASS cache.

globus-gass-cache

The Globus Toolkit 2.2 provides command line tools (globus-gass-cache), as well as a C API that can be used to perform operations on the cache. The operations are:

  • add: Add the URL to the cache if it is not there. If the URL is already in the cache, increment its reference count.

  • delete: Remove a reference to the URL with this tag; if there are no more references, remove the cached file.

  • cleanup-tag: Remove all references to this tag for the specified URL, or all URLs (if no URL is specified).

  • cleanup-url: Remove all tag references to this URL.

  • list: List the contents of the cache.

The GASS cache is used when a job is submitted via the GRAM sub-system. The count entry in the RSL parameters allows control of how long the program will stay in the cache. When forgotten, the file will remain forever. A common problem is to rerun a program in the cache after you have modified it locally:

&(executable=https://m0.itso-maya.com:20000/home/globus/Compile)

On the execution host, the binary will be tagged as https://m0.itso-maya.com:20000/home/globus/Compile. If modified on m0, it will not be modified on the cache. Consequently, the wrong program will be run on m0. You can check the cache on the remote server with globus-gass-cache -list. Use globus-gass-cache -clean-up to remove all the entries in the cache. The way to avoid this problem is to use (count=1) in the RSL commands. Count specifies that you only want to run the executable once.

Below is a set of examples to illustrate cache management using Globus Toolkit shell commands.

Example 7-19 shows how to create a copy on t2.itso-tupi.com of the file gsiclient2 stored on a GSIFTP server at t0.itso-tupi.com and request the file. The file will be referred to with the tag itso.

Example 7-19. Adding a file to the cache
globus-gass-cache -add -t itso -r t2 gsiftp://t0/home/globus/gsiclient2

The file is not stored in the cache with the same file name. Use the globus-gass-cache command to retrieve the file, as shown in Example 7-20.

Example 7-20. Retrieving a file in the cache
globus-gass-cache -list -r t2
URL: gsiftp://t0/home/globus/gsiclient2
        Tag:itso
globus-gass-cache -query -t itso -r t2 gsiftp://t0/home/globus/gsiclient2

It returns the name of the file in the cache.

/home/globus/.globus/.gass_cache/local/md5/4e/72/68/e57a109668e83f60927154d812/
md5/a6/78/0e/703376a3006db586eb24535315/data

You can then invoke it using globusrun, as shown in Example 7-21.

Example 7-21. Invoking a program from the cache
globusrun -o -r t2
'&(executable=/home/globus/.globus/.gass_cache/local/md5/4e/72/68/e57a109668e83
f60927154d812/md5/a6/78/0e/703376a3006db586eb24535315/data)
(arguments=https://g0.itso-tupi.com:10000)'

Files in the cache are usually referenced with a tag equal to a URL. You can use the file name or the tag to remove the file from the cache. GASS refers to the files in the cache with a tag equal to their URL.

The following command removes a single reference of tag itso from the specified URL. If this is the only tag, then the file corresponding to the URL on the local machine’s cache will be removed.

globus-gass-cache -delete -t itso gsiftp://t0//home/globus/gsiclient2

The following removes a reference to the tag itso from all URLs in the local cache:

globus-gass-cache -cleanup-tag -t itso

To remove all tags for the URL gsiftp://t0//home/globus/gsiclient2, and remove the cached copy of that file:

globus-gass-cache -cleanup-tag gsiftp://t0//home/globus/gsiclient2

Note

$GRAM_JOB_CONTACT is the tag used for a job started from GRAM and that uses GASS. All $GRAM_JOB_CONTACT tags are deleted when the GRAM job manager completes.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.204.201