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