airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: using custom node/cpu/walltime in experiment edit
Date Tue, 16 May 2017 15:13:00 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop a90d50df0 -> 5ea6293c7


using custom node/cpu/walltime in experiment edit


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/5ea6293c
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5ea6293c
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5ea6293c

Branch: refs/heads/develop
Commit: 5ea6293c78a98d59c3de8b211152fac73decf83c
Parents: a90d50d
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue May 16 11:12:55 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue May 16 11:12:55 2017 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php | 58 ++++++++++++++++++++++++---
 1 file changed, 52 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5ea6293c/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 11849ad..19f929c 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -274,16 +274,62 @@ class ExperimentController extends BaseController
 
     public function editView()
     {
-        $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
-            "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"]
-        );
-
         $experiment = ExperimentUtilities::get_experiment($_GET['expId']);
         $expVal = ExperimentUtilities::get_experiment_values($experiment);
         $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
 
+
+        $appInterfaces = AppUtilities::get_all_applications();
+        foreach($appInterfaces as $id=>$name) {
+            if ($id == $experiment->executionId) {
+                $appId = AppUtilities::get_application_interface($id)->applicationModules[0];
+            }
+        }
+
+        $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"];
+
+
+        $computeResourceId = $experiment->userConfigurationData->computationalResourceScheduling->resourceHostId;
+        $crResource = CRUtilities::get_compute_resource($computeResourceId);
+        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){
+            if($appDeployment->computeHostId == $computeResourceId && $appDeployment->appModuleId
== $appId){
+                $correctAppDeployment = $appDeployment;
+                break;
+            }
+        }
+
+        if($correctAppDeployment != null){
+            if($correctAppDeployment->defaultNodeCount > 0){
+
+            }
+            if($correctAppDeployment->defaultCPUCount > 0){
+                $cpuCount = $correctAppDeployment->defaultCPUCount;
+            }
+            if($correctAppDeployment->defaultWalltime > 0) {
+                $wallTimeLimit = $correctAppDeployment->defaultWalltime;
+            }
+        }
+
+        $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();


Mime
View raw message