MCPcopy Create free account
hub / github.com/RenderKit/ospray / computeGrid

Function computeGrid

modules/mpi/tutorials/ospMPIDistribTutorialPartialRepl.cpp:166–180  ·  view source on GitHub ↗

Compute an X x Y x Z grid to have 'num' grid cells, only gives a nice grid for numbers with even factors since we don't search for factors of the number, we just try dividing by two

Source from the content-addressed store, hash-verified

164// only gives a nice grid for numbers with even factors since
165// we don't search for factors of the number, we just try dividing by two
166vec3i computeGrid(int num)
167{
168 vec3i grid(1);
169 int axis = 0;
170 int divisor = 0;
171 while (computeDivisor(num, divisor)) {
172 grid[axis] *= divisor;
173 num /= divisor;
174 axis = (axis + 1) % 3;
175 }
176 if (num != 1) {
177 grid[axis] *= num;
178 }
179 return grid;
180}
181
182VolumeBrick makeLocalVolume(const int mpiRank, const int mpiWorldSize)
183{

Callers 1

makeLocalVolumeFunction · 0.70

Calls 1

computeDivisorFunction · 0.70

Tested by

no test coverage detected