1. A computer-implemented method executed by at least one processor for computing memory affinity for a plurality of logical partitions based on a hardware domain hierarchy in a computer system, the method comprising the steps of: selecting one of the plurality of logical partitions; computing memory affinity for the computer system based on the hardware domain hierarchy in the computer system, the hardware domain hierarchy including at least one primary domain and at least one secondary domain, by performing the steps of: (A) ordering the plurality of logical partitions into a priority list that lists the plurality of logical partitions in priority order; (B) selecting the next logical partition in the priority list; (C) assigning a spread type to the selected logical partition based on where the logical partition could theoretically fit in the computer system based on hardware boundaries in the hardware domain hierarchy in the computer system; (D) computing a raw score for the selected logical partition based on the assigned spread type for the logical partition; (E) multiplying the raw score by at least one adjustment factor to generate an adjusted score for the selected logical partition; and (F) repeating steps (B), (C), (D) and (E) for each of the plurality of logical partitions in the priority list; and (G) summing the adjusted scores for the plurality of logical partitions to compute the memory affinity for the computer system.