Using real dynamic assignments for tests.
This commit is contained in:
parent
5bf03dec2b
commit
66c7b1f12d
1 changed files with 56 additions and 52 deletions
|
|
@ -24,7 +24,8 @@ struct Test
|
||||||
// These tests require at least 3 processes to be launched.
|
// These tests require at least 3 processes to be launched.
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
// eo::log << eo::setlevel( eo::debug );
|
eo::log << eo::setlevel( eo::debug );
|
||||||
|
bool launchOnlyOne = true;
|
||||||
MpiNode::init( argc, argv );
|
MpiNode::init( argc, argv );
|
||||||
|
|
||||||
vector<int> v;
|
vector<int> v;
|
||||||
|
|
@ -49,60 +50,63 @@ int main(int argc, char** argv)
|
||||||
tIntervalStatic.requiredNodesNumber = ALL;
|
tIntervalStatic.requiredNodesNumber = ALL;
|
||||||
tests.push_back( tIntervalStatic );
|
tests.push_back( tIntervalStatic );
|
||||||
|
|
||||||
Test tWorldStatic;
|
if( !launchOnlyOne )
|
||||||
tWorldStatic.assign = new StaticAssignmentAlgorithm( v.size() );
|
{
|
||||||
tWorldStatic.description = "Correct static assignment with whole world as workers.";
|
Test tWorldStatic;
|
||||||
tWorldStatic.requiredNodesNumber = ALL;
|
tWorldStatic.assign = new StaticAssignmentAlgorithm( v.size() );
|
||||||
tests.push_back( tWorldStatic );
|
tWorldStatic.description = "Correct static assignment with whole world as workers.";
|
||||||
|
tWorldStatic.requiredNodesNumber = ALL;
|
||||||
|
tests.push_back( tWorldStatic );
|
||||||
|
|
||||||
Test tStaticOverload;
|
Test tStaticOverload;
|
||||||
tStaticOverload.assign = new StaticAssignmentAlgorithm( v.size()+100 );
|
tStaticOverload.assign = new StaticAssignmentAlgorithm( v.size()+100 );
|
||||||
tStaticOverload.description = "Static assignment with too many runs.";
|
tStaticOverload.description = "Static assignment with too many runs.";
|
||||||
tStaticOverload.requiredNodesNumber = ALL;
|
tStaticOverload.requiredNodesNumber = ALL;
|
||||||
tests.push_back( tStaticOverload );
|
tests.push_back( tStaticOverload );
|
||||||
|
|
||||||
Test tUniqueStatic;
|
Test tUniqueStatic;
|
||||||
tUniqueStatic.assign = new StaticAssignmentAlgorithm( 1, v.size() );
|
tUniqueStatic.assign = new StaticAssignmentAlgorithm( 1, v.size() );
|
||||||
tUniqueStatic.description = "Correct static assignment with unique worker.";
|
tUniqueStatic.description = "Correct static assignment with unique worker.";
|
||||||
tUniqueStatic.requiredNodesNumber = 2;
|
tUniqueStatic.requiredNodesNumber = 2;
|
||||||
tests.push_back( tUniqueStatic );
|
tests.push_back( tUniqueStatic );
|
||||||
|
|
||||||
Test tVectorStatic;
|
Test tVectorStatic;
|
||||||
vector<int> workers;
|
vector<int> workers;
|
||||||
workers.push_back( 1 );
|
workers.push_back( 1 );
|
||||||
workers.push_back( 2 );
|
workers.push_back( 2 );
|
||||||
tVectorStatic.assign = new StaticAssignmentAlgorithm( workers, v.size() );
|
tVectorStatic.assign = new StaticAssignmentAlgorithm( workers, v.size() );
|
||||||
tVectorStatic.description = "Correct static assignment with precise workers specified.";
|
tVectorStatic.description = "Correct static assignment with precise workers specified.";
|
||||||
tVectorStatic.requiredNodesNumber = 3;
|
tVectorStatic.requiredNodesNumber = 3;
|
||||||
tests.push_back( tVectorStatic );
|
tests.push_back( tVectorStatic );
|
||||||
|
|
||||||
Test tIntervalDynamic;
|
Test tIntervalDynamic;
|
||||||
tIntervalDynamic.assign = new StaticAssignmentAlgorithm( 1, eo::REST_OF_THE_WORLD, v.size() );
|
tIntervalDynamic.assign = new DynamicAssignmentAlgorithm( 1, eo::REST_OF_THE_WORLD );
|
||||||
tIntervalDynamic.description = "Dynamic assignment with interval.";
|
tIntervalDynamic.description = "Dynamic assignment with interval.";
|
||||||
tIntervalDynamic.requiredNodesNumber = ALL;
|
tIntervalDynamic.requiredNodesNumber = ALL;
|
||||||
tests.push_back( tIntervalDynamic );
|
tests.push_back( tIntervalDynamic );
|
||||||
|
|
||||||
Test tUniqueDynamic;
|
Test tUniqueDynamic;
|
||||||
tUniqueDynamic.assign = new StaticAssignmentAlgorithm( 1, v.size() );
|
tUniqueDynamic.assign = new DynamicAssignmentAlgorithm( 1 );
|
||||||
tUniqueDynamic.description = "Dynamic assignment with unique worker.";
|
tUniqueDynamic.description = "Dynamic assignment with unique worker.";
|
||||||
tUniqueDynamic.requiredNodesNumber = 2;
|
tUniqueDynamic.requiredNodesNumber = 2;
|
||||||
tests.push_back( tUniqueDynamic );
|
tests.push_back( tUniqueDynamic );
|
||||||
|
|
||||||
Test tVectorDynamic;
|
Test tVectorDynamic;
|
||||||
tVectorDynamic.assign = new StaticAssignmentAlgorithm( workers, v.size() );
|
tVectorDynamic.assign = new DynamicAssignmentAlgorithm( workers );
|
||||||
tVectorDynamic.description = "Dynamic assignment with precise workers specified.";
|
tVectorDynamic.description = "Dynamic assignment with precise workers specified.";
|
||||||
tVectorDynamic.requiredNodesNumber = tVectorStatic.requiredNodesNumber;
|
tVectorDynamic.requiredNodesNumber = tVectorStatic.requiredNodesNumber;
|
||||||
tests.push_back( tVectorDynamic );
|
tests.push_back( tVectorDynamic );
|
||||||
|
|
||||||
Test tWorldDynamic;
|
Test tWorldDynamic;
|
||||||
tWorldDynamic.assign = new StaticAssignmentAlgorithm( v.size() );
|
tWorldDynamic.assign = new DynamicAssignmentAlgorithm;
|
||||||
tWorldDynamic.description = "Dynamic assignment with whole world as workers.";
|
tWorldDynamic.description = "Dynamic assignment with whole world as workers.";
|
||||||
tWorldDynamic.requiredNodesNumber = ALL;
|
tWorldDynamic.requiredNodesNumber = ALL;
|
||||||
tests.push_back( tWorldDynamic );
|
tests.push_back( tWorldDynamic );
|
||||||
|
}
|
||||||
|
|
||||||
for( unsigned int i = 0; i < tests.size(); ++i )
|
for( unsigned int i = 0; i < tests.size(); ++i )
|
||||||
{
|
{
|
||||||
ParallelApply<int> job( plusOneInstance, v, *(tests[i].assign), 0 );
|
ParallelApply<int> job( plusOneInstance, v, *(tests[i].assign), 0, 3 );
|
||||||
|
|
||||||
if( job.isMaster() )
|
if( job.isMaster() )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Reference in a new issue