You are here

Revision of Swift help from Mon, 01/03/2011 - 00:00

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Getting Started

All in one, the command line code is something like this

    mkdir $HOME/{RLibrary,RPackages}
    cd $HOME/RPackages
    wget http://www.ci.ucihcago.edu/~wilde/Swift_0.1.tar.gz
    R CMD INSTALL -l $HOME/RLibrary Swift_0.1.tar.gz
    export R_LIBS=$HOME/RLibrary
    SWIFT=$R_LIBS/swift
    PATH=$PATH:$PATH-to-recent-Sun-Java-bin-directory
    java -version # to verify your Java, ideally JRE or JDK 1.6+
    $SWIFT/exec/start-swift &
    R
    require(Swift)
    ?Swift
    basicSwiftTest()

Step by step

  1. Make directories under $HOME for RLibrary and Rpackages and change directory (cd) to there:

          mkdir $HOME/{RLibrary,RPackages}
          cd $HOME/RPackages
        
  2. get the Swift package
        wget http://www.ci.ucihcago.edu/~wilde/Swift_0.1.tar.gz
        R CMD INSTALL -l $HOME/RLibrary Swift_0.1.tar.gz
    
  3. Export the path to this library
        export R_LIBS=$HOME/RLibrary
        SWIFT=$R_LIBS/swift
        PATH=$PATH:$PATH-to-recent-Sun-Java-bin-directory
    
  4. You may also need to add the path to R to your PATH variable
    /gluster/apps/contrib/R-2.9.0/bin:$PATH
  5. Verify your Java version
        java -version # to verify your Java, ideally JRE or JDK 1.6+
    
  6. Start swift, leaving it hanging
        $SWIFT/exec/start-swift &
    

    or should it be this??????

    start-swift -s pbsf -c 8 -n 1 -t 00:30:00 -q nopreempt
  7. set the GLOBUS_HOSTNAME to your ?what?
    128.143.22.63
  8. Open R and verify the ability to load and run Swift
        R
        require(Swift) # load the Swift package
        ?Swift # read the help on Swift
        basicSwiftTest() # run a basic test
    
  9. In your R session (which?) set the open to ?what? load OpenMx by default?
    set options(swift.initialexpr = "library(OpenMx)")

Try the examples of swiftapply() and swiftLapply() in the Swift help page, and then try your own tests, including using OpenMx.

Also, the Swift/R/Swift.R file has an initial set of Swift tests. These are being reworked to put each test in a separate function, but scanning and trying these tests manually may give you some indications of how things work.

swiftLapply() should work just like the Snowfall equivalent sfApply().

OpenMx test BootstrapParallel.R works for me. We can soon I think allow swiftLapply() to cover any function, not just mxRun(). And I will implement the rest of the apply() family, sapply etc.

There are 3 styles of Swift server that should work for you: local, multiple hosts, and PBS cluster. I have tested the latter on Merlot.

To use one of the documented servers (ssh, pbsf) you need to set Swift to talk to that server by doing this option setting before running anything that calls swiftapply():

options(swift.server="pbsf") # or "local" or "ssh"

Examples

swiftapply() and swiftLapply() in the Swift help page, and then try your own tests, including using OpenMx.

swiftLapply() should work just like the Snowfall equivalent sfApply().

Swift Server

3 styles of Swift server should work: local, multiple hosts, and PBS cluster
To use one a server (ssh, pbsf), you need to set Swift to talk to that server by setting:

options(swift.server="pbsf") # or "local" or "ssh"

note: This option must be set before running anything that calls swiftapply()