Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nova inputs and Misc #2449

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions Exec/science/nova/analysis/nova_slice.py

This file was deleted.

74 changes: 74 additions & 0 deletions Exec/science/nova/analysis/polaris.submit
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/sh
#PBS -l select=12:system=polaris
#PBS -l filesystems=home:eagle:grand
#PBS -l place=scatter
#PBS -l walltime=02:00:00
#PBS -q prod
#PBS -A AstroExplosions

EXEC=./Castro2d.gnu.MPI.CUDA.ex
INPUTS=inputs_nova_t7

# Enable GPU-MPI (if supported by application)
##export MPICH_GPU_SUPPORT_ENABLED=1

module swap PrgEnv-nvhpc PrgEnv-gnu
module load nvhpc-mixed

# Change to working directory
cd ${PBS_O_WORKDIR}

# MPI and OpenMP settings
NNODES=`wc -l < $PBS_NODEFILE`
NRANKS_PER_NODE=$(nvidia-smi -L | wc -l)
NDEPTH=8
NTHREADS=1

NTOTRANKS=$(( NNODES * NRANKS_PER_NODE ))

function find_chk_file {
# find_chk_file takes a single argument -- the wildcard pattern
# for checkpoint files to look through
chk=$1

# find the latest 2 restart files. This way if the latest didn't
# complete we fall back to the previous one.
temp_files=$(find . -maxdepth 1 -name "${chk}" -print | sort | tail -2)
restartFile=""
for f in ${temp_files}
do
# the Header is the last thing written -- check if it's there, otherwise,
# fall back to the second-to-last check file written
if [ ! -f ${f}/Header ]; then
restartFile=""
else
restartFile="${f}"
fi
done

}

# look for 7-digit chk files
find_chk_file "*chk???????"

if [ "${restartFile}" = "" ]; then
# look for 6-digit chk files
find_chk_file "*chk??????"
fi

if [ "${restartFile}" = "" ]; then
# look for 5-digit chk files
find_chk_file "*chk?????"
fi

# restartString will be empty if no chk files are found -- i.e. new run
if [ "${restartFile}" = "" ]; then
restartString=""
else
restartString="amr.restart=${restartFile}"
fi


# For applications that need mpiexec to bind MPI ranks to GPUs
mpiexec -n ${NTOTRANKS} --ppn ${NRANKS_PER_NODE} --depth=${NDEPTH} --cpu-bind depth --env OMP_NUM_THREADS=${NTHREADS} -env OMP_PLACES=threads ./set_affinity_gpu_polaris.sh ${EXEC} ${INPUTS} ${restartString}

36 changes: 36 additions & 0 deletions Exec/science/nova/analysis/profile.submit
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh
#PBS -l select=1:ncpus=32:system=polaris
#PBS -l filesystems=home:eagle:grand
#PBS -l place=scatter
#PBS -l walltime=00:30:00
#PBS -q debug
#PBS -A AstroExplosions
shopt -s nullglob

#Loading Modules
module load gnu-parallel
module load conda
conda activate projectA

# Change to working directory
cd $PBS_O_WORKDIR
outdir="./stats"
mkdir -p $outdir

script=./HorizontalAvg2d.cray.x86-rome.ex

# GNU Parallel options
declare -a plts
for plotfile in ./*plt* ./stats/*plt*; do
[[ ! -d "$plotfile" ]] && continue
[[ "$plotfile" == *plt*.old.* ]] && continue
[[ -e "$(basename $plotfile)_profile.dat" ]] && continue
plts+=($plotfile)
done

NTASK=$((PBS_NNODES * 32))

parallel="parallel -j $NTASK --delay .2 -X"
$parallel "$script {}" ::: "${plts[@]}"


16 changes: 16 additions & 0 deletions Exec/science/nova/analysis/series_variable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import numpy as np
import matplotlib.pyplot as plt

file = np.loadtxt('grid_diag.out', skiprows=2)

time = file[: ,1]
temperature = file[:, 20]

fig = plt.figure(figsize=(8,6))
ax = fig.add_subplot(111)
ax.plot(time, temperature)
ax.set_ylim([3.0e5, 2.0e8])
ax.set_xlabel(r"$time\quad[s]$")
ax.set_ylabel(r"$T\quad[K]$")

fig.savefig("temp_t.png")
Loading
Loading