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
Make it so NUM_THREADS is set intelligently instead of idiotically in makefile so doing "make ptest" or "make ptestlong" doesn't kill some computers #6283
Comments
Attachment: trac_6283-numthreads.patch.gz apply to scripts repository. depends on #2624. |
patch for SAGE_ROOT/makefile |
Attachment: makefile.patch.gz Attachment: makefile.gz the file SAGE_ROOT/makefile |
comment:1
I'm not sure what "intelligently" means, but here is a patch which sets it to be the number of processors, as detected by This depends on the patch at #2624. |
Author: John Palmieri |
comment:2
I really want this patch in, since I am very very tired of editing the makefile on every tarball I unpack. One question: do we know what multiprocessing.cpu_count() returns on something like the Sun T2 machine? That machine has many "threads" but not terribly many cores, and I'm not sure what cpu_count does. Also, does this work in Cygwin or Windows? We are trying to revive the Cygwin port. |
comment:3
Hrm, I just checked on T2, and multiprocessing.cpu_count() returns 128 on that machine, which perhaps is not ideal. The whole issue of cpus/cores/threads is really complicated -- see our own drkirkby on comp.os.solaris. I think we can ignore this issue for the moment, since Sage doesn't even really build on T2. |
comment:4
Replying to @dandrake:
I'm happy to ignore this. If it returns the "wrong" number, that seems like a bug in Python. I don't have access to many different kinds of machines. Should we ask people on sage-devel to test |
comment:5
After the discussion on sage-devel, I think we should merge this. The only concrete example of a machine where this doesn't work is t2.math, and anyone can fix it by editing the makefile -- which is what everyone has been doing all along anyway! Release manager: merge attachment: trac_6283-numthreads.patch and also patch the makefile in $SAGE_ROOT with attachment: makefile.patch. |
Reviewer: Dan Drake |
Attachment: trac_6283-warning.patch.gz adds warning about setting the number of threads to 0 |
comment:6
The file
I think people should be made aware that having a value of zero means that all the cores/processors on their system would be devoted to parallel doctesting. On a personal machine, that's OK and any damage done would be localized to the person's own machine. But on a multi-user machine such as the machines making up the Sage cluster, bsd.math, etc., the default value of zero can be dangerous because on sage.math, say, this would use 24 cores for parallel doctesting. Most of the time, people are running very long jobs on sage.math, mod.math, and geom.math. Using all 24 cores on any of these machines can have unexpected consequences such as having doctest failures due to segfaults, out of memory error, and even bringing those machines offline. The patch |
comment:7
Your warnings are a good idea. Perhaps we can make it part of release manager boot camp to teach release managers to do doctests with |
comment:8
Merged these patches in the script repository:
Manually patched the file |
Merged: Sage 4.1.2.alpha3 |
Changed reviewer from Dan Drake to Dan Drake, Minh Van Nguyen |
comment:9
I realise this has got positive review, but I would have personally not given it that. I would have personally not allowed the default to exceed 8, since for 99% of machines with 8 or more 'CPUs/threads', they are mutli-user servers, not personal workstations. As such, people should not be exploiting them to the full. On 't2' currently this would not cause an issue, since it is not used a lot. But it would be an issue once there are many users. I doubt it would be sensible on sage.math to exploit it to the full. Dave |
comment:10
Replying to @sagetrac-drkirkby:
Agreed.
I think a value of 1 would be sensible. No matter if one runs doctest using
only to realize that it spawned 24 cores on mod.math to parallel doctest. In panic mode, I hastily killed all of my threads. So how about opening another ticket to make |
comment:11
Replying to @sagetrac-mvngu:
I have a different idea, which we'll discuss at #7011. |
Changed merged from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4 |
comment:12
There is no 4.1.2.alpha3. Sage 4.1.2.alpha3 was William Stein's release for working on making the notebook a standalone package. |
The top of SAGE_ROOT/makefile is
I've many times accidently done "make ptest" and with extremely unpleasant results the next day.
Component: doctest coverage
Author: John Palmieri
Reviewer: Dan Drake, Minh Van Nguyen
Merged: Sage 4.1.2.alpha4
Issue created by migration from https://trac.sagemath.org/ticket/6283
The text was updated successfully, but these errors were encountered: