Example #1
0
    def __init__(self, np=1, reason=None, label=None):
        self.np = np
        self.reason = reason
        self.label = label + '_' + time.strftime("%d%m%y-%H%M%S")

        if self.np > 1:
            self.launchmode = DistributedLaunchMode(self.np)
            self.executable = sumatra.programs.Executable(path="mpirun")
        else:
            self.launchmode = SerialLaunchMode()
            self.executable = sumatra.programs.PythonExecutable(
                path=sys.executable)
Example #2
0
class TestSerialLaunchMode(unittest.TestCase, BaseTestLaunchMode):

    def setUp(self):
        self.lm = SerialLaunchMode()

    def tearDown(self):
        for path in "valid_test_script.py", "invalid_test_script.py", "test_parameters":
            if os.path.exists(path):
                os.remove(path)

    def test__get_platform_information__should_return_a_list_of_PlatformInformation_objects(self):
        pis = self.lm.get_platform_information()
        pi0 = pis[0]
        import platform
        self.assertEqual(pi0.version, platform.version())

    def test__equality(self):
        new_lm = SerialLaunchMode()
        self.assertEqual(self.lm, new_lm)
        assert self.lm != 42
Example #3
0
class TestSerialLaunchMode(unittest.TestCase, BaseTestLaunchMode):

    def setUp(self):
        self.lm = SerialLaunchMode()

    def tearDown(self):
        for path in "valid_test_script.py", "invalid_test_script.py", "test_parameters":
            if os.path.exists(path):
                os.remove(path)

    def test__get_platform_information__should_return_a_list_of_PlatformInformation_objects(self):
        pis = self.lm.get_platform_information()
        pi0 = pis[0]
        import platform
        self.assertEqual(pi0.version, platform.version())

    def test__equality(self):
        new_lm = SerialLaunchMode()
        self.assertEqual(self.lm, new_lm)
        assert self.lm != 42
Example #4
0
 def setUp(self):
     self.lm = SerialLaunchMode()
Example #5
0
from sumatra.projects import Project
from sumatra.records import Record
from sumatra.recordstore import django_store
from sumatra.programs import PythonExecutable
from sumatra.launch import SerialLaunchMode
from sumatra.datastore import FileSystemDataStore
from sumatra.parameters import SimpleParameterSet
from sumatra.versioncontrol._git import GitRepository
import random
from datetime import datetime

serial = SerialLaunchMode()
executable = PythonExecutable("/usr/bin/python", version="2.7")
repos = GitRepository('.')
datastore = FileSystemDataStore("/path/to/datastore")
project = Project("test_project",
                  default_executable=executable,
                  default_repository=repos,
                  default_launch_mode=serial,
                  data_store=datastore,
                  record_store=django_store.DjangoRecordStore())
parameters = SimpleParameterSet({'a': 2, 'b': 3})

for i in range(50):
    record = Record(executable=executable, repository=repos,
                    main_file="main.py", version="99863a9dc5f",
                    launch_mode=serial, datastore=datastore,
                    parameters=parameters, input_data=[], script_arguments="",
                    label="fake_record%00d" % i,
                    reason="testing", diff='', user='******',
                    on_changed='store-diff', stdout_stderr='srgvrgvsgverhcser')
Example #6
0
 def test__equality(self):
     new_lm = SerialLaunchMode()
     self.assertEqual(self.lm, new_lm)
     assert self.lm != 42
Example #7
0
 def setUp(self):
     self.lm = SerialLaunchMode()
Example #8
0
from __future__ import unicode_literals
from builtins import range
from sumatra.projects import Project
from sumatra.records import Record
from sumatra.recordstore import django_store
from sumatra.programs import PythonExecutable
from sumatra.launch import SerialLaunchMode
from sumatra.datastore import FileSystemDataStore
from sumatra.parameters import SimpleParameterSet
from sumatra.versioncontrol._git import GitRepository
import random

serial = SerialLaunchMode()
executable = PythonExecutable("/usr/bin/python", version="2.7")
repos = GitRepository('.')
datastore = FileSystemDataStore("/path/to/datastore")
project = Project("test_project",
                  default_executable=executable,
                  default_repository=repos,
                  default_launch_mode=serial,
                  data_store=datastore,
                  record_store=django_store.DjangoRecordStore())
parameters = SimpleParameterSet({'a': 2, 'b': 3})

for i in range(50):
    record = Record(executable=executable,
                    repository=repos,
                    main_file="main.py",
                    version="99863a9dc5f",
                    launch_mode=serial,
                    datastore=datastore,