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 7620177
In Process

The Archive Base Latest Questions

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

I am writing a program in C (a 2d poisson solver) and I am

  • 0

I am writing a program in C (a 2d poisson solver) and I am using openMP to speed-up a big for loop. What I observed is that inside an openMP parallel block, the for loop is not vectorized even in the case where I include the #pragma always vector directive. For the compilation I am using the pathscale compiler.

The code I want to vectorize looks like this :

  #pragma omp parallel shared(in, out, lambda,dim,C) private(k)
     {
            #pragma omp for  schedule(guided,dim/nthreads)  nowait  
            for(k = 0;k < dim; k++){
                    in[k]  = C*out[k]*lambda[k];
            }
    }

where out,lambda and in are double precision arrays.

But even if I include #pragma always vector, what the compiler answers is :

 warning: ignoring #pragma always vector

Do you know if there is any workaround for this?

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-31T03:52:36+00:00Added an answer on May 31, 2026 at 3:52 am

    I looked through the User Guide for the PathScale compiler, and did not find neither #pragma always nor #pragma vector. So I think the compiler just tells you that it does not recognize this pragma, and ignores it.

    However in section 7.4.5 I found the following options that should help you with vectorization:

    Vectorization of user code … is controlled by the flag -LNO:simd[=(0|1|2)], which enables or disables inner loop vectorization. 0 turns off the vectorizer, 1 (the default) causes the compiler to vectorize only if it can determine that there is no undesirable performance impact due to sub-optimal alignment, and 2 will vectorize without any constraints (this is the most aggressive).

    -LNO:simd_verbose=ON prints vectorizer information (from vectorizing user code) to stdout.

    As a side note (guessing where you could take that #pragma always vector from), Intel’s compiler has #pragma vector with always being one possible parameter to the pragma. But pragmas are generally compiler-specific, except for few extensions (OpenMP being one) that are supported by multiple vendors.

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

Sidebar

Related Questions

I am writing a program using the Sleuth Kit Library that is designed to
Im writing a program that should read input via stdin, so I have the
I'm writing a program that sends an email out at a client's specific local
If you are writing a program that is executable from the command line, you
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I'm writing a program that uses SetWindowRgn to make transparent holes in a window
I am writing a program in Python that will act as a server and
I'm writing a program that contains a generational garbage collector. There are just two
I am writing a program that will draw a solid along the curve of
I am writing a program and have some code inside a string. This code

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.