Changeset 0540bd0 in flex_extract.git
- Timestamp:
- Oct 25, 2022, 8:48:28 AM (17 months ago)
- Branches:
- dev
- Children:
- 6e16c9d
- Parents:
- 7d77efa
- Location:
- Source/Python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Source/Python/Classes/ControlFile.py
rb9ce98c r0540bd0 23 23 # August 2020 - Leopold Haimberger 24 24 # - added a class parameter for system installation path 25 # October 2022 - Anne Tipka (previously Philipp) 26 # - added class parameter for packingType (compression) of grib messages 27 # - added class parameter for event trigger for time critical jobs 25 28 # 26 29 # @License: … … 332 335 Switch to select the calculation of extra ensemble members for the 333 336 ELDA stream. It doubles the amount of retrieved ensemble members. 337 338 eventid : int 339 Id for one of the events for time critical jobs 1 at ECMWF servers. 340 341 eventjobname : str 342 The name the ecaccess-job-submit command will be given. 343 This is how the job will be recognized in the list of jobs. 334 344 335 345 logicals : list of str … … 426 436 self.rrint = 0 427 437 self.doubleelda = 0 438 self.eventid = None 439 self.eventjobname = '' 428 440 429 441 self.logicals = ['gauss', 'omega', 'omegadiff', 'eta', 'etadiff', -
Source/Python/Mods/tools.py
r73d2e4e r0540bd0 705 705 return job_id.decode() 706 706 707 def submit_job_to_ecserver(target, job name):707 def submit_job_to_ecserver(target, jobfile): 708 708 '''Uses ecaccess-job-submit command to submit a job to the ECMWF server. 709 709 … … 719 719 The target where the file should be sent to, e.g. the queue. 720 720 721 job name : str721 jobfile : str 722 722 The name of the jobfile to be submitted to the ECMWF server. 723 723 … … 730 730 try: 731 731 job_id = subprocess.check_output(['ecaccess-job-submit', '-queueName', 732 target, jobname]) 732 target, jobfile]) 733 734 except subprocess.CalledProcessError as e: 735 print('... ERROR CODE: ' + str(e.returncode)) 736 print('... ERROR MESSAGE:\n \t ' + str(e)) 737 738 print('\n... Do you have a valid ecaccess certification key?') 739 sys.exit('... ecaccess-job-submit FAILED!') 740 except OSError as e: 741 print('... ERROR CODE: ' + str(e.errno)) 742 print('... ERROR MESSAGE:\n \t ' + str(e.strerror)) 743 744 print('\n... Most likely the ECACCESS library is not available!') 745 sys.exit('... ecaccess-job-submit FAILED!') 746 747 return job_id.decode() 748 749 def submit_eventjob_to_ecserver(target, jobfile, eventid, jobname, ecuid): 750 '''Uses ecaccess-job-submit command to submit a job to the ECMWF server. 751 752 Note 753 ---- 754 The return value is just for testing reasons. It does not have 755 to be used from the calling function since the whole error handling 756 is done in here. 757 758 Parameters 759 ---------- 760 target : str 761 The target where the file should be sent to, e.g. the queue. 762 763 jobfile : str 764 The name of the jobfile to be submitted to the ECMWF server. 765 766 eventid : int 767 The id number from an event listed by ECMWF through ecaccess-event-list. 768 769 jobname : str 770 The name of the job, helps to distingush between jobs. 771 Will be shown in the queue and list of jobs. 772 773 ecuid : str 774 The user id on ECMWF server. 775 776 Return 777 ------ 778 job_id : int 779 The id number of the job as a reference at the ECMWF server. 780 ''' 781 782 try: 783 job_id = subprocess.check_output(['ecaccess-job-submit', 784 '-queueName', target, '-jobName', jobname, 785 '-onStart', '-onSuccess', '-onFailure', 786 '-onRetry', '-retryCount', '5', 787 '-mailTo', ecuid, 788 '-eventIds', eventid, 789 jobfile]) 733 790 734 791 except subprocess.CalledProcessError as e: -
Source/Python/submit.py
r47be2684 r0540bd0 202 202 mk_jobscript(jtemplate, job_file, clist) 203 203 204 job_id = submit_job_to_ecserver(queue, job_file) 204 #job_id = submit_job_to_ecserver(queue, job_file) 205 job_id = submit_eventjob_to_ecserver(queue, c.eventjobname, 206 c.eventid, c.ecuid) 207 205 208 print('The job id is: ' + str(job_id.strip())) 206 209
Note: See TracChangeset
for help on using the changeset viewer.