## 2 Related Work
[11] found that the JSQ-MaxWeight algorithm was heavy-traffic optimal only in specific scenarios with two-level data locality. Thus, they proposed an algorithm that uses Weighted-Workload routing and priority services to optimize multilevel data locality. Data skew means that data blocks are unevenly distributed over servers, so some servers will become hot spots, which may decrease the data locality. To address this problem, [PERSON] et al. [40] proposed an approach to mitigate data skew by adjusting tasks' runtime resource allocation. The data skew problem is addressable by carefully placing data blocks. ActCap [41] used a Markov chain-based model to do node-capability-aware data placement for the continuously incoming data. [PERSON] et al. [42] grouped data blocks in a few racks and assigned tasks onto these racks, which greatly decreased the number of off-switch exchanges, thereby shortening job completion time. [PERSON] et al. [43] presented Dependency-Aware Locality for MapReduce (DALM) for processing the skewed and dependent input data. DALM accommodates data dependency in a data locality framework, organically synthesizing the key components from data reorganization, replication, and placement. Some recent research works proposed sophistic scheduling models to optimize communication costs. [PERSON] et al. [44] proposed an offline scheduling algorithm based on graph and hypergraph models, which correctly encoded the interactions between map and reduce tasks. [PERSON] et al. [45] aimed at a problem where an input split consisted of multiple data blocks that were distributed and stored in different nodes. [PERSON] et al. [46] proposed two data-locality-aware task scheduling algorithms that optimized makespan and communication, respectively, and theoretically studied their performance. [PERSON] et al. [47] proposed scheduling algorithms to optimize the locality-enhanced load balance and the map, local reduce, shuffle, and final reduce phases. Unlike the approaches that maximize data locality, our approach's goal is to minimize the job completion time by adoptively adjusting data locality. Overall, these task scheduling algorithms effectively minimize job completion time and maximize data locality, but few of them take the dynamic data transfer costs into account. We observe that if multiple data-remote tasks are assigned to the same server, the job completion time increases dramatically. The HTA (Hadoop Task Assignment) problem [13] considered dynamic data transfer costs by using a non-decreasing function, where the data transfer cost increases with the total number of data-remote tasks. [PERSON] [15] modeled data-remote tasks' runtime as random variables. However, these approaches do not fit our scenario, where the data transfer costs on different servers are quite different. In this paper, we propose a novel data locality scheduling model with dynamic data transfer costs for multicore servers, and develop online and offline algorithms for the model. Although it seems similar to our previous work, BAR (Balance and Reduce) [14], it differs in terms of the task-scheduling model and algorithm. For instance, BAR's scheduling model is based on the HTA problem, but DynDL and HTA are different. Additionally, BAR is an offline algorithm, and here we propose online and offline algorithms to solve DynDL. In Section 6, we compare the two approaches via extensive simulations.