On Sunday, 17 November 2013 19:09:00 Maciej Fijalkowski wrote:
> On Sun, Nov 17, 2013 at 6:22 PM, Tobias Oberstein
> 
> <[email protected]> wrote:
> > Hi,
> > 
> > the new FreeBSD buildslave has run the first time:
> > 
> > http://buildbot.pypy.org/builders/pypy-c-jit-freebsd-9-x86-64/builds/6
> > 
> > PyPy was built successfully, but there are a couple of issues:
> > 
> > https://bugs.pypy.org/issue1637
> > https://bugs.pypy.org/issue1638
> > https://bugs.pypy.org/issue1639
> > 
> > I'll address those.
> > 
> > There is another issue that bugs me .. look at the built times:
> > 
> > [Timer] Timings:
> > [Timer] annotate                       ---  576.0 s
> > [Timer] rtype_lltype                   --- 1323.7 s
> > [Timer] pyjitpl_lltype                 --- 1098.6 s
> > [Timer] backendopt_lltype              ---  314.2 s
> > [Timer] stackcheckinsertion_lltype     ---  161.5 s
> > [Timer] database_c                     ---  451.3 s
> > [Timer] source_c                       ---  668.5 s
> > [Timer] compile_c                      --- 2403.8 s
> > [Timer] ===========================================
> > [Timer] Total:                         --- 6997.6 s
> > 
> > and compare with "Linux 64 on allegro64":
> > 
> > [Timer] Timings:
> > [Timer] annotate                       ---  641.5 s
> > [Timer] rtype_lltype                   --- 1528.5 s
> > [Timer] pyjitpl_lltype                 ---  938.7 s
> > [Timer] backendopt_lltype              ---  242.2 s
> > [Timer] stackcheckinsertion_lltype     ---  206.8 s
> > [Timer] database_c                     ---  325.3 s
> > [Timer] source_c                       ---  357.7 s
> > [Timer] compile_c                      ---  246.4 s
> > [Timer] ===========================================
> > [Timer] Total:                         --- 4487.1 s
> > 
> > *****
> > 
> > Why the heck does "compile_c" take 10x the time on FreeBSD?
> > 
> > Note that FreeBSD builder uses Clang .. could that be a reason?
> > 
> > Any hints on that are welcome!
> > 
> > Cheers,
> > Tobias
> > 
> > 
> > 
> > _______________________________________________
> > pypy-dev mailing list
> > [email protected]
> > https://mail.python.org/mailman/listinfo/pypy-dev
> 
> I would guess because we can't guess the number of processors we don't
> parallelize the build correctly.

Hi,

Please see attached for a patch that fixes this.  It should be trivial to add 
support for the other bsd systems, however I am not sure where the other bsds 
put their sysctl.  

Tobias: can you please confirm if this patch works (please make sure there is 
no MAKEFLAGS specified).  The Ports Collection invokes the Makefile directly 
so never needed this.  

Regards
--- ./rpython/config/support.py~	2013-12-16 12:34:17.000000000 +0200
+++ ./rpython/config/support.py	2013-12-16 12:33:52.000000000 +0200
@@ -8,7 +8,9 @@
     if os.environ.get('MAKEFLAGS'):
         return 1    # don't override MAKEFLAGS.  This will call 'make' without any '-j' option
     if sys.platform == 'darwin':
-        return darwin_get_cpu_count()
+        return sysctl_get_cpu_count('/usr/sbin/sysctl')
+    elif sys.platform.startswith('freebsd'):
+        return sysctl_get_cpu_count('/sbin/sysctl')
     elif not sys.platform.startswith('linux'):
         return 1    # implement me
     try:
@@ -26,11 +28,10 @@
     except:
         return 1 # we really don't want to explode here, at worst we have 1
 
-def darwin_get_cpu_count(cmd = "/usr/sbin/sysctl hw.ncpu"):
+def sysctl_get_cpu_count(cmd, name='hw.ncpu'):
     try:
-        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
-        # 'hw.ncpu: 20'
-        count = proc.communicate()[0].rstrip()[8:]
+        proc = subprocess.Popen([cmd, '-n', name], stdout=subprocess.PIPE)
+        count = proc.communicate()[0]
         return int(count)
     except (OSError, ValueError):
         return 1

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to