Program "dlgmcp"
simulates the driven
lattice gas using the
Monte Carlo method in
parallel
. Each process accesses an independent
stream of pseudorandom numbers using the additive lagged Fibonacci
generator in the sprng library.
A simulation collects and averages data from several (8 in the
case of the data below) independent runs.
The parallel code is in the class of "embarrassingly parallel" methods, the runs merely being divided among the processes.
If np is the number of processes, then np-1 processes do Monte Carlo runs while one process is reserved to collect and average data. That server process uses approximately zero cpu time.
| np-1 (workers) |
tworkers(sec) | np (all) |
tall(sec) | <U/(6J)> | std err in <(U/(6J)> |
|---|---|---|---|---|---|
| 1 | 2199 | 2 | 4399 | -1.483 | 0.001333 |
| 2 | 2220 | 3 | 3346 | -1.483 | 0.001323 |
| 3 | 2193 | 4 | 3017 | -1.483 | 0.001390 |
| 4 | 2185 | 5 | 2734 | -1.483 | 0.001356 |
| 5 | 2199 | 6 | 2758 | -1.483 | 0.001377 |
| 6 | 2235 | 7 | 2794 | -1.483 | 0.001365 |
One sees that total processor time is approximately independent of the number of processors. Results (energy and std error of energy) are nearly independent of the number of processors. That results depend slightly on the number of processors probably stems from the dependence of random numbers on processors.