|
|
|
@ -4,7 +4,8 @@
|
|
|
|
|
// TODO use task
|
|
|
|
|
// TODO destroy the locks
|
|
|
|
|
|
|
|
|
|
void clean(MilanInt myRank,
|
|
|
|
|
void clean(MilanLongInt NLVer,
|
|
|
|
|
MilanInt myRank,
|
|
|
|
|
MilanLongInt MessageIndex,
|
|
|
|
|
vector<MPI_Request> &SRequest,
|
|
|
|
|
vector<MPI_Status> &SStatus,
|
|
|
|
@ -15,10 +16,18 @@ void clean(MilanInt myRank,
|
|
|
|
|
MilanLongInt msgInd,
|
|
|
|
|
MilanLongInt *msgIndSent,
|
|
|
|
|
MilanLongInt NumMessagesBundled,
|
|
|
|
|
MilanReal *msgPercent)
|
|
|
|
|
MilanReal *msgPercent,
|
|
|
|
|
omp_lock_t *MateLock)
|
|
|
|
|
{
|
|
|
|
|
// Cleanup Phase
|
|
|
|
|
|
|
|
|
|
#pragma omp parallel
|
|
|
|
|
{
|
|
|
|
|
#pragma omp master
|
|
|
|
|
{
|
|
|
|
|
#pragma omp task
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
|
cout << "\n(" << myRank << ") Waitall= " << endl;
|
|
|
|
|
fflush(stdout);
|
|
|
|
@ -37,6 +46,7 @@ void clean(MilanInt myRank,
|
|
|
|
|
MPI_Buffer_detach(&Buffer, &BufferSize); // Detach the Buffer
|
|
|
|
|
free(Buffer); // Free the memory that was allocated
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
|
cout << "\n(" << myRank << ")End of function to compute matching: " << endl;
|
|
|
|
@ -60,6 +70,8 @@ void clean(MilanInt myRank,
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#pragma omp task
|
|
|
|
|
{
|
|
|
|
|
*msgActualSent = msgActual;
|
|
|
|
|
*msgIndSent = msgInd;
|
|
|
|
|
if (msgInd > 0)
|
|
|
|
@ -70,6 +82,11 @@ void clean(MilanInt myRank,
|
|
|
|
|
{
|
|
|
|
|
*msgPercent = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Destroy the locks
|
|
|
|
|
#pragma omp taskloop num_tasks(NUM_THREAD)
|
|
|
|
|
for (int i = 0; i < NLVer; i++)
|
|
|
|
|
omp_destroy_lock(&MateLock[i]);
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_HANG_
|
|
|
|
|
if (myRank == 0)
|
|
|
|
@ -77,3 +94,5 @@ void clean(MilanInt myRank,
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|