On Mon, May 5, 2014 at 5:07 PM, John H Palmieri <jhpalmier...@gmail.com> wrote:
>
>
> On Monday, May 5, 2014 4:41:39 PM UTC-7, William wrote:
>>
>> On Mon, May 5, 2014 at 4:16 PM, John H Palmieri <jhpalm...@gmail.com>
>> wrote:
>> >> -leif
>> >>
>> >> P.S.:  If you haven't set MAKE, Sage "guesses" the number of threads to
>> >> use to build the Sage library as well as the docs, AFAIK.
>> >
>> >
>> > Right: Sage uses SAGE_NUM_THREADS to decide how many threads to use for
>> > building spkgs and docs. If it's set to a number, that value gets used.
>> > Otherwise, SAGE_NUM_THREADS gets set in src/bin/sage-env, using the
>> > Python
>> > program src/bin/sage-num-threads.py:
>> >
>> >     sage_num_threads_array=(`sage-num-threads.py 2>/dev/null || echo 1 2
>> > 1`)
>> >     SAGE_NUM_THREADS=${sage_num_threads_array[0]}
>> >
>> > This is documented in the installation manual, but maybe it should also
>> > be
>> > in the top-level README.txt.
>>
>> There's something confusing going on here still.   I just read the
>> source to sage-num-threads.py and it outputs 3 numbers. The first is 1
>> by default since I didn't set any environment variables, so despite my
>> having 12 cores, SAGE_NUM_THREADS is 1. The others are 8 and 12, but
>> according to sage-num-threads.py those are *only* used if I explicitly
>> request something to happen in parallel, e.g., "make ptest".    To
>> quote the docs:
>>
>>   "2) The number of threads to use when parallel execution is
>> explicitly asked for (e.g. sage -tp)"
>>
>> I definitely only typed "make test" in my clean Sage install, so I did
>> not explicitly ask for anything to be in parallel.
>
>
> Building spkgs is by parallel by default, but I think it should be limited
> by SAGE_NUM_THREADS.
>
>>
>> However, it looks
>> like the doc building is in parallel anyways, which is the point when
>> I ran out of RAM.   So something seems misleading.  Maybe 2 above
>> really is
>>
>>   "2) The number of threads to use when parallel execution is
>> explicitly asked for (e.g. sage -tp), or when building the
>> documentation (which is always in parallel!?)."
>
>
> No: the number of threads used for docbuilding comes from SAGE_NUM_THREADS.
> From src/doc/common/build_options.py:
>
>     # Number of threads to use for parallel-building the documentation.
>     NUM_THREADS = int(os.environ.get('SAGE_NUM_THREADS', 1))
>
> If you do "sage --sh -c 'export $SAGE_NUM_THREADS' " then you get "1",
> right? By the way, I searched for SAGE_NUM_THREADS_PARALLEL, and it is only
> used in src/sage/doctest/control.py, the doctesting framework.

Your command doesn't quite work... but yes, it's 1:

salvus@salvus-base:/usr/local/sage/sage-6.2.rc2$ sage --sh -c 'export
$SAGE_NUM_THREADS'
/bin/bash: line 0: export: `1': not a valid identifier
salvus@salvus-base:/usr/local/sage/sage-6.2.rc2$ sage -c
'print(os.environ["SAGE_NUM_THREADS"])'
1

OK, thanks for the clarification (I'm glad things are this way).  So
nothing is actually being built in parallel in my case.  So the docs
are perfectly fine, and I still have my original question about RAM
needed for building the Sag docs.

William


-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to