1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 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 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100
|
.\" Man page generated from reStructuredText.
.
.TH "INTRO_SHMEM" "3" "May 30, 2025" "" "Open MPI"
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
intro_shmem \- Introduction to the OpenSHMEM programming model
.SH DESCRIPTION
.sp
The SHMEM programming model consists of library routines that provide
low\-latency, high\-bandwidth communication for use in highly parallelized
scalable programs. The routines in the OpenSHMEM application programming
interface (API) provide a programming model for exchanging data between
cooperating parallel processes. The resulting programs are similar in
style to Message Passing Interface (MPI) programs. The SHMEM API can be
used either alone or in combination with MPI routines in the same
parallel program.
.sp
An OpenSHMEM program is SPMD (single program, multiple data) in style.
The SHMEM processes, called processing elements or PEs, all start at the
same time and they all run the same program. Usually the PEs perform
computation on their own subdomains of the larger problem and
periodically communicate with other PEs to exchange information on which
the next computation phase depends.
.sp
The OpenSHMEM routines minimize the overhead associated with data
transfer requests, maximize bandwidth and minimize data latency. Data
latency is the period of time that starts when a PE initiates a transfer
of data and ends when a PE can use the data. OpenSHMEM routines support
remote data transfer through put operations, which transfer data to a
different PE, get operations, which transfer data from a different PE,
and remote pointers, which allow direct references to data objects owned
by another PE. Other operations supported are collective broadcast and
reduction, barrier synchronization, and atomic memory operations. An
atomic memory operation is an atomic read\-and\-update operation, such as
a fetch\-and\-increment, on a remote or local data object.
.SH OPENSHMEM ROUTINES
.sp
This section lists the significant OpenSHMEM message\-passing routines.
.sp
PE queries
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI_num_pes\fP(3)
.IP \(bu 2
\fI_my_pe\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fINUM_PES\fP(3)
.IP \(bu 2
\fIMY_PE\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Elemental data put routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_p\fP(3)
.IP \(bu 2
\fI\%shmem_float_p\fP(3)
.IP \(bu 2
\fI\%shmem_int_p\fP(3)
.IP \(bu 2
\fI\%shmem_long_p\fP(3)
.IP \(bu 2
\fI\%shmem_short_p\fP\&.*(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Block data put routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_put32\fP(3)
.IP \(bu 2
\fI\%shmem_put64\fP(3)
.IP \(bu 2
\fI\%shmem_put128\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_put\fP(3)
.IP \(bu 2
\fI\%shmem_float_put\fP(3)
.IP \(bu 2
\fI\%shmem_int_put\fP(3)
.IP \(bu 2
\fI\%shmem_long_put\fP(3)
.IP \(bu 2
\fI\%shmem_short_put\fP\&.*(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_complex_put(3)
.IP \(bu 2
shmem_integer_put(3)
.IP \(bu 2
shmem_logical_put(3)
.IP \(bu 2
shmem_real_put(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Elemental data get routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_g\fP(3)
.IP \(bu 2
\fI\%shmem_float_g\fP(3)
.IP \(bu 2
\fI\%shmem_int_g\fP(3)
.IP \(bu 2
\fI\%shmem_long_g\fP(3)
.IP \(bu 2
\fI\%shmem_short_g\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Block data get routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_get32\fP(3)
.IP \(bu 2
\fI\%shmem_get64\fP(3)
.IP \(bu 2
\fI\%shmem_get128\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_get\fP(3)
.IP \(bu 2
\fI\%shmem_float_get\fP(3)
.IP \(bu 2
\fI\%shmem_int_get\fP(3)
.IP \(bu 2
\fI\%shmem_long_get\fP(3)
.IP \(bu 2
\fI\%shmem_short_get\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_complex_get(3)
.IP \(bu 2
shmem_integer_get(3)
.IP \(bu 2
shmem_logical_get(3)
.IP \(bu 2
shmem_real_get(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Strided put routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_iput32\fP(3)
.IP \(bu 2
\fI\%shmem_iput64\fP(3)
.IP \(bu 2
\fI\%shmem_iput128\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_iput\fP(3)
.IP \(bu 2
\fI\%shmem_float_iput\fP(3)
.IP \(bu 2
\fI\%shmem_int_iput\fP(3)
.IP \(bu 2
\fI\%shmem_long_iput\fP(3)
.IP \(bu 2
\fI\%shmem_short_iput\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_complex_iput(3)
.IP \(bu 2
shmem_integer_iput(3)
.IP \(bu 2
shmem_logical_iput(3)
.IP \(bu 2
shmem_real_iput(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Strided get routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_iget32\fP(3)
.IP \(bu 2
\fI\%shmem_iget64\fP(3)
.IP \(bu 2
\fI\%shmem_iget128\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_iget\fP(3)
.IP \(bu 2
\fI\%shmem_float_iget\fP(3)
.IP \(bu 2
\fI\%shmem_int_iget\fP(3)
.IP \(bu 2
\fI\%shmem_long_iget\fP(3)
.IP \(bu 2
\fI\%shmem_short_iget\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_complex_iget(3)
.IP \(bu 2
shmem_integer_iget(3)
.IP \(bu 2
shmem_logical_iget(3)
.IP \(bu 2
shmem_real_iget(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Point\-to\-point synchronization routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_int_wait\fP(3)
.IP \(bu 2
\fI\%shmem_int_wait_until\fP(3)
.IP \(bu 2
\fI\%shmem_long_wait\fP(3)
.IP \(bu 2
\fI\%shmem_long_wait_until\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_wait\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_wait_until\fP(3)
.IP \(bu 2
\fI\%shmem_short_wait\fP(3)
.IP \(bu 2
\fI\%shmem_short_wait_until\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_int4_wait(3)
.IP \(bu 2
shmem_int4_wait_until(3)
.IP \(bu 2
shmem_int8_wait(3)
.IP \(bu 2
shmem_int8_wait_until(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Barrier synchronization routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_barrier_all\fP(3)
.IP \(bu 2
\fI\%shmem_barrier\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Atomic memory fetch\-and\-operate (fetch\-op) routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_swap\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Reduction routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_int_and_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_and_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_and_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_and_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_double_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_float_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_double_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_float_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_double_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_float_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_sum_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_double_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_float_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_or_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_or_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_or_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_or_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_int_xor_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_long_xor_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_xor_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_short_xor_to_all\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_int4_and_to_all(3)
.IP \(bu 2
shmem_int8_and_to_all(3)
.IP \(bu 2
shmem_real4_max_to_all(3)
.IP \(bu 2
shmem_real8_max_to_all(3)
.IP \(bu 2
shmem_int4_max_to_all(3)
.IP \(bu 2
shmem_int8_max_to_all(3)
.IP \(bu 2
shmem_real4_min_to_all(3)
.IP \(bu 2
shmem_real8_min_to_all(3)
.IP \(bu 2
shmem_int4_min_to_all(3)
.IP \(bu 2
shmem_int8_min_to_all(3)
.IP \(bu 2
shmem_real4_sum_to_all(3)
.IP \(bu 2
shmem_real8_sum_to_all(3)
.IP \(bu 2
shmem_int4_sum_to_all(3)
.IP \(bu 2
shmem_int8_sum_to_all(3)
.IP \(bu 2
shmem_real4_prod_to_all(3)
.IP \(bu 2
shmem_real8_prod_to_all(3)
.IP \(bu 2
shmem_int4_prod_to_all(3)
.IP \(bu 2
shmem_int8_prod_to_all(3)
.IP \(bu 2
shmem_int4_or_to_all(3)
.IP \(bu 2
shmem_int8_or_to_all(3)
.IP \(bu 2
shmem_int4_xor_to_all(3)
.IP \(bu 2
shmem_int8_xor_to_all(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Broadcast routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_broadcast32\fP(3)
.IP \(bu 2
\fI\%shmem_broadcast64\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Cache management routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_udcflush\fP(3)
.IP \(bu 2
\fI\%shmem_udcflush_line\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Byte\-granularity block put routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_putmem\fP(3)
.IP \(bu 2
\fI\%shmem_getmem\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_character_put(3)
.IP \(bu 2
shmem_character_get(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Collect routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_collect32\fP(3)
.IP \(bu 2
\fI\%shmem_collect64\fP(3)
.IP \(bu 2
\fI\%shmem_fcollect32\fP(3)
.IP \(bu 2
\fI\%shmem_fcollect64\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Atomic memory fetch\-and\-operate (fetch\-op) routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_double_swap\fP(3)
.IP \(bu 2
\fI\%shmem_float_swap\fP(3)
.IP \(bu 2
\fI\%shmem_int_cswap\fP(3)
.IP \(bu 2
\fI\%shmem_int_fadd\fP(3)
.IP \(bu 2
\fI\%shmem_int_finc\fP(3)
.IP \(bu 2
\fI\%shmem_int_swap\fP(3)
.IP \(bu 2
\fI\%shmem_long_cswap\fP(3)
.IP \(bu 2
\fI\%shmem_long_fadd\fP(3)
.IP \(bu 2
\fI\%shmem_long_finc\fP(3)
.IP \(bu 2
\fI\%shmem_long_swap\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_cswap\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_fadd\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_finc\fP(3)
.IP \(bu 2
\fI\%shmem_longlong_swap\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_int4_cswap(3)
.IP \(bu 2
shmem_int4_fadd(3)
.IP \(bu 2
shmem_int4_finc(3)
.IP \(bu 2
shmem_int4_swap(3)
.IP \(bu 2
shmem_int8_swap(3)
.IP \(bu 2
shmem_real4_swap(3)
.IP \(bu 2
shmem_real8_swap(3)
.IP \(bu 2
shmem_int8_cswap(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Atomic memory operation routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_int4_add(3)
.IP \(bu 2
shmem_int4_inc(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Remote memory pointer function
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_ptr\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Reduction routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_longdouble_max_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longdouble_min_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longdouble_prod_to_all\fP(3)
.IP \(bu 2
\fI\%shmem_longdouble_sum_to_all\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.IP \(bu 2
Fortran only:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
shmem_real16_max_to_all(3)
.IP \(bu 2
shmem_real16_min_to_all(3)
.IP \(bu 2
shmem_real16_prod_to_all(3)
.IP \(bu 2
shmem_real16_sum_to_all(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Accessibility query routines
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
C/C++ and Fortran:
.INDENT 2.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shmem_pe_accessible\fP(3)
.IP \(bu 2
\fI\%shmem_addr_accessible\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Symmetric Data Objects
.sp
Consistent with the SPMD nature of the OpenSHMEM programming model is
the concept of symmetric data objects. These are arrays or variables
that exist with the same size, type, and relative address on all PEs.
Another term for symmetric data objects is “remotely accessible data
objects”. In the interface definitions for OpenSHMEM data transfer
routines, one or more of the parameters are typically required to be
symmetric or remotely accessible.
.sp
The following kinds of data objects are symmetric:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
Fortran data objects in common blocks or with the SAVE
attribute. These data objects must not be defined in a dynamic
shared object (DSO).
.IP \(bu 2
Non\-stack C and C++ variables. These data objects must not be
defined in a DSO.
.IP \(bu 2
Fortran arrays allocated with \fIshpalloc\fP(3)
.IP \(bu 2
C and C++ data allocated by \fIshmalloc\fP(3)
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B Collective Routines
Some SHMEM routines, for example, shmem_broadcast(3) and
\fI\%shmem_float_sum_to_all\fP(3), are classified as collective routines
because they distribute work across a set of PEs. They must be called
concurrently by all PEs in the active set defined by the PE_start,
logPE_stride, PE_size argument triplet. The following man pages
describe the OpenSHMEM collective routines:
.INDENT 7.0
.IP \(bu 2
shmem_and(3)
.IP \(bu 2
\fI\%shmem_barrier\fP(3)
.IP \(bu 2
shmem_broadcast(3)
.IP \(bu 2
shmem_collect(3)
.IP \(bu 2
shmem_max(3)
.IP \(bu 2
shmem_min(3)
.IP \(bu 2
shmem_or(3)
.IP \(bu 2
shmem_prod(3)
.IP \(bu 2
shmem_sum(3)
.IP \(bu 2
shmem_xor(3)
.UNINDENT
.UNINDENT
.SH USING THE SYMMETRIC WORK ARRAY, PSYNC
.sp
Multiple pSync arrays are often needed if a particular PE calls as
OpenSHMEM collective routine twice without intervening barrier
synchronization. Problems would occur if some PEs in the active set for
call 2 arrive at call 2 before processing of call 1 is complete by all
PEs in the call 1 active set. You can use \fI\%shmem_barrier\fP(3) or
\fI\%shmem_barrier_all\fP(3) to perform a barrier synchronization between
consecutive calls to OpenSHMEM collective routines.
.sp
There are two special cases:
.INDENT 0.0
.IP \(bu 2
The \fI\%shmem_barrier\fP(3) routine allows the same pSync array to be
used on consecutive calls as long as the active PE set does not
change.
.IP \(bu 2
If the same collective routine is called multiple times with the same
active set, the calls may alternate between two pSync arrays. The
SHMEM routines guarantee that a first call is completely finished by
all PEs by the time processing of a third call begins on any PE.
.UNINDENT
.sp
Because the SHMEM routines restore pSync to its original contents,
multiple calls that use the same pSync array do not require that pSync
be reinitialized after the first call.
.SH SHMEM ENVIRONMENT VARIABLES
.sp
This section lists the significant SHMEM environment variables.
.INDENT 0.0
.IP \(bu 2
\fBSMA_VERSION\fP print the library version at start\-up.
.IP \(bu 2
\fBSMA_INFO\fP print helpful text about all these environment
variables.
.IP \(bu 2
\fBSMA_SYMMETRIC_SIZE\fP number of bytes to allocate for the symmetric
heap.
.IP \(bu 2
\fBSMA_DEBUG\fP enable debugging messages.
.UNINDENT
.sp
The first call to SHMEM must be \fIstart_pes\fP(3). This routines
initialize the SHMEM runtime.
.sp
Calling any other SHMEM routines beforehand has undefined behavior.
Multiple calls to this routine is not allowed.
.SH COMPILING AND RUNNING OPENSHMEM PROGRAMS
.sp
The OpenSHMEM specification is silent regarding how OpenSHMEM programs
are compiled, linked and run. This section shows some examples of how
wrapper programs could be utilized to compile and launch applications.
The commands are styled after wrapper programs found in many MPI
implementations.
.sp
The following sample command line demonstrates running an OpenSHMEM
Program using a wrapper script (\fBoshrun\fP in this case):
.INDENT 0.0
.IP \(bu 2
C/C++:
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
oshcc c_program.c
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.IP \(bu 2
FORTRAN:
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
oshfort fortran_program.f
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following sample command line demonstrates running an OpenSHMEM
Program assuming that the library provides a wrapper script for such
purpose (named \fBoshrun\fP for this example):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
oshrun \-n 32 ./a.out
.ft P
.fi
.UNINDENT
.UNINDENT
.SH EXAMPLES
.sp
\fBExample 1\fP: The following Fortran OpenSHMEM program directs all PEs
to sum simultaneously the numbers in the VALUES variable across all PEs:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PROGRAM REDUCTION
REAL VALUES, SUM
COMMON /C/ VALUES
REAL WORK
CALL START_PES(0)
VALUES = MY_PE()
CALL SHMEM_BARRIER_ALL ! Synchronize all PEs
SUM = 0.0
DO I = 0, NUM_PES()\-1
CALL SHMEM_REAL_GET(WORK, VALUES, 1, I) ! Get next value
SUM = SUM + WORK ! Sum it
ENDDO
PRINT *, \(aqPE \(aq, MY_PE(), \(aq COMPUTED SUM=\(aq, SUM
CALL SHMEM_BARRIER_ALL
END
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBExample 2\fP: The following C OpenSHMEM program transfers an array of
10 longs from PE 0 to PE 1:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <mpp/shmem.h>
main() {
long source[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
static long target[10];
shmem_init();
if (shmem_my_pe() == 0) {
/* put 10 elements into target on PE 1 */
shmem_long_put(target, source, 10, 1);
}
shmem_barrier_all(); /* sync sender and receiver */
if (shmem_my_pe() == 1)
printf("target[0] on PE %d is %d\en", shmem_my_pe(), target[0]);
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 0.0
.INDENT 3.5
The following man pages also contain information on OpenSHMEM routines.
See the specific man pages for implementation information.
.sp
shmem_add(3) shmem_and(3) \fI\%shmem_barrier\fP(3)
\fI\%shmem_barrier_all\fP(3) shmem_broadcast(3) shmem_cache(3)
shmem_collect(3) shmem_cswap(3) shmem_fadd(3)
\fI\%shmem_fence\fP(3) shmem_finc(3) shmem_get(3) shmem_iget(3)
shmem_inc(3) shmem_iput(3) shmem_lock(3) shmem_max(3)
shmem_min(3) \fI\%shmem_my_pe\fP(3) shmem_or(3) shmem_prod(3)
shmem_put(3) \fI\%shmem_quiet\fP(3) \fI\%shmem_short_g\fP(3)
\fI\%shmem_short_p\fP(3) shmem_sum(3) \fI\%shmem_swap\fP(3)
\fI\%shmem_wait\fP(3) shmem_xor(3) \fI\%shmem_pe_accessible\fP(3)
\fI\%shmem_addr_accessible\fP(3) \fI\%shmem_init\fP(3) \fI\%shmem_malloc\fP(3)
\fIshmem_my_pe\fP(3) \fIshmem_n_pes\fP(3)
.UNINDENT
.UNINDENT
.SH COPYRIGHT
2003-2025, The Open MPI Community
.\" Generated by docutils manpage writer.
.
|