airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: handling when node count is 0
Date Tue, 24 Nov 2015 21:18:51 GMT
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 <chathuri@apache.org>
Authored: Tue Nov 24 16:18:45 2015 -0500
Committer: Chathuri Wimalasena <chathuri@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);
 				}
 


Mime
View raw message