#!/bin/sh

# check gpu first
# WARNING non gpu nodes have nvidia-smi due to nvidia-drivers installation
#command -v nvidia-smi && nvidia-smi -L && exec /opt/gensoft/exe/gromacs/2026.0/bin/gmx_cuda "$@"

# check devices instead, thanks JDB
[[ -e /dev/nvidia0 ]] && exec /opt/gensoft/exe/gromacs/2026.0/bin/gmx_cuda "$@"

# avx 512
grep -q avx512 /proc/cpuinfo &&  exec /opt/gensoft/exe/gromacs/2026.0/bin/gmx_avx512 "$@"

# seems avx2
exec /opt/gensoft/exe/gromacs/2026.0/bin/gmx_avx2 "$@"
