queueTransfer optimization in processMatchedVertices

omp-walther
StefanoPetrilli 2 years ago
parent 9d1a416f99
commit e328f3969c

@ -65,8 +65,8 @@
using namespace std;
#define NUM_THREAD 4
#define UCHUNK 5
const int NUM_THREAD = 2;
const int UCHUNK = 50;
const MilanLongInt REQUEST = 1;
const MilanLongInt SUCCESS = 2;

@ -199,10 +199,11 @@ void processMatchedVertices(
Message[1] = w; // GHOST
Message[2] = REQUEST; // TYPE
// Send a Request (Asynchronous)
//#pragma omp master
// {
printf("Send case 2: (%ld, %ld, %ld)\n", Message[0], Message[1], Message[2]);
fflush(stdout);
MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
// }
#pragma omp atomic
(*msgActual)++;
}
@ -254,10 +255,10 @@ void processMatchedVertices(
Message[1] = w; // GHOST
Message[2] = FAILURE; // TYPE
// Send a Request (Asynchronous)
//#pragma omp master
// {
printf("Send case 4: (%ld, %ld, %ld)\n", Message[0], Message[1], Message[2]);
fflush(stdout);
MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
// }
#pragma omp atomic
(*msgActual)++;
}
@ -300,10 +301,9 @@ void processMatchedVertices(
Message[2] = SUCCESS; // TYPE
// Send a Request (Asynchronous)
//#pragma omp master
// {
// printf("Send case 5: (%ld, %ld, %ld)\n", Message[0], Message[1], Message[2]);
fflush(stdout);
MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
// }
#pragma omp atomic
(*msgActual)++;
}
@ -327,39 +327,17 @@ void processMatchedVertices(
} // End of switch
} // End of inner for
// TODO privateU.size() < UCHUNK could be commented but it generate errors, why?
if (privateU.size() > UCHUNK || U.empty())
{
#pragma omp critical(U)
{
while (!privateU.empty())
U.push_back(privateU.pop_back());
}
#ifndef error
#pragma omp critical(privateMsg)
{
while (!privateQLocalVtx.empty())
{
QLocalVtx.push_back(privateQLocalVtx.pop_back());
QGhostVtx.push_back(privateQGhostVtx.pop_back());
QMsgType.push_back(privateQMsgType.pop_back());
QOwner.push_back(privateQOwner.pop_back());
}
}
#endif
} // End of private.size()
}
} // End of outer for
} // End of while ( !U.empty() )
queuesTransfer(U, privateU, QLocalVtx,
QGhostVtx,
QMsgType, QOwner, privateQLocalVtx,
privateQGhostVtx,
privateQMsgType,
privateQOwner);
queuesTransfer(U, privateU, QLocalVtx,
QGhostVtx,
QMsgType, QOwner, privateQLocalVtx,
privateQGhostVtx,
privateQMsgType,
privateQOwner);
} // End of while ( !U.empty() )
#ifdef COUNT_LOCAL_VERTEX
printf("Count local vertexes: %ld for thread %d of processor %d\n",

@ -28,6 +28,8 @@ void processMessages(
staticQueue &U)
{
//#define PRINT_DEBUG_INFO_
MilanInt Sender;
MPI_Status computeStatus;
MilanLongInt bundleSize, w;
@ -92,6 +94,8 @@ void processMessages(
if (Message[2] == SIZEINFO)
{
//printf("Inizio sizeinfo\n");
fflush(stdout);
#ifdef PRINT_DEBUG_INFO_
cout << "\n(" << myRank << ")Received bundled message from Process " << Sender << " Size= " << Message[0] << endl;
@ -124,6 +128,9 @@ void processMessages(
cout << endl;
fflush(stdout);
#endif
//printf("Fine sizeinfo\n");
fflush(stdout);
}
else
{ // Just a single message:

Loading…
Cancel
Save