Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:07:42+00:00 2026-05-24T00:07:42+00:00

I have a serial code that looks something like that: sum = a; sum

  • 0

I have a serial code that looks something like that:

sum = a;
sum += b;
sum += c;
sum += d;

I would like to parallelize it to something like that:

temp1 = a + b     and in the same time     temp2 = c + d
sum = temp1 + temp2

How do I do it using Intel parallel studio tools?

Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:07:43+00:00Added an answer on May 24, 2026 at 12:07 am

    Assuming that all variables are of integral or floating point types, there is absolutely no sense to parallelize this code (in the sense of executing by different threads/cores), as the overhead will be much much higher than any benefit out of it. The applicable parallelism in this example is at the level of multiple computation units and/or vectorization on a single CPU. Optimizing compilers are sophisticated enough nowadays to exploit this automatically, without code changes; however if you wish you may explicitly use temporary variables, as in the second part of the question.

    And if you ask just out of curiosity: Intel Parallel Studio provides several ways to parallelize code. For example, let’s use Cilk keywords together with C++11 lambda functions:

    #include <cilk/cilk.h>
    ...
    temp = cilk_spawn [=]{ return a+b; }();
    sum = c+d;
    cilk_sync;
    sum += temp;
    

    Don’t expect to get performance out of that (see above), unless you use classes with a computational-heavy overloaded operator+.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a microcontroller that must download a large file from a PC serial
serial.write() method in pyserial seems to only send string data. I have arrays like
I want to read and write from serial using events/interrupts. Currently, I have it
I need to code a PHP script that would let me generate a pdf
I have an application for entering in serial numbers to a database. A serial
We have a small embedded system without any video or serial ports (i.e. we
I have a document with connection information to a device over a serial port.
I have a GSM modem connected via USB. The modem creates 2 serial ports.
Have just started using Google Chrome , and noticed in parts of our site,
Have you guys had any experiences (positive or negative) by placing your source code/solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.