Laël Cellier <lael.cell...@gmail.com> added the comment:

Unlike gcc, icc can pretty much parallelize everything while detecting cases 
like the mutexes used by the ɢɪʟ for deciding not to parallelize.

The requirement is to use a less conservative approach using -par-threshold97 
while using -par-schedule-auto -qoverride-limits -parallel -ipo1 -O3 ‑ip inside 
icc.cfg and CFLAGS at the same time.

The build does produce the main python C library, but the python interpreter 
using it doesn’t even start :
Program received signal SIGSEGV, Segmentation fault.
0x00007fffff6128b0 in _PyEval_EvalFrameDefault () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
(gdb) bt
#0  0x00007fffff6128b0 in _PyEval_EvalFrameDefault () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#1  0x00007fffff3d55bc in _PyEval_EvalCodeWithName () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#2  0x00007fffff3d474b in _PyFunction_Vectorcall () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#3  0x00007fffff60da57 in call_function () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#4  0x00007fffff613fb4 in _PyEval_EvalFrameDefault () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#5  0x00007fffff3d55bc in _PyEval_EvalCodeWithName () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#6  0x00007fffff4bbbb2 in builtin___build_class__ () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#7  0x00007fffff42d72a in cfunction_vectorcall_FASTCALL_KEYWORDS () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#8  0x00007fffff60da57 in call_function () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#9  0x00007fffff613fb4 in _PyEval_EvalFrameDefault () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#10 0x00007fffff3d55bc in _PyEval_EvalCodeWithName () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#11 0x00007fffff4ea2ff in exec_code_in_module () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#12 0x00007fffff4e9fdf in PyImport_ImportFrozenModuleObject () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#13 0x00007fffff4e9d8f in PyImport_ImportFrozenModule () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#14 0x00007fffff5e3643 in init_importlib () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#15 0x00007fffff5e442c in pycore_init_import_warnings () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#16 0x00007fffff5e45ac in pyinit_config () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#17 0x00007fffff5e4922 in pyinit_core () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#18 0x00007fffff5eb67c in Py_InitializeFromConfig () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#19 0x00007fffff5d8fd0 in pymain_init () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#20 0x00007fffff50e099 in pymain_main () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#21 0x00007fffff50e071 in Py_BytesMain () from 
/home/example/rpmbuild/BUILD/Python-3.8.3/libpython3.8.so.1.0
#22 0x00000000004011b5 in main ()

The point of doing this is about significant speedups at some intensive 
workloads like those handling large strings.

The configure script is already detecting case where icc is used in order to 
append ‑fp‑model fast=1. It looks like the same should be done where (on the 
specific files) it’s relevant (but I’m not having enough time to determines 
where not even to debug this).

A better approach in order to fix this would be to ensure thread safety at the 
relevant places if we consider gcc might one day be able to automatically 
parallelize at that level which means disabling the compiler option for icc is 
only a temporary fix at best.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40923>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to