Macaulay2 » Documentation
Packages » PALPInterface :: Compiling PALP with larger limits
next | previous | forward | backward | up | index | toc

Compiling PALP with larger limits -- how to build PALP yourself when a computation exceeds its limits

PALP sizes its arrays with constants fixed when it is compiled, so a large enough input runs out of one of them, and the only remedy is to compile PALP again with larger values. The packaged builds (Homebrew, Ubuntu, and the one Macaulay2 can build) leave these at PALP's defaults, apart from the dimension bound, which the 11d build raises to 11; see palpDmax. The simplest case is a polytope of dimension 12, such as the 12-simplex: even its vertices need POLY_Dmax at least 12. Nef partitions in codimension four are another, and there other limits are met too. Each of these fails with the 11d build, for a different reason:

  • the 8-simplex, the polytope of $\mathbb{P}^8$, in codimension four, with Need SYM_Nmax > 46083: its symmetry group has 9! elements;
  • the 9-simplex in codimension four, which needs POLY_Dmax at least $9 + 4 - 1 = 12$;
  • the 6-cube, the polytope of $(\mathbb{P}^1)^6$, in codimension four, on which nef.x aborts with Assertion failed: (_PTL->n < Nef_Max).

The error from these functions shows PALP's own message, which names the constant to increase. Larger arrays use more memory, so increase only what the message asks for. Raising a limit removes the error, but does not make the computation fast: with the values below, neither the first nor the third of these examples finished within ten minutes, even without Hodge numbers.

Getting the source

Macaulay2 uses PALP 2.21, from https://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html.

curl -O https://hep.itp.tuwien.ac.at/~kreuzer/CY/palp/palp-2.21.tar.gz
tar xzf palp-2.21.tar.gz
cd palp-2.21

What to change

The constants are #define lines in two header files.

  • Global.h: POLY_Dmax, the largest dimension, near the top. Below it, the branch for POLY_Dmax greater than 4 sets POINT_Nmax (lattice points), VERT_Nmax (vertices; PALP recommends a multiple of 32), FACE_Nmax (faces), SYM_Nmax (symmetries) and EQUA_Nmax (facets).
  • Nef.h: Nef_Max and NP_Max, which bound the number of nef partitions nef.x handles, on its first two lines.

For instance, to allow dimension 12 and raise the other two limits met above (the 9-simplex would also need SYM_Nmax above $10! = 3628800$):

Global.h:  #define POLY_Dmax 12              (was 6)
           #define SYM_Nmax  400000          (was 46080)
Nef.h:     #define Nef_Max   2000000         (was 500000)

Compiling

In the palp-2.21 directory, run GNU make. This needs GNU make 4 or later; on macOS the system make is older, and fails with No rule to make target `poly-d.x', so use gmake from Homebrew (brew install make).

gmake

This takes a few seconds, and leaves poly.x, cws.x, nef.x, class.x and mori.x in the directory. These are the programs that use the values in Global.h. The target all-dims also builds poly-4d.x up to poly-11d.x, and so on, whose dimension bounds are fixed whatever Global.h says.

Using it from Macaulay2

Tell Macaulay2 where the programs are with programPaths, and set palpDmax to 6, so that the plain names poly.x, nef.x, and so on are the ones looked up, rather than poly-11d.x, which may be installed elsewhere. Do this before the first PALP computation of the session at that value of palpDmax, since each program is looked up only once for each value. Replace the directory here by your own.

needsPackage "PALPInterface"
scan({"poly.x", "cws.x", "nef.x", "class.x"},
    p -> programPaths#p = "/home/me/palp-2.21/")
palpDmax = 6

To check which executable is used:

(palpProgram "nef")#"path"

Everything then runs as before, with the new limits. For the 12-simplex, which with poly-11d.x gives the error Please increase POLY_Dmax to at least 12, PALP compiled with POLY_Dmax 12 as above gives:

A = id_(ZZ^12) | matrix toList(12 : {-1});
palpMVertices A   -- its 13 vertices, at once

Given as the weight system {13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} instead, the same polytope took more than five minutes, because PALP starts from all the lattice points of $\Delta(q)$, here about five million.

Caveat

The setting of palpDmax to 6 is needed because the package looks for nef-11d.x first. This may change in a later version.

See also


The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/PALPInterface.m2:1310:0.