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:

See the ::pwtk::findExecutable for how the pw.x executable is located.

OPTIONS

ARGUMENTS

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
}