Skip to content
Snippets Groups Projects
Commit 2a97c713 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add scripts to process cells dumps into active and edge analysis

parent 77a2463d
No related branches found
No related tags found
1 merge request!458Add time based edge repartitioning
#!/bin/bash
#
# Usage:
# process_cells nprocess
#
# Description:
# Process all the cell dumps in the current directory
#
# Outputs file per rank with the active cells identified and marked
# as to whether they are near an edge or not.
# Handle command-line
if test "$1" = ""; then
echo "Usage: $0 nprocess"
exit 1
fi
NPROCS=$1
# Locate script.
SCRIPTHOME=$(dirname "$0")
# Find all files. Use version sort to get into correct order.
files=$(ls -v cells_*.dat)
if test $? != 0; then
echo "Failed to find any cell dump files"
exit 1
fi
# Construct list of names need the number of ranks.
ranks=$(ls -v cells_*.dat | sed 's,cells_\(.*\)_.*.dat,\1,' | sort | uniq | wc -l)
echo "Number of ranks = $ranks"
# Now construct a list of files ordered by rank, not step.
files=$(ls cells_*.dat | sort -t "_" -k 3,3 -n | xargs -n 4)
# And process them,
echo "Processing cell dumps files..."
echo $files | xargs -P $NPROCS -n 4 /bin/bash -c "${SCRIPTHOME}/process_cells_helper 20 20 20 \$0 \$1 \$2 \$3"
# Create summary.
grep "top cells" step*-active-cells.dat | sort -h > active_cells.log
# And plot of active cells to edge cells.
stilts plot2plane ifmt=ascii in=active_cells.log xmin=-0.1 xmax=1.1 ymin=-100 ymax=2200 grid=1 \
legend=false xpix=600 ypix=500 xlabel="Edge cells/Active cells" ylabel="Step" \
layer1=mark x1="col9/1.0/col6" y1="index*7" size1=3 shading1=aux auxmap=rainbow \
aux=col6 auxfunc=log auxlabel="Active cells" layer2=histogram x2="col9/1.0/col6" \
color2=grey binsize2=0.01 phase2=0.5 barform2=semi_steps weight2=30 thick2=1 \
out=active_cells.png
exit
#!/bin/bash
# Helper for process_cells.
# Locate script.
SCRIPTHOME=$(dirname "$0")
step=$(echo $4|sed 's,cells_\(.*\)_\(.*\).dat,\2,')
${SCRIPTHOME}/analyse_dump_cells.py $* > step${step}-active-cells.dat
exit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment