-
Notifications
You must be signed in to change notification settings - Fork 0
/
openshmem.vim
216 lines (189 loc) · 10.5 KB
/
openshmem.vim
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
" Vim syntax file
" Language: C/C11/C++ for OpenSHMEM 1.5 API
" Maintainer: James A. Ross
" Latest Revision: March 18, 2020
if version < 600
syntax clear
elseif exists ("b:current_syntax")
finish
endif
" Read the C syntax first
if version < 600
source <sfile>:p:h/c.vim
else
runtime! syntax/c.vim
endif
""" SHMEM Constants
syn keyword shmemConst SHMEM_THREAD_SINGLE
syn keyword shmemConst SHMEM_THREAD_FUNNELED
syn keyword shmemConst SHMEM_THREAD_SERIALIZED
syn keyword shmemConst SHMEM_THREAD_MULTIPLE
syn keyword shmemConst SHMEM_TEAM_NUM_CONTEXTS
syn keyword shmemConst SHMEM_TEAM_INVALID
syn keyword shmemConst SHMEM_CTX_INVALID
syn keyword shmemConst SHMEM_CTX_SERIALIZED
syn keyword shmemConst SHMEM_CTX_PRIVATE
syn keyword shmemConst SHMEM_CTX_NOSTORE
syn keyword shmemConst SHMEM_SIGNAL_SET
syn keyword shmemConst SHMEM_SIGNAL_ADD
syn keyword shmemConst SHMEM_MALLOC_ATOMICS_REMOTE
syn keyword shmemConst SHMEM_MALLOC_SIGNAL_REMOTE
syn keyword shmemConst SHMEM_MAJOR_VERSION
syn keyword shmemConst SHMEM_MINOR_VERSION
syn keyword shmemConst SHMEM_MAX_NAME_LEN
syn keyword shmemConst SHMEM_VENDOR_STRING
syn keyword shmemConst SHMEM_CMP_EQ
syn keyword shmemConst SHMEM_CMP_NE
syn keyword shmemConst SHMEM_CMP_LT
syn keyword shmemConst SHMEM_CMP_LE
syn keyword shmemConst SHMEM_CMP_GT
syn keyword shmemConst SHMEM_CMP_GE
""" Deprecated/Redundant Constants
syn keyword shmemConstDeprecated SHMEM_SYNC_VALUE
syn keyword shmemConstDeprecated _SHMEM_SYNC_VALUE
syn keyword shmemConstDeprecated SHMEM_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_BCAST_SYNC_SIZE
syn keyword shmemConstDeprecated _SHMEM_BCAST_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_REDUCE_SYNC_SIZE
syn keyword shmemConstDeprecated _SHMEM_REDUCE_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_BARRIER_SYNC_SIZE
syn keyword shmemConstDeprecated _SHMEM_BARRIER_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_COLLECT_SYNC_SIZE
syn keyword shmemConstDeprecated _SHMEM_COLLECT_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_ALLTOALL_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_ALLTOALLS_SYNC_SIZE
syn keyword shmemConstDeprecated SHMEM_REDUCE_MIN_WRKDATA_SIZE
syn keyword shmemConstDeprecated _SHMEM_REDUCE_MIN_WRKDATA_SIZE
syn keyword shmemConstDeprecated _SHMEM_MAJOR_VERSION
syn keyword shmemConstDeprecated _SHMEM_MINOR_VERSION
syn keyword shmemConstDeprecated _SHMEM_MAX_NAME_LEN
syn keyword shmemConstDeprecated _SHMEM_VENDOR_STRING
syn keyword shmemConstDeprecated _SHMEM_CMP_EQ
syn keyword shmemConstDeprecated _SHMEM_CMP_NE
syn keyword shmemConstDeprecated _SHMEM_CMP_LT
syn keyword shmemConstDeprecated _SHMEM_CMP_LE
syn keyword shmemConstDeprecated _SHMEM_CMP_GT
syn keyword shmemConstDeprecated _SHMEM_CMP_GE
""" Library Handles
syn keyword shmemConst SHMEM_TEAM_WORLD
syn keyword shmemConst SHMEM_TEAM_SHARED
syn keyword shmemConst SHMEM_CTX_DEFAULT
""" OpenSHMEM Types
syn keyword shmemType shmem_cmp_t
syn keyword shmemType shmem_ctx_t
syn keyword shmemType shmem_team_t
syn keyword shmemType shmem_team_config_t
""" Library Setup, Exit, and Query Routines
syn keyword shmemFunc shmem_init
syn keyword shmemFunc shmem_my_pe
syn keyword shmemFunc shmem_n_pes
syn keyword shmemFunc shmem_finalize
syn keyword shmemFunc shmem_global_exit
syn keyword shmemFunc shmem_pe_accessible
syn keyword shmemFunc shmem_addr_accessible
syn keyword shmemFunc shmem_ptr
syn keyword shmemFunc shmem_info_get_version
syn keyword shmemFunc shmem_info_get_name
syn keyword shmemFunc shmem_init_thread
syn keyword shmemFunc shmem_query_thread
""" Memory Management Routines
syn keyword shmemFunc shmem_malloc
syn keyword shmemFunc shmem_free
syn keyword shmemFunc shmem_realloc
syn keyword shmemFunc shmem_align
syn keyword shmemFunc shmem_malloc_with_hints
syn keyword shmemFunc shmem_calloc
""" Deprecated Initialization and Memory Magement Routines
syn keyword shmemFuncDeprecated _my_pe
syn keyword shmemFuncDeprecated _num_pes
syn keyword shmemFuncDeprecated shmalloc
syn keyword shmemFuncDeprecated shfree
syn keyword shmemFuncDeprecated shrealloc
syn keyword shmemFuncDeprecated shmemalign
syn keyword shmemFuncDeprecated start_pes
""" Team Management Routines
syn keyword shmemFunc shmem_team_my_pe
syn keyword shmemFunc shmem_team_n_pes
syn keyword shmemFunc shmem_team_get_config
syn keyword shmemFunc shmem_team_translate_pe
syn keyword shmemFunc shmem_team_split_strided
syn keyword shmemFunc shmem_team_split_2d
syn keyword shmemFunc shmem_team_destroy
""" Communication Management Routines
syn keyword shmemFunc shmem_ctx_create
syn keyword shmemFunc shmem_team_create_ctx
syn keyword shmemFunc shmem_ctx_get_team
syn keyword shmemFunc shmem_ctx_destroy
""" Remote Memory Access Routines
syn match shmemFunc '\<shmem_\(put\|p\|iput\|get\|g\|iget\|put_nbi\|get_nbi\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(float\|double\|longdouble\|char\|schar\|short\|int\|long\|longlong\|uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\|ptrdiff\)_\(put\|p\|iput\|get\|g\|iget\|put_nbi\|get_nbi\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(put\|iput\|get\|iget\)\(8\|16\|32\|64\|128\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(put\|get\)\(8\|16\|32\|64\|128\)_nbi\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(put\|get\)mem\(_nbi\)\?\>'
""" Atomic Memory Operations
syn match shmemFunc '\<shmem_atomic_\(set\|inc\|add\|and\|or\|xor\)\>'
syn match shmemFunc '\<shmem_atomic_\(fetch\|compare_swap\|swap\|fetch_inc\|fetch_add\|fetch_and\|fetch_or\|fetch_xor\)\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(int\|long\|longlong\|uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\|size\|ptrdiff\)_atomic_\(inc\|add\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(int\|long\|longlong\|uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\|size\|ptrdiff\)_atomic_\(compare_swap\|fetch_inc\|fetch_add\)\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(int\|long\|longlong\|uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\|size\|ptrdiff\|float\|double\)_atomic_\(set\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(int\|long\|longlong\|uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\|size\|ptrdiff\|float\|double\)_atomic_\(fetch\|swap\)\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\)_atomic_\(and\|or\|xor\)\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(uint\|ulong\|ulonglong\|int32\|int64\|uint32\|uint64\)_atomic_\(fetch_and\|fetch_or\|fetch_xor\)\(_nbi\)\?\>'
""" Deprecated Atomic Memory Operations
syn match shmemFuncDeprecated '\<shmem_\(fetch\|set\|cswap\|finc\|inc\|fadd\|add\|swap\)\>'
syn match shmemFuncDeprecated '\<shmem_\(int\|long\|longlong\)_\(cswap\|finc\|inc\|fadd\|add\)\>'
syn match shmemFuncDeprecated '\<shmem_\(float\|double\|int\|long\|longlong\)_\(fetch\|set\|swap\)\>'
""" Signaling Operations
syn match shmemFunc '\<shmem_put_signal\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?\(float\|double\|longdouble\|char\|schar\|short\|int\|long\|longlong\|uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\|ptrdiff\)_put_signal\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?put\(8\|16\|32\|64\|128\)_signal\(_nbi\)\?\>'
syn match shmemFunc '\<shmem_\(ctx_\)\?putmem_signal\(_nbi\)\?\>'
syn keyword shmemFunc shmem_signal_fetch
""" Collective Routines
syn keyword shmemFunc shmem_barrier_all
syn keyword shmemFunc shmem_sync
syn keyword shmemFunc shmem_team_sync
syn keyword shmemFunc shmem_sync_all
syn match shmemFunc '\<shmem_\(alltoall\|alltoalls\|broadcast\|collect\|fcollect\)\(mem\)\?\>'
""" Deprecated Collective Routines
syn keyword shmemFuncDeprecated shmem_barrier
syn match shmemFuncDeprecated '\<shmem_\(alltoall\|alltoalls\|broadcast\|collect\|fcollect\)\(32\|64\)\>'
""" Reductions
syn match shmemFunc '\<shmem_\(float\|double\|longdouble\|char\|schar\|short\|int\|long\|longlong\|uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\|ptrdiff\)_\(alltoall\|alltoalls\|broadcast\|collect\|fcollect\)\>'
syn match shmemFunc '\<shmem_\(and\|or\|xor\|max\|min\|sum\|prod\)_reduce\>'
syn match shmemFunc '\<shmem_\(uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\)_\(and\|or\|xor\)_reduce\>'
syn match shmemFunc '\<shmem_\(char\|schar\|short\|int\|long\|longlong\|ptrdiff\|uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\|float\|double\|longdouble\)_\(max\|min\)_reduce\>'
syn match shmemFunc '\<shmem_\(char\|schar\|short\|int\|long\|longlong\|ptrdiff\|uchar\|ushort\|uint\|ulong\|ulonglong\|int8\|int16\|int32\|int64\|uint8\|uint16\|uint32\|uint64\|size\|float\|double\|longdouble\|complexd\|complexf\)_\(sum\|prod\)_reduce\>'
""" Deprecated Reductions
syn match shmemFuncDeprecated '\<shmem_\(short\|int\|long\|longlong\)_\(and\|or\|xor\)_to_all\>'
syn match shmemFuncDeprecated '\<shmem_\(short\|int\|long\|longlong\|float\|double\|longdouble\)_\(max\|min\)_to_all\>'
syn match shmemFuncDeprecated '\<shmem_\(short\|int\|long\|longlong\|float\|double\|longdouble\|complexd\|complexf\)_\(sum\|prod\)_to_all\>'
""" Point-To-Point Synchronization Routines
syn match shmemFunc '\<shmem_\(short_\|int_\|long_\|longlong_\|ushort_\|uint_\|ulong_\|ulonglong_\|int32_\|int64_\|uint32_\|uint64_\|size_\|ptrdiff_\)\?\(wait_until\|test\)\(_all\|_any\|_some\|_all_vector\|_any_vector\|_some_vector\)\?\>'
syn keyword shmemFunc shmem_signal_wait_until
""" Deprecated Point-To-Point Synchronization Routines
syn match shmemFuncDeprecated '\<shmem_\(short_\|int_\|long_\|longlong_\)\?wait\>'
""" Memory Ordering Routines
syn keyword shmemFunc shmem_fence
syn keyword shmemFunc shmem_ctx_fence
syn keyword shmemFunc shmem_quiet
syn keyword shmemFunc shmem_ctx_quiet
""" Distributed Locking Routines
syn keyword shmemFunc shmem_clear_lock
syn keyword shmemFunc shmem_set_lock
syn keyword shmemFunc shmem_test_lock
""" Deprecated Cache Management
syn keyword shmemFuncDeprecated shmem_clear_cache_inv
syn keyword shmemFuncDeprecated shmem_set_cache_inv
syn keyword shmemFuncDeprecated shmem_clear_cache_line_inv
syn keyword shmemFuncDeprecated shmem_set_cache_line_inv
syn keyword shmemFuncDeprecated shmem_udcflush
syn keyword shmemFuncDeprecated shmem_udcflush_line
""" Profiling Interface
syn keyword shmemFunc shmem_pcontrol
let b:current_syntax = "openshmem"
hi def link shmemConst Constant
hi def link shmemFunc Function
hi def link shmemType Type
hi shmemConstDeprecated cterm=underline ctermfg=DarkRed guifg=Magenta
hi shmemFuncDeprecated cterm=underline ctermfg=DarkCyan guifg=#00ffff