flowcraft/generator/inspect.py
def trace_parser(self):
        """Method that parses the trace file once and updates the
        :attr:`status_info` attribute with the new entries.
        """

        # Check the timestamp of the tracefile. Only proceed with the parsing
        # if it changed from the previous time.
        size_stamp = os.path.getsize(self.trace_file)
        self.trace_retry = 0
        if size_stamp and size_stamp == self.trace_sizestamp:
            return
        else:
            logger.debug("Updating trace size stamp to: {}".format(size_stamp))
            self.trace_sizestamp = size_stamp

        with open(self.trace_file) as fh:

            # Skip potential empty lines at the start of file
            header = next(fh).strip()
            while not header:
                header = next(fh).strip()

            # Get header mappings before parsing the file
            hm = self._header_mapping(header)

            for line in fh:

                # Skip empty lines
                if line.strip() == "":
                    continue

                fields = line.strip().split("\t")

                # Skip if task ID was already processes
                if fields[hm["task_id"]] in self.stored_ids:
                    continue

                # Parse trace entry and update status_info attribute
                self._update_trace_info(fields, hm)
                self.send = True

        self._update_process_stats()
        self._update_barrier_status()
def trace_parser(self):
        """Method that parses the trace file once and updates the
        :attr:`status_info` attribute with the new entries.
        """

        # Check the timestamp of the tracefile. Only proceed with the parsing
        # if it changed from the previous time.
        size_stamp = os.path.getsize(self.trace_file)
        self.trace_retry = 0
        if size_stamp and size_stamp == self.trace_sizestamp:
            return
        else:
            logger.debug("Updating trace size stamp to: {}".format(size_stamp))
            self.trace_sizestamp = size_stamp

        with open(self.trace_file) as fh:

            # Skip potential empty lines at the start of file
            header = next(fh).strip()
            while not header:
                header = next(fh).strip()

            # Get header mappings before parsing the file
            hm = self._header_mapping(header)

            for line in fh:

                # Skip empty lines
                if line.strip() == "":
                    continue

                fields = line.strip().split("\t")

                # Skip if task ID was already processes
                if fields[hm["task_id"]] in self.stored_ids:
                    continue

                # Parse trace entry and update status_info attribute
                self._update_trace_info(fields, hm)
                self.send = True

        self._update_process_stats()
        self._update_barrier_status()
def trace_parser ( self ) : # Check the timestamp of the tracefile. Only proceed with the parsing # if it changed from the previous time. size_stamp = os . path . getsize ( self . trace_file ) self . trace_retry = 0 if size_stamp and size_stamp == self . trace_sizestamp : return else : logger . debug ( "Updating trace size stamp to: {}" . format ( size_stamp ) ) self . trace_sizestamp = size_stamp with open ( self . trace_file ) as fh : # Skip potential empty lines at the start of file header = next ( fh ) . strip ( ) while not header : header = next ( fh ) . strip ( ) # Get header mappings before parsing the file hm = self . _header_mapping ( header ) for line in fh : # Skip empty lines if line . strip ( ) == "" : continue fields = line . strip ( ) . split ( "\t" ) # Skip if task ID was already processes if fields [ hm [ "task_id" ] ] in self . stored_ids : continue # Parse trace entry and update status_info attribute self . _update_trace_info ( fields , hm ) self . send = True self . _update_process_stats ( ) self . _update_barrier_status ( )
Method that parses the trace file once and updates the
        :attr:`status_info` attribute with the new entries.
Method that parses the trace file once and updates the : attr : status_info attribute with the new entries .