Skip to content

Commit

Permalink
Merge pull request #5 from polyluxus/bugfix_and_test_3.5.0
Browse files Browse the repository at this point in the history
small bugfixes, display manual, ready for Multiwfn 3.5
  • Loading branch information
polyluxus authored Apr 13, 2018
2 parents e461909 + 26cab45 commit a292635
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 13 deletions.
9 changes: 7 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
VERSIONLOG

0.5.1 2018-04-13
minor bugfixes
initial tests with Multiwfn 3.5
added option to display manual (if installed)

0.5.0 2018-04-11
Rewrite installation routines
Added rc handling
Removed legacy mode
(To Do) Rework remote mode, i.e. implement another scheduler
Reworked remote mode, i.e. implement another scheduler (BSUB)

0.4.4 2018-01-11
Warns about local settings.ini
Expand Down Expand Up @@ -53,4 +58,4 @@ VERSIONLOG
The first working draft of the script.
Version 3.3.8 of Multiwfn.

(Martin; 0.4.4; 2018-01-11)
(Martin; 0.5.1; 2018-04-13)
14 changes: 12 additions & 2 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,18 @@ working on it further, but until then see the following.

(e) What else?

Make sure the script is executeable.
If you want to access the manual with the -H switch, you need to download
it and put it with the executable. The script searches for a pdf file,
and will display the first it finds.

There are a couple of options implemented to look for a pdf viewer,
the safest is to set 'use_pdfviewer=' to your preferred one in the rc.
Tested are in that order: "use_pdfviewer" xdg-open gvfs-open evince okular less.

Also please make sure the script is executeable.
(chmod +x <scriptname>)
Occasionally the Multiwfn distribution itself was not marked executable;
therefore better check that one, too.

Now everything should be done.

Expand All @@ -119,4 +129,4 @@ working on it further, but until then see the following.
Alternatively you can add an alias, or add the multiwfn
directory to your PATH.

(Martin; 0.5.0; 2018-04-11)
(Martin; 0.5.1; 2018-04-13)
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# runMultiwfn.bash

A wrapper for Multiwfn 3.4.1 (Linux) written in bash.
Initial tests with Multiwfn 3.5 have been successful, too.

It does probably work without any modification for any newer
version; as long as the definitions of the environment variables
Expand Down Expand Up @@ -152,9 +153,15 @@ The following option switches are available:
Suppress logging messages of the script.
(May be specified multiple times.)

- `h`
- `-h`
Prints a short version of the options.

- `-H`
Displays the manual (if installed, see INSTALL.txt).
This requires a pdfviewer installed, which can be set in the rc.
The script will test a few commands before giving up (see the
example `runMultiwfn.rc` for details).

---

## Examples
Expand All @@ -178,4 +185,4 @@ or via github (polyluxus), or any other way you can think of.
I have a blog (that has not been updated in a while):
https://thedailystamp.wordpress.com/

(Martin; 0.5.0; 2018-04-11)
(Martin; 0.5.1; 2018-04-13)
5 changes: 5 additions & 0 deletions runMultiwfn.rc
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ bsub_rwth_project="default"
# By default clean up the temporary setting.ini
settingsini_nocleanup="false"

# Set a default pdfviewer (needs to be an executable command found through PATH)
# Tested in that order are: "$use_pdfviewer" xdg-open gvfs-open evince okular less
use_pdfviewer="xpdf"

# (Martin; 0.5.1; 2018-04-13)
42 changes: 35 additions & 7 deletions runMultiwfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

#Multiwfn initialization script
# See CHANGES.txt
version="0.5.0"
versiondate="2018-04-11"
version="0.5.1"
versiondate="2018-04-13"

# The following two lines give the location of the installation.
# They can be set in the rc file, too.
installpath_Multiwfn_gui="/path/is/not/set"
installpath_Multiwfn_nogui="/path/is/not/set"

# Set a default pdfviewer (needs to be an executable command found through PATH)
# Tested in that order are: "$use_pdfviewer" xdg-open gvfs-open evince okular less
use_pdfviewer="xpdf"

# See the readme file for more details.

#####
Expand Down Expand Up @@ -57,6 +61,24 @@ helpme ()
exit 0
}

display_manual ()
{
local manual_location use_Multiwfnpath pdf_open pdf_open_command
use_Multiwfnpath=$(get_Multiwfnpath_or_exit "$installpath_Multiwfn_gui") || exit 1
if manual_location=$(find "$use_Multiwfnpath" -iname '*.pdf' -print -quit) ; then
debug "manual_location=$manual_location"
for pdf_open in "$use_pdfviewer" xdg-open gvfs-open evince okular less ; do
debug "Testing: $pdf_open"
pdf_open_command=$(command -v "$pdf_open") || continue
"$pdf_open_command" "$manual_location" && break
fatal "Could not find programm to open pdf; please check your settings."
done
else
fatal "Cannot find manual."
fi
exit 0
}

#
# Print logging information and warnings nicely.
# If there is an unrecoverable error: display a message and exit.
Expand Down Expand Up @@ -565,7 +587,7 @@ process_options ()
#hlp
local OPTIND=1

while getopts :m:p:w:gRl:i:o:c:qfkQ:P:sh options ; do
while getopts :m:p:w:gRl:i:o:c:qfkQ:P:shH options ; do
case $options in

#hlp -m <ARG> Define memory to be used per thread in byte.
Expand Down Expand Up @@ -722,6 +744,10 @@ process_options ()
#hlp
h) helpme ;;

#hlp -H Display the manual.
#hlp Requires a pdfviewer and the manual to be installed.
H) display_manual ;;

\?) fatal "Invalid option: -$OPTARG." ;;

:) fatal "Option -$OPTARG requires an argument." ;;
Expand Down Expand Up @@ -749,7 +775,6 @@ process_options ()

run_interactive ()
{
exit 0
export KMP_STACKSIZE=$requested_KMP_STACKSIZE
message "Memory (KMP_STACKSIZE) is set to $KMP_STACKSIZE."
Multiwfnpath="$use_Multiwfnpath"
Expand Down Expand Up @@ -810,6 +835,7 @@ runRemote ()
echo "#!/bin/bash" >&9
echo "# Submission script automatically created with $scriptname" >&9

local overhead_KMP_STACKSIZE
overhead_KMP_STACKSIZE=$(( requested_KMP_STACKSIZE + 5000000 ))

# Header is different for the queueing systems
Expand All @@ -831,8 +857,8 @@ runRemote ()
#BSUB -W ${requested_walltime%:*}
#BSUB -J ${submitscript%.*}
#BSUB -N
#BSUB -o df-bp86svp.runMultiwfn.sh.o%J
#BSUB -e df-bp86svp.runMultiwfn.sh.e%J
#BSUB -o $submitscript.o%J
#BSUB -e $submitscript.e%J
EOF
if [[ "$PWD" =~ [Hh][Pp][Cc] ]] ; then
echo "#BSUB -R select[hpcwork]" >&9
Expand All @@ -853,7 +879,7 @@ runRemote ()
echo "Calculation $inputfile and $commandfile from $PWD."
echo "Working directry is $PWD"
cd $PWD
cd "$PWD"
export PATH="\$PATH:$use_Multiwfnpath"
export Multiwfnpath="$use_Multiwfnpath"
Expand Down Expand Up @@ -989,8 +1015,10 @@ fi
write_temp_settingsini

if [[ "$execmode" == "remote" ]] ; then
debug "Running remote."
runRemote "$request_qsys"
else
debug "Running interactive."
run_interactive
fi

Expand Down

0 comments on commit a292635

Please sign in to comment.