Termination of all processes in MPI

The problem is finding the password in a large file of about 10 GB using MPI. I divided the file between different processes of the block size (Total number of bytes in file / P), where p is the number of processes for creating and applying my search logic in each process through a loop in parallel. I want to stop other processes when one process finds a solution.

So, to interrupt all other processes, I use the following two approaches.

  • The first approach is to call the MPI_Abort () function from the process whenever it finds a solution.
  • The second approach is to use the flag and set it whenever any process finds its solution. After setting this flag, send it to all other processes using the non-blocking send / recv / Iprobe function. Then mark this flag with each process using if(flag == 1) break; and do it ..

My first question is: which of these two methods is better and why?
       and the second - when I used the second approach, I got the following msg after successful completion ...

* An error occurred in MPI_Finalize * after MPI was completed *** MPI_ERRORS_ARE_FATAL (goodbye) [abc: 19150] Abort until MPI_INIT is completed; unable to guarantee that all other processes were killed!

* An error occurred in MPI_Finalize * after MPI was completed * MPI_ERRORS_ARE_FATAL (goodbye) [abc: 19151] Abort until MPI_INIT is completed; unable to guarantee that all other processes were killed!

+5
source share
1 answer

MPI_AbortDesigned for abnormal shutdown. The standard says:

int MPI_Abort(MPI_Comm comm, int errorcode)

This procedure makes the "best attempt" to abort all tasks in the comm group. This function does not require the caller to take any action with an error code.

Therefore, it really should be used only to free MPI as a last resort, and not as a regular exit flag.

, - - MPI_Finalize . , MPI_Finalize MPI .

+2

All Articles