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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:27:42+00:00 2026-05-27T17:27:42+00:00

I have a problem that I tried to ask about previously, but didn’t get

  • 0

I have a problem that I tried to ask about previously, but didn’t get far and have found new information and am hoping for greater help. The code is a hybrid MPI/OPENMP code that crashes with a segmentation fault when trying to run across several nodes (although it works if it is only executed on one node, being the one the master process is spawned from). There are static arrays in the problem, and I discovered that if the static arrays are “too big” it causes the seg fault, but if they are “small” everything runs fine. I also converted the code to dynamic memory allocation as a test, and this solves the problem … no matter the size (even the larger ones that failed in the static world), the code runs to completion just fine. This solution is not a long-term one though, as the test code is only that … a test code, there is a much bigger code that exhibits the same behavior and changing it to dynamic is not an option. I need to determine what is causing the static array seg fault situation.

Basically, what is the difference between how statically allocated and dynamically allocated memory is handled? What (beyond the things I have tried) should I try to get past this? I believe the problem is related to a system setting, probably one that only violates when jobs are passed through MPICH2, but are not a problem when logged into the node (hence why it runs fine on nodes that I’m currently logged into).

In my .bashrc file I have “ulimit -s unlimited“, “export OMP_STACKSIZE=4g” and “export KMP_STACKSIZE=4G” since I’m using the ifort compiler. I believe this must be a relatively simple fix but I can’t come by it.

If the violating program source code is desired I can send it out, but I think the description given here covers the problem, just let me know.

  • 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-27T17:27:43+00:00Added an answer on May 27, 2026 at 5:27 pm

    Statically allocated things appear on the stack, while dynamic is on the heap. That’s why small static arrays work fine while larger ones do not.

    Since you are using the ifort compiler, you can try compiling with -heap-arrays, but that will only put dynamically allocated arrays on the heap (ifort is unique in that “temporary” allocatable arrays may go on the stack, like those allocated in subprograms).

    The other thing to check is that the MPI job is actually letting you set your stack size. Try running mpirun -n <numprocs> ulimit -s and it should show all unlimited, otherwise it isn’t honoring your bashrc.

    You can try a bash script (myScript.sh) such as:

    #!/bin/bash
    ulimit -s unlimited
    ./myProg
    

    which would then be run with:

    mpiexec -n <numprocs> myScript.sh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I have a problem that I illustrated in this question but had no correct
i have a problem that i can't solve ! (sqlite3, but i think it
Got a little problem i asked about it before but maybe i didnt ask
I have tried again to ask the same question , but I ended up
In a couple of scripts that I use I have problem that is intermittent.
I have a problem that confuses my users, being that although an item is
I have the problem that an specific step in Ant can only be executed
I have a problem that I would like have solved via a SQL query.
I have a problem that I feel is best implimented in a stand alone
I have a problem that seems like its a result of a deadlock-situation. Whe

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.