You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/11/24 22:18:51 UTC

airavata git commit: handling when node count is 0

Repository: airavata
Updated Branches:
  refs/heads/airavata-0.15-release-branch ddb643e32 -> 09143819d


handling when node count is 0


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

Branch: refs/heads/airavata-0.15-release-branch
Commit: 09143819d19c18e3f3ef40945cd77721f1f33350
Parents: ddb643e
Author: Chathuri Wimalasena <ch...@apache.org>
Authored: Tue Nov 24 16:18:45 2015 -0500
Committer: Chathuri Wimalasena <ch...@apache.org>
Committed: Tue Nov 24 16:18:45 2015 -0500

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/bes/utils/ResourceProcessor.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/09143819/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/ResourceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/ResourceProcessor.java b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/ResourceProcessor.java
index 45fbc23..924253e 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/ResourceProcessor.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/ResourceProcessor.java
@@ -75,7 +75,11 @@ public class ResourceProcessor {
 					RangeValueType rangeType = new RangeValueType();
 					rangeType.setLowerBound(Double.NaN);
 					rangeType.setUpperBound(Double.NaN);
-					rangeType.setExact(crs.getTotalCPUCount()/crs.getNodeCount());
+                    int nodeCount = crs.getNodeCount();
+                    if (nodeCount <= 0){
+                        nodeCount = 1;
+                    }
+                    rangeType.setExact(crs.getTotalCPUCount()/ nodeCount);
 					JSDLUtils.setIndividualCPUCountRequirements(value, rangeType);
 				}