From f5dcf7263d555bb05497c6c9598f9a5e79c4d61e Mon Sep 17 00:00:00 2001 From: Amin Pakzad Date: Tue, 1 Oct 2024 21:43:25 -0700 Subject: [PATCH 1/2] small modifications toM9 and shakermaker --- modules/createEVENT/M9/M9App2.py | 2 +- modules/createEVENT/M9/M9Run.py | 2 +- modules/tools/ShakerMaker/ShakerMakersubmitjob.py | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/createEVENT/M9/M9App2.py b/modules/createEVENT/M9/M9App2.py index c3958ea73..1005eb6ad 100644 --- a/modules/createEVENT/M9/M9App2.py +++ b/modules/createEVENT/M9/M9App2.py @@ -92,7 +92,7 @@ def Submit_tapis_job(username, password): status =t.jobs.getJobStatus(jobUuid=mjobUuid).status previous = status while True: - if status in ["FINISHED","FAILED","STOPPED"]: + if status in ["FINISHED","FAILED","STOPPED","STAGING_INPUTS"]: break status = t.jobs.getJobStatus(jobUuid=mjobUuid).status if status == previous: diff --git a/modules/createEVENT/M9/M9Run.py b/modules/createEVENT/M9/M9Run.py index a3f0bc17a..2cabc67ee 100644 --- a/modules/createEVENT/M9/M9Run.py +++ b/modules/createEVENT/M9/M9Run.py @@ -52,7 +52,7 @@ information['number_of_realizations'] = int(args.number) if args.gridType: information['grid_type'] = args.gridType - if args.API == 'true': + if args.API in ['true', 1, 'True', 'TRUE']: information['APIFLAG'] = True diff --git a/modules/tools/ShakerMaker/ShakerMakersubmitjob.py b/modules/tools/ShakerMaker/ShakerMakersubmitjob.py index e0943d18e..b58c51a06 100644 --- a/modules/tools/ShakerMaker/ShakerMakersubmitjob.py +++ b/modules/tools/ShakerMaker/ShakerMakersubmitjob.py @@ -178,9 +178,10 @@ 'FINISHED', 'FAILED', 'CANCELLED', - 'CANCELLED', + 'STAGING_INPUTS', 'QUEUED', 'RUNNING', + 'BLOCKED', ]: job_info = t.jobs.getJob(jobUuid=uuid) if job_info.status != previous_status: @@ -200,9 +201,19 @@ print('This can take several days according to the queue') # noqa: T201 print('please wait for the job to finish') # noqa: T201 print('you can check the job status through the designsafe portal') # noqa: T201 +if job_info.status == 'STAGING_INPUTS': + print('Job is staging inputs') + print('This can take several hours') + print('please wait for the job to finish') + print('you can check the job status through the designsafe portal') if job_info.status == 'RUNNING': print('Job is running') # noqa: T201 print('This can take several hours') # noqa: T201 print('please wait for the job to finish') # noqa: T201 print('you can check the job status through the designsafe portal') # noqa: T201 +if job_info.status == 'BLOCKED': + print('Job is blocked for now') + print('Please wait for the job to be staged') + print('This can take several hours') + print('you can check the job status through the designsafe portal') # %% From 518e974622f53f75cb35b5a6e9dda6f12ec0fa9b Mon Sep 17 00:00:00 2001 From: Amin Pakzad Date: Wed, 2 Oct 2024 16:34:08 -0700 Subject: [PATCH 2/2] adding allocation to the Shaker maker job submit --- modules/tools/ShakerMaker/ShakerMakersubmitjob.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/tools/ShakerMaker/ShakerMakersubmitjob.py b/modules/tools/ShakerMaker/ShakerMakersubmitjob.py index b58c51a06..47f9a0cd9 100644 --- a/modules/tools/ShakerMaker/ShakerMakersubmitjob.py +++ b/modules/tools/ShakerMaker/ShakerMakersubmitjob.py @@ -14,6 +14,7 @@ parser.add_argument('--tapisfolder', type=str, help='folder to upload the files to') parser.add_argument('--username', type=str, help='username for DesignSafe') parser.add_argument('--password', type=str, help='password for DesignSafe') +parser.add_argument('--allocation', type=str, help='allocation for DesignSafe') args = parser.parse_args() @@ -39,6 +40,7 @@ systemcodepath = args.tapisfolder +allocation = f"-A {args.allocation}" faultinfo = metadata['faultdata'] faultfiles = faultinfo['Faultfilenames'] @@ -155,7 +157,7 @@ 'archiveOnAppError': False, 'fileInputArrays': [{'sourceUrls': urls, 'targetDir': '*'}], 'parameterSet': { - 'schedulerOptions': [{'arg': '-A DesignSafe-SimCenter'}], + 'schedulerOptions': [{'arg': allocation}], 'envVariables': [ {'key': 'inputFile', 'value': 'ShakerMakermodel.py'}, {'key': 'numProcessors', 'value': totalcores},