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

Function computeGrid

modules/mpi/testing/distributed_test_fixture.cpp:28–42  ·  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

26// only gives a nice grid for numbers with even factors since
27// we don't search for factors of the number, we just try dividing by two
28vec3i computeGrid(int num)
29{
30 vec3i grid(1);
31 int axis = 0;
32 int divisor = 0;
33 while (computeDivisor(num, divisor)) {
34 grid[axis] *= divisor;
35 num /= divisor;
36 axis = (axis + 1) % 3;
37 }
38 if (num != 1) {
39 grid[axis] *= num;
40 }
41 return grid;
42}
43
44MPIDistribBase::MPIDistribBase()
45{

Callers 1

MPIDistribBaseMethod · 0.70

Calls 1

computeDivisorFunction · 0.70

Tested by

no test coverage detected