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

  • Home
  • SEARCH
  • 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 7683791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:52:37+00:00 2026-05-31T18:52:37+00:00

I am trying to parallelize my code using openmp. I have managed to parallelize

  • 0

I am trying to parallelize my code using openmp. I have managed to parallelize most of my code except one part. From my knowledge the following part cannot be parallelized but I thought of having a different opinion. Any suggestions would be appreciated. If possible the inner 2 for loops can be parallelized it will be great.

for (o = 0; o < octaves; ++o)
  for ( i = 0; i <= 1; ++i)
    {
      b = responseMap.at(filter_map[o][i]);
      m = responseMap.at(filter_map[o][i+1]);
      t = responseMap.at(filter_map[o][i+2]);

      // loop over middle response layer at density of the most 
      // sparse layer (always top), to find maxima across scale and space

      for ( r = 0; r < t->height; ++r)
        {
          for (c = 0; c < t->width; ++c)
            {
              if (isExtremum(r, c, t, m, b))
                {
                  interpolateExtremum(r, c, t, m, b);
                }
            }
        }
    }
  • 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-31T18:52:39+00:00Added an answer on May 31, 2026 at 6:52 pm

    Well let’s see here: r and c are local variables inside the loops. t, m and b seem to be read-only shared state for the inner loops. If the isExtremum and interpolateExtremum are pure functions (they don’t produce side-effects), then you can safely slap a parallel for on the inner loops:

      #pragma omp parallel for private(r, c)
      for ( r = 0; r < t->height; ++r)
        {
          for (c = 0; c < t->width; ++c)
            {
              if (isExtremum(r, c, t, m, b))
                {
                  interpolateExtremum(r, c, t, m, b);
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to work out how to parallelize some code from data mining
I am trying to parallelize some Image Matching code written in OpenCV using TBB.
I am trying to parallelise a code using scala actors. That is my first
I have the following the code: int myArray[] = {0, 0, 0, 0, 0,
I'm trying to a parallelize an application using multiprocessing which takes in a very
I am trying to parallize a program I am using and got the following
I am trying to get a parallel effect in C++ program using the following
Trying to launch and pass tel. no. to skype by this code from my
I'm trying to parallelise the Floyd-Warshall algorithm using OpenMP (basically editing a 2D array
I'm trying to use doSMP / foreach to parallelize some code in R. I

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.