Problem is to search a string of maximum length of 10bytes in a file of size 20gb. File contains one string in one line. I am writing parallel programming to do this. I just divided the file into p processes of about (Number of bytes in the file / P) bytes and read this much chunk by all processes parallely. After this i searched a string in all the processes at the same time.
So i just want to stop searching in all the other processes when meanwhile i get match of string in any one process, to get benefit of parallel programming.
How we can stop execution of other processes?
Not sure if it is the most elegant way, but once one process found a matching string, it can MPI_Isend() to all processes that no more work needs to be done.
Every process will check once in a while using MPI_Iprobe() if there is a msg waiting, and if there is: accept it using MPI_Rccv() and the process can now terminate itself elegantly.