Mpi 32 and 64 platform.

I have a vector or vector of type double and a vector of vector of size_t. I'm sending these vectors to different processors. My code is working as I expect in 32 bit platform. When I try to run in 64 bit platform I get the following errors, "Job abrobted" "terminated" "process exited without calling finalize"
I think this should have something to do with the size of double in 32 and 64 platform but I can't figure out what is that exactly. Any help would be appreciated.
Any help would be appreciated.


Make it easy for people to help you, the question is too vague.

You have asked lots of questions about MPI before.
I think this should have something to do with the size of double in 32 and 64 platform but I can't figure out what is that exactly. Any help would be appreciated.


Without seeing the code, why??

Could also be due to timing issues. Just because a program seems to work OK doesn't mean it's coded correctly - especially with multi-threading.

With multi-core processors, multiple threads execute in parallel. So any 'synchronisation' issues can be difficult to spot if things sometimes 'work'.

I once had a threading issue that only manifested itself (if at all) after several minutes of running. That was a nightmare to debug...
Last edited on
@seeplus thanks for your answer. I can't post the code because it's a huge code. But imagine this as a simple send and receive in mpi. I flattened the vector of vectors into vectors, then send them using mpi_send and other processors received them. I was working in 32 platform before and I tested all mpi commands and corporated functions and they were working properly. When I changed to 64 I got this problem. I just commented mpi_send and receive and copied the required information in all processors and I got the code working. That's why I say the only problem can be related to the size of variable which may differ in 32 and 64 platforms. I mean maybe something is being sent but there is not enough space for that to be received.
I think this should have something to do with the size of double in 32 and 64 platform

I don't.

Show (a minimal, but compileable) version of the code which causes the problem.

Make sure that your MPI libraries (you haven't actually said which OS or implementation you are using) are consistent with your platform.

Note that "vector of vector" is NOT a great arrangement in MPI, which distributes 1-d arrays amongst processors.

Simple debugging lines (with a few MPI_Barrier's to ensure synchronicity) should at least allow you to home in on the offending lines. Standard debuggers won't work aren't easy to use with MPI (well, maybe: https://www.open-mpi.org/faq/?category=debugging )
Last edited on
What does this very basic send/receive of a vector do on your 64-bit system? (Just use two processors).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <vector>
#include "mpi.h"
using namespace std;

int main( int argc, char* argv[] )
{
   int rank, nproc;
   MPI_Status stat;

   MPI_Init( &argc, &argv );
   MPI_Comm_size( MPI_COMM_WORLD, &nproc );
   MPI_Comm_rank( MPI_COMM_WORLD, &rank  );

   int tag = 1;
   if ( rank == 0 )                                   // Root processor (0)
   {
      vector<double> A = { 10, 20, 30, 40, 50 };                           // Some data
      int n = A.size();
      MPI_Send( &n, 1, MPI_INT, 1, tag, MPI_COMM_WORLD );                  // Send size
      MPI_Send( A.data(), n, MPI_DOUBLE, 1, tag, MPI_COMM_WORLD );         // Send data
   }
   else if ( rank == 1 )                              // Next processor (1)
   {
      int n;
      MPI_Recv( &n, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &stat );           // Receive size
      vector<double> B(n);                                                 // Allocate buffer
      MPI_Recv( B.data(), n, MPI_DOUBLE, 0, tag, MPI_COMM_WORLD, &stat );  // Receive data

      cout << "Processor " << rank << " received " << n << " pieces of data: ";
      for ( double x : B ) cout << x << " ";
      cout << '\n';
   }
   MPI_Finalize();
}


C:\c++>"C:\Program Files\Microsoft MPI\bin"\mpiexec -n 2 sendVector 
Processor 1 received 5 pieces of data: 10 20 30 40 50 




Microsoft MPI (https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi )
has separate libraries for 32-bit and 64-bit platforms in Windows. I would assume that is true for MPICH, OpenMPI etc as well, whether on Windows or linux or on any unix system.

So, make sure that you link to the appropriate libraries.
Last edited on
The operating system is 64-bit,x64-based processor. The libraries included are for 64x.
It gives me this error.

job aborted:
[ranks] message

[0] terminated

[1] process exited without calling finalize

---- error analysis -----
but works on 32 platform.
Maybe it helps as well to find the problem, A few days ago I got some strange errors in my system when running MPI. "The code execution cannot proceed because dll was not found" and "the application was unable to start correctly 0xc00007b". then I tried many things to fix this and at the end I repaired the drive c so I got rid of this.
I tried the possible solution in this page,
https://appuals.com/fix-error-0xc00007b-application-was-unable-to-start-correctly/
Last edited on
Confirm please: the error cited in your last post is for my code or yours?

(1) What operating system are you using? Windows, linux, whatever?
(2) What compiler are you using?
(3) What MPI implementation are you using? (MPICH, OpenMPI, Microsoft, ...?)

Are you sure that you aren't using 32-bit c++ libraries for your compiler? It looks like your set-up is wrong.


FWIW, I run from the command line, using the g++ compiler and Microsoft MPI. I usually compile and run individual code in single files with simple batch files:
set OPT1="C:\Program Files (x86)\Microsoft SDKs\MPI\Include"
set OPT2="C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\msmpi.lib"
g++ -Wall -pedantic -Wextra -I%OPT1% -o %1.exe %1.cpp %OPT2%

If I'm running in Fortran rather than C++ then I have more options open to me, and there I usually use the Intel compiler.
Last edited on
1) the operation system is windows 10 64 bit.
2) visual studio 2017
3)I am using Microsoft-MPI. I run your code in another system and it worked fine. but in my system it jsut worked on 32 bit. the other system is windows 10, 64 bit as well.
Last edited on
If you are using Visual Studio then you are presumably using the cl.exe compiler. You can compile from the command line with that as well.

A suitable batch file (m.bat, say) would be
set OPT1="C:\Program Files (x86)\Microsoft SDKs\MPI\Include"
set OPT2="C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\msmpi.lib"
cl /EHsc -I%OPT1% %1.cpp %OPT2%

which allows compilation with the command (assuming the file is called sendvector.cpp):
m sendvector

Then run it (I actually launched this from a batch file):
C:\c++>"C:\Program Files\Microsoft MPI\bin"\mpiexec -n 2 sendVector 
Processor 1 received 5 pieces of data: 10 20 30 40 50 


I have no idea how you convey your MPI link libraries to Visual Studio as I can't stand bloated software like that IDE. However, you would have to make sure they were the x64 ones if you want a 64-bit executable.


You don't say whether your "normal" c++ codes (without MPI) run on your 64-bit system. Make sure that your Visual Studio settings do compile for 64-bit - they may have been set to compile for a 32-bit subsystem, as your version appears to be relatively old.


Incidentally, does the executable that you created on the 32-bit system run "as-is" on the 64-bit one? I'm pretty sure that it should.



Last edited on
Topic archived. No new replies allowed.