HOWTO: Remote Dynamic Linking with Parrot and Chirp

Many batch applications depend on access to a large number of dynamically linked libraries. However, if these libraries are not distributed across all nodes of a distributed system, the batch jobs will fail when attempting to link. One easy solution to this problem is to perform remote dynamic linking using Parrot and Chirp. Parrot allows unmodified applications to connect to remote storage, while Chirp is a server that exports filesystem data. Neither component requires special privileges.

This document describes the small number of steps to perform remote dynamic linking for a batch job. For a full explanation of how to use Parrot and Chirp, you should consult the full manuals.

First, download and install the CCTools. Either a binary or source package will do. You do not need to install any optional packages such as Globus or Kerberos in order to make this work.

Pick a machine to serve as a simple file server, let's assume it is called library.somewhere.edu. Log into that machine and start a Chirp file server, using /tmp/library to store your files:

    % chirp_server -r /tmp/library &
    *** chirp_server starting at Fri May 12 13:31:03 2006
Now, set the access control on the file server. Let's suppose you want to make the libraries accessible from any host in the somewhere.edu domain:
    % chirp library.somewhere.edu
    connected to library.somewhere.edu as unix:fred
    chirp> setacl / hostname:*.somewhere.edu rl
While still logged into the same host, start a shell with Parrot, and copy any libraries that you need over to the file server:
    % parrot_run tcsh
    % mkdir /chirp/library.somewhere.edu/library
    % cd /chirp/library.somewhere.edu/library
    % cp -L /usr/local/lib/* .
    % cp -L /lib/* .
    % ls -la
Now, from any host, can use Parrot and set your library search path to include the Chirp file server like so:
    % parrot_run tcsh
    % setenv LD_LIBRARY_PATH /chirp/library.somewhere.edu/library
To verify that you are in fact loading from the remote file server, use the ldd tool to check for dependencies:
    % ldd sim.exe
     libfoo.so.1 /chirp/library.somewhere.edu/library/libfoo.so.1
     libbar.so.2 /chirp/library.somewhere.edu/library/libfoo.so.2
     libc.so.6   /chirp/library.somewhere.edu/library/libc.so.6
Now, if you wish to use Parrot to help sim.exe access its files while running within Condor, you can construct a Condor submit file like this:
    universe = vanilla
    executable = parrot_run
    # note the -H option is needed for Parrot
    arguments = -H ./mysim.exe /chirp/server.nd.edu/mydata
    transfer_input_files = mysim.exe
    output = output.txt
    error = error.txt
    log = log.txt
    environment = LD_LIBRARY_PATH=/chirp/library.somewhere.edu/library
    queue
[an error occurred while processing this directive]