Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4974 Discussions

Can MPI one-sided lead to a lovelock or deadlock situation?

Ahmed_E_2
Beginner
908 Views

Concerning the MPI one-sided, I developed a code in which each regular rank allocates a huge amount of memory with (MPI_Alloc_mem). Only one rank exposes its allocation to the other ranks as shared memory. My code works fine. However, I notice the following if I run multiple ranks on the same machine, it is not working (sometimes it crashes and sometimes it just hang). if I run the master rank on a dedicated machine, and I run all other ranks on another machine, the code works again! I repeated my experiments several times and it is always the same case.

So, I have three questions:

  1. Would it be possible to tell any ideas about what may be happening? I use printf, as I do not have debugger like Alinea DDT

  2. Is it possible that a livelock happens because the master process which owns the actual data is preempted, while another process that may try to read the actual data is scheduled.

  3. How to know the way (Intel MPI) work? I mean there is no much information available on the standard of the MPI itself.

0 Kudos
2 Replies
Dmitry_D_Intel
Employee
908 Views

Hi Ahmed,

Would be great if you could share your code sample and an exact cmd line you use to run IMPI.

Information about configuration and IMPI version would help here as well.

If you wish to play with an intranode memory sharing, then I would recommend you to use MPI-3 functionality (MPI_Win_allocate_shared).

You may find description here: link

BR,

Dmitry

 

0 Kudos
Ahmed_E_2
Beginner
908 Views

 

 

Dmitry Durnov (Intel) wrote:

Hi Ahmed,

Would be great if you could share your code sample and an exact cmd line you use to run IMPI.

Information about configuration and IMPI version would help here as well.

If you wish to play with an intranode memory sharing, then I would recommend you to use MPI-3 functionality (MPI_Win_allocate_shared).

You may find description here: link

BR,

Dmitry

 

Hi Dmitry

The following is my cmd command

mpirun -n 40  ./executable

The following is a sample of my code

int id=0;
double start=0
double * global_scheduling_step=NULL;
MPI_Init(&argc,&argv);
MPI_Comm_rank ( MPI_COMM_WORLD ,&id );
if(id==DATAOWNER)
        {
                MPI_Alloc_mem(sizeof(int), MPI_INFO_NULL, &global_scheduling_step);
                *global_scheduling_step = 0;
                MPI_Win_create(global_scheduling_step, sizeof(int),sizeof(int), MPI_INFO_NULL,MPI_COMM_WORLD, &win_global_scheduling_step);
                
        }
        else
        {
             MPI_Win_create(NULL,0,sizeof(int), MPI_INFO_NULL,MPI_COMM_WORLD, &win_global_scheduling_step);       
        }
        // Do a large size of allocation using malloc

        while(start!=-1)
        {

                MPI_Win_lock(MPI_LOCK_EXCLUSIVE,DATAOWNER,0,win_global_scheduling_step);
                        MPI_Get_accumulate(&one,1,MPI_INT,&local_scheduling_step,1,MPI_INT,DATAOWNER,0,1,MPI_INT,MPI_SUM,win_global_scheduling_step);
                MPI_Win_unlock(DATAOWNER,win_global_scheduling_step);

                start = check(local_scheduling_step);
                if(start==-1)
                        break;     
                // dosomething
        }

MPI_Win_free(&win_global_scheduling_step);
MPI_Finalize();

Thanks for sharing the link. It is really nice, however, I do not want to play with intra-node SHM.   I mean I am trying to understand what happening.  

0 Kudos
Reply