diff --git a/src/load_balance_general.c b/src/load_balance_general.c index e10806a6a23466fcc33361d4ead9650361fd7ed5..6523c0c8efa1f4566e8b2f8c9c9139641e2ebc0e 100644 --- a/src/load_balance_general.c +++ b/src/load_balance_general.c @@ -196,7 +196,6 @@ int worker_check_status() { * :param possible_donor: Fellow worker thread to beg for work from. */ void worker_send_request(thread_struct* thread_args_ptr, int possible_donor) { - int msg_status_flag = 0; char* log_msg = calloc(256, sizeof(char)); int req_buffer = 0; MPI_Request request_var; @@ -213,24 +212,8 @@ void worker_send_request(thread_struct* thread_args_ptr, int possible_donor) { exit(2); } - // Ensure thread isn't currently sending a message to this thread. If so, abort. - MPI_Iprobe(possible_donor, tag_work_request, MPI_COMM_WORLD, &msg_status_flag, MPI_STATUS_IGNORE); - if (msg_status_flag != 1) { - - sleep(1); - - // Ensure that there is still possible work to do. - if (worker_check_status() == 1) { - - // Double check that donor does not have waiting request. To try to prevent race conditions. - // (I don't know how to properly "mutex lock" out entirely separate processes, when they can't share memory) - MPI_Iprobe(possible_donor, tag_work_request, MPI_COMM_WORLD, &msg_status_flag, MPI_STATUS_IGNORE); - if (msg_status_flag != 1) { - // Initialilze interaction by sending a "begging message" for work. - MPI_Isend(&req_buffer, 1, MPI_INT, possible_donor, tag_work_request, MPI_COMM_WORLD, &request_var); - } - } - } + // Initialilze interaction by sending a "begging message" for work. + MPI_Isend(&req_buffer, 1, MPI_INT, possible_donor, tag_work_request, MPI_COMM_WORLD, &request_var); log("EXIT FUNCTION worker_send_request()"); log("");