Commit a29d07a
Drastically improve efficiency of tripole generation
In the tripole, we use the make_topo_gen routine. This was allocating
two arrays with 20,000,000 elements to hold topography for the
patch. The target grid is divided into blocks of 100x25 points, and
for each point in these blocks, for ever block, both of the large
arrays were being completely zeroed. This meant that performance was
almost completely dominated by memset.
Isolating to just 10 of these blocks (but including NetCDF input and
output), I saw 98.2% of the CPU time spent in memset, taking over 2
minutes to process. With this patch, it takes about 5 seconds to
process the blocks, where most of that time is spent in KD tree
generation and NetCDF input/output. An entire invocation of gen_topo
from GEBCO to a 1/10 full-globe grid went down from around 2 hours to
6 minutes.1 parent cf776e1 commit a29d07a
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
585 | 584 | | |
586 | 585 | | |
587 | 586 | | |
| |||
610 | 609 | | |
611 | 610 | | |
612 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
613 | 616 | | |
614 | 617 | | |
615 | | - | |
616 | | - | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | | - | |
| 621 | + | |
621 | 622 | | |
622 | 623 | | |
623 | 624 | | |
| |||
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| 649 | + | |
| 650 | + | |
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
| |||
0 commit comments