func dieHintScore(hint topology.Hint, sysID idset.ID, socket system.CPUPackage) float64 {
	numaNodes := idset.NewIDSet(socket.DieNodeIDs(sysID)...)
	for _, idstr := range strings.Split(hint.NUMAs, ",") {
		hID, err := strconv.ParseInt(idstr, 0, 0)
		if err != nil {
			log.Warn("invalid hint NUMA node %s from %s", idstr, hint.Provider)
			return 0.0
		}
		if numaNodes.Has(idset.ID(hID)) {
			return 1.0
		}
	}
	return 0.0
}
Calculate the die node score of the given hint and die.
package topologyaware
import (
	system "github.com/intel/cri-resource-manager/pkg/sysfs"
	"github.com/intel/cri-resource-manager/pkg/topology"
	idset "github.com/intel/goresctrl/pkg/utils"
	"k8s.io/kubernetes/pkg/kubelet/cm/cpuset"
	"strconv"
	"strings"
)
func cpuHintScore(hint topology.Hint, CPUs cpuset.CPUSet) float64 {
	hCPUs, err := cpuset.Parse(hint.CPUs)
	if err != nil {
		log.Warn("invalid hint CPUs '%s' from %s", hint.CPUs, hint.Provider)
		return 0.0
	}
	common := hCPUs.Intersection(CPUs)
	return float64(common.Size()) / float64(hCPUs.Size())
}
func numaHintScore(hint topology.Hint, sysIDs ...idset.ID) float64 {
	for _, idstr := range strings.Split(hint.NUMAs, ",") {
		hID, err := strconv.ParseInt(idstr, 0, 0)
		if err != nil {
			log.Warn("invalid hint NUMA node %s from %s", idstr, hint.Provider)
			return 0.0
		}
		for _, id := range sysIDs {
			if hID == int64(id) {
				return 1.0
			}
		}
	}
	return 0.0
}