Permalink
Browse files

Merge pull request #1986 from ghalliday/hthorallocator

Fix problems with hthor not caching allocators

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information...
2 parents 0e49e7e + b19674f commit c347d0bf7a8b172b0a7c1c837e878ef62be25b7e @richardkchapman richardkchapman committed Mar 27, 2012
Showing with 16 additions and 6 deletions.
  1. +2 −0 ecl/eclagent/eclagent.ipp
  2. +9 −3 ecl/eclagent/eclgraph.cpp
  3. +3 −3 ecl/hthor/hthor.cpp
  4. +2 −0 ecl/hthor/hthor.ipp
@@ -717,6 +717,8 @@ protected:
IAgentContext & agent;
Linked<IOutputMetaData> resultMeta;
Linked<IOutputMetaData> counterMeta;
+ Owned<IEngineRowAllocator> inputAllocator;
+ Owned<IEngineRowAllocator> counterAllocator;
unsigned activityId;
};
@@ -1812,15 +1812,19 @@ IHThorGraphResults * EclBoundLoopGraph::execute(void * counterRow, ConstPointerA
{
Owned<GraphResults> results = new GraphResults(3);
- IHThorGraphResult * inputResult = results->createResult(1, agent.queryCodeContext()->getRowAllocator(resultMeta, activityId));
+ if (!inputAllocator)
+ inputAllocator.setown(agent.queryCodeContext()->getRowAllocator(resultMeta, activityId));
+ IHThorGraphResult * inputResult = results->createResult(1, LINK(inputAllocator));
ForEachItemIn(i, rows)
inputResult->addRowOwn(rows.item(i));
rows.kill();
if (counterRow)
{
counterMeta.setown(new EclCounterMeta);
- IHThorGraphResult * counterResult = results->createResult(2, agent.queryCodeContext()->getRowAllocator(counterMeta, activityId));
+ if (!counterAllocator)
+ counterAllocator.setown(agent.queryCodeContext()->getRowAllocator(counterMeta, activityId));
+ IHThorGraphResult * counterResult = results->createResult(2, LINK(counterAllocator));
counterResult->addRowOwn(counterRow);
}
@@ -1835,7 +1839,9 @@ void EclBoundLoopGraph::execute(void * counterRow, IHThorGraphResults * graphLoo
if (counterRow)
{
counterMeta.setown(new EclCounterMeta);
- IHThorGraphResult * counterResult = results->createResult(0, agent.queryCodeContext()->getRowAllocator(counterMeta, activityId));
+ if (!counterAllocator)
+ counterAllocator.setown(agent.queryCodeContext()->getRowAllocator(counterMeta, activityId));
+ IHThorGraphResult * counterResult = results->createResult(0, LINK(counterAllocator));
counterResult->addRowOwn(counterRow);
}
View
@@ -8742,7 +8742,7 @@ CHThorLocalResultWriteActivity::CHThorLocalResultWriteActivity(IAgentContext &_a
void CHThorLocalResultWriteActivity::execute()
{
- IHThorGraphResult * result = graph->createResult(helper.querySequence(), agent.queryCodeContext()->getRowAllocator(input->queryOutputMeta(), activityId));
+ IHThorGraphResult * result = graph->createResult(helper.querySequence(), LINK(rowAllocator));
loop
{
const void *nextrec = input->nextInGroup();
@@ -8771,7 +8771,7 @@ CHThorLocalResultSpillActivity::CHThorLocalResultSpillActivity(IAgentContext &_a
void CHThorLocalResultSpillActivity::ready()
{
CHThorSimpleActivityBase::ready();
- result = graph->createResult(helper.querySequence(), agent.queryCodeContext()->getRowAllocator(outputMeta.queryOriginal(), activityId));
+ result = graph->createResult(helper.querySequence(), LINK(rowAllocator));
nullPending = false;
}
@@ -9023,7 +9023,7 @@ CHThorGraphLoopResultWriteActivity::CHThorGraphLoopResultWriteActivity(IAgentCon
void CHThorGraphLoopResultWriteActivity::execute()
{
- IHThorGraphResult * result = graph->createGraphLoopResult(agent.queryCodeContext()->getRowAllocator(input->queryOutputMeta(), activityId));
+ IHThorGraphResult * result = graph->createGraphLoopResult(LINK(rowAllocator));
loop
{
const void *nextrec = input->nextInGroup();
View
@@ -2444,6 +2444,7 @@ public:
CHThorLocalResultWriteActivity (IAgentContext &agent, unsigned _activityId, unsigned _subgraphId, IHThorLocalResultWriteArg &_arg, ThorActivityKind _kind, __int64 graphId);
virtual void execute();
+ virtual bool needsAllocator() const { return true; }
};
@@ -2568,6 +2569,7 @@ public:
CHThorGraphLoopResultWriteActivity (IAgentContext &agent, unsigned _activityId, unsigned _subgraphId, IHThorGraphLoopResultWriteArg &_arg, ThorActivityKind _kind, __int64 graphId);
virtual void execute();
+ virtual bool needsAllocator() const { return true; }
};

0 comments on commit c347d0b

Please sign in to comment.