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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:07:12+00:00 2026-06-06T00:07:12+00:00

The following short Fortran90 program crashes as long as it contains the MPI_GET call.

  • 0

The following short Fortran90 program crashes as long as it contains the MPI_GET call.
Rank 1 tries to read a value from rank 0 and hangs in MPI_WIN_UNLOCK. Rank 0 tries crashes in MPI_BARRIER with a segmentation fault.

I repeatedly check the syntax of the commands, but they seem to be right. Similiar code in C/C++ works on the same system.

I’m using OpenMPI 1.4.3 and gfortran 4.4.5.

PROGRAM mpitest
USE mpi
IMPLICIT NONE

INTEGER :: ierr, npe, rnk, win
INTEGER (KIND=MPI_ADDRESS_KIND) lowerbound, sizeofreal
REAL :: val = 1.0, oval = 2.0

CALL MPI_INIT( ierr )
CALL MPI_COMM_RANK( MPI_COMM_WORLD, rnk, ierr )
CALL MPI_COMM_SIZE( MPI_COMM_WORLD, npe, ierr )

CALL MPI_TYPE_GET_EXTENT(MPI_REAL, lowerbound, sizeofreal, ierr)

CALL MPI_WIN_CREATE(val, sizeofreal, sizeofreal, MPI_INFO_NULL, MPI_COMM_WORLD, win, ierr)

IF( rnk .EQ. 1 ) THEN
   CALL MPI_WIN_LOCK( MPI_LOCK_SHARED, 0, 0, win, ierr )
   CALL MPI_GET( oval, 1, MPI_REAL, 0, 0, 1, MPI_REAL, win, ierr )
   CALL MPI_WIN_UNLOCK( 0, win, ierr )
END IF

CALL MPI_BARRIER( MPI_COMM_WORLD, ierr )
CALL MPI_WIN_FREE(win, ierr)
CALL MPI_FINALIZE(ierr)

END PROGRAM mpitest

mpif90 mpitest.f90
mpirun -n 2 ./a.out

*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0x34006020a0
[ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36420) [0x7f2d1c8c1420]
[ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x13ae70) [0x7f2d1c9c5e70]
[ 2] /usr/lib/libmpi.so.0(ompi_convertor_pack+0x199) [0x7f2d1c61d629]
[ 3] /usr/lib/openmpi/lib/openmpi/mca_osc_pt2pt.so(+0x56b0) [0x7f2d166876b0]
[ 4] /usr/lib/openmpi/lib/openmpi/mca_osc_pt2pt.so(+0x3a81) [0x7f2d16685a81]
[ 5] /usr/lib/openmpi/lib/openmpi/mca_osc_pt2pt.so(+0x23ac) [0x7f2d166843ac]
[ 6] /usr/lib/libopen-pal.so.0(opal_progress+0x5b) [0x7f2d1ba700db]
[ 7] /usr/lib/libmpi.so.0(+0x35635) [0x7f2d1c60f635]
[ 8] /usr/lib/openmpi/lib/openmpi/mca_coll_tuned.so(+0x1afa) [0x7f2d1688eafa]
[ 9] /usr/lib/openmpi/lib/openmpi/mca_coll_tuned.so(+0x958f) [0x7f2d1689658f]
[10] /usr/lib/libmpi.so.0(MPI_Barrier+0x8d) [0x7f2d1c6250cd]
[11] /usr/lib/libmpi_f77.so.0(PMPI_BARRIER+0x13) [0x7f2d1cf661d3]
[12] ./a.out() [0x401003]
[13] ./a.out(main+0x34) [0x401058]
[14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f2d1c8ac30d]
[15] ./a.out() [0x400da9]
*** End of error message ***
  • 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-06-06T00:07:14+00:00Added an answer on June 6, 2026 at 12:07 am

    This is a tricky one, but a clue comes from the fact that the segfault occurs here in an unrelated and utterly safe routine, MPI_Barrier(). The problem is that there’s stack corruption.

    The underlying problem is just an argument kind mismatch (which I’d have hoped that the MPI Fortran bindings would have caught, but didn’t). The target displacement argument to MPI_Get is an integer of kind MPI_ADDRESS_KIND, but you’re just passing it an integer.

    If you use lowerbound as your target offset, or promote the 0 you pass in to be of kind MPI_ADDRESS_KIND explicitly, your program works.

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

Sidebar

Related Questions

The following is a short clock program from the book programming in the key
The following short but complete example program const long iterations = 1000000000; T[] array
Consider the following short program: #include <type_traits> #include <iostream> using namespace std; template <typename
In short, currently I am using the following code to pull records from multiple
I'm using the following query to extract the frequent short values from a mediumblob
I'm using the following short program to test std::clock() : #include <ctime> #include <iostream>
In the following short program: use Template; my $template = Template->new (INCLUDE_PATH => .);
Short question. I have the following situation: function callbackTest(data, callback) { callback.call(data); } var
Consider the following C code: struct Foo { short a; long b; char c;
I have the following code: boolean Short = x(); boolean Long = y(); boolean

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.