Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - MPI and buffer limits : (5 Items)
   
MPI and buffer limits  
Hi there, 

I am new to QNX. I am working with evaluation version on virtual machine( Linux Mint 18 as a host). I made an example 
code to learn IPC with MPI interface. Both client and sever process has two buffers of equal sizes: one is used for 
integer data transfer and other is used to receive string response from the server.  It works as long as the size of 
total memory is within ~1MB (*0.5 MB for client + *0.5 MB for server). After that it gives segmentation fault. I don't 
understand why.  I check the MsgSend interface and it say, "the maximum size for a one-part message-pass is pow(2, 31) 
− 1 (SSIZE_MAX)". I am not exceeding that limits.  Does anybody familiar with this behavior? If yes then please tell me
 how to resolve this segmentation fault. 

Thank you very much!
Re: MPI and buffer limits  
Please post your code.
And the QNX version you are using.
Re: MPI and buffer limits  
I've attached my code files with this response. Please have a look at it. I am using QNX 7.0.0 
Attachment: Text MPI.h 530 bytes Text main.c 957 bytes Text MPI.c 1.56 KB
Re: MPI and buffer limits  
Your problem doesn't have anything to do with IPC -- you are just exceeding your maximum stack size (which has a default
 of 512kB). In "main.c", lines 24 and 33, you declare local automatic send/receive buffers.
  		int send_buff[NumberOfWords];
  		  ...
		int receive_buff[NumberOfWords];

The program will try to allocate these on the stack, which gives you a much stricter limit in size. Try allocating from 
heap instead:
    		int *send_buff = malloc(NumberOfWords * sizeof(int));
    		  ...
    		int *receive_buff = malloc(NumberOfWords * sizeof(int));

With that change applied, things work nicely for me.

Best regards,
Thomas
Re: MPI and buffer limits  
Yes, you are right Thomas. Thank you very much for pointing it out :)