@@ -17,6 +17,12 @@ warning ()
1717 return 1
1818}
1919
20+ fatal ()
21+ {
22+ echo " ERROR : $* " >&2
23+ exit 1
24+ }
25+
2026debug ()
2127{
2228 echo " DEBUG : $* " >&4
@@ -224,6 +230,13 @@ recover_rc ()
224230 if read_boolean ; then ask_installation_path ; fi
225231 fi
226232 debug " use_xtbhome=$use_xtbhome ; use_xtbname=$use_xtbname "
233+ if [[ -z $use_xtbname ]] ; then
234+ ask_callname
235+ else
236+ message " recovered setting 'xtb_callname=$use_xtbname '."
237+ ask " Would you like to change these settings?"
238+ if read_boolean ; then ask_callname ; fi
239+ fi
227240
228241 use_chatty=" $stay_quiet "
229242 if [[ -z $use_chatty ]] ; then
@@ -256,20 +269,21 @@ recover_rc ()
256269 debug " use_interactivity=$use_interactivity "
257270
258271 use_queue=" $request_qsys "
259- use_bsub_project=" $bsub_project "
272+ # Try to recover old vrsion where it was bsub_project
273+ use_qsys_project=" ${qsys_project:- $bsub_project } "
260274 if [[ -z $use_queue ]] ; then
261275 ask_qsys_details
262276 else
263277 message " Recovered queueing system setting 'request_qsys=$use_queue '."
264- if [[ ! -z $use_bsub_project ]] ; then
265- message " Recovered project setting 'bsub_project= $bsub_project '."
278+ if [[ -n $use_qsys_project ]] ; then
279+ message " Recovered project setting 'qsys_project= $use_qsys_project '."
266280 ask " Would you like to change these settings?"
267281 else
268282 ask " Would you like to change this setting?"
269283 fi
270284 if read_boolean ; then ask_qsys_details ; fi
271285 fi
272- debug " use_queue=$use_queue ; use_bsub_project= $use_bsub_project "
286+ debug " use_queue=$use_queue ; use_qsys_project= $use_qsys_project "
273287
274288 use_module_system=" $use_modules "
275289 use_module_items=( " ${load_modules[@]} " )
@@ -329,7 +343,7 @@ read_boolean ()
329343 pattern_true_false=" [Tt]([Rr]([Uu][Ee]?)?)?|[Ff]([Aa]([Ll]([Ss][Ee]?)?)?)?"
330344 pattern_yes_no=" [Yy]([Ee][Ss]?)?|[Nn][Oo]?"
331345 pattern=" ($pattern_true_false |$pattern_yes_no |0|1)"
332- until [[ $readvar =~ ^[[:space:]]* $pattern [[:space:]]* $ ]] ; do
346+ until [[ $readvar =~ ^[[:space:]]* ${ pattern} [[:space:]]* $ ]] ; do
333347 message " Please enter t(rue)/y(es)/1 or f(alse)/n(o)/0."
334348 echo -n " Answer : " >&3
335349 read -r readvar
@@ -397,6 +411,13 @@ ask_installation_path ()
397411 debug " use_xtbname=$use_xtbname "
398412}
399413
414+ ask_callname ()
415+ {
416+ ask " What is the name of the xtb binary?"
417+ use_xtbname=" $( read_human_input) "
418+ debug " use_xtbname=$use_xtbname "
419+ }
420+
400421ask_modules ()
401422{
402423 ask " If a modular cluster management is available, do you want to use it?"
@@ -453,7 +474,7 @@ ask_interactivity ()
453474
454475ask_qsys_details ()
455476{
456- message " Currently supported: pbs-gen, bsub-gen, bsub-rwth"
477+ message " Currently supported: pbs-gen, bsub-gen, slurm-gen, bsub-rwth, slurm -rwth"
457478 local test_queue
458479 test_queue=$( read_human_input)
459480 debug " test_queue=$test_queue "
@@ -464,11 +485,17 @@ ask_qsys_details ()
464485 [Bb][Ss][Uu][Bb]* )
465486 use_queue=" bsub-gen"
466487 ask " What project would you like to specify?"
467- use_bsub_project=$( read_human_input)
468- debug " use_bsub_project=$use_bsub_project "
488+ use_qsys_project=$( read_human_input)
489+ debug " use_qsys_project=$use_qsys_project "
490+ ;;&
491+ [Ss][Ll][Uu][Rr][Mm]* )
492+ use_queue=" slurm-gen"
493+ ask " What project would you like to specify?"
494+ use_qsys_project=$( read_human_input)
495+ debug " use_qsys_project=$use_qsys_project "
469496 ;;&
470497 * [Rr][Ww][Tt][Hh] )
471- use_queue=" bsub -rwth"
498+ use_queue=" ${use_queue % - * } -rwth"
472499 ;;
473500 ' ' )
474501 : ;;
@@ -635,7 +662,7 @@ print_settings ()
635662 echo " ###"
636663
637664 echo " ## Set default queueing system for which the script should be written"
638- echo " ## (pbs-gen, bsub-gen, or bsub -rwth [special case , see source])"
665+ echo " ## (pbs-gen, bsub-gen, slurm-gen, or * -rwth [special cases , see source])"
639666 echo " # "
640667 if [[ -z $use_queue ]] ; then
641668 echo " # request_qsys=\" bsub-rwth\" "
@@ -645,14 +672,14 @@ print_settings ()
645672 echo " # "
646673 echo " ###"
647674
648- echo " ## If project options are enabled (e.g. for bsub-rwth), "
649- echo " ## set to which it should be accounted."
675+ echo " ## If project/ account options are enabled (e.g. for bsub-rwth), "
676+ echo " ## set the name to which it should be accounted to ."
650677 echo " ## This can be overwritten with -P0 or -P default."
651678 echo " #"
652- if [[ -z $use_bsub_project ]] ; then
653- echo " # bsub_project =\" default\" "
679+ if [[ -z $use_qsys_project ]] ; then
680+ echo " # qsys_project =\" default\" "
654681 else
655- echo " bsub_project =\" $use_bsub_project \" "
682+ echo " qsys_project =\" $use_qsys_project \" "
656683 fi
657684 echo " # "
658685 echo " ###"
@@ -702,21 +729,25 @@ print_settings ()
702729
703730create_bin_link ()
704731{
705- local link_target_path=" $HOME /bin"
706- local link_target_name=" runxtb"
707- local link_target=" $link_target_path /$link_target_name "
732+ local link_target_path=" $HOME /bin"
733+ local link_target_name link_target link_source
708734
735+ for link_target_name in " runxtb" " crest.prepare" ; do
736+ link_target=" $link_target_path /$link_target_name "
737+ link_source=" $runxtbrc_path /${link_target_name} .sh"
709738 if [[ -e " $link_target " ]] ; then
710739 debug " Link '$link_target ' does already exist."
740+ continue
711741 else
712742 ask " Would you like to create a symbolic link '$link_target '?"
713743 if read_boolean ; then
714744 [[ -r " $link_target_path " ]] || fatal " Cannot read '$link_target_path '."
715745 [[ -w " $link_target_path " ]] || fatal " Cannot write to '$link_target_path '."
716- [[ -x " $runxtbrc_path /runxtb.sh " ]] || fatal " Not executable: '$runxtbrc_path /runxtb.sh '."
717- message " $( ln -vs " $runxtbrc_path /runxtb.sh " " $link_target " ) "
746+ [[ -x " $link_source " ]] || fatal " Not executable: '$link_source '."
747+ message " $( ln -vs " $link_source " " $link_target " ) "
718748 fi
719749 fi
750+ done
720751}
721752
722753#
0 commit comments