You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2017/05/23 18:51:35 UTC

airavata-php-gateway git commit: fixing Bug

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop deac6da31 -> 133aba898


fixing Bug


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/133aba89
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/133aba89
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/133aba89

Branch: refs/heads/develop
Commit: 133aba89805a42f01023109c8600f9e0d83d60c5
Parents: deac6da
Author: scnakandala <su...@gmail.com>
Authored: Tue May 23 14:51:32 2017 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Tue May 23 14:51:32 2017 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php | 42 +++++++++------------------
 1 file changed, 14 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/133aba89/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index fbbbe7f..c028a26 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -289,21 +289,16 @@ class ExperimentController extends BaseController
         $nodeCount = Config::get('pga_config.airavata')["node-count"];
         $cpuCount = Config::get('pga_config.airavata')["total-cpu-count"];
         $wallTimeLimit = Config::get('pga_config.airavata')["wall-time-limit"];
+        $cpusPerNode = 0;
 
+        $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
+            "nodeCount" => $nodeCount,
+            "cpuCount" => $cpuCount,
+            "wallTimeLimit" => $wallTimeLimit,
+            "cpusPerNode" => $cpusPerNode
+        );
 
         $computeResourceId = $experiment->userConfigurationData->computationalResourceScheduling->resourceHostId;
-        $crResource = CRUtilities::get_compute_resource($computeResourceId);
-        $cpusPerNode = $crResource->cpusPerNode;
-        if($crResource->defaultNodeCount > 0){
-            $nodeCount = $crResource->defaultNodeCount;
-        }
-        if($crResource->defaultCPUCount > 0){
-            $cpuCount = $crResource->defaultCPUCount;
-        }
-        if($crResource->defaultWalltime > 0){
-            $wallTimeLimit = $crResource->defaultWalltime;
-        }
-
         $appDeployments = Airavata::getAllApplicationDeployments(Session::get('authz-token'), Session::get("gateway_id"));
         $correctAppDeployment = null;
         foreach($appDeployments as $appDeployment){
@@ -313,24 +308,14 @@ class ExperimentController extends BaseController
             }
         }
 
+        $appDeploymentDefaults = array();
         if($correctAppDeployment != null){
-            if($correctAppDeployment->defaultNodeCount > 0){
-
-            }
-            if($correctAppDeployment->defaultCPUCount > 0){
-                $cpuCount = $correctAppDeployment->defaultCPUCount;
-            }
-            if($correctAppDeployment->defaultWalltime > 0) {
-                $wallTimeLimit = $correctAppDeployment->defaultWalltime;
-            }
+            $appDeploymentDefaults['nodeCount'] = $correctAppDeployment->defaultNodeCount;
+            $appDeploymentDefaults['cpuCount'] = $correctAppDeployment->defaultCPUCount;
+            $appDeploymentDefaults['wallTimeLimit'] = $wallTimeLimit;
+            $appDeploymentDefaults['queueName'] = $correctAppDeployment->defaultQueueName;
         }
 
-        $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
-            "nodeCount" => $nodeCount,
-            "cpuCount" => $cpuCount,
-            "wallTimeLimit" => $wallTimeLimit
-        );
-
         $computeResources = CRUtilities::create_compute_resources_select($experiment->executionId, $expVal['scheduling']->resourceHostId);
 
         $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
@@ -383,7 +368,8 @@ class ExperimentController extends BaseController
                     "canEditSharing" => $canEditSharing,
                     "projectOwner" => json_encode($projectOwner),
                     "updateSharingViaAjax" => false,
-                    "cpusPerNode" => $cpusPerNode
+                    "cpusPerNode" => $cpusPerNode,
+                    "appDeploymentDefaults" => $appDeploymentDefaults,
                 ));
             }
             else {