Commit 323a7b9
Reduce memory usage by avoid eager allocation of H
With the tools I added in PR #708, I am now in the position where I can
look at optimizing how memory is used in Palace.
One of the first places I found is with the allocation of H.
Currently, we allocate the full Hessenberg matrix with size max_dim *
max_dim, even when only fewer iterations are required. For cases where
max_dim (= MaxIts) is large, this can be very significant.
Here, I allocate H incrementally with the GMRES. In my test case,
incremental allocation reduced the total memory from 600 GB to 200 GB.1 parent dd86424 commit 323a7b9
1 file changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
514 | 516 | | |
515 | 517 | | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
519 | | - | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
525 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
526 | 541 | | |
527 | 542 | | |
528 | 543 | | |
| |||
0 commit comments