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

Function computeGrid

modules/mpi/tutorials/ospMPIDistribTutorialVolume.cpp:158–172  ·  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

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

Callers 1

makeLocalVolumeFunction · 0.70

Calls 1

computeDivisorFunction · 0.70

Tested by

no test coverage detected