MCPcopy Create free account
hub / github.com/mpi4py/mpi4py / BaseArray

Class BaseArray

test/arrayimpl.py:119–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119class BaseArray:
120 #
121 backend = None
122
123 TypeMap = TypeMap.copy()
124 TypeMap.pop("g", None)
125
126 def __len__(self):
127 return len(self.array)
128
129 def __getitem__(self, i):
130 return self.array[i]
131
132 def __setitem__(self, i, v):
133 self.array[i] = v
134
135 @property
136 def mpidtype(self):
137 try:
138 return self.TypeMap[self.typecode]
139 except KeyError:
140 return MPI.DATATYPE_NULL
141
142 def as_raw(self):
143 return self.array
144
145 def as_mpi(self):
146 return (self.as_raw(), self.mpidtype)
147
148 def as_mpi_c(self, count):
149 return (self.as_raw(), count, self.mpidtype)
150
151 def as_mpi_v(self, cnt, dsp):
152 return (self.as_raw(), (cnt, dsp), self.mpidtype)
153
154
155if array is not None:

Callers

nothing calls this directly

Calls 1

popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…