mpi for loop run cuda crashed

I compile a program mpi+cuda .

The mpi.cpp is main distribute i & j

for ( i = 0; i <=20; i += 4 )


  for ( j = 20; j <= 50; j += 5)


	   cuda(); //enter cuda



But every run only i = 0 j = 40 , will next j =50 it is stop.

I get some mesage :

I can not solve this problem , how about you attitude this problem ?

That error message comes from the Microsoft C++ runtime library - it could be absolutely anything causing it, including something that has nothing to do with CUDA at all.

I don’t understand your mean , so I have to check my include .h file ?

No. You have to better define your problem. The error message comes from a low level compiler runtime library. Anything compiled or linked into the running application (CUDA, MPI, your code, Microsoft’s compiler runtime code) could be the cause. It is impossible to help based on only that Error message and the 7 lines of pseudo code you posted.

sorry… please download and check my code :

mpi.cpp is main distribute phi & theta and than enter cuda line in