[ https://issues.apache.org/jira/browse/FLINK-8431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331253#comment-16331253 ]
ASF GitHub Bot commented on FLINK-8431: --------------------------------------- Github user EronWright commented on a diff in the pull request: https://github.com/apache/flink/pull/5307#discussion_r162473916 --- Diff: flink-mesos/src/main/java/org/apache/flink/mesos/scheduler/Offer.java --- @@ -81,11 +82,14 @@ public Offer(Protos.Offer offer) { } this.resources = Collections.unmodifiableList(resources); - this.cpuCores = aggregateScalarResource(resourceMap, "cpus"); - this.memoryMB = aggregateScalarResource(resourceMap, "mem"); - this.networkMbps = aggregateScalarResource(resourceMap, "network"); - this.diskMB = aggregateScalarResource(resourceMap, "disk"); - this.portRanges = Collections.unmodifiableList(aggregateRangesResource(resourceMap, "ports")); + Map<String, Double> aggregatedScalarResourceMap = scalarResourceMap.entrySet() + .stream() + .collect(Collectors.toMap( + e -> e.getKey(), + e -> e.getValue().stream().mapToDouble(r -> r.getScalar().getValue()).sum() + )); + this.aggregatedScalarResourceMap = Collections.unmodifiableMap(aggregatedScalarResourceMap); --- End diff -- I think this change was motivated by a need to implement the new `getScalarValues`. It is good that the aggregation still occurs eagerly. The logic could probably be simplified using `Map::merge` within the `for` loop and skipping the creation of `scalarResourceMap`. > Allow to specify # GPUs for TaskManager in Mesos > ------------------------------------------------ > > Key: FLINK-8431 > URL: https://issues.apache.org/jira/browse/FLINK-8431 > Project: Flink > Issue Type: Improvement > Components: Cluster Management, Mesos > Reporter: Dongwon Kim > Assignee: Dongwon Kim > Priority: Minor > > Mesos provides first-class support for Nvidia GPUs [1], but Flink does not > exploit it when scheduling TaskManagers. If Mesos agents are configured to > isolate GPUs as shown in [2], TaskManagers that do not specify to use GPUs > cannot see GPUs at all. > We, therefore, need to introduce a new configuration property named > "mesos.resourcemanager.tasks.gpus" to allow users to specify # of GPUs for > each TaskManager process in Mesos. > [1] http://mesos.apache.org/documentation/latest/gpu-support/ > [2] http://mesos.apache.org/documentation/latest/gpu-support/#agent-flags -- This message was sent by Atlassian JIRA (v7.6.3#76005)