TABLE OF CONTENTS
::pwtk::runPW
SYNOPSIS
proc ::pwtk::runPW {args} {
USAGE
runPW [options] input ?output?
Options are:
-append -serial -outdir_clean -prefix -postfix -exec -ihandle <value>
DESCRIPTION
Run the pw.x calculation. Prior to running calculation, this routine will:
- construct the pw.x input file from the specified input data
- create the outdir directory if it does not yet exist
See the ::pwtk::findExecutable for how the pw.x executable is located.
OPTIONS
- -append == treat the output file in append mode (default = overwrite)
- -serial == run the calculation in serial mode (default = parallel)
- -outdir_clean == clean the outdir prior to running calculations
- -prefix == explicitly specify the prefix for parallel execution
- -postfix == explicitly specify the postfix for parallel execution
- -exec == explicitly specify the pw.x executable
- -ihandle <value> == explicitly set the input handle (for the description of input handle, see ::pwtk::input_handle)
ARGUMENTS
- input -- filename (or headname) to which the pw.x input file will be stored. The .in (.out) suffix will be added to headname for input (output) filename.
- output -- [optional] filename to which the pw.x output will be stored
SOURCE
set extra_option { {outdir_clean "clean the outdir before running the pw.x calculations"} } array set opt [::cmdline::getKnownOptions args $extra_option] if { $opt(outdir_clean) } { if { [remote_mode_] } { ::pwtk::warning "ignoring -outdir_clean option, because it is too dangerous for remote mode" } else { # clean the outdir if requested if { [::pwtk::outdir_query] != "" } { ::pwtk::print "Cleaning ESPRESSO_TMPDIR : [input::namelistGetVarValue CONTROL outdir 1]" ::pwtk::outdir_clean ::pwtk::print "------------------------ cleaning done." } } } # create the outdir & wfcdir if { [remote_mode_] } { # BEWARE: # this will not work for -rfull when ***dir_prefix (*** = out # or wfc) is set differently in ~/.pwtk/pwtk.tcl on remote # host (filesystem) and it is not overwitten in the current # pwtk script, yet the script uses the ***dir_postfix. Such # unlucky cases are likely rare and in this case the creation # of outdir is relegated to pw.x) remote_execTclScript_ "file mkdir [outdir_query]; file mkdir [wfcdir_query]" } else { outdir_create wfcdir_create } # run the calculation eval {makeInputRun_ ::pwtk::pwi pw} $args }