Closed jameshanlon closed 12 years ago
Was this causing a problem in practice? I can see the potential issue (and it would be good to tidy up the code) but it shouldn't matter if the coreID is set incorrectly when the core is added as node->setNodeID(nodeID) is called after the cores are added and this causes the coreID to be recalculated with the right values (unless I'm missing something).
For a 128 core network it causes the following assertion to be raised:
$ axe a.128.xe axe: Node.cpp:58: uint32_t Node::getCoreID(unsigned int) const: Assertion `coreNum <= makeMask(getCoreNumberBits())' failed. Aborted
The 'setParent() method called in 'addCore' (Node.cpp:17) has a dependence on the size of the 'cores' vector in Node (setParent --> seeNewNodeID --> getCoreID -->getCoreID --> getCoreNumBits. This should be called after all cores have been added to a Node.
Fixed this in: https://github.com/jameshanlon/tool_axe/commit/68d8d582b55ff5ff621faff03d8baafb29eaaea3