-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp Singularity example experiment: use runsolver to limit resourc…
…e usage.
- Loading branch information
1 parent
65b54cc
commit 72e3485
Showing
5 changed files
with
163 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/env python | ||
|
||
"""Filter lines from run.err that stem from "expected errors".""" | ||
|
||
from pathlib import Path | ||
import shutil | ||
|
||
|
||
IGNORE_PATTERNS = [ | ||
"CPU time limit exceeded", | ||
"std::bad_alloc", | ||
"WARNING: will ignore action costs", | ||
"differs from the one in the portfolio file", | ||
"Terminated", | ||
"Killed", | ||
] | ||
|
||
|
||
def main(): | ||
print("Running filter-stderr.py") | ||
stderr = Path("run.err") | ||
if stderr.is_file(): | ||
need_to_filter = False | ||
filtered_content = [] | ||
with open(stderr, "r") as f: | ||
for line in f: | ||
if any(pattern in line for pattern in IGNORE_PATTERNS): | ||
need_to_filter = True | ||
else: | ||
filtered_content.append(line) | ||
|
||
if need_to_filter: | ||
shutil.move(stderr, "run.err.bak") | ||
# We write an empty file if everything has been filtered. Lab | ||
# will remove empty run.err files later. | ||
with open(stderr, "w") as f: | ||
f.writelines(filtered_content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters