-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/87 add status script #145
Conversation
# Conflicts: # mcpartools/mcengine/data/run_shieldhit.sh
Codecov Report
@@ Coverage Diff @@
## master #145 +/- ##
==========================================
- Coverage 63.82% 61.01% -2.82%
==========================================
Files 12 13 +1
Lines 868 967 +99
Branches 0 150 +150
==========================================
+ Hits 554 590 +36
- Misses 314 315 +1
- Partials 0 62 +62
Continue to review full report at Codecov.
|
Log files at written in running directory, I'd rather expect them to be written in the workspace:
|
I'd also expect the status script to print on the screen basic information, like:
In the log file more details should be dumped. It is not necessary to write it to separate file each time (single status.log is enough) |
@@ -11,13 +11,14 @@ ERR=`mktemp` | |||
# On exit or if the script is interrupted (i.e. by receiving SIGINT signal) delete temporary files | |||
trap "rm -f $OUT $ERR" EXIT | |||
|
|||
qsub {options_args:s} -t 1-{jobs_no:d} -o {log_dir:s} -e {log_dir:s} -terse {script_dir:s}/{calculate_script_name:s} > $OUT 2> $ERR |
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.
Why -terse
was removed ?
|
||
if [[ ${{SUCCESSES}} -ne 0 ]] | ||
then | ||
echo "# AVERAGE TIME [s]= `printf "%20d" $(($TOTAL_TIME / $SUCCESSES))`" >> ${{LOG_FILE}} |
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.
Time of longest job would be nice to have
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.
few minor improvements
mcpartools/generator.py
Outdated
@@ -242,3 +248,15 @@ def save_logs(self): | |||
file_logger.info('Date and time: ' + time.strftime("%Y-%m-%d %H:%M:%S")) | |||
file_logger.info('username@hostname: ' + getpass.getuser() + '@' + socket.gethostname()) | |||
file_logger.info('Current working directory: ' + os.getcwd()) | |||
|
|||
def generate_merge_logs_script(self): | |||
wspdir_name = 'workspace' |
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.
Take a look some lines above:
def generate_workspace(self):
wspdir_name = 'workspace'
this would be a second use of this hardcoded string. Third one will be below in generate_status_script
.
I'd recommend to extract it to a class variable in order not to break DRY rule.
mcpartools/scheduler/common.py
Outdated
@@ -16,6 +16,7 @@ def __init__(self): | |||
@classmethod | |||
def get_scheduler(cls, scheduler_options, log_location): | |||
file_logger = logging.getLogger('file_logger') | |||
|
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.
Please avoid commiting extra empty lines
Final thoughts/tasks:
|
…to feature/87-add-status-script
…to feature/87-add-status-script
…to feature/87-add-status-script
Try running the submit script, but please deliberately forget to type In this case all jobs will fail, as
While in the log files there is a clear message:
|
Executing status script while jobs are running in normal mode also ends up with weird message:
|
I've did another stupid thing: started submit script from worker node. Of course the submission failed (it can be only done from login node). But the status script showed me some strange message:
I'd rather expect a single line telling me that the submission failed and no jobs are in running or pending state. |
This closes #87