forked from openshmem-org/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
osh.tex
executable file
·999 lines (865 loc) · 31.4 KB
/
osh.tex
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
% Version as of April 8, 1997
% ----------------------------------------------------------------------
% osh.tex inspired by mpi-macs.tex --- man page macros,
% discuss, missing, mpifunc macros
%
% ----------------------------------------------------------------------
% TeX if definitions. These are defined here so (a) there is one place to
% change the defaults and (b) so that they can be changed by reading a
% configuration file
% Control the use of color
\newif\ifusecolor
\usecolortrue
% Control whether changes are highlighted
\newif\ifshowchange
\showchangetrue
% Control whether deleted text is shown
\newif\ifshowdelete
\showdeletetrue
% Control the use of change "bars" (really markers). Note that
% both changetrue and changebarstrue must not be set
\newif\ifchangebars
\changebarsfalse
% Control whether tickets are indicated in the margins (or inline, when
% they occur in inner mode. Note that this has no effect if \showchangetrue
% is not set
\newif\ifshowtickets
\showticketstrue
% For publisher's additions in the printed book
\newif\ifbookprinting
\bookprintingfalse
%
% There are a number of features that are controlled by LaTeX if commands.
% This step allows you to control these through a configuration file
% This file should contain valid LaTeX commands, including comments (using
% the standard % character for comments)
%
% Known commands include:
% \showchangetrue - Show changes/additions (from a previous version)
% \showdeletetrue - Show deleted text (deleted from a previous version)
% \changebarstrue - Show change "bars" around changes (really begin/end
% markers in the output file)
% \usecolortrue - Use color to show changes
%
\newread\cfgin
%
% General text color update macros
% These permit the use of nesting of the color changes, as well as
% a "do not change" option
%
\ifusecolor
\definecolor{orange}{rgb}{1,0.5,0}
\definecolor{purple}{rgb}{0.8,0,1}
\let\XA=\expandafter
% Definition for "Use current color"
\def\ColorSame{same}
% Create a stack that is 5 deep (no arrays in TeX)
\def\ColorS{black}
\def\ColorSi{same}
\def\ColorSii{same}
\def\ColorSiii{same}
\def\ColorSiiii{same}
% Stack pointer
\newcount\ColorStackP
\ColorStackP=0
% Push a new color
\def\ColorPush#1{%
\global\advance\ColorStackP 1\relax%
\ifnum\ColorStackP>4\message{Font Color stack too deep}\fi%
\ifnum\ColorStackP=1\global\def\ColorSi{#1}\else
\ifnum\ColorStackP=2\global\def\ColorSii{#1}\else
\ifnum\ColorStackP=3\global\def\ColorSiii{#1}\else
\ifnum\ColorStackP=4\global\def\ColorSiiii{#1}%
\fi
\fi
\fi
\fi
\def\ColorCur{#1}%
\ifx \ColorCur\ColorSame \relax\else \color{#1}\fi
}
% Pop that color
\def\ColorPop{\global\advance\ColorStackP -1\relax%
\ifnum\ColorStackP<0\message{Font Color stack < 0}\fi%
\ifnum\ColorStackP=0\def\ColorCur{\ColorS}\else
\ifnum\ColorStackP=1\def\ColorCur{\ColorSi}\else
\ifnum\ColorStackP=2\def\ColorCur{\ColorSii}\else
\ifnum\ColorStackP=3\def\ColorCur{\ColorSiii}\else
\ifnum\ColorStackP=4\def\ColorCur{\ColorSiiii}%
\fi
\fi
\fi
\fi
\fi%\typeout{cur = \ColorCur and same = \ColorSame}%
\ifx\ColorCur\ColorSame\relax\else\color{\ColorCur}\fi%
}
% A synonym for color that is controlled by the \usecolortrue command
\def\Color#1{\color{#1}}
\else
\def\ColorPush#1{}
\def\ColorPop{}
\def\Color#1{}
\fi % \ifusecolor
\ifshowdelete
\def\nocomment{\catcode`\%=9}
\def\restorecomment{\catcode`\%=14}
\else
\let\nocomment=\relax
\let\restorecomment=\relax
\fi
\ifchangebars
\def\BegChange{\begchange}
\def\EndChange{\endchange}
\else
\let\BegChange=\relax
\let\EndChange=\relax
\fi
\ifshowchange
%
% Use margin par for the ticket number unless marginpar won't work, in
% which case inline the ticket number. To do more would require special
% code for the TeX output routine, which isn't worth it for what we need
% here.
% Note that the changebars and the ticket both use marginpar, and if both
% are used at the same time, LaTeX may run out of floats
\ifchangebars
\def\ticket#1{\relax}
\else
\ifshowtickets
\def\ticket#1{\ifinner[ticket#1.]\else\protect\marginpar[\mbox{\hbox to \marginparwidth{\hss ticket#1.\hspace{30pt}}}]{\hbox to \marginparwidth{\hspace{30pt}ticket#1.\hss}}\fi}
\else
\def\ticket#1{\relax}
\fi % showtickets
\fi % changebars
\fi
% fancyvrb defines Verbatim, which is a slightly better Verbatim environment
% Regrettably, the key feature needed, commandchars, does not work correctly
% in our environment (it doesn't accept arbitrary grouping characters).
% See README-2.2 for instructions on using Verbatim along with the above
% update macros.
%\usepackage{fancyvrb}
\def\snir{\relax}
\def\rins{\relax}
% To make the changes without showing the location or old source:
% \newcommand{\CHANGE}[2]{}
% \newcommand{\INTO}[1]{#1}
% \newcommand{\ADD}[2]{#2}
% \newcommand{\DELETE}[2]{}
% available: red green blue cyan yellow magenta
\def\RVWCAP/{} % shortcut for Review item 23.a - capitalization of titles (in \section}
% \def\RVWcap/{\mpiiidotiMergeFromREVIEWbegin{23.a}} % shortcut for Review item 23.a - capitalization of titles
\def\RVWcap/{} % shortcut for Review item 23.a - capitalization of titles
\def\OnlyForAutomaticAnnexGeneration#1{}% deleting the content were the macro is used; but preserving it for the Annex
% This macro enables that all "_" (underscore) characters in the pfd
% file are searchable, and that cut&paste will copy the "_" as underscore.
% Without the following macro, the \_ is treated in searches and cut&paste
% as a " " (space character).
% This macro does not modify the behavior of _ in math or in verbatim
% environments. In verbatim environments, the "_" is always treated
% as a searchable character.
%
\DeclareRobustCommand{\_}{\texttt{\char`\_}}
%
% From MPI-2.0
% ------------
% Place some penalty for doing the break
% The penalty for a ``\gb'' should be greater than a \hyphenpenalty.
% \hyphenpenalty is 50 in plain.tex.
\def\gb{\penalty10000\hskip 0pt plus 8em\penalty4800\hskip 0pt plus-8em%
\penalty10000}
% A theorem-like environment for code Examples (S. Otto) see Lamport, pg 58
%
% Note that because we use a theorem environment that resets the counter
% with every chapter, pdflatex will issue a warning for each example that
% has the same number as an example in another chapter. This is too hard
% to fix (the easist way is to not use the theorem environment and roll
% a custom environment, including adding the necessary low-level commands
% for the pdf link support.
%\newtheorem{example}{Example}[chapter]
% Theorems have \em text; we want \rm. The easiest way to fix this,
% since we are not using Theorems, is to change the @begintheorem macro
\makeatletter
\def\@begintheorem#1#2{\rm \trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
\makeatother
% Use \exindex{MPI\_FUNC} to generate an index entry for MPI
% functions/constants
%\newcommand{\exindex}[1]{\relax}
%\newcommand{\exindex}[1]{\index{EXAMPLES:#1}}
% a couple of commands from Marc Snir, modified S. Otto
%\newlength{\discussSpace}
%\setlength{\discussSpace}{.4cm}
%\newenvironment{funcdef}[1]{
% \vspace{\codeSpace}
% \noindent
% \samepage
% \hangindent 7em\hangafter=1
% {\funcNoIndex{{\prefix}#1}}\mpifuncmainindex{#1}
% \MPIfunclist
%}{\end{list} \vspace{\codeSpace}}
%\newcommand{\function}[1]{{\raggedright \hangindent 7em\hangafter=1\tt #1 \par \vspace{0.1in}}}
%\newcommand{\CM}{Communication Middleware}
% Watermark
%
% For release please remove waternark and lino
% DRAFT !!!
%\usepackage{draftwatermark}
% max depth for table of content
\setcounter{tocdepth}{4}
% set path to figures
\graphicspath{{./figures/}}
\usepackage{xspace}
%\sloppy
%\newcommand{\openshmem} {\mbox{OpenSHMEM}\xspace % \textsuperscript{{\small \texttrademark}}
%}
\newcommand{\openshmem} {{Open\-SHMEM}\xspace}
\newcommand{\insertDocVersion}{1.1}
\newcommand{\deprecate}[1]{\textcolor{Gray}{#1 (deprecated)}}
%\renewcommand\linenumberfont{\normalfont\scriptsize\sffamily}
\hypersetup{pdftitle={\openshmem Specification Draft},
pdfauthor={HPC Tools, University of Houston},
pdfkeywords={Specification, Draft, \openshmem, SHMEM, PGAS, Partitioned, Global, Address, Gasnet, Parallel}}
\definecolor{gray}{rgb}{0.92,0.92,0.92}
\lstset{ %
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
basicstyle=\ttfamily\footnotesize,
%identifierstyle=\ttfamily\itshape,
breaklines=true, % sets automatic line breaking
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
%frame=single, % adds a frame around the code
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
%keywordstyle=\color{blue}, % keyword style
%language=Octave, % the language of the code
morekeywords={*,...}, % if you want to add more keywords to the set
% numbers=left, % where to put the line-numbers; possible values are (none, left, right)
%numbersep=5pt, % how far the line-numbers are from the code
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
%tabsize=2, % sets default tabsize to 2 spaces
%title=\lstname, % show the filename of files included with \lstinputlisting; also try caption instead of title
}\newcommand{\discuss}[1]{}
% long discussion
\bgroup\catcode`\{=10\catcode`\}=10\catcode`\[=1\catcode`\]=2\long\gdef\Eatdiscussion#1end{discussion}[\relax\end[discussion]]\relax\egroup\newenvironment{discussion}{\bgroup\def\do##1{\catcode`##1=10}\dospecials\Eatdiscussion}{\egroup}
\newcommand{\missing}[1]{}
\newcommand{\alter}[1]{}
\newcommand{\status}[1]{}
% special comment command for last round
%\newcommand{\question}[1]{\vspace{\discussSpace} {\small {\bf Question:} #1} \vspace{\discussSpace}}
\newcommand{\question}[1]{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Use this to make pages start on the right side
%\newcommand{\startchap}[0]{\relax}
%\newlength{\codeSpace}
%\setlength{\codeSpace}{.4cm}
\def\RMA/{\textsf{RMA}} % RMA macro -- see TEX Book, pg 8,204 bloody TEX!!
\newcommand{\uu}[1]{\underline{\hyperpage{#1}}}
\newcommand{\typedefindex}[1]{\index{TYPEDEF:#1}}
\newcommand{\cdeclindex}[1]{\index{CONST:#1}} % for index entry of C declarations like MPI_Comm
\newcommand{\cdeclmainindex}[1]{\index{CONST:#1|uu}}
\def\MPIfunclist{
\begin{list}{}{ % see pg 113 of Lamport's book
\setlength{\leftmargin}{105pt}
\setlength{\labelwidth}{80pt}
\setlength{\labelsep}{10pt}
\setlength{\itemindent}{0pt}
\setlength{\itemsep}{0pt}
\setlength{\topsep}{2pt}
}
}
\newlength{\codeSpace}
\setlength{\codeSpace}{.4cm}
\newcommand{\IN}[0]{{\small IN}}
\newcommand{\OUT}[0]{{\small OUT}}
\newcommand{\INOUT}[0]{{\small INOUT}}
\newcommand{\prefix}[0]{{LLC\_}}
\newcommand{\mpiarg}[1]{\gb\textsf{#1}}
\newcommand{\funcarg}[3]{\item[\hbox to 30pt{\textsf{#1} \hfill} \mpiarg{#2}\hfill]{\small #3}}
\def\gb{\penalty10000\hskip 0pt plus 8em\penalty4800\hskip 0pt plus-8em%
\penalty10000}
\newcommand{\funcNoIndex}[1]{\gb\textsf{#1}}
\newcommand{\mpifuncmainindex}[1]{\index{#1|uu}}
% special for functions that you don't want listed in index.
% This was added for showing corrections to functions already listed.
\newenvironment{funcdefnolist}[1]{
\vspace{\codeSpace}
\vspace{\codeSpace}
\noindent
\samepage
{\func{#1}}
\begin{list}{}{ % see pg 113 of Lamport's book
\setlength{\leftmargin}{200pt}
\setlength{\labelwidth}{180pt}
\setlength{\labelsep}{10pt}
\setlength{\itemindent}{0pt}
\setlength{\itemsep}{0pt}
\setlength{\topsep}{5pt}
}
}{\end{list} \vspace{\codeSpace}}
\newenvironment{ffuncdef}[1]{
\vspace{\codeSpace}
\noindent
Fortran binding:
\noindent
\samepage
{\ffunc{#1}}
\begin{list}{}{ % see pg 113 of Lamport's book
\setlength{\leftmargin}{200pt}
\setlength{\labelwidth}{180pt}
\setlength{\labelsep}{10pt}
\setlength{\itemindent}{0pt}
\setlength{\itemsep}{0pt}
\setlength{\topsep}{5pt}
}
}{\end{list} \vspace{\codeSpace}}
% see page 77, the TeX book.
\newcommand{\cfunc}[1]{\gb\textsf{#1}}
\newcommand{\ffunc}[1]{\gb\textsf{#1}}
\newcommand{\const}[1]{\protect\gb\protect{\textsf{\small #1}}\index{CONST:#1}}
\newcommand{\constskip}[1]{\protect\gb\protect{\textsf{\small #1}}}
% for ones from MPI-1
\newcommand{\consti}[1]{\protect\gb\protect{\textsf{\small #1}}\index{CONST:#1}} % constants/handles - language independent
%\newcommand{\consti}[1]{\protect\gb\protect{\small\sf #1}\index{CONST:#1}} % constants/handles - language independent
\newcommand{\constiskip}[1]{\protect\gb\protect{\textsf{\small #1}}} % ... same, but not in the Constant Index
\newcommand{\constitemtwo}[3]{\item[\const{#1}, \const{#2}\hfill]{#3}}
\newcommand{\constitemthree}[4]{\item[\const{#1}, \const{#2}, \const{#3}\hfill]{#4}}
% for ones that don't go in index
\newcommand{\constskipitem}[2]{\item[\constskip{#1}\hfill]{#2}}
% \newcommand{\carg}[1]{\gb\textsf{#1}} % currently not used
% \newcommand{\farg}[1]{\gb\textsf{#1}} % currently not used
\newcommand{\type}[1]{\gb\textsf{#1}\index{CONST:#1}} % datatype handles
%
\newcommand{\gtype}[1]{\textsf{#1}} % generic (language independent) type
\newcommand{\shorttype}[1]{\textsf{#1}\index{CONST:#1}} % ... same but without \gb panelty
\newcommand{\ctype}[1]{\gb\texttt{#1}} % - and corresponding C type
\newcommand{\ftype}[1]{\gb\texttt{#1}} % - and corresponding Fortran type
%
% Info is for MPI_Info predefined strings. \infokey{keyname} and
% \infoval{keyvaluename}
\newcommand{\info}[1]{\protect\gb\protect{\small\sf #1}\index{CONST:#1}}
\newcommand{\infoval}[1]{\protect\gb\protect{\small\sf #1}\index{CONST:#1}}
\let\infokey=\infoval
\newcommand{\infoskip}[1]{\protect\gb\protect{\small\sf #1}}
%
\newcommand{\error}[1]{\protect\gb\protect{\small\sf #1}\index{CONST:#1}}
\newcommand{\errorskip}[1]{\protect\gb\protect{\small\sf #1}}
\newcommand{\errori}[1]{\protect\gb\protect{\small\sf #1}}
\def\class{$\langle$CLASS$\rangle$}
\newenvironment{constlist}[0]{
\vspace{\codeSpace}
\noindent
\begin{list}{}{ % see pg 113 of Lamport's book
\setlength{\leftmargin}{200pt}
\setlength{\labelwidth}{190pt}
\setlength{\labelsep}{10pt}
\setlength{\itemindent}{10pt}
\setlength{\itemsep}{-5pt}
\setlength{\topsep}{-5pt}
}
}{\end{list} \vspace{\codeSpace}}
% some commands from Bill Gropp
\def\code#1{\texttt{#1}}
\def\setmargin#1{\begingroup\leftmargin #1 \advance\leftmargin\labelsep
\leftmargini #1 \advance\leftmargini\labelsep}
\def\esetmargin{\endgroup}
\def\ibamount{3.0cm\relax}
\def\ibaamount{4.0cm}
\def\ibdamount{4.5cm}
\def\ibcamount{2.0cm}
\def\ib#1{\hbox to \ibamount{#1\hfil}}
\def\iba#1{\hbox to \ibaamount{#1\hfil}}
\def\ibd#1{\hbox to \ibdamount{#1\hfil}}
\def\ibc#1{\hbox to \ibcamount{#1\hfil}}
% Use \code{...} for code fragments
%\def\code#1{\texttt{#1}}
% Use \df{name} for a definition of name in the text
\def\df#1{{\bf #1}}
% Use \note{text} for marginal notes
\def\note#1{\marginpar{\bf #1}}
%
% Get line numbers in the gutters. Thanks to Guy Steele and HPFF!
%
\makeatletter
%
% This is used to put line numbers on plain pages. Used in draft.tex
%
\def\withlinenumbers{\relax
\def\@evenfoot{\hbox to 0pt{\hss\LineNumberRuler\hskip 1.5pc}\hfil}\relax
\def\@oddfoot{\hfil\hbox to 0pt{\hskip 1.5pc\LineNumberRuler\hss}}}
\def\LineNumberRuler{\vbox to 0pt{\vss\normalsize \baselineskip13.6pt
\lineskip 1pt \normallineskip 1pt \def\baselinestretch{1}\relax
\LNR{1}\LNR{2}\LNR{3}\LNR{4}\LNR{5}\LNR{6}\LNR{7}\LNR{8}\LNR{9}
\LNR{10}\LNR{11}\LNR{12}\LNR{13}\LNR{14}
\LNR{15}\LNR{16}\LNR{17}\LNR{18}\LNR{19}
\LNR{20}\LNR{21}\LNR{22}\LNR{23}\LNR{24}
\LNR{25}\LNR{26}\LNR{27}\LNR{28}\LNR{29}
\LNR{30}\LNR{31}\LNR{32}\LNR{33}\LNR{34}\LNR{35}
\LNR{36}\LNR{37}\LNR{38}\LNR{39}
\LNR{40}\LNR{41}\LNR{42}\LNR{43}\LNR{44}
\LNR{45}\LNR{46}\LNR{47}\LNR{48}
\vskip 31pt}}
\def\LNR#1{\hbox to 1pc{\hfil\tiny#1\hfil}}
% jmm; merge the withlinenumbers stuff into
% the centered page numbers that tex defines by default
\def\ps@plainwithlinenumbers{\let\@mkboth\@gobbletwo
\def\@oddhead{}
\def\@oddfoot{\hfil\rm\thepage\hfil
\hbox to 0pt{\hskip 1.5pc\LineNumberRuler\hss}}
\def\@evenhead{}
\def\@evenfoot{\hbox to 0pt{\hss
\LineNumberRuler\hskip 1.5pc}\rm\hfil\thepage\hfil}}
% The old version; uncommenting the withlinenumbers part didn't
% work because that macro replaced the footer definition that
% did page numbering.
%\def\ps@plainwithlinenumbers{\ps@plain}%\withlinenumbers}
% end jmm changes
%
% 1st page of a chapter has its own page style, so we have to put line
% numbers in here also.
%
\newwrite\chappages
\immediate\openout\chappages=chappage.txt
\def\writespace{ }
%
% Contents is done with \chapter*{Contents}, so we need to turn off the
% line numbers in this case. Easiest to look at def
%
\def\incontents{0}
\newif\ifcontents
\contentsfalse
\def\chapter{\clearpage \ifcontents\else\thispagestyle{plainwithlinenumbers}\fi
\write\chappages{Chapter \thechapter\writespace - \the\count0}
\global\@topnum\z@ \@afterindentfalse \secdef\@chapter\@schapter}
%
% Change "Chapter" to "Chapter", "Appendix" to "Annex"
%
\renewcommand{\chaptername}{Chapter}
\renewcommand{\appendixname}{Annex}
% ... old code does not work correctly with pdflatex
% \def\@chapapp{Chapter}
% \def\appendix{\par
% \setcounter{chapter}{0}
% \setcounter{section}{0}
% \def\@chapapp{Annex}
% \def\thechapter{\Alph{chapter}}}
\makeatother
%
% Also from HPFF. These look potentially useful.
%
\newenvironment{rationale}{\begin{list}{}{}\item[]{\it Rationale.}
}{{\rm ({\it End of rationale.})} \end{list}}
\newenvironment{implementors}{\begin{list}{}{}\item[]{\it Advice
to implementors.}
}{{\rm ({\it End of advice to implementors.})} \end{list}}
\newenvironment{users}{\begin{list}{}{}\item[]{\it Advice to users.}
}{{\rm ({\it End of advice to users.})} \end{list}}
%
% Use Sans Serif font for sections, etc. S. Otto
%
\makeatletter
\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus
-.2ex}{2.3ex plus .2ex}{\Large\sf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus
-.2ex}{1.5ex plus .2ex}{\large\sf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
-1ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\sf\bf}}
\def\paragraph{\@startsection {paragraph}{4}{\z@}{3.25ex plus 1ex
minus .2ex}{-1em}{\normalsize\sf}}
\makeatother
%
% An Editor's Note macro
%
\def\ednote#1{{\sl Editor's note: #1}}
% a way to comment out large sections of text
\newcommand{\commentOut}[1]{{}}
%
% A few commands to help in writing MPI man pages
%
\def\twoc#1#2{
\begin{list}
{\hbox to95pt{#1\hfil}}
{\setlength{\leftmargin}{120pt}
\setlength{\labelwidth}{95pt}
\setlength{\labelsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\topsep}{0pt}
}
\item
{#2}
\end{list}
}
\outer\long\def\onec#1{
\begin{list}
{}
{\setlength{\leftmargin}{25pt}
\setlength{\labelwidth}{0pt}
\setlength{\labelsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\topsep}{0pt}
}
\item
{#1}
\end{list}
}
\def\manhead#1{\noindent{\bf{#1}}}
\makeatletter
%
% make our own index environment that can have a different
% title than just "Index" -- S. Otto
%
\def\@index{Index}
\def\@introtext{} % MPI-2.1
\newif\if@restonecol
\def\myindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
%\columnsep 35pt\twocolumn[\@makeschapterhead{Index}]
%\@mkboth{INDEX}{INDEX}\thispagestyle{plain}\parindent\z@
%\columnsep 35pt\twocolumn[\@makeschapterhead{\@index}]
\columnsep 35pt\twocolumn[\@makeschapterhead{\@index}\@introtext\vspace{15pt}] % MPI-2.1
\@mkboth{\@index}{\@index}\thispagestyle{plain}\parindent\z@
\parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endmyindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
\makeatother
%macros for language binding: mpibind, mpifbind, and fargs:
\def\fargs{\\\advance\leftskip 2em}
\raggedbottom
% from binding chapter for appendix B.
% -*- latex -*-
\makeatletter
\newbox\arg@box
\def\separator{\rule{\linewidth}{0.5pt}}
\def\function#1{\texttt{#1}}
\def\variable#1{\texttt{#1}}
\def\subtitle{\pagebreak[3]\@ifstar{\@subtit@star}{\@subtit@norm}}
\def\@subtit@star#1{
\item[\hbox{\normalsize\sf\begin{tabular}[t]{l}#1\end{tabular}}\hfill]
\hfil\par
\expandafter{\let\par=\space\ignorespaces\let\par=\endgraf}
}
\def\@subtit@norm#1{
\setbox\arg@box=\hbox{\normalsize\sf\begin{tabular}[t]{l}#1\end{tabular}}
\ifdim \wd\arg@box > \labelwidth \item[\copy\arg@box\hfill]\hfil\par
\else \dp\arg@box=0pt \item[\copy\arg@box\hfill] \fi
\expandafter{\let\par=\space\ignorespaces\let\par=\endgraf}
}
\newenvironment{manpage}[3]{\@beginManpage#1\@@#2\@@#3\@@}{\@endManpage}
\def\@beginManpage#1\@@#2\@@#3\@@{
\addcontentsline{toc}{subsection}{#2}
\clearpage
\begin{list}{}{
\setlength\labelwidth{1.2in}
\setlength\leftmargin{\labelwidth}
\addtolength\leftmargin{\labelsep}
\topsep 5pt plus 2pt minus 2pt
\itemsep 5pt plus 2pt minus 2pt
\parsep 10pt plus 2pt minus 2pt
\raggedbottom
}
}
\def\@endManpage{\end{list} \clearpage \flushbottom}
\makeatother
% The next set of macros define change marks for the document
%----------------------------------------------------------------------
% intended for general change marks not associated with a certain version
%\def\begchange{\marginpar[\hspace*{-60pt}\mbox{\hspace*{10pt}
%$\top$ \tiny (General)}]{\mbox{$\top$ \tiny (General)}}}
%\def\endchange{\marginpar[\hspace*{-60pt}\mbox{\hspace*{10pt}
%$\bot$ \tiny (General)}]{\mbox{$\bot$ \tiny (General)}}}
%
% These versions are careful to generate no extraneous error messages
% about overfull boxes
%
% Because they use marginpar, they can't be used everywhere. If
% marginpar isn't available, they do *not* add any marks.
%
\def\begchange{\ifinner\else\protect\marginpar[\mbox{\hbox to
\marginparwidth{\hss\mbox{\hspace*{10pt}$\top$ \tiny
(Fin2)}\hspace*{30pt}}}]{\hbox to \marginparwidth{\mbox{$\top$ \tiny (Fin2)}\hss}}\fi}
\def\endchange{\ifinner\else\protect\marginpar[\mbox{\hbox to \marginparwidth{\hss\mbox{\hspace*{10pt}$\bot$ \tiny (Fin2)}\hspace*{30pt}}}]{\hbox to \marginparwidth{\mbox{$\bot$ \tiny (Fin2)}\hss}}\fi}
%get rid of these change marks
%\def\begchange{}
%\def\endchange{}
%\def\begchange{\ifinner\else\protect\fi}
%\def\endchange{\ifinner\else\fi}
% change marks for June draft
\def\begchangejune{}
\def\endchangejune{}
% change marks for July draft
\def\begchangejuly{}
\def\endchangejuly{}
% change marks for Sept draft
\def\begchangesept{}
\def\endchangesept{}
% change marks for Oct draft
\def\begchangeoct{}
\def\endchangeoct{}
% change marks for Dec draft - for RT
\def\begchangedec{}
\def\endchangedec{}
% change marks for Jan draft
\def\begchangejan{}
\def\endchangejan{}
% change marks for February draft - for RT
\def\begchangefeb{}
\def\endchangefeb{}
% change marks for March draft
\def\begchangemar{}
\def\endchangemar{}
\def\begchangemarch{}
\def\endchangemarch{}
% change marks for April draft
\def\begchangeapr{}
\def\endchangeapr{}
% change marks for first final draft
\def\begchangefini{}
\def\endchangefini{}
% change marks for second final draft
\def\begchangefinii{}
\def\endchangefinii{}
%\def\begchangefiniii{\marginpar[\mbox{\hbox to
% \marginparwidth{\hss\mbox{\hspace*{10pt}$\top$ \tiny
% (Fin3)}\hspace*{30pt}}}]{\hbox to \marginparwidth{\mbox{$\top$ \tiny (Fin3)}\hss}}}
%\def\endchangefiniii{\marginpar[\mbox{\hbox to \marginparwidth{\hss\mbox{\hspace*{10pt}$\bot$ \tiny (Fin3)}\hspace*{30pt}}}]{\hbox to \marginparwidth{\mbox{$\bot$ \tiny (Fin3)}\hss}}}
%get rid of these change marks
\def\begchangefiniii{}
\def\endchangefiniii{}
%----------------------------------------------------------------------
\newcommand{\startchap}[0]{%\cleardoublepage
}
\newcommand{\OSH}{\emph{OpenSHMEM}}
\newcommand{\rcomment}[1]
{{\color{red}\textsf{#1}}}
\newcommand{\bAPI}[2]{
\subsubsection{\bf #1}%\hfill
#2
\hfill %\\
\begin{description}
%\par\nobreak\vspace{-\parskip}
\item[SYNOPSIS] \hfill \\ \\
%\\ \\
}
\newcommand{\eAPI}{
\end{description}
}
\newcommand{\synC}{%\hfill \\
%\vspace{-\parskip} \par
\textbf{C/C++:}
\begin{lstlisting} [language={C}, backgroundcolor=\color{gray}, lineskip=2pt, morekeywords={size_t}, aboveskip=0pt, belowskip=0pt]
}
\newcommand{\synCE}{
\end{lstlisting}
}
\newcommand{\synFE}{
\end{lstlisting}
}
\newcommand{\synF}{%\hfill \\
%\vspace{-\parskip} \par
\textbf{FORTRAN:}
\begin{lstlisting} [language={Fortran}, backgroundcolor=\color{gray}, lineskip=3pt, deletekeywords={TARGET,LEN}, aboveskip=0pt, belowskip=0pt]
}
\newcommand{\aC}[1] {\textit{#1}}
\newcommand{\sC}[1] {\textbf{#1}}
\newcommand{\aF}[1]{\textit{#1}}
\newcommand{\desB}[3] {\hfill
\item[DESCRIPTION] \hfill %\\
\begin{description}
\item[Arguments] \hfill \\
#1
\hfill %\\ \\
\item[API description] \hfill \\ %\\
#2 %\par
\hfill \\ %\\
#3
\hfill \\ %\\
\end{description}
}
\newcommand{\argRow}[3] {
\begin{tabular}{p{2cm} p{2cm} p{10cm}}
\textbf{#1} & \textit{#2} & {#3} \\
\end{tabular}
}
\newcommand{\desTB}[2] {#1 \\ \\
\begin{tabular}{p{5cm} p{9cm}}
\hline
Routine & Data Type of target and source\\
\hline \tabularnewline
\end{tabular}\\
#2
%\hfill
}
\newcommand{\desTBC}[4] {#1 \\ \\
\begin{tabular}{p{5cm} p{9cm}}
\hline
#2 & #3\\
\hline \tabularnewline
\end{tabular}\\
#4
\hfill
}
\newcommand{\desR}[1]
{\hfill %\\ \\
\item[Return Values] \hfill \\ %\\
#1
\\
}
\newcommand{\cRow}[2]{
\begin{tabular}{p{5cm} p{9cm}}
#1 & #2 \tabularnewline
\end{tabular}\\
}
\newcommand{\notesB}[1]{\hfill %\\ \\
\item[Notes] \hfill \\ %\\
#1
%\\
}
\newcommand{\exampleB}[1] {
\item[EXAMPLES] \hfill \\ \\
#1
}
\newcommand{\exampleITEM}[3] {
#1
\lstinputlisting[language={C}, tabsize=2, basicstyle=\ttfamily\footnotesize, morekeywords={size_t}] {#2}
#3
}
\newcommand{\exampleITEMF}[3] {
#1
\lstinputlisting[language={Fortran}, tabsize=2, basicstyle=\ttfamily\footnotesize, deletekeywords={TARGET}] {#2}
#3
}
\newcommand{\source}{\textit{source}}
\newcommand{\target}{\textit{target}}
\newcommand{\PUT}{\textit{Put}}
\newcommand{\GET}{\textit{Get}}
\newcommand{\OPR}[1]{\textit{#1}}
%\newcommand{\FUNC}[1] {\texttt{#1}}
%\newcommand{\FUNC}[1] {{\bf \texttt{#1}}}
%\newcommand{\FUNC}[1] {\texttt{#1}}
\newcommand{\FUNC}[1] {\textit{#1}}
\newcommand{\VAR}[1] {\textit{#1}}
\newcommand{\CONST}[1] {\textit{#1}}
\newcommand{\CorCpp}{\textit{C/C++}}
\newcommand{\Fortran}{\textit{Fortran}}
\newcommand{\Clang}{\textit{C}}
\newcommand{\Cpp}{\textit{C++}}
\newcommand{\barrier}{\FUNC{SHMEM\_BARRIER}}
\newcommand{\barrierall}{\FUNC{SHMEM\_BARRIER\_ALL}}
\newcommand{\broadcast}{\FUNC{SHMEM\_BROADCAST}}
\newcommand{\collect}{\FUNC{SHMEM\_COLLECT}}
\newcommand{\reduction}{\textit{Reduction Operations}}
\newcommand{\activeset}{\textit{Active~set}}
\newcommand{\shmemprefix}{\textit{SHMEM\_}}
\newcommand{\shmemprefixC}{\textit{\_SHMEM\_}}
\def\StandardListing {
\lstset {
%% basicstyle=\scriptsize\ttfamily,
%% backgroundcolor=\color{ListingBG},
%% showspaces=false,
%% showstringspaces=false,
%% showtabs=false,
%% frame=tlBR,
%% frameround=tttt,
%% numbers=none,
%% caption=\lstname
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
basicstyle=\ttfamily\footnotesize,
breaklines=true, % sets automatic line breaking
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
morekeywords={*,...}, % if you want to add more keywords to the set
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
backgroundcolor=\color{gray},
}
}
% annotated program source should be line numbered though
\def\ProgramNumberedListing {
\StandardListing
\lstset {
numbers=left,
numberstyle=\footnotesize
}
}
% new command to show program listings
\newcommand{\numberedlisting}[2] {
\ProgramNumberedListing
\lstinputlisting[#1]{#2}
\StandardListing
}
\lstdefinelanguage{OSH+C}[]{C}{
classoffset=1,
morekeywords={
_SHMEM_BCAST_SYNC_SIZE, _SHMEM_SYNC_VALUE,
start_pes,
my_pe, _my_pe, shmem_my_pe,
num_pes, _num_pes, shmem_n_pes,
shmem_int_p, shmem_short_p, shmem_long_p,
shmem_int_put, shmem_short_put, shmem_long_put,
shmem_barrier_all, shmem_barrier,
shmalloc, shfree, shrealloc,
shmem_broadcast32, shmem_broadcast64,
shmem_short_inc, shmem_int_inc, shmem_long_inc,
shmem_short_add, shmem_int_add, shmem_long_add,
shmem_short_finc, shmem_int_finc, shmem_long_finc,
shmem_short_fadd, shmem_int_fadd, shmem_long_fadd,
shmem_set_lock, shmem_test_lock, shmem_clear_lock,
shmem_long_sum_to_all,
shmem_complexd_sum_to_all,
},
keywordstyle=\color{black}\textbf,
classoffset=0,
sensitive=true
}
\lstdefinelanguage{OSH2+C}[]{OSH+C}{
classoffset=1,
morekeywords={
shmem_init,
shmem_finalize,
shmem_malloc,
shmem_my_pe,
shmem_error,
},
keywordstyle=\color{black}\textbf,
classoffset=0,
sensitive=true
}
\lstdefinelanguage{OSH+F}[]{Fortran}{
classoffset=1,
morekeywords={
SHMEM_BCAST_SYNC_SIZE, SHMEM_SYNC_VALUE,
start_pes,
my_pe, shmem_my_pe,
num_pes, shmem_n_pes,
shmem_int_p, shmem_short_p, shmem_long_p,
shmem_int_put, shmem_short_put, shmem_long_put,
shmem_barrier_all, shmem_barrier,
shpalloc, shpdeallc, shpclmove,
shmem_broadcast32, shmem_broadcast64,
shmem_broadcast4, shmem_broadcast8,
shmem_short_inc, shmem_int_inc, shmem_long_inc,
shmem_short_add, shmem_int_add, shmem_long_add,
shmem_short_finc, shmem_int_finc, shmem_long_finc,
shmem_short_fadd, shmem_int_fadd, shmem_long_fadd,
shmem_set_lock, shmem_test_lock, shmem_clear_lock,
shmem_long_sum_to_all,
},
keywordstyle=\color{black}\textbf,
classoffset=0,
sensitive=false
}
\newcommand{\outputlisting}[2] {
\begin{minipage}{\linewidth}
\vspace{0.1in}
\lstinputlisting[#1]{#2}
\StandardListing
\vspace{0.1in}
\end{minipage}
}
\hyphenation{Open-SHMEM}