-
Notifications
You must be signed in to change notification settings - Fork 94
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
#312: add a feature to check MLE #442
Conversation
onlinejudge/_implementation/main.py
Outdated
@@ -142,6 +142,8 @@ def get_parser() -> argparse.ArgumentParser: | |||
subparser.add_argument('-t', '--tle', type=float, help='set the time limit (in second) (default: inf)') | |||
subparser.add_argument('-i', '--print-input', action='store_true', help='print input cases if not AC') | |||
subparser.add_argument('-j', '--jobs', metavar='N', type=int, help='specifies the number of jobs to run simultaneously (default: no parallelization)') | |||
subparser.add_argument('--print-memory', action='store_true', help='print the amount of memory which your program used, even if it is enough small') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://eitopi.com/enough-tukaikata
一応small enoughが正しそうです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとう。修正しました
(ところでこのような1行程度の自明な修正なら suggestion 機能を使うのがおすすめです。提案した側の名前が commit log に乗るという利点があります)
PRありがとうございます。 |
Windowsなどtimeが入っていない場合になにか警告した方がいいでしょうか? |
|
CI が落ちてるのは POJ が落ちているためです。無視してマージしてくれてかまいません。 |
@fukatani CI 再実行かけました |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kimiyuki |
できれば squash はしない方がよいですが、この程度ならわざわざ修正するほどでもないと思うのでこのままでいきましょう。 |
@kmyk Setting→Optionsで下の方にスクロールしていくとMergeというメニューがあります。 |
@fukatani 設定しました。 |
@kmyk 設定ありがとうございます!なにかあればまた相談します。 |
close #312
うっかり MLE しないようにメモリ使用量を監視する機能を足します。
具体的な仕様は次のようになります。
実装には GNU
time
(/usr/bin/time
とかにあるやつであって、shell builtin のtime
コマンドとは異なる) を利用しています。メモリ使用量を監視するのは一般に面倒で (ある時刻の使用量でなくて実行開始から終了まででの全時刻の最大を取らないとだめ、監視対象のプロセスをきちんと指定しないとだめ、別プロセスのメモリ使用量を好き勝手に取得するのはセキュリティの問題がある)、 他のよい方法は思い付きませんでした。
もちろん
time
が常に存在するとは限らないですし、存在しても互換性の問題がないとも限らないので、とりあえず使ってみて動くかどうかを判断する処理も含んでいます。@fukatani これもレビューが簡単ではないものですが、よろしくお願いします 🙇