Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topcom isRegularTriangulation example running out of memory on some s390x builds #1707

Open
d-torrance opened this issue Dec 17, 2020 · 6 comments
Labels
build issue platform specific issues involving compiling M2, generating examples, or running tests

Comments

@d-torrance
Copy link
Member

d-torrance commented Dec 17, 2020

From a recent PPA build of the development branch on s390x using Ubuntu 20.04. (The same thing happened in Ubuntu 20.10, but not Ubuntu 18.04 or Ubuntu 21.04, where everything built just fine):

-- making example results for "isRegularTriangulation"                     
 ulimit -c unlimited; ulimit -t 700; ulimit -m 850000; ulimit -s 8192; ulimit -n 512;  cd /tmp/M2-25317-0/1-rundir/; GC_MAXIMUM_HEAP_SIZE=400M "/<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/usr-dist/s390x-Linux-Ubuntu-20.04/bin/M2-binary" -q --int --no-randomize --no-readline --silent --stop --print-width 129 -e 'needsPackage("Topcom", Reload => true, FileName => "/<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/Macaulay2/packages/Topcom.m2")' <"/tmp/M2-25317-0/0_is__Regular__Triangulation.m2" >>"/<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/usr-dist/common/share/doc/Macaulay2/Topcom/example-output/_is__Regular__Triangulation.errors" 2>&1
/<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/usr-dist/common/share/doc/Macaulay2/Topcom/example-output/_is__Regular__Triangulation.errors:0:1: (output file) error: Macaulay2 exited with status code 1
/tmp/M2-25317-0/0_is__Regular__Triangulation.m2:0:1: (input file)
M2: *** Error 1
 -- 763.683 seconds elapsed
 -- storing example results from output file../../../usr-dist/common/share/doc/Macaulay2/Topcom/example-output/_is__Regular__Triangulation.out
 -- warning: missing file /<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/usr-dist/common/share/doc/Macaulay2/Topcom/example-output/_is__Regular__Triangulation.out
../../m2/debugging.m2:20:6:(1):[9]: error: installPackage: 1 error(s) occurred running examples for package Topcom:

_is__Regular__Triangulation.errors
**********************************
         {0,2,4}, {3,4,5}, {1,2,3}}

o2 = {{0, 1, 2}, {1, 3, 5}, {2, 3, 4}, {0, 1, 5}, {0, 2, 4}, {3, 4, 5}, {1, 2, 3}}

o2 : List

i3 : isRegularTriangulation(A,tri)


 *** out of memory trying to allocate 3311714395 bytes, exiting ***

../../m2/installPackage.m2:684:14:(1):[8]: --back trace--
../../m2/methods.m2:119:80:(1):[7]: --back trace--
../../m2/option.m2:16:8:(1):[6]: --back trace--
../../m2/installPackage.m2:568:5:(1):[5]: --back trace--
../../m2/methods.m2:119:80:(1):[4]: --back trace--
../../m2/option.m2:16:8:(1):[3]: --back trace--
currentString:1:1:(3):[2]: --back trace--
Macaulay2/Core/startup.m2.in:563:33:(0):[1]: --back trace--
Macaulay2/Core/startup.m2.in:674:6:(0): --back trace--
make[4]: *** [Makefile:93: /<<BUILDDIR>>/macaulay2-1.16.99+git202012151651/M2/usr-dist/s390x-Linux-Ubuntu-20.04/lib/s390x-linux-gnu/Macaulay2/Topcom/.installed] Error 1

3311714395 bytes?!? That's over 3 gigs! Is this example really that big?

@d-torrance
Copy link
Member Author

The weird thing is that this function pretty much just calls topcom...

isRegularTriangulation = method(Options=>{Homogenize=>true})
isRegularTriangulation(Matrix, List) := opts -> (A, tri) -> (
-- now create the output file
(outfile, errfile) := callTopcom("checkregularity --checktriang -v", {topcomPoints(A, opts), [], tri });
match("Checked 1 triangulations, 0 non-regular so far", get errfile)
)

@DanGrayson
Copy link
Member

3311714395 bytes?!? That's over 3 gigs! Is this example really that big?

No, it can't be, because we enforce a memory limit, and the example has worked in the past.

@d-torrance
Copy link
Member Author

Possibly related. check_1 "Topcom", which tests isRegularTriangulation, timed out on an armhf Ubuntu 18.04 PPA build:

