Other useful scripts

From CUC3
Revision as of 15:10, 15 July 2008 by import>Jss43 (→‎testcode: update to r10123)
Jump to navigation Jump to search

A place to share non-research specific scripts that could be useful to others.

scratchrestart.pl

A common issue is running over quota on the clusters, due to each calculation generating a large file (e.g. CPMD RESTART files). scratchrestart.pl attempts to solve this by searching recursively through the directory tree (from the working directory) and moving all files matching a regular expression to a scratch disk, leaving behind a symbolic link to the file's new location and leaving all other files untouched. Warning: you will be asked for confirmation *only* once.

# scratchrestart.pl --help
usage: scratchrestart.pl [regular expression]

Search all files matching the regular expression (default: RESTART) contained in the
the current directory and all subdirectories and move them to scratch, leaving behind a 
symbolic link to the file now in scratch.  The directory structure is preserved in scratch. 
e.g. The file /home/jss43/RUN/RESTART.1 is moved to /scratch/jss43/RUN/RESTART.1.
Files are only moved if they are not symbolic links, so it is safe to do multiple times 
(a run only moves the files that have been generated since the last run).

This is used for moving files to /storage on tardis: you will need to change the value of the $scratch variable to be the name of your scratch disk.

testcode

testcode Test that code at least reproduces previous results by running a set of test calculations and comparing to "benchmarks": useful to test for regressions, compilation issues and optimisations. Requires a script that analyses output of the calculations. Integrated with subversion (but this is not required). The Alavi group use this for automated nightly testing of their software and during development work.

Features:

  • Flexible job specification, so that a few jobs or job categories can be tested at a time, allowing for both quick tests when developing a small area of the code and a more comprehensive set of tests.
  • Multiple tests in the same job directory.
  • Ability to test more than one codebase in one test suite. This is not particularly appropriate for very disparate codes: see the benchmarks section for further details.
  • Easy to adapt: all the configuration is given in a simple syntax in config files.
  • Can produce benchmarks for future comparisons.
  • Can be used in conjunction with checktest.py (not yet released) and cron to regularly check an svn repository code.
  • Can run the test jobs either locally or by submission to a cluster.

See the README file for more information.