def _build_data(self):
        """Build HPL data from basic parameters"""

        def baseN(nodes, mpn):
            return int(math.sqrt(mpn * 0.80 * nodes * 1024 * 1024 / 8))

        def nFromNb(baseN, nb):
            factor = int(baseN / nb)
            if factor % 2 != 0:
                factor -= 1
            return nb * factor

        def get_grid(nodes, ppn):
            cores = nodes * ppn
            sqrt = math.sqrt(cores)
            factors = [
                num for num in range(2, int(math.floor(sqrt) + 1)) if cores % num == 0
            ]
            if len(factors) == 0:
                factors = [1]

            diff = 0
            keep = 0
            for factor in factors:
                if diff == 0:
                    diff = cores - factor
                if keep == 0:
                    keep = factor
                tmp_diff = cores - factor
                if tmp_diff < diff:
                    diff = tmp_diff
                    keep = factor
            return [keep, int(cores / keep)]

        properties = dict(
            realN=nFromNb(baseN(self.nodes, self.memory_per_node), self.block_size),
            nb=self.block_size,
            pQ=get_grid(self.nodes, self.cores_per_node),
        )
        return self._data_from_jinja(**properties)
Build HPL data from basic parameters