|
@@ -102,11 +102,13 @@ void loadDlls(IArray &objects, const char * libDirectory)
|
|
|
{
|
|
|
const char *thisDll = libFiles->query().queryFilename();
|
|
|
if (!strstr(thisDll, "javaembed")) // Bit of a hack, but loading this if java not present terminates...
|
|
|
- {
|
|
|
- LoadedObject *loaded = loadDll(thisDll);
|
|
|
- if (loaded)
|
|
|
- objects.append(*loaded);
|
|
|
- }
|
|
|
+ if (!strstr(thisDll, "py2embed")) // These two clash, so ...
|
|
|
+ if (!strstr(thisDll, "py3embed")) // ... best to load neither...
|
|
|
+ {
|
|
|
+ LoadedObject *loaded = loadDll(thisDll);
|
|
|
+ if (loaded)
|
|
|
+ objects.append(*loaded);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -280,6 +282,273 @@ class InternalStatisticsTest : public CppUnit::TestFixture
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION( InternalStatisticsTest );
|
|
|
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( InternalStatisticsTest, "StatisticsTest" );
|
|
|
|
|
|
+class PtreeThreadingTest : public CppUnit::TestFixture
|
|
|
+{
|
|
|
+ CPPUNIT_TEST_SUITE( PtreeThreadingTest );
|
|
|
+ CPPUNIT_TEST(testContention);
|
|
|
+ CPPUNIT_TEST_SUITE_END();
|
|
|
+
|
|
|
+ void testContention()
|
|
|
+ {
|
|
|
+ _testContention(ipt_lowmem);
|
|
|
+ _testContention(ipt_fast);
|
|
|
+ }
|
|
|
+ void _testContention(byte flags)
|
|
|
+ {
|
|
|
+ class casyncfor: public CAsyncFor
|
|
|
+ {
|
|
|
+ volatile int v;
|
|
|
+ void donothing()
|
|
|
+ {
|
|
|
+ v++;
|
|
|
+ }
|
|
|
+ byte flags = ipt_none;
|
|
|
+ int mode = 0;
|
|
|
+ int iterations = 0;
|
|
|
+ const char *desc = nullptr;
|
|
|
+
|
|
|
+ public:
|
|
|
+ casyncfor(const char *_desc, byte _flags, int _mode, int _iter)
|
|
|
+ : flags(_flags), mode(_mode), iterations(_iter), desc(_desc)
|
|
|
+ {
|
|
|
+ };
|
|
|
+ double For(unsigned num, unsigned maxatonce, double overhead = 0.0)
|
|
|
+ {
|
|
|
+ unsigned start = msTick();
|
|
|
+ CAsyncFor::For(num, maxatonce);
|
|
|
+ unsigned elapsed = msTick()-start;
|
|
|
+ double looptime = (elapsed * 1.0) / (iterations*num);
|
|
|
+ if (mode < 3)
|
|
|
+ DBGLOG("%s (%s) test completed in %d ms (%f ms/iter)", desc, flags & ipt_fast ? "fast" : "lowmem", elapsed, looptime-overhead);
|
|
|
+ return looptime;
|
|
|
+ }
|
|
|
+ void Do(unsigned i)
|
|
|
+ {
|
|
|
+ for (unsigned i = 0; i < iterations; i++)
|
|
|
+ {
|
|
|
+ Owned<IPropertyTree> p = mode >= 3 ? nullptr : createPTreeFromXMLString(
|
|
|
+ "<W_LOCAL buildVersion='community_6.0.0-trunk0Debug[heads/cass-wu-part3-0-g10b954-dirty]'"
|
|
|
+ " cloneable='1'"
|
|
|
+ " clusterName=''"
|
|
|
+ " codeVersion='158'"
|
|
|
+ " eclVersion='6.0.0'"
|
|
|
+ " hash='2796091347'"
|
|
|
+ " state='completed'"
|
|
|
+ " xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'>"
|
|
|
+ " <Debug>"
|
|
|
+ " <debugquery>1</debugquery>"
|
|
|
+ " <expandpersistinputdependencies>1</expandpersistinputdependencies>"
|
|
|
+ " <savecpptempfiles>1</savecpptempfiles>"
|
|
|
+ " <saveecltempfiles>1</saveecltempfiles>"
|
|
|
+ " <spanmultiplecpp>0</spanmultiplecpp>"
|
|
|
+ " <standaloneexe>1</standaloneexe>"
|
|
|
+ " <targetclustertype>hthor</targetclustertype>"
|
|
|
+ " </Debug>"
|
|
|
+ " <FilesRead>"
|
|
|
+ " <File name='myfile' useCount='2' cluster = 'mycluster'/>"
|
|
|
+ " <File name='mysuperfile' useCount='2' cluster = 'mycluster'>"
|
|
|
+ " <Subfile name='myfile'/>"
|
|
|
+ " </File>"
|
|
|
+ "</FilesRead>"
|
|
|
+ " <Graphs>"
|
|
|
+ " <Graph name='graph1' type='activities'>"
|
|
|
+ " <xgmml>"
|
|
|
+ " <graph wfid='2'>"
|
|
|
+ " <node id='1'>"
|
|
|
+ " <att>"
|
|
|
+ " <graph>"
|
|
|
+ " <att name='rootGraph' value='1'/>"
|
|
|
+ " <edge id='2_0' source='2' target='3'/>"
|
|
|
+ " <edge id='3_0' source='3' target='4'/>"
|
|
|
+ " <edge id='4_0' source='4' target='5'/>"
|
|
|
+ " <node id='2' label='Inline Row {1}'>"
|
|
|
+ " <att name='definition' value='./sets.ecl(2,13)'/>"
|
|
|
+ " <att name='_kind' value='148'/>"
|
|
|
+ " <att name='ecl' value='ROW(TRANSFORM({ integer8 v },SELF.v := 1;)); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " <att name='predictedCount' value='1'/>"
|
|
|
+ " </node>"
|
|
|
+ " <node id='3' label='Filter'>"
|
|
|
+ " <att name='definition' value='./sets.ecl(3,15)'/>"
|
|
|
+ " <att name='_kind' value='5'/>"
|
|
|
+ " <att name='ecl' value='FILTER(v = STORED('one')); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " <att name='predictedCount' value='0..?[disk]'/>"
|
|
|
+ " </node>"
|
|
|
+ " <node id='4' label='Count'>"
|
|
|
+ " <att name='_kind' value='125'/>"
|
|
|
+ " <att name='ecl' value='TABLE({ integer8 value := COUNT(group) }); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " <att name='predictedCount' value='1'/>"
|
|
|
+ " </node>"
|
|
|
+ " <node id='5' label='Store Internal('wf2')'>"
|
|
|
+ " <att name='_kind' value='22'/>"
|
|
|
+ " <att name='ecl' value='extractresult(value, named('wf2')); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " </node>"
|
|
|
+ " </graph>"
|
|
|
+ " </att>"
|
|
|
+ " </node>"
|
|
|
+ " </graph>"
|
|
|
+ " </xgmml>"
|
|
|
+ " </Graph>"
|
|
|
+ " <Graph name='graph2' type='activities'>"
|
|
|
+ " <xgmml>"
|
|
|
+ " <graph wfid='3'>"
|
|
|
+ " <node id='6'>"
|
|
|
+ " <att>"
|
|
|
+ " <graph>"
|
|
|
+ " <att name='rootGraph' value='1'/>"
|
|
|
+ " <edge id='7_0' source='7' target='8'/>"
|
|
|
+ " <edge id='8_0' source='8' target='9'/>"
|
|
|
+ " <node id='7' label='Inline Row {1}'>"
|
|
|
+ " <att name='definition' value='./sets.ecl(2,13)'/>"
|
|
|
+ " <att name='_kind' value='148'/>"
|
|
|
+ " <att name='ecl' value='ROW(TRANSFORM({ integer8 v },SELF.v := 1;)); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " <att name='predictedCount' value='1'/>"
|
|
|
+ " </node>"
|
|
|
+ " <node id='8' label='Filter'>"
|
|
|
+ " <att name='definition' value='./sets.ecl(5,1)'/>"
|
|
|
+ " <att name='_kind' value='5'/>"
|
|
|
+ " <att name='ecl' value='FILTER(v = INTERNAL('wf2')); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " <att name='predictedCount' value='0..?[disk]'/>"
|
|
|
+ " </node>"
|
|
|
+ " <node id='9' label='Output Result #1'>"
|
|
|
+ " <att name='definition' value='./sets.ecl(1,1)'/>"
|
|
|
+ " <att name='name' value='sets'/>"
|
|
|
+ " <att name='definition' value='./sets.ecl(5,1)'/>"
|
|
|
+ " <att name='_kind' value='16'/>"
|
|
|
+ " <att name='ecl' value='OUTPUT(..., workunit); '/>"
|
|
|
+ " <att name='recordSize' value='8'/>"
|
|
|
+ " </node>"
|
|
|
+ " </graph>"
|
|
|
+ " </att>"
|
|
|
+ " </node>"
|
|
|
+ " </graph>"
|
|
|
+ " </xgmml>"
|
|
|
+ " </Graph>"
|
|
|
+ " </Graphs>"
|
|
|
+ " <Query fetchEntire='1'>"
|
|
|
+ " <Associated>"
|
|
|
+ " <File desc='a.out.cpp'"
|
|
|
+ " filename='/Users/rchapman/HPCC-Platform/ossd/a.out.cpp'"
|
|
|
+ " ip='192.168.2.203'"
|
|
|
+ " type='cpp'/>"
|
|
|
+ " </Associated>"
|
|
|
+ " </Query>"
|
|
|
+ " <Results>"
|
|
|
+ " <Result isScalar='0'"
|
|
|
+ " name='Result 1'"
|
|
|
+ " recordSizeEntry='mf1'"
|
|
|
+ " rowLimit='-1'"
|
|
|
+ " sequence='0'"
|
|
|
+ " status='calculated'>"
|
|
|
+ " <rowCount>1</rowCount>"
|
|
|
+ " <SchemaRaw xsi:type='SOAP-ENC:base64'>"
|
|
|
+ " dgABCAEAGBAAAAB7IGludGVnZXI4IHYgfTsK </SchemaRaw>"
|
|
|
+ " <totalRowCount>1</totalRowCount>"
|
|
|
+ " <Value xsi:type='SOAP-ENC:base64'>"
|
|
|
+ " AQAAAAAAAAA= </Value>"
|
|
|
+ " </Result>"
|
|
|
+ " </Results>"
|
|
|
+ " <State>completed</State>"
|
|
|
+ " <Statistics>"
|
|
|
+ " <Statistic c='eclcc'"
|
|
|
+ " count='1'"
|
|
|
+ " creator='eclcc'"
|
|
|
+ " kind='TimeElapsed'"
|
|
|
+ " s='compile'"
|
|
|
+ " scope='compile:parseTime'"
|
|
|
+ " ts='1431603789722535'"
|
|
|
+ " unit='ns'"
|
|
|
+ " value='805622'/>"
|
|
|
+ " <Statistic c='unknown'"
|
|
|
+ " count='1'"
|
|
|
+ " creator='unknownRichards-iMac.local'"
|
|
|
+ " kind='WhenQueryStarted'"
|
|
|
+ " s='global'"
|
|
|
+ " scope='workunit'"
|
|
|
+ " ts='1431603790007020'"
|
|
|
+ " unit='ts'"
|
|
|
+ " value='1431603790007001'/>"
|
|
|
+ " <Statistic c='unknown'"
|
|
|
+ " count='1'"
|
|
|
+ " creator='unknownRichards-iMac.local'"
|
|
|
+ " desc='Graph graph1'"
|
|
|
+ " kind='TimeElapsed'"
|
|
|
+ " s='graph'"
|
|
|
+ " scope='graph1'"
|
|
|
+ " ts='1431603790007912'"
|
|
|
+ " unit='ns'"
|
|
|
+ " value='0'/>"
|
|
|
+ " </Statistics>"
|
|
|
+ " <Temporaries>"
|
|
|
+ " <Variable name='wf2' status='calculated'>"
|
|
|
+ " <rowCount>1</rowCount>"
|
|
|
+ " <totalRowCount>1</totalRowCount>"
|
|
|
+ " <Value xsi:type='SOAP-ENC:base64'>"
|
|
|
+ " AQAAAAAAAAA= </Value>"
|
|
|
+ " </Variable>"
|
|
|
+ " </Temporaries>"
|
|
|
+ " <Tracing>"
|
|
|
+ " <EclAgentBuild>community_6.0.0-trunk0Debug[heads/cass-wu-part3-0-g10b954-dirty]</EclAgentBuild>"
|
|
|
+ " </Tracing>"
|
|
|
+ " <Variables>"
|
|
|
+ " <Variable name='one' sequence='-1' status='calculated'>"
|
|
|
+ " <rowCount>1</rowCount>"
|
|
|
+ " <SchemaRaw xsi:type='SOAP-ENC:base64'>"
|
|
|
+ " b25lAAEIAQAYAAAAAA== </SchemaRaw>"
|
|
|
+ " <totalRowCount>1</totalRowCount>"
|
|
|
+ " <Value xsi:type='SOAP-ENC:base64'>"
|
|
|
+ " AQAAAAAAAAA= </Value>"
|
|
|
+ " </Variable>"
|
|
|
+ " </Variables>"
|
|
|
+ " <Workflow>"
|
|
|
+ " <Item mode='normal'"
|
|
|
+ " state='done'"
|
|
|
+ " type='normal'"
|
|
|
+ " wfid='1'/>"
|
|
|
+ " <Item mode='normal'"
|
|
|
+ " state='done'"
|
|
|
+ " type='normal'"
|
|
|
+ " wfid='2'>"
|
|
|
+ " <Dependency wfid='1'/>"
|
|
|
+ " </Item>"
|
|
|
+ " <Item mode='normal'"
|
|
|
+ " state='done'"
|
|
|
+ " type='normal'"
|
|
|
+ " wfid='3'>"
|
|
|
+ " <Dependency wfid='2'/>"
|
|
|
+ " <Schedule/>"
|
|
|
+ " </Item>"
|
|
|
+ " </Workflow>"
|
|
|
+ "</W_LOCAL>"
|
|
|
+ , flags);
|
|
|
+ switch(mode)
|
|
|
+ {
|
|
|
+ case 1: case 3: for (int j = 0; j < 100000; j++) donothing(); break;
|
|
|
+ case 2: case 4: for (int j = 0; j < 1000000; j++) donothing(); break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } max("maxContention",flags,0,1000),
|
|
|
+ some("someContention",flags,1,200),
|
|
|
+ min("minContention",flags,2,200),
|
|
|
+ csome("control some",flags,3,200),
|
|
|
+ cmin("control min",flags,4,200),
|
|
|
+ seq("single",flags,0,1000);
|
|
|
+ max.For(8,8);
|
|
|
+ some.For(8,8,csome.For(8,8));
|
|
|
+ min.For(8,8,cmin.For(8,8));
|
|
|
+ seq.For(8,1);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+CPPUNIT_TEST_SUITE_REGISTRATION( PtreeThreadingTest );
|
|
|
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PtreeThreadingTest, "PtreeThreadingTest" );
|
|
|
+
|
|
|
//MORE: This can't be included in jlib because of the dll dependency
|
|
|
class StringBufferTest : public CppUnit::TestFixture
|
|
|
{
|