Add psutil as standard package

92 views
Skip to first unread message

Jeroen Demeyer

unread,
Sep 7, 2016, 8:28:35 AM9/7/16
to sage-devel
Hello,

at https://trac.sagemath.org/ticket/21421 we propose to add the Python
package "psutil" as standard package for Sage. The tarball is 308KB,
installed it is about 624KB. The use case is replacing
src/sage/misc/memory_info.py

From https://pypi.python.org/pypi/psutil

psutil is a cross-platform library for retrieving information on running
processes and system utilization (CPU, memory, disks, network) in Python.


[ ] I agree, let's make psutil standard
[ ] I don't want psutil in Sage


Jeroen.

Jean-Pierre Flori

unread,
Sep 7, 2016, 8:35:21 AM9/7/16
to sage-devel
  [x] I agree, let's make psutil standard  

Vincent Delecroix

unread,
Sep 7, 2016, 8:48:04 AM9/7/16
to sage-...@googlegroups.com
Under the assumption that there is nothing more in memory_info.py than
in psutil

[ ] I agree, let's make psutil standard

Do you have an open ticket for testing psutil replacements?

Jeroen Demeyer

unread,
Sep 7, 2016, 8:51:04 AM9/7/16
to sage-...@googlegroups.com
On 2016-09-07 14:48, Vincent Delecroix wrote:
> Under the assumption that there is nothing more in memory_info.py than
> in psutil

Well, psutil goes way beyond what memory_info.py provides. The only
logic that we would still need to keep from memory_info.py is these few
lines, which can easily be inlined in the place where we need them:

limit = self.rlimit_address_space()
if limit < 0:
limit = self.total_swap() + self.total_ram()

# Use less than half of the addressable memory
return min(maxsize, limit)

> Do you have an open ticket for testing psutil replacements?

Not yet.

leif

unread,
Sep 7, 2016, 9:01:22 AM9/7/16
to sage-...@googlegroups.com
Jean-Pierre Flori wrote:
> [x] I agree, let's make psutil standard

[x] I agree

[x] Why is it that large?


-leif


leif

unread,
Sep 7, 2016, 9:09:55 AM9/7/16
to sage-...@googlegroups.com
[x] Use it in other places as well
(related to multiprocessing, such as
doctesting, docbuilding, building the
Sage library -- in the long run)


-leif


Travis Scrimshaw

unread,
Sep 7, 2016, 10:15:46 AM9/7/16
to sage-devel

[X] I agree, let's make psutil standard 
[ ] I don't want psutil in Sage

Best,
Travis


Thierry

unread,
Sep 7, 2016, 10:19:23 AM9/7/16
to sage-...@googlegroups.com
On Wed, Sep 07, 2016 at 02:28:31PM +0200, Jeroen Demeyer wrote:
> Hello,
>
> at https://trac.sagemath.org/ticket/21421 we propose to add the Python
> package "psutil" as standard package for Sage. The tarball is 308KB,
> installed it is about 624KB. The use case is replacing
> src/sage/misc/memory_info.py
>
> From https://pypi.python.org/pypi/psutil
>
> psutil is a cross-platform library for retrieving information on running
> processes and system utilization (CPU, memory, disks, network) in Python.
>
>
> [X] I agree, let's make psutil standard

And contribute to the demiscification of Sage :P

Ciao,
Thierry


> [ ] I don't want psutil in Sage
>
>
> Jeroen.
>
> --
> 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+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

Erik Bray

unread,
Sep 7, 2016, 10:46:59 AM9/7/16
to sage-devel
On Wed, Sep 7, 2016 at 2:28 PM, Jeroen Demeyer <jdem...@cage.ugent.be> wrote:
> [ x ] I agree, let's make psutil standard

I've used psutil in the past; it's a nice package.

William Stein

unread,
Sep 7, 2016, 11:09:08 AM9/7/16
to sage-devel
On Wed, Sep 7, 2016 at 5:28 AM, Jeroen Demeyer <jdem...@cage.ugent.be> wrote:
> Hello,
>
> at https://trac.sagemath.org/ticket/21421 we propose to add the Python
> package "psutil" as standard package for Sage. The tarball is 308KB,
> installed it is about 624KB. The use case is replacing
> src/sage/misc/memory_info.py
>
> From https://pypi.python.org/pypi/psutil
>
> psutil is a cross-platform library for retrieving information on running
> processes and system utilization (CPU, memory, disks, network) in Python.
>
>

[x] I agree, let's make psutil standard

Yes, I'm so glad we can do this right and not have to maintain code
ourselves for this problem! I spent way too much time on this stuff
in the early days of sage with ugly hacks (like running top and
parsing the output)...

William

--
William (http://wstein.org)

Thierry Dumont

unread,
Sep 7, 2016, 11:26:37 AM9/7/16
to sage-...@googlegroups.com

[x] I agree, let's make psutil standard

tdumont.vcf

leif

unread,
Sep 7, 2016, 12:17:44 PM9/7/16
to sage-...@googlegroups.com
Thierry wrote:
> On Wed, Sep 07, 2016 at 02:28:31PM +0200, Jeroen Demeyer wrote:
>> Hello,
>>
>> at https://trac.sagemath.org/ticket/21421 we propose to add the Python
>> package "psutil" as standard package for Sage. The tarball is 308KB,
>> installed it is about 624KB. The use case is replacing
>> src/sage/misc/memory_info.py
>>
>> From https://pypi.python.org/pypi/psutil
>>
>> psutil is a cross-platform library for retrieving information on running
>> processes and system utilization (CPU, memory, disks, network) in Python.
>>
>>
>> [X] I agree, let's make psutil standard
>
> And contribute to the demiscification of Sage :P

ROFL, I first read "descientification" (for whatever reason...)


-leif


Jeroen Demeyer

unread,
Sep 8, 2016, 3:07:47 AM9/8/16
to sage-...@googlegroups.com
On 2016-09-07 15:09, leif wrote:
> [x] Use it in other places as well
> (related to multiprocessing, such as
> doctesting, docbuilding, building the
> Sage library -- in the long run)

It's not a multiprocessing package. It's more a replacement for typical
Unix command-line tools like "ps", "free", "killall", ...

Jeroen Demeyer

unread,
Sep 8, 2016, 3:09:03 AM9/8/16
to sage-...@googlegroups.com
On 2016-09-07 17:08, William Stein wrote:
> like running top and parsing the output...

Yes, there was a big "WTF?" moment when I saw that :-)

leif

unread,
Sep 8, 2016, 4:24:17 AM9/8/16
to sage-...@googlegroups.com
That's why I said "use it in places related to", not "replace
multiprocessing by it".

I.e., be smarter w.r.t. resource usage when doing multiprocessing. Also
some messages could add relevant info obtained through psutil.


-leif


William Stein

unread,
Sep 8, 2016, 7:57:20 AM9/8/16
to sage-...@googlegroups.com
Imagine it is early 2006, that there are only two users of sage, and you don't know if there will ever be a third.   Then it is less wtf...

 

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.
Reply all
Reply to author
Forward
0 new messages