Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
4dacad3c
Commit
4dacad3c
authored
9 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Create the empty thread info file in using one rank, otherwise the output can be garbled
parent
4de22f48
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!70
Include parallel sort tasks in task dump and add support for MPI dumps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/main.c
+6
-3
6 additions, 3 deletions
examples/main.c
examples/process_plot_tasks_MPI
+89
-0
89 additions, 0 deletions
examples/process_plot_tasks_MPI
with
95 additions
and
3 deletions
examples/main.c
+
6
−
3
View file @
4dacad3c
...
...
@@ -412,10 +412,13 @@ int main(int argc, char *argv[]) {
if
(
dump_tasks
&&
(
dump_tasks
==
1
||
j
%
dump_tasks
==
1
))
{
#ifdef WITH_MPI
/* Make sure output file is empty. */
/* Make sure output file is empty
, only on one rank
. */
sprintf
(
dumpfile
,
"thread_info_MPI-step%d.dat"
,
j
);
file_thread
=
fopen
(
dumpfile
,
"w"
);
fclose
(
file_thread
);
if
(
myrank
==
0
)
{
file_thread
=
fopen
(
dumpfile
,
"w"
);
fclose
(
file_thread
);
}
MPI_Barrier
(
MPI_COMM_WORLD
);
for
(
int
i
=
0
;
i
<
nr_nodes
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
examples/process_plot_tasks_MPI
0 → 100755
+
89
−
0
View file @
4dacad3c
#!/bin/bash -xv
#
# Usage:
# process_plot_tasks_MPI nprocess time-range-ms
#
# Description:
# Process all the thread info files in the current directory
# creating task graphs for all MPI ranks and all rank threads.
#
# The input files are created by a run using the "-y interval" flag and
# should be named "thread_info_MPI-step
<n>
.dat" in the current directory.
# All located files will be processed using "nprocess" concurrent
# processes and all plots will have the given time range. An output
# HTML file "index.html" will be created to view all the plots.
#
#
# This file is part of SWIFT:
#
# Copyright (C) 2015 Peter W. Draper (p.w.draper@durham.ac.uk)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see
<http:
//
www.gnu.org
/
licenses
/>
.
# Handle command-line
if test "$2" == ""; then
echo "Usage: $0 nprocess time-range-ms"
exit 1
fi
NPROCS=$1
TIMERANGE=$2
# Find all thread info files.
files=$(ls thread_info_MPI-step*.dat)
if test $? != 0; then
echo "Failed to find any thread info files"
exit 1
fi
# Construct list of names, the step no and names for the graphics.
list=""
for f in $files; do
s=$(echo $f| sed 's,thread_info_MPI-step\(.*\).dat,\1,')
list="$f $s step${s}r $list"
done
# Need number of ranks used.
# And process them,
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./plot_tasks_MPI.py \$0 \$2 $TIMERANGE"
# Construct document - serial.
cat
<
<
EOF
>
index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
SWIFT task graphs
</title>
</head>
<body>
<h1>
SWIFT task graphs
</h1>
EOF
cat $list | while read f s g; do
cat
<
<
EOF
>
> index.html
<h2>
Step $s
</h2>
EOF
for i in $(seq 0 3); do
cat
<
<
EOF
>
> index.html
<a
href=
"step${s}r${i}.png"
><img
src=
"step${s}r${i}.png"
width=
400px/
></a>
EOF
done
done
cat
<
<
EOF
>
> index.html
</body>
</html>
EOF
exit
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment