Code Monkey home page Code Monkey logo

cluster_tools's Introduction

PREREQUISITES
=============
- add LFC_HOME to your environment,
   (not necessary if only low-level interface and/or executables are used)

   e.g. add to your script something like:
   export LFC_HOME='/grid/lsgrid/marc/'
   This directory will be used to store the data.

- startGridSession lsgrid

CLUSTER STORAGE
===============
Cluster storage performs all operations robustly
- it automatically retries on failure (with waiting periods)
- it replicates accross grid
- it uses hashing to check identity


Python objects
--------------
For sending large python objects, make use of submit / receive functions in cluster_storage.py:

#somewhere on grid, do:
id = submit(your_object)
#or, with fixed id:
id = submit(your_object,"your_id")

#somewhere else on grid, do:
object = receive(id)    

#clean up
destroy(id)


Files 
-----
Same as python objects, but use filenames:

#somewhere on grid, do:
id = submit_file(filename)

#or, with fixed id:
id = submit_file(filename,"your_id")

#somewhere else on grid, do:
filename = receive_file(id)

#clean up
destroy(id)


Low-level
---------
Use ClusterStorageEngine object, available as:  cluster_storage.cs

cs.is_file('/grid/lsgrid/marc/test.dat')
cs.delete_file('/grid/lsgrid/marc/test.dat')
cs.replicate_all('/grid/lsgrid/marc/test.dat')

cs.retrieve_file('/grid/lsgrid/marc/test.dat','local_name.dat')
cs.store_file('local_name.dat','/grid/lsgrid/marc/test.dat')

#do not redownload file to check if store really succeeded:
cs.store_file('local_name.dat','/grid/lsgrid/marc/test.dat', check_equal=False)

cs.list_dir('/grid/lsgrid/marc')

#list of storage servers
cs.get_other_storage_engines()


Executables
-----------
copy all files to bin directory, make them executable if necessary (use chmod), then:

#copy 
gcp /grid/lsgrid/marc/test.dat local_name.dat
gcp local_name.dat /grid/lsgrid/marc/test.dat

#replicate
greplicate /grid/lsgrid/marc/test.dat

#delete
grm /grid/lsgrid/marc/test.dat

#directories
gmkdir /grid/lsgrid/marc/test
grmdir /grid/lsgrid/marc/test


#Note 1:
Grid paths can be indicated by prepending with grid:/
This can be useful with a command such as gcp, to distinguish local and grid paths
(Otherwise, paths starting with /grid/ are assumed to be on the grid). E.g: 

gcp grid://grid/lsgrid/marc/test.dat local_name.dat

#Note 2:
If a grid path does not start with the / symbol, the command will prepend it with 
the contents of LFC_HOME (i.e. your 'home' directory on the grid storage)

#create a dir test under the home dir:
gmkdir test

#copy a file to it
gcp local_name.dat grid:/test/test.dat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.