(self, name, groupId, gpuId, tmpPath="./tmp")
| 290 | return self.getDict("dcgm", groupId, gpuId, tmpPath) |
| 291 | |
| 292 | def getDict(self, name, groupId, gpuId, tmpPath="./tmp"): |
| 293 | fileName = self.getFileName(name, groupId, gpuId, tmpPath) |
| 294 | if not os.path.isfile(fileName): |
| 295 | raise OSError(f"[{fileName}] does not existed!") |
| 296 | |
| 297 | data = {} |
| 298 | with open(fileName, "r") as rf: |
| 299 | try: |
| 300 | data = json.load(rf) |
| 301 | except Exception: |
| 302 | self._logger.error(f"read [{fileName}] error. not a json file!") |
| 303 | raise TypeError(f"read [{fileName}] error. not a json file!") |
| 304 | return data |
| 305 | |
| 306 | def dumpOpInfoDict( |
| 307 | self, data, groupId, gpuId, pretty=False, tmpPath="./tmp" |
no test coverage detected