Exemplo n.º 1
0
    def __init__(self, cfg: dict, shotnr: int = 18431):
        """Generates a reader for KSTAR ECEI data.

        Parameters:
        -----------
        cfg: delta config dictionary
        """

        self.adios = adios2.ADIOS()
        self.logger = logging.getLogger("simple")

        self.shotnr = shotnr
        self.IO = self.adios.DeclareIO(gen_io_name(self.shotnr))

        self.reader = None
        # Generate a descriptive channel name
        if len(cfg["channel_range"]) > 1:
            self.logger.error(
                "reader_base is not using MPI. The following channel_ranges are ignored:"
            )
            for crg in cfg["channel_range"][1:]:
                self.logger.error(f"Ignoring channel range {crg}")

        self.chrg = channel_range.from_str(cfg["channel_range"][0])
        self.channel_name = gen_channel_name_v3(cfg["datapath"], self.shotnr,
                                                self.chrg.to_str())
        self.logger.info(f"reader_base: channel_name =  {self.channel_name}")
Exemplo n.º 2
0
    def __init__(self, cfg: dict, shotnr: int=18431):

        self.logger = logging.getLogger("simple")

        self.shotnr = shotnr
        self.adios = adios2.ADIOS()
        self.IO = self.adios.DeclareIO(gen_io_name(0))
        self.writer = None
        # Adios2 variable that is defined in DefineVariable
        self.variable = None
        # The shape used to define self.variable
        self.shape = None

        # Generate a descriptive channel name
        self.chrg = channel_range.from_str(cfg["channel_range"][0])
        self.channel_name = gen_channel_name_v3(cfg["datapath"], self.shotnr, self.chrg.to_str())
        self.logger.info(f"writer_base: channel_name =  {self.channel_name}")
Exemplo n.º 3
0
    def __init__(self, cfg: dict, shotnr: int=18431):
        """Generates a reader for KSTAR ECEI data.

        Parameters:
        -----------
        cfg: delta config dictionary
        """

        comm  = MPI.COMM_SELF
        self.rank = comm.Get_rank()
        self.size = comm.Get_size()
        # This should be MPI.COMM_SELF, not MPI.COMM_WORLD
        self.adios = adios2.ADIOS(MPI.COMM_SELF)
        self.logger = logging.getLogger("simple")

        self.shotnr = shotnr
        self.IO = self.adios.DeclareIO(gen_io_name(self.shotnr))
        # Keeps track of the past chunk sizes. This allows to construct a dummy time base

        self.reader = None
        # Generate a descriptive channel name
        self.chrg = channel_range.from_str(cfg["channel_range"][self.rank])
        self.channel_name = gen_channel_name_v3(cfg["datapath"], self.shotnr, self.chrg.to_str())
        self.logger.info(f"reader_base: channel_name =  {self.channel_name}")