Commit 5357549
authored
664 missing assertions for threaded execution (#284)
Benjamin (@byjtew) noticed, once upon a time, that should users manually modify the number of threads available to OpenMP _while_ the application is running, the application could crash without a clear error message. This issue recently resurfaced and this MR fixes at least some instances of this by implicitly checking if thread-counts remain the same whenever the sparse accumulator (SPA) of vectors or sparse matrices is retrieved. This check, however, has non-trivial overhead and is only active in debug mode. The end-user advice hence, as always, is to enable debug mode should their application crash for unclear reasons.
This MR also includes a performance improvement to advancing iterators over ALP/GraphBLAS vectors, which was done in the context of this MR as otherwise the debug-mode unit tests took too much time. However, this performance improvement should also benefit performance-mode code as it holistically speeds up iteration. It also includes minor code style fixes and internal documentation improvements.
The implementation of the check is constrained in that it assumes thread counts will not change between allocating SPA buffer data and assigning that buffer to a SPA. While the ALP internals guarantee that no such change occurs from within ALP, it is conceivable that such a run-time thread-count change could be concurrently initiated by a user thread, which in turn could be timed unfortunately so that this assumption is indeed violated. We consider this a rather adversarial case that would not be worth the implementation effort to guard against, but do note this caveat here in the commit notes.
Thanks also to @GiovaGa for recently revisiting this MR and again to Benjamin for flagging the issue and providing the initial fix, now finally merged.1 parent adfdd1e commit 5357549
2 files changed
+169
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
65 | 88 | | |
66 | 89 | | |
67 | 90 | | |
| |||
104 | 127 | | |
105 | 128 | | |
106 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
107 | 133 | | |
108 | 134 | | |
109 | 135 | | |
| |||
163 | 189 | | |
164 | 190 | | |
165 | 191 | | |
| 192 | + | |
166 | 193 | | |
167 | 194 | | |
168 | 195 | | |
| |||
182 | 209 | | |
183 | 210 | | |
184 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
185 | 217 | | |
186 | 218 | | |
187 | 219 | | |
| |||
370 | 402 | | |
371 | 403 | | |
372 | 404 | | |
373 | | - | |
| 405 | + | |
374 | 406 | | |
375 | 407 | | |
376 | 408 | | |
| |||
379 | 411 | | |
380 | 412 | | |
381 | 413 | | |
382 | | - | |
| 414 | + | |
383 | 415 | | |
384 | 416 | | |
385 | 417 | | |
386 | 418 | | |
387 | | - | |
| 419 | + | |
388 | 420 | | |
389 | 421 | | |
390 | 422 | | |
| |||
396 | 428 | | |
397 | 429 | | |
398 | 430 | | |
399 | | - | |
| 431 | + | |
400 | 432 | | |
401 | 433 | | |
402 | 434 | | |
| |||
426 | 458 | | |
427 | 459 | | |
428 | 460 | | |
| 461 | + | |
429 | 462 | | |
430 | 463 | | |
431 | | - | |
| 464 | + | |
432 | 465 | | |
433 | 466 | | |
434 | 467 | | |
| |||
440 | 473 | | |
441 | 474 | | |
442 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
443 | 575 | | |
444 | 576 | | |
445 | 577 | | |
| |||
457 | 589 | | |
458 | 590 | | |
459 | 591 | | |
460 | | - | |
461 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
462 | 595 | | |
463 | 596 | | |
464 | 597 | | |
| |||
470 | 603 | | |
471 | 604 | | |
472 | 605 | | |
| 606 | + | |
| 607 | + | |
473 | 608 | | |
474 | 609 | | |
475 | 610 | | |
| |||
565 | 700 | | |
566 | 701 | | |
567 | 702 | | |
| 703 | + | |
568 | 704 | | |
569 | 705 | | |
570 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
656 | 659 | | |
657 | 660 | | |
658 | 661 | | |
| |||
689 | 692 | | |
690 | 693 | | |
691 | 694 | | |
692 | | - | |
693 | | - | |
| 695 | + | |
694 | 696 | | |
695 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
696 | 703 | | |
697 | 704 | | |
698 | 705 | | |
| |||
712 | 719 | | |
713 | 720 | | |
714 | 721 | | |
715 | | - | |
| 722 | + | |
716 | 723 | | |
717 | 724 | | |
718 | 725 | | |
| |||
729 | 736 | | |
730 | 737 | | |
731 | 738 | | |
732 | | - | |
| 739 | + | |
733 | 740 | | |
734 | 741 | | |
735 | 742 | | |
| |||
742 | 749 | | |
743 | 750 | | |
744 | 751 | | |
745 | | - | |
| 752 | + | |
746 | 753 | | |
747 | 754 | | |
748 | 755 | | |
| |||
751 | 758 | | |
752 | 759 | | |
753 | 760 | | |
754 | | - | |
| 761 | + | |
755 | 762 | | |
756 | 763 | | |
757 | 764 | | |
| |||
762 | 769 | | |
763 | 770 | | |
764 | 771 | | |
| 772 | + | |
765 | 773 | | |
766 | 774 | | |
767 | 775 | | |
| |||
770 | 778 | | |
771 | 779 | | |
772 | 780 | | |
| 781 | + | |
773 | 782 | | |
774 | 783 | | |
775 | 784 | | |
| |||
781 | 790 | | |
782 | 791 | | |
783 | 792 | | |
| 793 | + | |
784 | 794 | | |
785 | 795 | | |
786 | 796 | | |
| |||
1308 | 1318 | | |
1309 | 1319 | | |
1310 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1311 | 1324 | | |
1312 | 1325 | | |
1313 | 1326 | | |
1314 | 1327 | | |
1315 | 1328 | | |
1316 | 1329 | | |
1317 | 1330 | | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1318 | 1334 | | |
1319 | 1335 | | |
1320 | 1336 | | |
| |||
0 commit comments