Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cambricon] Resolve infinite loop issue when retrieving logs #738

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

cifar10
Copy link
Contributor

@cifar10 cifar10 commented Sep 10, 2024

1、原始代码说明
在while循环外创建info_line列表,循环内每次间隔300秒访问生成的log文件,并将含有"elapsed time per iteration"字符串的信息append到info_line列表中,只有当列表长度等于迭代步数 getattr(module, "steps") 时跳出while循环。

2、问题说明
当while循环访问到未完成包含所有信息的log时,已有的部分信息仍然会被append到info_line列表;下一次间隔300秒后,会再次将完整的(假设此时log已完成记录所有迭代步)信息append。则列表长度大于getattr(module, "steps"),则一直处于while循环内空转,导致进程无法结束。

3、修改说明
将info_line列表的初始化放在while循环内,每一次append都是独立操作,直到获得完整迭代数,满足跳出while循环条件。

@KerwinKai KerwinKai merged commit 4ae86d5 into FlagOpen:main Sep 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants