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: (A) selecting one of the plurality of logical partitions; (B) computing memory affinity for the selected logical partition 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: (C) computing a raw score for the selected logical partition based on a spread type related to the hardware domain hierarchy; (D) multiplying the raw score by at least one adjustment factor to generate an adjusted score; (E) repeating steps (A) through (D) for each of the plurality of logical partitions; and (F) summing the adjusted scores for the plurality of logical partitions.