This tutorial was generated from the file projects/Harvey2015/test/TestProfileSimulationLiteratePaper.hpp at revision r23521.
Note that the code is given in full at the bottom of the page.
Measure compute-time performance for a large population to plot parallel speed-up (Figure 5)#
This class was used to produce the results in Figure 5.
It constructs a population of 1,024,000 cells and simulates the population
dynamics for 100 time-steps, printing out the total compute time at the end.
It must be run multiple times in order to gauge the parallel efficiency/speed-up.
The geometry for the construction of the population is contained in
This test suite should be run in parallel. It should be run on several numbers of processes (from 1 to 32 processes in figure
in the paper.)
Warning: an individual run of this code is likely to take up to hour (actual wall-clock time) depending on
the number of processors, speed of your CPUs, amount of memory, network bandwidth, compiler optimization etc.
When run sequentially on a 2.7GHz machine with more than 8Gb of RAM this simulation takes about 40 minutes.
The program does not produce output to screen during the simulation.
A useful for loop (in bash) would be
This runs the test on increasingly larger number of processes and only outputs the lines which state
the total execution time for the simulation.
N.B. The results for the paper were generated using a large shared-memory computer, and this test
is not suitable for running on small desktop machines due to the large memory overhead.
This class was used to produce the results in Figure 5.
It constructs a population of 1,024,000 cells in a repeating pattern
of 1024 cells (to simplify construction) and simulates the system
for 100 integration time steps.
The maximum of the recorded wall time for all processes relative to the recorded
wall time for one process is used to produce the speed-up metric.
Note that SEM refers to the subcellular element model from the publication
Modeling multicellular systems using subcellular elements, Newman, T.J, Math. Biosci. Eng. (2) 2005.
This model was used as a scientific motivation during the work in this bolt-on project.
These methods are run before (setUp) and after (tearDown) the
test suite has completed to output the total time for the simulation.
This functions pools all timing results onto a single process to
compute the maximum time taken by any single process.
The cell population is constructed in batches of 1024 cells,
whose geometry is defined in test/data/2d_1024_cells.dat.
This simplifies the construction of a large population of cells.
Set a location for each batch of 1024 cells.
We use the GenerateSemCells method to create total_num_cells repeating patterns
of 1000 cells using the geometry defined in test/data/2d_1024_cells.dat.
This code block writes out the initial distribution of cell numbers
between processes to file. The round-robin directives enforce that only
a single process may execute this block of code concurrently, which prevents
concurrent writes to a single file.
This distribution file may be found relative to CHASTE_TEST_OUTPUT which by default is
/tmp/$USER/testoutput
We create a cell population object from the mesh and the set of cells
generated above.
Create a simulation object from the cell population.
We set a flag to denote that no cell division takes place which
enables marginally greater efficiency.
Output from the simulation may be found relative to CHASTE_TEST_OUTPUT which by default is
/tmp/$USER/testoutput
Create a cell-cell interaction force law, and pass it to the
simulator object. The force is set to have the same magnitude
between all cells in the population.
Set the simulation to run for 100 time-steps. This
allows comparison of the running speed of this simulation
as the number of processes is increased.
Solve the simulation and report the total execution time.
These lines give a little extra information about which main functions used the time in the
simulation.