Memory and Run Time Scaling

It seems intuitive and obvious that the amount of memory used (M) should scale with the total number of cells (N). For a 3-D problem,

So if the total memory M is proportional to N, then it follows from the above equations that

You might also think that the run time scales in the same way, but that is not quite correct. Memory usage is a function of how much information you have and run time is a function of how many calculations you have to do on that information. The single most important factor determining run time is how many time steps () are required to update each cell. So it now makes more sense to write an expression like this:

The CFL condition is needed to calculate how the number of time steps scales:

where C is the CFL number and is the maximum wave speed. C and can be ignored since they are constants, and then we can write

So if we have a run where we are trying to get to some final time , we have to take a certain number of time steps.

Combining this equation with our previous equation for , we get the final result:

Below is a very simple example that illustrates how these equations work. For simplicity, the 1 x 1 x 1 simulation has all of its values explicitly set to 1.

Grid N dx dt
1 x 1 x 1 1 1 1 1 1 1
2 x 2 x 2 8 ½ ½ 1 2 16
4 x 4 x 4 64 ¼ ¼ 1 4 256

The scaling equations can also be generalized to problems of any dimension ndim.

Comments

No comments.