Teuthology: Concat(Matrix) size and minscanlen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

 

Reviewing the teuthology code, I wonder if the definition of the Concat(Matrix) class is correct:

 

class Concat(Matrix):

    """

    Concatenates all items in child matrices

    """

    def __init__(self, item, submats):

        self.submats = submats

        self.item = item

 

    def size(self):

        return 1

 

    def minscanlen(self):

        return 1

 

    def index(self, i):

        out = frozenset()

        for submat in self.submats:

            for i in range(submat.size()):

                out = out | frozenset([submat.index(i)])

        return (self.item, out)

 

    def tostr(self, depth):

        ret = '\t'*depth + "Concat({item}):\n".format(item=self.item)

        return ret + ''.join([i.tostr(depth+1) for i in self.submats])

 

Specifically, I’m not sure I follow why the size and minscanlen methods return 1, as they do for a PickRandom(Matrix) . In the latter case, those are reasonable, since PickRandom always returns a single job.

 

For a Concat matrix, I’d expect something like

 

    def size(self):

        return sum([sub.size() for sub in self.submats])

 

    def minscanlen(self):

        return sum([sub.minscanlen() for sub in self.submats])

_______________________________________________
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx

[Index of Archives]     [CEPH Users]     [Ceph Devel]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux