Ejemplo n.º 1
0
def main(argv=None):

    if argv is None:
        argv = []
        
    if len(argv) < 2:
        raise ValueError('need to specify directory to output the definitions')
    outputDir = argv[1]
    
    baseDefinition = DefinitionModule.createPomsetContainingParameterSweep()
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'mr_wordcount.pomset'), baseDefinition)
    DefinitionModule.bindParameterSweepDefinitionParameters(baseDefinition)
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'mr_wordcount_staging.pomset'), baseDefinition)

    
    baseDefinition = DefinitionModule.createPomsetContainingLoopDefinition()
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'loop_wordcount.pomset'), baseDefinition)
    DefinitionModule.bindLoopDefinitionParameters(baseDefinition)
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'loop_wordcount_staging.pomset'), baseDefinition)

    
    return
Ejemplo n.º 2
0
    def setUp(self):
        
        # create the automaton
        self.automaton = AutomatonModule.Automaton()
        self.automaton.commandManager(CommandPatternModule.CommandManager())


        # create the generator
        self.generator = TaskModule.ParameterSweepTaskGenerator()

        # create the pomset
        self.pomset = TestUtilsModule.createPomsetContainingParameterSweep()
        TestUtilsModule.bindParameterSweepDefinitionParameters(self.pomset)

        return
Ejemplo n.º 3
0
    def test3(self):
        pomset = TestUtilsModule.createPomsetContainingParameterSweep()

        context = ContextModule.wrapPomsetInContext(pomset)

        errors = [x for x in context.reference().parameterBindingErrors()]
        self.assertEquals(len(errors), 3)
        for expectedInfo, actualInfo in zip([
                ('output file', KeyError),
                ('input file', KeyError),
                ('output file', KeyError)], errors):
            expectedParameterName, expectedErrorClass = expectedInfo
            actualParameter, actualError = actualInfo
            self.assertEquals(expectedParameterName, actualParameter.id())
            self.assertEquals(expectedErrorClass, actualError.__class__)
            pass

        self.assertRaises(ErrorModule.ValidationError,
                          context.reference().validateParameterBindings)

        return
 def setUp(self):
     definition = GeneratePomsetsModule.createPomsetContainingParameterSweep()
     GeneratePomsetsModule.bindParameterSweepDefinitionParameters(definition)
     
     self.definitionToCopy = definition
     return