mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Small simplifications and code cleanup
Non-functional simplifications.
This commit is contained in:
parent
0d6cdc0c6d
commit
3730ae1efb
1 changed files with 5 additions and 6 deletions
|
@ -127,21 +127,20 @@ bool getline(std::istream& input, std::string& str) {
|
|||
|
||||
// Some MPI implementations use busy-wait pooling, while we need yielding
|
||||
static MPI_Request reqInput = MPI_REQUEST_NULL;
|
||||
MPI_Ibarrier(InputComm, &reqInput);
|
||||
MPI_Ibcast(&size, 1, MPI_UNSIGNED_LONG, 0, InputComm, &reqInput);
|
||||
if (is_root())
|
||||
MPI_Wait(&reqInput, MPI_STATUS_IGNORE);
|
||||
else {
|
||||
while (true) {
|
||||
static int flag;
|
||||
int flag;
|
||||
MPI_Test(&reqInput, &flag, MPI_STATUS_IGNORE);
|
||||
if (flag)
|
||||
break;
|
||||
else
|
||||
else {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
}
|
||||
|
||||
MPI_Bcast(&size, 1, MPI_UNSIGNED_LONG, 0, InputComm);
|
||||
}
|
||||
if (!is_root())
|
||||
vec.resize(size);
|
||||
MPI_Bcast(vec.data(), size, MPI_CHAR, 0, InputComm);
|
||||
|
|
Loading…
Add table
Reference in a new issue