Replaced some staticQueues with vectors for performance reasons
parent
066c1a5e62
commit
500403dbda
@ -1,32 +1,34 @@
|
|||||||
#include "MatchBoxPC.h"
|
#include "MatchBoxPC.h"
|
||||||
|
|
||||||
void queuesTransfer(staticQueue &U,
|
void queuesTransfer(staticQueue &U,
|
||||||
staticQueue &privateU,
|
staticQueue &privateU,
|
||||||
vector<MilanLongInt> &QLocalVtx,
|
vector<MilanLongInt> &QLocalVtx,
|
||||||
vector<MilanLongInt> &QGhostVtx,
|
vector<MilanLongInt> &QGhostVtx,
|
||||||
vector<MilanLongInt> &QMsgType,
|
vector<MilanLongInt> &QMsgType,
|
||||||
vector<MilanInt> &QOwner,
|
vector<MilanInt> &QOwner,
|
||||||
staticQueue &privateQLocalVtx,
|
vector<MilanLongInt> &privateQLocalVtx,
|
||||||
staticQueue &privateQGhostVtx,
|
vector<MilanLongInt> &privateQGhostVtx,
|
||||||
staticQueue &privateQMsgType,
|
vector<MilanLongInt> &privateQMsgType,
|
||||||
staticQueue &privateQOwner)
|
vector<MilanInt> &privateQOwner)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#pragma omp critical(U)
|
#pragma omp critical(U)
|
||||||
{
|
{
|
||||||
while (!privateU.empty())
|
while (!privateU.empty())
|
||||||
U.push_back(privateU.pop_back());
|
U.push_back(privateU.pop_back());
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma omp critical(privateMsg)
|
#pragma omp critical(sendMessageTransfer)
|
||||||
{
|
{
|
||||||
while (!privateQLocalVtx.empty())
|
|
||||||
{
|
QLocalVtx.insert(QLocalVtx.end(), privateQLocalVtx.begin(), privateQLocalVtx.end());
|
||||||
QLocalVtx.push_back(privateQLocalVtx.pop_back());
|
QGhostVtx.insert(QGhostVtx.end(), privateQGhostVtx.begin(), privateQGhostVtx.end());
|
||||||
QGhostVtx.push_back(privateQGhostVtx.pop_back());
|
QMsgType.insert(QMsgType.end(), privateQMsgType.begin(), privateQMsgType.end());
|
||||||
QMsgType.push_back(privateQMsgType.pop_back());
|
QOwner.insert(QOwner.end(), privateQOwner.begin(), privateQOwner.end());
|
||||||
QOwner.push_back(privateQOwner.pop_back());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
privateQLocalVtx.clear();
|
||||||
|
privateQGhostVtx.clear();
|
||||||
|
privateQMsgType.clear();
|
||||||
|
privateQOwner.clear();
|
||||||
}
|
}
|
Loading…
Reference in New Issue