示例#1
0
    def test_process(self):
        try:
            plugin = pu.load_plugin(self.plugin_name)
            if self.plugin_name == base_class_name:
                self.assertRaises(NotImplementedError, plugin.process, "test",
                                  "test", 1, 1)
                return
            # load appropriate data
            data = tu.get_appropriate_input_data(plugin)
            self.assertGreater(len(data), 0,
                               "Cannot find appropriate test data")

            # generate somewhere for the data to go
            output = tu.get_appropriate_output_data(plugin, data)
            self.assertGreater(len(output), 0,
                               "Cannot create appropriate output data")

            plugin.set_parameters(None)

            for i in range(len(data)):
                plugin.run_process(data[i], output[i], ["CPU0"], 0)
                print("Output from plugin under test ( %s ) is in %s" %
                      (plugin.name, output[i].backing_file.filename))

                data[i].complete()
                output[i].complete()

        except ImportError as e:
            print(
                "Failed to run plugin test as libraries not available (%s), passing test"
                % (e))
            pass
示例#2
0
    def test_process(self):
        try:
            plugin = pu.load_plugin(self.plugin_name)
            if self.plugin_name == base_class_name:
                self.assertRaises(NotImplementedError, plugin.process,
                                  "test", "test", 1, 1)
                return
            # load appropriate data
            data = tu.get_appropriate_input_data(plugin)
            self.assertGreater(len(data), 0, "Cannot find appropriate test data")

            # generate somewhere for the data to go
            output = tu.get_appropriate_output_data(plugin, data)
            self.assertGreater(len(output), 0,
                               "Cannot create appropriate output data")

            plugin.set_parameters(None)

            for i in range(len(data)):
                plugin.run_plugin(data[i], output[i], ["CPU0"], 0)
                print("Output from plugin under test ( %s ) is in %s" %
                      (plugin.name, output[i].backing_file.filename))

                data[i].complete()
                output[i].complete()

        except ImportError as e:
            print("Failed to run plugin test as libraries not available (%s), passing test" % (e))
            pass
示例#3
0
 def test_pipeline(self):
     logging.debug("Starting test_pipeline")
     if not hasattr(self, 'temp_dir'):
         self.temp_dir = tempfile.gettempdir()
     input_data = None
     first_plugin = pu.load_plugin(self.plugin_list[0])
     if self.plugin_list[0] == base_class_name:
         return
     if not hasattr(self, 'input_file'):
         input_data = tu.get_appropriate_input_data(first_plugin)[0]
     else:
         input_data = RawTimeseriesData()
         input_data.populate_from_nexus(self.input_file)
     logging.debug("Starting to run the processing chain")
     process.run_plugin_chain(input_data, self.plugin_list, self.temp_dir)
示例#4
0
 def test_pipeline(self):
     logging.debug("Starting test_pipeline")
     if not hasattr(self, 'temp_dir'):
         self.temp_dir = tempfile.gettempdir()
     input_data = None
     first_plugin = pu.load_plugin(self.plugin_list[0])
     if self.plugin_list[0] == base_class_name:
         return
     if not hasattr(self, 'input_file'):
         input_data = tu.get_appropriate_input_data(first_plugin)[0]
     else:
         input_data = RawTimeseriesData()
         input_data.populate_from_nexus(self.input_file)
     logging.debug("Starting to run the processing chain")
     process.run_plugin_chain(input_data, self.plugin_list, self.temp_dir)
示例#5
0
    def test_pipeline(self):
        if self.process_filename is None:
            return

        temp_dir = tempfile.gettempdir()
        process_list = ProcessList()
        process_list.populate_process_list(self.process_filename)

        first_plugin = pu.load_plugin(process_list.process_list[0]['id'])
        input_data = tu.get_appropriate_input_data(first_plugin)[0]

        try :
            process.run_process_list(input_data, process_list, temp_dir)
        except ImportError as e:
            print("Failed to run plugin test as libraries not available (%s), passing test" % (e))
            pass
示例#6
0
    def test_pipeline(self):
        if self.process_filename is None:
            return

        temp_dir = tempfile.gettempdir()
        process_list = ProcessList()
        process_list.populate_process_list(self.process_filename)

        first_plugin = pu.load_plugin(process_list.process_list[0]['id'])
        input_data = tu.get_appropriate_input_data(first_plugin)[0]

        try:
            process.run_process_list(input_data, process_list, temp_dir)
        except ImportError as e:
            print(
                "Failed to run plugin test as libraries not available (%s), passing test"
                % (e))
            pass
