next up previous contents
Next: Miscellaneous Up: Utilities used by CASTEP Previous: Utilities lev1 (old) and   Contents

How to split a large job into a set of smaller jobs. Utility sum

If your CASTEP job is estimated to be too large to run with all $\mathbf{k}$-points simultaneously, you can split it into parts. Final files band.out and psi2.[option] are then compiled together by a special utility sum (hopefully, it works although it has been long time ago!).

Let us consider this case in detail:

In the case that the option MAP is on, you should be a bit more careful. It is a good idea to refrain from running all CASTEP jobs one after another because this may lead to a collection of very large {psi2.MAP.N} files. To save the disk space, you can run the first two jobs, then sum them, delete files with the extensions .1 and .2 and move files psi2.[option] and band.out into psi2.[option].1 and band.out.1, respectively. Then, you can run CASTEP for the 3rd subset, rename the files produced by attaching the extension .2 and then run the sum again. This process must be repeated as many times as necessary for each sequential pair of subsets.

The sum-ming can be done automatically by constructing a shell-script. Suppose, we have 5 subsets of the k-points and the corresponding fort.15 files for them are fort.15.1, fort.15.2, ..., fort.15.5, while the corresponding CASTEP codes are castepx.1, castepx.2, ..., castepx.5 (note that some of them may coincide but should have different names anyway; use symbolic link in this case). Then, the following script can be used:

 #! /bin/csh -f
foreach num (1 2 3 4 5)
if( $num == '1' ) then
  set ext='1'
elseif
  set ext='2'
endif
 /bin/cp fort.15.$num fort.15
castepx.$num > problem.$num
if( -e band.out )  mv band.out band.out.$ext 
if ( -e psi2.DOS ) mv psi2.DOS psi2.DOS.$ext
if ( -e psi2.DOp ) mv psi2.DOp psi2.DOp.$ext
if ( -e psi2.SRF ) mv psi2.SRF psi2.SRF.$ext
if ( -e psi2.MAP ) mv psi2.MAP psi2.MAP.$ext
if( $ext == '2') then
  sum 2 > sum.$num
  mv band.out band.out.1
  if ( -e psi2.DOS ) mv psi2.DOS psi2.DOS.1
  if ( -e psi2.DOp ) mv psi2.DOp psi2.DOp.1
  if ( -e psi2.SRF ) mv psi2.SRF psi2.SRF.1
  if ( -e psi2.MAP ) mv psi2.MAP psi2.MAP.1
  if ( -e psi2.DOS.2 ) /bin/rm psi2.DOS.2
  if ( -e psi2.DOp.2 ) /bin/rm psi2.DOp.2
  if ( -e psi2.MAP.2 ) /bin/rm psi2.MAP.2
  if ( -e psi2.SRF.2 ) /bin/rm psi2.SRF.2
endif
end
#
mv band.out.1 band.out
if ( -e psi2.DOS.1 ) mv psi2.DOS.1 psi2.DOS
if ( -e psi2.DOp.1 ) mv psi2.DOp.1 psi2.DOp
if ( -e psi2.SRF.1 ) mv psi2.SRF.1 psi2.SRF
if ( -e psi2.MAP.1 ) mv psi2.MAP.1 psi2.MAP


next up previous contents
Next: Miscellaneous Up: Utilities used by CASTEP Previous: Utilities lev1 (old) and   Contents
Lev Kantorovich 2006-05-08