def test_thread_coloring(self, backend, skip_opencl, elements, elem_node_map, elem_node, mat, x):
        assert NUM_ELE % 2 == 0, "NUM_ELE must be even."

        plan = _plan.Plan(elements.all_part,
                          mat(op2.INC, (elem_node[op2.i[0]],
                                        elem_node[op2.i[1]])),
                          x(op2.WRITE, elem_node[0]),
                          partition_size=NUM_ELE / 2,
                          matrix_coloring=True)

        assert plan.nblocks == 2
        eidx = 0
        for p in range(plan.nblocks):
            for thrcol in range(plan.nthrcol[p]):
                counter = numpy.zeros(NUM_NODES, dtype=numpy.uint32)
                for e in range(eidx, eidx + plan.nelems[p]):
                    if plan.thrcol[e] == thrcol:
                        counter[elem_node.values[e][0]] += 1
                assert (counter < 2).all()

            eidx += plan.nelems[p]
dataset/ETHPy150Open OP2/PyOP2/test/unit/test_coloring.py/TestColoring.test_thread_coloring/original