Software Archive
Read-only legacy content
17060 Discussions

Array notation and parallelisation

Nick_M_3
New Contributor I
1,031 Views

Does the Intel compiler currently attempt to parallelise array notation expressions?  If it does, I am failing dismally in persuading it to do so.  I use CILK_NWORKERS=4, and print both the wall clock and CPU.

If not, what would the recommended alternative be in any case where that were desirable?  To back off to loops and use OpenMP?

0 Kudos
6 Replies
Barry_T_Intel
Employee
1,031 Views

No, I don't believe it does.  You'll need to use an outer loop to specify the parallelism.  Any of the parallelism frameworks will work; cilk, TBB or OpenMP, to name a few.

    - Barry

0 Kudos
Nick_M_3
New Contributor I
1,031 Views

Thanks.  Not a problem.   It clarifies the code, anyway, much like Fortran sections.

0 Kudos
Georg_Z_Intel
Employee
1,031 Views
Hello, I should add here that the compiler can do it for sufficiently big loops that justify the overhead of threading if "/Qparallel" or "-parallel" (auto-parallelizer) is specified. However, OpenMP runtime will be used underneath. Hence you control it with OMP_NUM_THREADS. Best regards, Georg Zitzlsberger
0 Kudos
Barry_T_Intel
Employee
1,031 Views

Thanks for the correction, Georg.

    - Barry

0 Kudos
TimP
Honored Contributor III
1,031 Views

As mentioned above, the auto-parallel options invoke OpenMP, so don't mix well with Cilk(tm) Plus.  There might even be a case for the compiler throwing a warning if cilk_for is used with auto-parallelization.

Under OpenMP 4.0, combined vectorization and threaded parallelism for a long countable for loop may be specified by

#pragma omp parallel for simd

which is implemented in icc 14.0 "XE2013 SP1"

With auto-parallel, it probably requires tinkering with par-threshold or writing explicit inner and outer loops.

0 Kudos
Nick_M_3
New Contributor I
1,031 Views

Thanks very much.  I don't currently have access to icc 14.0, and generally avoid relying on the latest and greatest versions of compilers, because the people I deal with (and their collaborators) don't always control which version they have to use.  But I will split the OpenMP and CilkPlus usages, to minimise confusion.

A warning on auto-parallelization and CilkPlus would be useful, until and unless they work together.

0 Kudos
Reply