def get_last_tid(self):
        try:
            spec = {'tid': {'$gt': 0}}
            sort = [('tid', -1)]
            row = self.db.docs.find_one(spec, sort=sort)
        except Exception as e:
            raise DatabaseException(e)
        if row:
            return row['tid']
        return 0
def config(self):
        settings = {
            # Use SYSTEMMPI since openfoam-org doesn't have USERMPI
            'mplib': 'SYSTEMMPI',

            # Add links into bin/, lib/ (eg, for other applications)
            'link': False,
        }
        # OpenFOAM v2.4 and earlier lacks WM_LABEL_OPTION
        if self.spec.satisfies('@:2.4'):
            settings['label-size'] = False
        return settings