Opened 3 years ago

Last modified 12 days ago

#28226 new defect

crun profiler Ipython magic fails

Reported by: Vincent Delecroix Owned by:
Priority: major Milestone: sage-9.8
Component: interfaces Keywords: days100
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Even though I have the google perf tools installed (archlinux) the IPython magic command %crun consistently fails

sage: %crun (2**179 + 1).factor()
Using local file /opt/sage/sage-py3-gcc/local/bin/python3.
Using local file /home/vincent/.sage/temp/mangouste/1954/tmp_yf6kdnqc.perf.
substr outside of string at /usr/bin/pprof line 3695.
Use of uninitialized value in string eq at /usr/bin/pprof line 3695.
substr outside of string at /usr/bin/pprof line 3697.
Use of uninitialized value in string eq at /usr/bin/pprof line 3697.
/home/vincent/.sage/temp/mangouste/1954/tmp_yf6kdnqc.perf: header size >= 2**16
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-46-97fe85432fe5> in <module>()
----> 1 get_ipython().magic('crun (2**179 + 1).factor()')

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
   2158         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2159         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2160         return self.run_line_magic(magic_name, magic_arg_s)
   2161 
   2162     #-------------------------------------------------------------------------

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
   2079                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2080             with self.builtin_trap:
-> 2081                 result = fn(*args,**kwargs)
   2082             return result
   2083 

</opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/decorator.py:decorator-gen-113> in crun(self, s)

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    186     # but it's overkill for just that one bit of state.
    187     def magic_deco(arg):
--> 188         call = lambda f, *a, **k: f(*a, **k)
    189 
    190         if callable(arg):

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/sage/repl/ipython_extension.py in crun(self, s)
     91         """
     92         import sage.misc.gperftools
---> 93         sage.misc.gperftools.crun(s, evaluator=self.shell.ex)
     94 
     95     @line_magic

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/sage/misc/gperftools.py in crun(s, evaluator)
    374     finally:
    375         prof.stop()
--> 376     prof.top()
    377 
    378 

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/sage/misc/gperftools.py in top(self, cumulative)
    297             args += ['--cum']
    298         args += ['--text', self._executable(), self.filename()]
--> 299         self._call_pprof(*args)
    300 
    301     def save(self, filename, cumulative=True, verbose=True):

/opt/sage/sage-py3-gcc/local/lib/python3.7/site-packages/sage/misc/gperftools.py in _call_pprof(self, *args, **kwds)
    271         """
    272         from subprocess import check_call
--> 273         check_call([self._pprof()] + list(args), **kwds)
    274 
    275     def top(self, cumulative=True):

/opt/sage/sage-py3-gcc/local/lib/python3.7/subprocess.py in check_call(*popenargs, **kwargs)
    345         if cmd is None:
    346             cmd = popenargs[0]
--> 347         raise CalledProcessError(retcode, cmd)
    348     return 0
    349 

CalledProcessError: Command '['pprof', '--cum', '--text', '/opt/sage/sage-py3-gcc/local/bin/python3', '/home/vincent/.sage/temp/mangouste/1954/tmp_yf6kdnqc.perf']' returned non-zero exit status 1.

Change History (8)

comment:1 Changed 3 years ago by Erik Bray

Milestone: sage-8.9sage-9.1

Ticket retargeted after milestone closed

comment:2 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.1sage-9.2

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

comment:3 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.2sage-9.3

comment:4 Changed 17 months ago by Matthias Köppe

Milestone: sage-9.3sage-9.4

Moving to 9.4, as 9.3 has been released.

comment:5 Changed 14 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:6 Changed 10 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:7 Changed 5 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:8 Changed 12 days ago by Matthias Köppe

Milestone: sage-9.7sage-9.8
Note: See TracTickets for help on using tickets.