From 8e70c2a487871a7c6cb6102bac7af9478fa636ae Mon Sep 17 00:00:00 2001 From: Andrews Cordolino Sobral Date: Wed, 15 May 2024 21:39:39 +0200 Subject: [PATCH] Added getJobResultMap and getJobPreciousResults --- proactive/ProactiveGateway.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/proactive/ProactiveGateway.py b/proactive/ProactiveGateway.py index 20c86f4..19ddbb6 100644 --- a/proactive/ProactiveGateway.py +++ b/proactive/ProactiveGateway.py @@ -586,6 +586,26 @@ def getJobResult(self, job_id, timeout=60000): all_results.append(str(result.getValue())) return os.linesep.join(v for v in all_results) + def getJobResultMap(self, job_id, timeout=60000): + """ + Retrieves the resultMap of a completed job. + + :param job_id: The ID of the job to fetch the result for. + :param timeout: The timeout in milliseconds for waiting for the job to finish. + :return: The result of the job if available within the timeout period. + """ + return self.proactive_scheduler_client.waitForJob(job_id, timeout).getResultMap() + + def getJobPreciousResults(self, job_id, timeout=60000): + """ + Retrieves the precious results of a completed job. + + :param job_id: The ID of the job to fetch the result for. + :param timeout: The timeout in milliseconds for waiting for the job to finish. + :return: The result of the job if available within the timeout period. + """ + return self.proactive_scheduler_client.waitForJob(job_id, timeout).getPreciousResults() + def getTaskResult(self, job_id, task_name, timeout=60000): """ Retrieves the result of a specified task from a job.