Example #1
0
    def set_value(self, vid, value, subgroup=None, ignore_type=False):
        """
        Set the value of an entry-id field to value
        Returns the value or None if not found
        subgroup is ignored in the general routine and applied in specific methods
        """
        if vid == "MULTI_DRIVER" and value:
            ninst_max = self.get_value("NINST_MAX")
            for comp in self._components:
                if comp == "CPL":
                    continue
                ninst = self.get_value("NINST_{}".format(comp))
                expect(
                    ninst == ninst_max,
                    "All components must have the same NINST value in multi_driver mode.  NINST_{}={} shoud be {}"
                    .format(comp, ninst, ninst_max),
                )
        if "NTASKS" in vid or "NTHRDS" in vid:
            expect(value != 0, "Cannot set NTASKS or NTHRDS to 0")

        return EnvBase.set_value(self,
                                 vid,
                                 value,
                                 subgroup=subgroup,
                                 ignore_type=ignore_type)
Example #2
0
 def set_value(self, vid, value, subgroup=None, ignore_type=False):
     """
     check if vid is in test section of file
     """
     newval = EnvBase.set_value(self, vid, value, subgroup, ignore_type)
     if newval is None:
         tnode = self.get_optional_child("test")
         if tnode is not None:
             newval = self.set_element_text(vid, value, root=tnode)
     return newval
Example #3
0
 def set_value(self, vid, value, subgroup=None, ignore_type=False):
     """
     check if vid is in test section of file
     """
     newval = EnvBase.set_value(self, vid, value, subgroup, ignore_type)
     if newval is None:
         tnode = self.get_optional_child("test")
         if tnode is not None:
             newval = self.set_element_text(vid, value, root=tnode)
     return newval
Example #4
0
    def set_value(self, vid, value, subgroup=None, ignore_type=False):
        """
        Set the value of an entry-id field to value
        Returns the value or None if not found
        subgroup is ignored in the general routine and applied in specific methods
        """
        if vid == "MULTI_DRIVER" and value:
            ninst_max = self.get_value("NINST_MAX")
            for comp in self._components:
                if comp == "CPL":
                    continue
                ninst = self.get_value("NINST_{}".format(comp))
                expect(ninst == ninst_max,
                       "All components must have the same NINST value in multi_driver mode.  NINST_{}={} shoud be {}".format(comp,ninst,ninst_max))

        return EnvBase.set_value(self, vid, value, subgroup=subgroup, ignore_type=ignore_type)
Example #5
0
    def set_value(self, vid, value, subgroup=None, ignore_type=False):
        """
        Set the value of an entry-id field to value
        Returns the value or None if not found
        subgroup is ignored in the general routine and applied in specific methods
        """
        if self._pio_async_interface:
            vid, comp, iscompvar = self.check_if_comp_var(vid, None)
            if vid.startswith("PIO") and iscompvar:
                if comp and comp != "CPL":
                    logger.warning("Only CPL settings are used for PIO in async mode")
                subgroup = "CPL"


        if vid == "PIO_ASYNC_INTERFACE":
            if type(value) == type(True):
                self._pio_async_interface = value
            else:
                self._pio_async_interface = convert_to_type(value, "logical" , vid)

        return EnvBase.set_value(self, vid, value, subgroup, ignore_type)