Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
ac3bdaa5
Commit
ac3bdaa5
authored
Sep 20, 2017
by
Peter W. Draper
Browse files
Add scripts to process cells dumps into active and edge analysis
parent
f18b365e
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/process_cells
0 → 100755
View file @
ac3bdaa5
#!/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
examples/process_cells_helper
0 → 100755
View file @
ac3bdaa5
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment