Skip to content

Commit

Permalink
Make sure the VM alias script finds the serial_executables.conf
Browse files Browse the repository at this point in the history
When sourcing the file, we should look for serial_executables.conf in the same directory as the script is in.
  • Loading branch information
jkshenton committed Sep 16, 2024
1 parent 736e6f2 commit c17c2c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/workshop/vm_aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ prepend_command() {
alias "$executable"="$command $executable"
}

# Get the directory of the current script
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")

# Read the list of executables from the serial configuration file
serial_executables=$(cat ./serial_executables.conf)
serial_executables=$(cat "$SCRIPT_DIR/serial_executables.conf")

# Loop over the serial executables and create aliases
for exe in $serial_executables; do
prepend_command "castep-serial" "$exe"
done

# an extra alias for the serial version of castep
alias "castep"="castep-serial castep.serial"

# For the MPI executables, prepend castep-mpi to mpirun
# and that will anyway ensure that the mpi versions of the executables are used
alias "mpirun"="castep-mpi mpirun"

0 comments on commit c17c2c3

Please sign in to comment.