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

Add GPL and start proper documentation

parent d6f94d8e
No related branches found
No related tags found
No related merge requests found
mpistalls
swiftmpistepsim
*.o
*~
COPYING 0 → 100644
This diff is collapsed.
This package is a standalone part of [SWIFT](http://www.swiftsim.com) that
aims to roughly simulate the MPI interactions that taking a single step
of a simulation makes.
The interactions are captured from a run of SWIFT when configured using the
configure option `--enable-mpiuse-reports`. When this is enabled each step of
the simulation produces logs for each rank which record when the MPI
interaction was started and when it completed. Other information such as the
ranks involved, the size of the data exchanged, the MPI tags used and which
SWIFT task types were used are also recorded.
To use the program `swiftmpistepsim` you need to select the step of interest
(for instance one whose run-time seems dominated by the MPI tasks) and then
concatenate all the logs for that step into a single file. You can then
run using:
```
mpirun -np <nranks> swiftmpistepsim <step-log>
```
which will output timings for the various MPI calls.
To simulate SWIFT we use three threads, which run simultaneously, one that
injects the MPI commands, i.e. initiates the interaction using calls to
`MPI_Isend` and `MPI_Irecv`, and two other threads that poll the MPI library
using `MPI_Test` to discover when the exchanges have been completed.
SWIFT itself uses more threads than this for the injection and polling phases,
but it is not thought to make a large difference. A later development could
explore that...
---------------------------
Peter W. Draper 18 Sep 2019.
/**
* Attempt to reproduce the asynchronous stalling that we see for medium
* busy steps in SWIFT.
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2019 Peter W. Draper
*
* Timed injection version.
* 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.
*
* So we need to setup a multithreaded MPI program that performs asynchronous
* exchanges of various data sizes and continuously checks the requests for
* completion. Also need timers to record the time taken by all this...
*/
* 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/>.
*
******************************************************************************/
#include <mpi.h>
#include <pthread.h>
#include <unistd.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment