airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [46/51] [abbrv] airavata git commit: validating and update process model with max walltime
Date Tue, 03 Nov 2015 19:48:11 GMT
validating and update process model with max walltime


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/2d6ee02a
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/2d6ee02a
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/2d6ee02a

Branch: refs/heads/master
Commit: 2d6ee02a5ae8e4769b33138d1ecfd5597c84fc94
Parents: 6fc864e
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Mon Nov 2 11:57:41 2015 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Mon Nov 2 11:57:41 2015 -0500

----------------------------------------------------------------------
 .../validator/impl/BatchQueueValidator.java     | 193 ++++++++++---------
 .../cpi/impl/SimpleOrchestratorImpl.java        |   3 +
 2 files changed, 100 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2d6ee02a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java
index 18420db..212426d 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java
@@ -77,124 +77,125 @@ public class BatchQueueValidator implements JobMetadataValidator {
                 ValidatorResult validatorResult = new ValidatorResult();
                 validatorResult.setResult(true);
                 validatorResultList.add(validatorResult);
-            }
-            ComputeResourceDescription computeResource;
-            if (processModel == null){
-                computeResource = appCatalog.getComputeResource().getComputeResource(experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
-            }else {
-                computeResource = appCatalog.getComputeResource().getComputeResource(processModel.getResourceSchedule().getResourceHostId());
+            } else {
+                ComputeResourceDescription computeResource;
+                if (processModel == null) {
+                    computeResource = appCatalog.getComputeResource().getComputeResource(experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
+                } else {
+                    computeResource = appCatalog.getComputeResource().getComputeResource(processModel.getResourceSchedule().getResourceHostId());
 
-            }
-            List<BatchQueue> batchQueues = computeResource.getBatchQueues();
+                }
+                List<BatchQueue> batchQueues = computeResource.getBatchQueues();
 
-            if (batchQueues != null && !batchQueues.isEmpty()) {
-                if (computationalResourceScheduling != null) {
-                    String experimentQueueName = computationalResourceScheduling.getQueueName().trim();
-                    int experimentWallTimeLimit = computationalResourceScheduling.getWallTimeLimit();
-                    int experimentNodeCount = computationalResourceScheduling.getNodeCount();
-                    int experimentCPUCount = computationalResourceScheduling.getTotalCPUCount();
-                    ValidatorResult queueNameResult = new ValidatorResult();
+                if (batchQueues != null && !batchQueues.isEmpty()) {
+                    if (computationalResourceScheduling != null) {
+                        String experimentQueueName = computationalResourceScheduling.getQueueName().trim();
+                        int experimentWallTimeLimit = computationalResourceScheduling.getWallTimeLimit();
+                        int experimentNodeCount = computationalResourceScheduling.getNodeCount();
+                        int experimentCPUCount = computationalResourceScheduling.getTotalCPUCount();
+                        ValidatorResult queueNameResult = new ValidatorResult();
 
-                    //Set the validation to false. Once all the queue's are looped, if nothing
matches, then this gets passed.
-                    queueNameResult.setResult(false);
-                    queueNameResult.setErrorDetails("The specified queue" + experimentQueueName
+
-                            "does not exist. If you believe this is an error, contact the
administrator to verify App-Catalog Configurations");
-                    for (BatchQueue queue : batchQueues) {
-                        String resourceQueueName = queue.getQueueName();
-                        int maxQueueRunTime = queue.getMaxRunTime();
-                        int maxNodeCount = queue.getMaxNodes();
-                        int maxcpuCount = queue.getMaxProcessors();
-                        if (resourceQueueName != null && resourceQueueName.equals(experimentQueueName))
{
-                            queueNameResult.setResult(true);
-                            queueNameResult.setErrorDetails("");
+                        //Set the validation to false. Once all the queue's are looped, if
nothing matches, then this gets passed.
+                        queueNameResult.setResult(false);
+                        queueNameResult.setErrorDetails("The specified queue" + experimentQueueName
+
+                                "does not exist. If you believe this is an error, contact
the administrator to verify App-Catalog Configurations");
+                        for (BatchQueue queue : batchQueues) {
+                            String resourceQueueName = queue.getQueueName();
+                            int maxQueueRunTime = queue.getMaxRunTime();
+                            int maxNodeCount = queue.getMaxNodes();
+                            int maxcpuCount = queue.getMaxProcessors();
+                            if (resourceQueueName != null && resourceQueueName.equals(experimentQueueName))
{
+                                queueNameResult.setResult(true);
+                                queueNameResult.setErrorDetails("");
 
-                            //Validate if the specified wall time is within allowable limit
-                            ValidatorResult wallTimeResult = new ValidatorResult();
-                            if (experimentWallTimeLimit == 0) {
-                                wallTimeResult.setResult(false);
-                                wallTimeResult.setErrorDetails("Walltime cannot be zero for
queue " + resourceQueueName);
-                            } else {
-                                if (maxQueueRunTime == 0) {
-                                    wallTimeResult.setResult(true);
-                                    wallTimeResult.setErrorDetails("Maximum wall time is
not configured for the queue," +
-                                            "Validation is being skipped");
-                                    logger.info("Maximum wall time is not configured for
the queue" +
-                                            "Validation is being skipped");
+                                //Validate if the specified wall time is within allowable
limit
+                                ValidatorResult wallTimeResult = new ValidatorResult();
+                                if (experimentWallTimeLimit == 0) {
+                                    wallTimeResult.setResult(false);
+                                    wallTimeResult.setErrorDetails("Walltime cannot be zero
for queue " + resourceQueueName);
                                 } else {
-                                    if (maxQueueRunTime < experimentWallTimeLimit) {
-                                        wallTimeResult.setResult(false);
-                                        wallTimeResult.setErrorDetails("Job Execution walltime
" + experimentWallTimeLimit +
-                                                "exceeds the allowable walltime" + maxQueueRunTime
+
-                                                "for queue " + resourceQueueName);
-                                    } else {
+                                    if (maxQueueRunTime == 0) {
                                         wallTimeResult.setResult(true);
-                                        wallTimeResult.setErrorDetails("");
+                                        wallTimeResult.setErrorDetails("Maximum wall time
is not configured for the queue," +
+                                                "Validation is being skipped");
+                                        logger.info("Maximum wall time is not configured
for the queue" +
+                                                "Validation is being skipped");
+                                    } else {
+                                        if (maxQueueRunTime < experimentWallTimeLimit)
{
+                                            wallTimeResult.setResult(false);
+                                            wallTimeResult.setErrorDetails("Job Execution
walltime " + experimentWallTimeLimit +
+                                                    "exceeds the allowable walltime" + maxQueueRunTime
+
+                                                    "for queue " + resourceQueueName);
+                                        } else {
+                                            wallTimeResult.setResult(true);
+                                            wallTimeResult.setErrorDetails("");
+                                        }
                                     }
                                 }
-                            }
-                            //validate max node count
-                            ValidatorResult nodeCountResult = new ValidatorResult();
-                            if (maxNodeCount == 0) {
-                                nodeCountResult.setResult(true);
-                                nodeCountResult.setErrorDetails("Max node count is not configured
for the queue," +
-                                        "Validation is being skipped");
-                                logger.info("Max node count is not configured for the queue"
+
-                                        "Validation is being skipped");
-                            } else {
-                                if (experimentNodeCount == 0) {
-                                    nodeCountResult.setResult(false);
-                                    nodeCountResult.setErrorDetails("Job Execution node count
cannot be zero for queue " + resourceQueueName);
+                                //validate max node count
+                                ValidatorResult nodeCountResult = new ValidatorResult();
+                                if (maxNodeCount == 0) {
+                                    nodeCountResult.setResult(true);
+                                    nodeCountResult.setErrorDetails("Max node count is not
configured for the queue," +
+                                            "Validation is being skipped");
+                                    logger.info("Max node count is not configured for the
queue" +
+                                            "Validation is being skipped");
                                 } else {
-                                    if (maxNodeCount < experimentNodeCount) {
+                                    if (experimentNodeCount == 0) {
                                         nodeCountResult.setResult(false);
-                                        nodeCountResult.setErrorDetails("Job Execution node
count " + experimentNodeCount +
-                                                "exceeds the allowable node count" + maxNodeCount
+
-                                                "for queue " + resourceQueueName);
+                                        nodeCountResult.setErrorDetails("Job Execution node
count cannot be zero for queue " + resourceQueueName);
                                     } else {
-                                        nodeCountResult.setResult(true);
-                                        nodeCountResult.setErrorDetails("");
+                                        if (maxNodeCount < experimentNodeCount) {
+                                            nodeCountResult.setResult(false);
+                                            nodeCountResult.setErrorDetails("Job Execution
node count " + experimentNodeCount +
+                                                    "exceeds the allowable node count" +
maxNodeCount +
+                                                    "for queue " + resourceQueueName);
+                                        } else {
+                                            nodeCountResult.setResult(true);
+                                            nodeCountResult.setErrorDetails("");
+                                        }
                                     }
                                 }
-                            }
-                            // validate cpu count
-                            ValidatorResult cpuCountResult = new ValidatorResult();
-                            if (maxcpuCount == 0) {
-                                cpuCountResult.setResult(true);
-                                cpuCountResult.setErrorDetails("Max cpu count is not configured
for the queue," +
-                                        "Validation is being skipped");
-                                logger.info("Max cpu count is not configured for the queue"
+
-                                        "Validation is being skipped");
-                            } else {
-                                if (experimentCPUCount == 0) {
-                                    cpuCountResult.setResult(false);
-                                    cpuCountResult.setErrorDetails("Job Execution cpu count
cannot be zero for queue " + resourceQueueName);
+                                // validate cpu count
+                                ValidatorResult cpuCountResult = new ValidatorResult();
+                                if (maxcpuCount == 0) {
+                                    cpuCountResult.setResult(true);
+                                    cpuCountResult.setErrorDetails("Max cpu count is not
configured for the queue," +
+                                            "Validation is being skipped");
+                                    logger.info("Max cpu count is not configured for the
queue" +
+                                            "Validation is being skipped");
                                 } else {
-                                    if (maxcpuCount < experimentCPUCount) {
+                                    if (experimentCPUCount == 0) {
                                         cpuCountResult.setResult(false);
-                                        cpuCountResult.setErrorDetails("Job Execution cpu
count " + experimentCPUCount +
-                                                "exceeds the allowable cpu count" + maxcpuCount
+
-                                                "for queue " + resourceQueueName);
+                                        cpuCountResult.setErrorDetails("Job Execution cpu
count cannot be zero for queue " + resourceQueueName);
                                     } else {
-                                        cpuCountResult.setResult(true);
-                                        cpuCountResult.setErrorDetails("");
+                                        if (maxcpuCount < experimentCPUCount) {
+                                            cpuCountResult.setResult(false);
+                                            cpuCountResult.setErrorDetails("Job Execution
cpu count " + experimentCPUCount +
+                                                    "exceeds the allowable cpu count" + maxcpuCount
+
+                                                    "for queue " + resourceQueueName);
+                                        } else {
+                                            cpuCountResult.setResult(true);
+                                            cpuCountResult.setErrorDetails("");
+                                        }
                                     }
                                 }
+                                validatorResultList.add(wallTimeResult);
+                                validatorResultList.add(nodeCountResult);
+                                validatorResultList.add(cpuCountResult);
                             }
-                            validatorResultList.add(wallTimeResult);
-                            validatorResultList.add(nodeCountResult);
-                            validatorResultList.add(cpuCountResult);
                         }
-                    }
-                    validatorResultList.add(queueNameResult);
+                        validatorResultList.add(queueNameResult);
 
+                    }
+                } else {
+                    // for some compute resources, you dnt need to specify queue names
+                    ValidatorResult result = new ValidatorResult();
+                    logger.info("There are not queues defined under the compute resource.
Airavata assumes this experiment " +
+                            "does not need a queue name...");
+                    result.setResult(true);
+                    validatorResultList.add(result);
                 }
-            } else {
-                // for some compute resources, you dnt need to specify queue names
-                ValidatorResult result = new ValidatorResult();
-                logger.info("There are not queues defined under the compute resource. Airavata
assumes this experiment " +
-                        "does not need a queue name...");
-                result.setResult(true);
-                validatorResultList.add(result);
             }
         } catch (AppCatalogException e) {
             logger.error("Error while getting information from App catalog", e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d6ee02a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index be65a70..81980b9 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -294,6 +294,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
                     if (batchQueue.getQueueName().equals(userGivenQueueName)) {
                         int maxRunTime = batchQueue.getMaxRunTime();
                         if (maxRunTime < userGivenWallTime) {
+                            resourceSchedule.setWallTimeLimit(maxRunTime);
                             // need to create more job submissions
                             int numOfMaxWallTimeJobs = ((int) Math.floor(userGivenWallTime
/ maxRunTime));
                             for (int i = 1; i <= numOfMaxWallTimeJobs; i++) {
@@ -312,6 +313,8 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
                 taskIdList.addAll(createAndSaveSubmissionTasks(gatewayId, processModel, userGivenWallTime));
             }
             taskIdList.addAll(createAndSaveOutputDataStagingTasks(processModel, gatewayId));
+            // update process scheduling
+            experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel, processModel.getProcessId());
             return getTaskDag(taskIdList);
         } catch (Exception e) {
             throw new OrchestratorException("Error during creating process");


Mime
View raw message