if ! grep "CacheExampleOutput => true" ./Topcom.m2 >/dev/null ; then /<<BUILDDIR>>/macaulay2-1.16.99+git202101061312/M2/usr-dist/arm-Linux-Ubuntu-18.04/bin/M2 -q --no-preload --stop --silent -e "needsPackage(\"Topcom\",LoadDocumentation=>true,DebuggingMode=>true); check(Topcom,UserMode=>false,Verbose=>true); exit 0" ; fi 
 -- running   check(0, "Topcom")                                             -- 2.75511 seconds elapsed
 -- capturing check(1, "Topcom")                                            
E: Build killed with signal TERM after 150 minutes of inactivity

@d-torrance
Copy link
Member Author

This happened again, but now on the next test:

if ! grep "CacheExampleOutput => true" ./Topcom.m2 >/dev/null ; then /<<BUILDDIR>>/macaulay2-1.17.1.1+git202101251610/M2/usr-dist/arm-Linux-Ubuntu-18.04/bin/M2 -q --no-preload --stop --silent -e "needsPackage(\"Topcom\",LoadDocumentation=>true,DebuggingMode=>true); check(Topcom,UserMode=>false,Verbose=>true); exit 0" ; fi 
 -- running   check(0, "Topcom")                                             -- 1.43566 seconds elapsed
 -- skipping  check(1, "Topcom")                                             -- 0.000170822 seconds elapsed
 -- capturing check(2, "Topcom")                                            
E: Build killed with signal TERM after 150 minutes of inactivity

@d-torrance
Copy link
Member Author

And again:

/<<BUILDDIR>>/macaulay2-1.17.2.1+git202105071727/M2/usr-dist/x86_64-Linux-Ubuntu-21.10/bin/M2 -q --no-preload --stop --silent -e "needsPackage(\"Topcom\",LoadDocumentation=>true,DebuggingMode=>true); check(Topcom,UserMode=>false,Verbose=>true); exit 0" 
 -- running   check(0, "Topcom")                                             -- 0.303817 seconds elapsed
 -- skipping  check(1, "Topcom")                                             -- 0.000048815 seconds elapsed
 -- capturing check(2, "Topcom")                                            
E: Build killed with signal TERM after 150 minutes of inactivity

@d-torrance
Copy link
Member Author

Ran out of memory on another Topcom test in an amd64 Ubuntu 21.04 PPA build:

 -- running   check(0, "Topcom")                                            
 ulimit -c unlimited; ulimit -t 700; ulimit -m 850000; ulimit -s 8192; ulimit -n 512;  cd /tmp/M2-7356-0/1-rundir/; GC_MAXIMUM_HEAP_SIZE=400M "/<<BUILDDIR>>/macaulay2-1.18.0.1+git202106251709/M2/usr-dist/x86_64-Linux-Ubuntu-21.04/bin/M2-binary" -q --int --no-randomize --no-readline --silent --stop --print-width 77 -e 'needsPackage("Topcom",Reload=>true,FileName=>"/<<BUILDDIR>>/macaulay2-1.18.0.1+git202106251709/M2/Macaulay2/packages/Topcom.m2")' <"/tmp/M2-7356-0/0.m2" >>"/tmp/M2-7356-0/0.tmp" 2>&1
/tmp/M2-7356-0/0.tmp:0:1: (output file) error: Macaulay2 exited with status code 1
/tmp/M2-7356-0/0.m2:0:1: (input file)
M2: *** Error 1
 -- 847.387 seconds elapsed
 -- skipping  check(1, "Topcom")                                             -- 0.000046747 seconds elapsed
 -- skipping  check(2, "Topcom")                                             -- 0.000026299 seconds elapsed
 -- running   check(3, "Topcom")                                             -- 0.338551 seconds elapsed
 -- capturing check(4, "Topcom")                                             -- 0.149882 seconds elapsed
Topcom.m2:370:1-382:1: error:
 -- o3 = {{0, 2, 4}, {2, 3, 4}, {0, 1, 4}, {1, 3, 4}}
 -- 
 -- o3 : List
 -- 
 -- i4 :   assert isRegularTriangulation(A,tri)
 -- 
 -- i5 :   assert(regularTriangulationWeights(A,tri,Homogenize=>false) == {1,1,0,0,0})
 -- 
 -- 
 --  *** out of memory trying to allocate 954956588 bytes, exiting ***
 -- 
../m2/debugging.m2:23:6:(1):[9]: error: test(s) #0 of package Topcom failed.

Again, the number of bytes we're trying to allocate seems very large -- nearly a gig!

@mahrud mahrud added the build issue platform specific issues involving compiling M2, generating examples, or running tests label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build issue platform specific issues involving compiling M2, generating examples, or running tests
Projects
None yet
Development

No branches or pull requests

3 participants