none
mpi for loop always running RRS feed

  • Question

  • I compile mpi program to  distribute iy & ix

    In mpitree.cpp :

    ny = 151 ; nx = 13 ;
    
    
    
    for (long l = 0; l < nx*ny; l += 16)
    
    
    
    	{
    
    
    
    		if(myid == 0)
    
    
    
    		{
    
    
    
    			for(j = 1; j < 16; j++)
    
    
    
    			{
    
    
    
    				iy = (l + j) / nx;	
    
    
    
    				ix = (l + j) % nx;	
    
    
    
    				MPI_Send ((void *)&iy, 1, MPI_INT, j, itag, MPI_COMM_WORLD);
    
    
    
    				MPI_Send ((void *)&ix, 1, MPI_INT, j, itag1, MPI_COMM_WORLD);
    
    
    
    			}
    
    
    
    			iy = l / nx;	
    
    
    
    			ix = l % nx;	
    
    
    
    			tree(myid, iy, ix);
    
    
    
    			
    
    
    
    		}
    
    
    
    		else
    
    
    
    		{
    
    
    
    			MPI_Recv ((void *)&iy, 1, MPI_INT, 0, itag, MPI_COMM_WORLD , istat);
    
    
    
    			MPI_Recv ((void *)&ix, 1, MPI_INT, 0, itag1, MPI_COMM_WORLD , istat);
    
    
    
    			tree(myid, iy, ix);
    
    
    
    		}
    
    
    
    		MPI_Barrier(MPI_COMM_WORLD);
    
    
    
    		
    
    
    
    	}
    
    
    
    

    When it will run l=176 , but it  don't  run l=182 and HPC Cluster manager "State" is runnung .

    Everytime it only  run l=0~166 (+=16) .....

    What happen is it ? How can I slove this problem ?

    If you are interest this problem ,please check my code :

    http://www.xun6.com/file/03961d3a8/code.rar.html 

    • Edited by YuJinSu Tuesday, May 18, 2010 2:49 PM
    Tuesday, May 18, 2010 1:16 PM

Answers

All replies

  • Hi YuJin,

    Can you try the MSMPI debugger to debug your program? You can get it in 2 ways:

    1) In Visual studio 2010, the MSMPI debugger is built in.

    2) In Visual Studio 2008, you can download the addin from HPC web site. see http://msdn.microsoft.com/en-us/library/dd560808.aspx

    Hope it helps,

    Thanks,

    Liwei

     

    • Marked as answer by YuJinSu Wednesday, May 26, 2010 3:32 AM
    Tuesday, May 18, 2010 2:22 PM
  • Hi YuJin,

    Can you try the MSMPI debugger to debug your program? You can get it in 2 ways:

    1) In Visual studio 2010, the MSMPI debugger is built in.

    2) In Visual Studio 2008, you can download the addin from HPC web site. see http://msdn.microsoft.com/en-us/library/dd560808.aspx

    Hope it helps,

    Thanks,

    Liwei

     


    Thank your propose.....

    I compile code by  Visual Studio 2008,so I will try NO.2 way.

    And than I will report to you after try it.

    • Marked as answer by YuJinSu Wednesday, May 26, 2010 3:31 AM
    • Unmarked as answer by YuJinSu Wednesday, May 26, 2010 3:31 AM
    Tuesday, May 18, 2010 2:51 PM
  • Hi YuJin,

    Can you try the MSMPI debugger to debug your program? You can get it in 2 ways:

    1) In Visual studio 2010, the MSMPI debugger is built in.

    2) In Visual Studio 2008, you can download the addin from HPC web site. see http://msdn.microsoft.com/en-us/library/dd560808.aspx

    Hope it helps,

    Thanks,

    Liwei

     

     

     

    I read the web site http://msdn.microsoft.com/en-us/library/dd560808.aspx , I don't found message for Visual Studio 2008.

    Web site content seemingly describe for Visual studio 2010.

    Maybe I am blind >"<
     

    Wednesday, May 19, 2010 2:14 AM
  • Hi YuJin,

    Can you try the MSMPI debugger to debug your program? You can get it in 2 ways:

    1) In Visual studio 2010, the MSMPI debugger is built in.

    2) In Visual Studio 2008, you can download the addin from HPC web site. see http://msdn.microsoft.com/en-us/library/dd560808.aspx

    Hope it helps,

    Thanks,

    Liwei

     


    Thank your propose.....

    I compile code by  Visual Studio 2008,so I will try NO.2 way.

    And than I will report to you after try it.

    I install Visual Studio 2010 ,so I try first way.
    Wednesday, May 26, 2010 3:31 AM