#!/bin/bash
#SBATCH -J NBO-7.0-case
#SBATCH --ntasks-per-node=8
#SBATCH --nodes=1
#SBATCH --time=10:00:00

module load NBO/7.0

# Remove any old nbo output file
rm a.3.nbo

cp $NBO_ROOT/tests/gennbo/a.3.* .
# Bring in the example input files from the NBO installation

# 'Stack' is memory assigned to a specific thread for storing local
# variables. Because each thread in parallel NRT is essentially
# performing an independent NBO search, the thread requires access to
# its own local NBO arrays and data structures, which are extensive.
ulimit -s unlimited

# By default, the gennbo and gennbo.sh scripts for GenNBO calculations
# set the stacksize to 256MB, which should be sufficient for every calculation.
# NRT analysis will fail, likely with no warning message, if there is
# insufficient stack memory assigned to the threads to complete the calculation.
# To set a higher value for the stacksize, use OMP_STACKSIZE environment variable
# export OMP_STACKSIZE=512M

# The gennbo (tcsh) and gennbo.sh (bash) scripts for standalone GenNBO
# calculations allow the user to specify the number of threads as the
# second input argument. 

gennbo.sh a.3 $SLURM_NTASKS