示例#7
0
                                                suffix='.h5', delete=False)
        logging.debug("Created output file name is  : %s", temp_file.name)
        global_data = {'file_name': temp_file.name}

    global_data = MPI.COMM_WORLD.bcast(global_data, root=0)

    logging.debug("Output file name is  : %s", global_data['file_name'])

    if 'CPU' in MACHINE_RANK_NAME:
        logging.debug("Loading plugin %s", options.plugin)
        plugin = pu.load_plugin(None, options.plugin)
        logging.debug("Loaded  plugin %s", options.plugin)

        # load appropriate data
        logging.debug("Loading test data")
        data = tu.get_appropriate_input_data(plugin)
        if data is None:
            logging.error("Cannot create appropriate input data")
            raise Exception("Cannot create appropriate input data")

        # generate somewhere for the data to go
        logging.debug("Sorting out output data")

        output = \
            tu.get_appropriate_output_data(plugin, data, mpi=True,
                                           file_name=global_data['file_name'])
        if output is None:
            logging.error("Cannot create appropriate output data")
            raise Exception("Cannot create appropriate output data")

        plugin.set_parameters(None)
    MPI.COMM_WORLD.barrier()

    logging.info("Starting the test process")

    logging.debug("Rank : %i - Size : %i", RANK, SIZE)

    IP = socket.gethostbyname(socket.gethostname())

    logging.debug("ip address is : %s", IP)

    MPI.COMM_WORLD.barrier()

    import os
    logging.debug(os.getenv('LD_LIBRARY_PATH'))

    MPI.COMM_WORLD.barrier()

    process_filename = tu.get_test_data_path(options.process_filename)

    process_list = ProcessList()
    process_list.populate_process_list(process_filename)

    first_plugin = pu.load_plugin(process_list.process_list[0]['id'])
    input_data = tu.get_appropriate_input_data(first_plugin)[0]

    process.run_process_list(input_data, process_list, options.directory,
                             mpi=True, processes=ALL_PROCESSES,
                             process=RANK)

    MPI.COMM_WORLD.barrier()
示例#9
0
    logging.debug("Rank : %i - Size : %i", RANK, SIZE)

    IP = socket.gethostbyname(socket.gethostname())

    logging.debug("ip address is : %s", IP)

    call_mpi_barrier()

    import os
    logging.debug(os.getenv('LD_LIBRARY_PATH'))

    call_mpi_barrier()

    process_filename = tu.get_test_data_path(options.process_filename)

    process_list = ProcessList()
    process_list.populate_process_list(process_filename)

    first_plugin = pu.load_plugin(process_list.process_list[0]['id'])
    input_data = tu.get_appropriate_input_data(first_plugin)[0]

    process.run_process_list(input_data,
                             process_list,
                             options.directory,
                             mpi=True,
                             processes=ALL_PROCESSES,
                             process=RANK)

    call_mpi_barrier()
示例#10
0
                                                delete=False)
        logging.debug("Created output file name is  : %s", temp_file.name)
        global_data = {'file_name': temp_file.name}

    global_data = MPI.COMM_WORLD.bcast(global_data, root=0)

    logging.debug("Output file name is  : %s", global_data['file_name'])

    if 'CPU' in MACHINE_RANK_NAME:
        logging.debug("Loading plugin %s", options.plugin)
        plugin = pu.load_plugin(None, options.plugin)
        logging.debug("Loaded  plugin %s", options.plugin)

        # load appropriate data
        logging.debug("Loading test data")
        data = tu.get_appropriate_input_data(plugin)
        if data is None:
            logging.error("Cannot create appropriate input data")
            raise Exception("Cannot create appropriate input data")

        # generate somewhere for the data to go
        logging.debug("Sorting out output data")

        output = \
            tu.get_appropriate_output_data(plugin, data, mpi=True,
                                           file_name=global_data['file_name'])
        if output is None:
            logging.error("Cannot create appropriate output data")
            raise Exception("Cannot create appropriate output data")

        plugin.set_parameters(None)