Test now passes
added support for user defined affinity function
useful testfile generator for great number of nodes