Loris Marchal

Samuel Mccauley

Frédéric Bertrand Simon

Minimizing I/Os in Out-of-Core Task Tree Scheduling

Keywords: Scheduling, Task tree, Tree traversal, I/O minimization, out-of-core Ordonnancement, Arbre de tâches, Parcours d'arbres, Minimisation d'Entrées/Sorties

Scientific applications are usually described as directed acyclic graphs, where nodes represent tasks and edges represent dependencies between tasks. For some applications, such as the multifrontal method of sparse matrix factorization, this graph is a tree: each task produces a single output data, used by a single task (its parent in the tree). We focus on the case when the data manipulated by tasks have a large size, which is especially the case in the multifrontal method. To process a task, both its inputs and its output must fit in the main memory. Moreover, output results of tasks have to be stored between their production and their use by the parent task. It may therefore happen, during an execution, that not all data fit together in memory. In particular, this is the case if the total available memory is smaller than the minimum memory required to process the whole tree. In such a case, some data have to be temporarily written to disk and read afterwards. These Input/Output (I/O) operations are very expensive; hence, the need to minimize them.

We revisit this open problem in this paper. Specifically, our goal is to minimize the total volume of I/O while processing a given task tree. We first formalize and generalize known results, then prove that existing solutions can be arbitrarily worse than optimal. Finally, we propose a novel heuristic algorithm, based on the optimal tree traversal for memory minimization. We demonstrate good performance of this new heuristic through simulations on both synthetic trees and realistic trees built from actual sparse matrices.

Introduction

Parallel workloads are often modeled as task graphs, where nodes represent tasks and edges represent the dependencies between tasks. There is an abundant literature on task graph scheduling when the objective is to minimize the total completion time, or makespan. However, with the increase of the size of the data to be processed, the memory footprint of the application can have a dramatic impact on the algorithm execution time, and thus needs to be optimized. When handling very large data, the available main memory may be too small to simultaneously handle all data needed by the computation. In this case, we have to resort to using disk as a secondary storage, which is sometimes known as out-of-core execution. The cost of the I/O operation to transfer data from and to the disk is known to be several orders of magnitude larger than the cost of accessing the main memory. Thus, in the case of out-of-core execution, it is a natural objective to minimize the total volume of I/O.

In the present paper, we consider the parallel scheduling of rooted in-trees. The vertices of the trees represent computational tasks, and the edges of the trees represent the dependencies between these tasks. Tasks are defined by their input and output data. Each task uses all the data produced by its children to output new data for its parent. In particular, a task must have enough available memory to fit the input from all its children.

The motivation for this work comes from numerical linear algebra, and especially the factorization of sparse matrices using direct multifrontal methods [START_REF] Davis | Direct Methods for Sparse Linear Systems, ser. Fundamentals of Algorithms[END_REF]. During the factorization, the computations are organized as a tree workflow called an elimination tree, and the huge size of the data involved makes it absolutely necessary to reduce the memory requirement of the factorization. Note that we consider here that no numerical pivoting is performed during the factorization, and thus that the structure of the tree, as well as the size of the data, are known before the computation really happens.

It is known that the problem of minimizing the peak memory M peak of a tree traversal, that is, the minimum amount of memory needed to process a tree, is polynomial [START_REF] Liu | An application of generalized tree pebbling to sparse matrix factorization[END_REF][START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF]. However, it may well happen that the available amount of memory M is smaller than the peak memory M peak . In this case, we have to decide which data, or part of data, have to be written to disk. In a previous study [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF], we have focused on the case when the data cannot be partially written to disk, and we proved that this variant of the problem was NP-complete. However, it is usually possible to split data that reside in memory, and write only part of it to the disk if needed. This is for instance what is done using paging: all data are divided in same-size pages, which can be moved from main memory to secondary storage when needed. Since all modern computer systems implement paging, it is natural to consider it when minimizing the I/O volume.

Note that as in [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF], the present study does not directly focus on parallel algorithms. However, parallel processing is the ultimate motivation for this work: complex scientific applications using large data such as multifrontal sparse matrix factorization always make use of parallel platforms. Most involved scheduling schemes combine data parallelism (a task uses multiple processors) and tree parallelism (several tasks are processed in parallel). We indeed have studied such a problem for peak memory minimization [START_REF] Eyraud-Dubois | Parallel scheduling of task trees with limited memory[END_REF]. However, one cannot hope to achieve good results for the minimization of I/O volume in a parallel settings until the sequential problem is well understood, which is not yet the case. The present paper is therefore a step towards understanding the sequential version of this problem.

The main contributions of this work are:

• A formalization in a common framework of the results scattered in the literature;

• A proof of the dominance of post-order traversals when trees are homogeneous (all output data have the same size), knowing that an algorithm to compute the best post-order traversal has been proposed by E. Agullo [START_REF] Agullo | On the out-of-core factorization of large sparse matrices[END_REF].

• A proof that neither the best post-order traversal nor the memory-peak minimization algorithms are approximation algorithms for minimizing the I/O volume;

• A new heuristic that achieves good performance both on synthetic and actual trees as shown through simulations.

The rest of this paper is organized as follows. We give an overview of the related work in Section 2. Then in Section 3 we formalize our model and present elementary results. Existing solutions are studied in Section 4 before a new one is introduced in Section 5 and evaluated through simulations in Section 6. We finally conclude and present future directions in Section 7.

Related work

Memory and storage have always been a limited parameter for large computations, as outlined by the pioneering work of Sethi and Ullman [START_REF] Sethi | The generation of optimal code for arithmetic expressions[END_REF] on register allocation for task trees. In the realm of sparse direct solvers, the problem of scheduling a tree so as to minimize peak memory has first been investigated by Liu [START_REF] Liu | On the storage requirement in the out-of-core multifrontal method for sparse factorization[END_REF] in the sequential case: he proposed an algorithm to find a peak-memory minimizing traversal of a task tree when the traversal is required to correspond to a postorder traversal of the tree. A postorder traversal requires that each subtree of a given node must be fully processed before the processing of another subtree can begin. A follow-up study [START_REF] Liu | An application of generalized tree pebbling to sparse matrix factorization[END_REF] presents an optimal algorithm to solve the general problem, without the postorder constraint on the traversal. Postorder traversals are known to be arbitrarily worse than optimal traversals for memory minimization [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF]. However, they are very natural and straightforward solutions to this problem, as they allow to fully process one subtree before starting a new one. Therefore, they are widely used in sparse matrix software like MUMPS [START_REF] Amestoy | A fully asynchronous multifrontal solver using distributed dynamic scheduling[END_REF][START_REF] Amestoy | Hybrid scheduling for the parallel solution of linear systems[END_REF], and achieve good performance on actual elimination trees [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF]. Note that peak memory minimization is still a crucial question for direct solvers, as highlighted by Agullo et al. [START_REF] Agullo | Robust memoryaware mappings for parallel multifrontal factorizations[END_REF], who study the effect of processor mapping on memory consumption for multifrontal methods.

As mentioned in the introduction, the problem of minimizing the I/O volume has been studied in [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF] with the constraint that each data either stays in the memory or has to be written wholly to disk. We study here the case when we have the option to store part of the data, which is also the topic of E. Agullo's PhD. thesis [START_REF] Agullo | On the out-of-core factorization of large sparse matrices[END_REF]. In his thesis, Agullo exhibits the best postorder traversal for the minimization of the I/O volume, which we adapt to our model in Section 4.1. He also studies numerous variants of the model that are important for direct solvers, as well as other memory management issues-both for sequential and parallel processing. Based on these preliminaries, he finally presents an out-of-core version of the MUMPS solver.

Finally, out-of-core execution is a well-know approach for computing on large data, especially (but not only) in linear algebra [START_REF] Toledo | A survey of out-of-core algorithms in numerical linear algebra[END_REF][START_REF] Saule | An out-of-core taskbased middleware for data-intensive scientific computing[END_REF].

Problem modeling and basic results

Model and notation

As introduced above, we assume that we have an available memory (or primary storage) of limited size M , and a disk (or secondary storage) of unlimited size.

We consider a workflow of tasks whose precedence constraints are modeled by a tree of tasks G = (V, E ). Its nodes v ∈ V represent tasks and its edges e ∈ E represent dependencies. All dependencies are directed toward the root (denoted by root): a node can only be executed after the termination of all its children. The output data of a node i occupies a size w i in the main memory. This data may be written totally or partially to the disk after task i produces it. In order for a node to be executed, the output data of all its children must be entirely stored in the main memory. An amount of memory m can be moved between the memory and the disk at a cost of m I/O operations, regardless of which data it corresponds to. We assume that all memory values (M , w i ) are given in an appropriate unit Inria (such as kilobytes) and are integers. We divide the main memory into slots, where each slot holds one such unit of memory.

At the beginning of the computation of a task i , the output data of i 's children must be in memory, while at the end of its computation, its own output data must be in memory. The amount of memory needed in order to execute node i is thus wi = max w i , ( j ,i )∈E w j .

We assume that M is at least as large as every wi , as otherwise the tree cannot be processed.

Our objective is to find a solution minimizing the total I/O volume. A solution needs to give the order in which nodes should be executed, and how much of each node should be written out during I/O operations. In particular, for a tree of n tasks, we define a solution to our problem as a permutation σ of [1 . . . n] and a function τ. We call such a solution a traversal. The permutation σ represents the schedule of the nodes, that is, σ(i ) = t means that task i is computed at step t , while the function τ represents the amount of I/O for each data: τ(i ) = m means that m among w i units of the output data of task i are written to disk (then we assume they are written as soon as task i completes). Note that we do not need to clarify which part of the data is written to disk, as our cost function only depends on the volume. Besides, we assume that when τ(i ) = 0, the write operation on the output data of task i is performed right after task i completes (and produces the data), and the read operation is performed just before the use of this data by task i 's parent, as any other I/O scheme would use more memory at some time step for the same I/O volume. Finally, since there are as many read than write operations, we only count the write operations.

In order for a traversal to be valid, it must respect the following conditions:

• Tasks are processed in a topological order:

∀(i , j ) ∈ E , σ(i ) < σ( j );
We say that a node i of parent j is considered active at step t under the schedule σ if σ(i ) < t < σ( j ). This means that its output data is either partially in memory and/or partially written to disk at time t . • The amount of data written to disk never exceeds the size of the data:

∀i ∈ V, 0 ≤ τ(i ) ≤ w i ;
• Enough memory remains available for the processing of each task (taking into account active nodes): ∀i ∈ G,

(k,p)∈E σ(k)<σ(i )<σ(p) (w k -τ(k)) ≤ M -wi .
The problem we are considering in this paper, called MINIO, is to find a valid traversal that minimizes the total amount of I/O, given by i ∈G τ(i ).

We formally define a postorder traversal as a traversal σ such that, for any node i and for any node k outside the subtree T i rooted at i , we have either

∀ j ∈ T i , σ(k) < σ( j ) or ∀ j ∈ T i , σ( j ) < σ(k).

Towards a compact solution

Although a traversal is described by both the schedule σ and the I/O function τ, the following results show that one can be deduced from the other. The first result is adapted from [5, Property 2.1], which has the same result limited to postorder traversals (see Section 2). It states that given a schedule σ, it is easy to derive a I/O scheme τ which minimizes the I/O volume of the traversal (σ, τ). Theorem 1. We consider a tree G, a memory bound M , and a schedule σ. The I/O function τ following the Furthest in the Future policy achieves the best performance under σ.

The I/O function τ following the Furthest in the Future (FiF) policy is defined as follows: during the execution of σ, whenever the memory exceeds the limit M , I/O operations are performed on the active nodes which will remain active the furthest in the future, i.e., whose execution come last in the schedule σ. This result is similar to Belady's rule which states the optimality of the offline MIN cache replacement [START_REF] Belady | A study of replacement algorithms for a virtual-storage computer[END_REF][START_REF] Lee | A simple proof of optimality for the MIN cache replacement policy[END_REF], that evicts from the cache the data which is used the latest.

Proof. Given a tree G, a memory bound M , a schedule σ and a I/O function τ that does not respect the FiF policy, it is straightforward to transform τ into another I/O function τ following the rule. Consider the first step when an I/O is performed on a data i that is not the last one to be used among active data. Let j denote the last data used among active ones. We can safely increase τ ( j ) and decrease τ (i ) until either τ ( j ) = w j or τ (i ) = 0. As j is active longer than i is, the memory freed by τ is available for a longer time than the one freed by τ, which keeps the traversal valid. Furthermore, by repeating this transformation, we produce an I/O function which respects the FiF policy.

On the other hand, if we have an I/O function τ describing how much of each node is written to disk, we can compute a schedule σ such that (σ, τ) is a valid traversal (if such a schedule exists).

Theorem 2. We consider a tree G, a memory bound M , and an I/O function τ for which there exists a valid schedule. Such a schedule can be computed in polynomial time.

The proof of this result is delegated to Section 5 where we use a similar method to derive a heuristic: once we know where the I/O operations take place, we may transform the tree by expanding some nodes to make these I/O operations explicit within the tree structure. If a valid traversal using τ exists, the resulting tree may be completely scheduled without any additional I/O, and such a schedule can be computed using an optimal scheduling algorithm for memory minimization.

Both previous results allow us to describe solutions in a more compact format (as either a schedule or an I/O function). However, this does make the problem less combinatorial: there are n! possible schedules and already 2 n τ functions if we restrict only to functions such that τ(i ) = 0 or w i .

Related algorithms

As mentioned in Section 2, the problem of minimizing the peak memory, denoted MINMEM, is strongly related to our problem, and has been extensively studied. In this problem, the available memory is unbounded (which means no I/Os are required) and we look for a schedule that minimizes the peak memory, i.e., the maximal amount of memory used at any time during the execution. There are at least two important algorithms for this problem, which we use in the present paper:

• It is possible to compute a schedule minimizing the peak-memory in polynomial time, as proved by Liu [START_REF] Liu | An application of generalized tree pebbling to sparse matrix factorization[END_REF]. We denote such an algorithm by OPTMINMEM.

• The best postorder traversal for peak-memory minimization can also be computed in polynomial time [START_REF] Liu | On the storage requirement in the out-of-core multifrontal method for sparse factorization[END_REF]. We will refer to this algorithm by POSTORDERMINMEM.

Existing solutions are not satisfactory

We now detail two existing solutions for the MINIO problem. The first one is the best postorder traversal proposed by Agullo [START_REF] Agullo | On the out-of-core factorization of large sparse matrices[END_REF]. The second consists in using the optimal traversal for MINMEM proposed by Liu [START_REF] Liu | An application of generalized tree pebbling to sparse matrix factorization[END_REF] and then to apply Theorem 1 to obtain a valid traversal. After presenting these algorithms, we prove that none of them has a constant competitive factor compared to the optimal traversal. Inria

Computing the best postorder traversal

For the sake of completeness, we present the adaption to our model of the algorithm computing the best postorder traversal for MINIO from [START_REF] Agullo | On the out-of-core factorization of large sparse matrices[END_REF]. Recall that in a postorder traversal, when a node is processed, its whole subtree must be processed before any other external node may be started. Given a node i and a postorder schedule σ, we first recursively define S i as the storage requirement of the subtree T i rooted at i . Let Chil(i ) be the children of i . Then:

S i = max     w i , max j ∈Chil(i )     S j + k∈Chil(i ) σ(k)<σ( j ) w k         .
This expression represents the maximum memory peak reached during the execution. If the peak is obtained at the end of the execution, it is then equal to w i . Otherwise, it appears during the execution of the subtree of some child j . In this case, the peak is composed of the weights of the children already processed, plus the peak S j of T j . We may now consider A i = min(M , S i ), which represents the amount of main memory used for the out-of-core execution of the subtree T i by σ. We recursively define V i as the volume of I/Os performed by σ during the execution T i when I/O operations are done using the FiF policy:

V i = max 0, max j ∈Chil(i ) A j + σ(k)<σ( j ) k∈Chil(i ) w k -M + j ∈Chil(i ) V j .
The expression of V i has a similar structure to the expression of S i . No I/Os can be incurred when only the root i is in memory, hence w i has no effect here. The second term accounts for the I/Os incurred on the children of i . Indeed, during the execution of node j , some parts of children of i must be written to disk if the memory peak exceeds M , and this quantity is at least A j + σ(k)<σ( j ) k∈Chil(i ) w k -M . The last term accounts for the I/Os occurring inside the subtrees. Note that such I/Os can only happen if the memory peak of the subtree exceeds M .

It remains to determine which postorder traversal minimizes the quantity V root . Note that the only term sensitive to the ordering of the children of i in the expression of V i is max

j ∈Chil(i ) A j + σ(k)<σ( j ) k∈Chil(i ) w k .
Theorem 3 states that sorting the children of i by decreasing values of A jw j achieves the minimum V i .

Theorem 3 (Lemma 3.1 in [START_REF] Liu | On the storage requirement in the out-of-core multifrontal method for sparse factorization[END_REF]). Given a set of values (x i , y i ) 1≤i ≤n , the minimum value of max 1≤i ≤n x i + i -1 j =1 y j is obtained by sorting the sequence (x i , y i ) in decreasing order of x iy i .

Therefore, the postorder traversal that processes the children nodes by decreasing order of A iw i minimizes the I/O cost among all postorder traversals. This traversal is described in Algorithm 1, initially called with r = root, and will be referred to as POSTORDERMINIO. Note that in the algorithm ⊕ refers to the concatenation operation on lists.

POSTORDERMINIO is optimal on homogeneous trees

In this section we focus on homogeneous trees, that is on trees where all nodes have output data of size one. We will show that POSTORDERMINIO is optimal on these homogeneous trees, i.e., that it performs the minimum number of I/Os. This generalizes a result of Sethi and Ullman [START_REF] Sethi | The generation of optimal code for arithmetic expressions[END_REF] for homogeneous binary trees.

Algorithm 1: POSTORDERMINIO (G, r )

Output: a tree G and a node r in G Output: an ordered list r of the nodes in the subtree rooted at r , corresponding to a postorder

1 foreach i child of r do 2 i ← POSTORDERMINIO(G, i ) 3 Compute the A i value using postorder i 4 r ← 5 for i child of r by decreasing value of A i -w i do 6 r ← r ⊕ i 7 r ← r ⊕ {r } 8 return r
Theorem 4. POSTORDERMINIO is optimal for homogeneous trees.

In order to prove this theorem, we need first to define some labels on the nodes of a tree. Let T be any homogeneous tree (w v = 1 for all nodes v of T ). In the following definitions, whenever v is a node of T with k children, v 1 , . . . , v k will be its children.

Memory bound l (v).

For each node v of T , we recursively define a label l (v) which represents the minimum amount of memory necessary to execute the subtree T (v) rooted at v without performing any I/Os:

l (v) =        0 if v is a leaf max 1≤i ≤k (l (v i ) + i -1) otherwise and ordering the children such that l (v i ) ≥ l (v i +1 ) for 1 ≤ i ≤ k -1
We call POSTORDER one postorder schedule that executes the children of any node by nonincreasing l -labels (ties being arbitrarily broken). Intuitively, under POSTORDER, while computing the i -th child, we have i -1 extra nodes in memory, each of size one, so we need l (v i )+(i -1) memory slots in total.

I/O indicator c(v).

If v i is a child of v, intuitively, c(v i ) represents the number of children of v written to disk by POSTORDER during the execution of T (v i ). This number can be either 0 or 1. We set c(v 1 ) = 0 and

c(v i ) = 0 if l (v i ) + 1≤ j <i (1 -c(v j )) ≤ M 1 otherwise.
We set c(root) = 0 where root is the root of T . To ease the writing of some proofs, we use the notation

m(v i ) = 1≤ j <i (1 -c(v j )). Thus m(v i ) represents the number of children of v in memory when v i is executed. Note that m(v 1 ) = 0 and m(v i ) = (1 -c(v 1 )) + 2≤ j <i (1 -c(v j )) ≥ (1 -c(v 1 )) = 1 for 2 ≤ i ≤ k.

I/O volumes w(v) and W (T (v))

. w(v) represents the total number of children of v stored by POS-TORDER:

w(v) = k i =1 c(v i ) = k i =2 c(v i ).
Inria Finally, for a given node v, we define W (T (v)) on the subtree rooted at v:

W (T (v)) = c(v) + µ∈T (v)
w(µ).

W (T (v)) intuitively represents the total volume of communications performed during the execution of the tree T (v) by POSTORDER.

We first state the correctness of the l -labels and the optimality of POSTORDER for the MINMEM problem.

Lemma 1. With infinite memory, POSTORDER uses l (n) slots to compute the subtree rooted at node n.

Proof. This result follows from the definition of the labels l (v).

Lemma 2. With infinite memory, any schedule uses at least l (v) slots to compute the subtree rooted at v.

Proof. We prove this result by induction on the size of T (v). If v is a leaf, the result holds (l (v) = 1).

Otherwise, we assume the lemma to be true for the subtrees rooted at the children v 1 , . . . , v k of v. We consider the schedule returned by MINMEM. The memory peak inherent to the execution of a subtree T (v i ) is equal to l (v i ) by the induction hypothesis. Assume without loss of generality that the children of v are ordered such that MINMEM first computes a node of T (v 1 ), then the next executed node not in T (v 1 ) is in T (v 2 ), then the next executed node neither in T (v 1 ) nor in T (v 2 ) is in T (v 3 ), and so on. Then, the memory peak reached during the execution of T (v i ) is at least l (v i ) + (i -1) because, in addition to T (v i ), at least i -1 subtrees have been partially executed: T (v 1 ), ..., T (v i -1 ). Finally, the total memory peak is at least equal to max 1≤i ≤k (l (v i )+i -1). By Theorem 3, this quantity is minimized when the nodes are ordered by non-increasing values of l (v i ). Hence, the total memory peak is at least l (v).

We now state the performance of POSTORDER for the MINIO problem (I/Os are done following the FiF policy).

Lemma 3. POSTORDER computes a given tree T using at most W (T ) I/Os.

Proof. We prove this result by induction on the size of T . We introduce a new notation: for any node v of T we define W (v) as W (v) = W (T (v))c(v). In other words, W (v) represents the total volume of communications performed during the execution of the tree T (v) if we had nothing to execute but T (v) (in practice T (v) may be a strict sub-tree of T and, therefore, the execution of T (v) in the midst of the execution of T can induce more communications). Note that W (v) = W (T (v)) if v is the root of T . We prove by induction on the size of T (v) that POSTORDER performs at most W (v) I/Os during the execution of T (v) if POSTORDER has nothing to execute but T (v).

Let us assume that v is a leaf. Because we have assumed (in Section 3.1) that M was large enough for a single node to be processed without I/Os, c(v) = 0 and thus W (T (v)) = 0 = W (v) + c(v). On the other hand, POSTORDER performs 0 I/O during the execution of T (v). Now assume that v is not a leaf. By the induction hypothesis, for any i ∈ [1; k], POSTORDER executes the tree T (v i ) alone using at most W (v i ) I/Os. We prove that to process the tree T (v i ), after the trees T (v 1 ) through T (v i -1 ) were processed, we need to perform at most

W (T (v i )) = W (v i ) + c(v i ) I/Os. Let us consider the (i + 1)-th child of v. If c(v i +1 ) = 0, then l (v i +1 ) + 1≤ j <i +1 (1 -c(v j
)) ≤ M . Then, according to Lemma 1, no I/Os are required to execute T (v i +1 ) under POSTORDER even after the processing of T (v 1 ) through T (v i ). Indeed, before the start of the processing of T (v i +1 ) the memory contains exactly

1≤ j <i +1 (1-c(v j )) nodes. Therefore W (v i +1 ) = c(v i +1 ) = W (T (v i +1
)) = 0 and we have the desired property.

We are now in the case c(v

i +1 ) = 1; thus l (v i +1 ) + 1≤ j <i +1 (1 -c(v j )) > M . Recall that for l ∈ [1; i ], l (v l ) ≥ l (v i +1 ). Thus, if l (v i +1 ) ≥ M , then for l ∈ [2; i ], l (v l ) ≥ M and c(v l ) = 1 (because m(v l ) ≥ (1 - c(v 1 )) = 1)
. Therefore, after the completion of T (v i ) there is only one node remaining in the memory: v i . Then using a single I/O POSTORDER writes v i to disk, the memory is empty, and T (v i +1 ) can then be processed with W (v i +1 ) I/Os, giving a total of at most W (v i +1 ) + c(v i +1 ) = W (T (v i +1 )) I/Os. The only remaining case is the case l (v i +1 ) < M . The processing of T (v i ) requires at least l (v i +1 ) empty memory slots because l (v i ) ≥ l (v i +1 ). Hence, after the completion of T (v i ) there are at least l (v i +1 )-1 empty memory slots (the memory including the node v i itself ). Then using a single I/O POSTORDER writes v i to disk and there are enough empty memory slots to process T (v i +1 ) without any additional I/Os. Therefore we need to perform at most W (T (v i +1 )) = W (v i +1 ) + c(v i +1 ) I/Os. This concludes the proof.

Lemma 5 relies on the following intermediate result.

Lemma 4. Consider a node v of a tree T with a child, a, whose label l (a) satisfies l (a) > M . Now, consider any tree T identical to T , except that the subtree rooted at a has been replaced by any tree whose new label l (a) satisfies l (a) ≥ l (a) ≥ M . Then w (v) = w(v).

Proof. Let v 1 , . . . , v k be the children of v, ordered so that l (v 1 ) ≥ • • • ≥ l (v k ). Let j be the index of a: a = v j . As the label of a in T , l (a), is not larger than l (a), we can have l (a) < l (v j +1 ). Therefore, we define another ordering of the children of v denoted by v 1 , . . . , v k such that l (v 1 ) ≥ • • • ≥ l (v k ). Let j be the index of a in this ordering:

v j = a = v j .
Note that j ≥ j . For i ∈ [ j + 1; j ], we have v i = v i -1 ; at j , we have v j = v j ; and for i ∉ [ j ; j ], we

have v i = v i .
If j = 1 then j = 1. This case means that a remains the node with the largest label. The labels of the other children of v remain unchanged. Because c(v 1 ) = c (v 1 ) = 0 by definition, then c

(v i ) = c(v i ) for any child v i of v and, thus, w(v) is equal to w (v).
Let us now consider the case j > 1. From what precedes, v j -1 = v j . Then l

(v j ) = l (v j -1 ) ≥ l (v j ) = l (a) ≥ M . However, for any i ∈ [1; j ], l (v i ) ≥ l (v j ) ≥ M and l (v i ) ≥ l (v j ) ≥ M . Therefore, for any i ∈ [2; j ], l (v i ) + m (v i ) > M (because m (v i ) ≥ 1 -c (v 1 ) = 1 ) and, thus, c (v i ) = 1. Similarly, for any i ∈ [2; j ], l (v i ) + m(v i ) > M (because m(v i ) ≥ m(v 1 ) = 1 ) and, thus, c(v i ) = 1. Therefore, for i ∈ [1; j ], c(v i ) = c (v i ). Then, for i ∈ [ j +1; k], v i = v i , m(v i ) = m (v i ), and c(v i ) = c (v i ) by an obvious induction. Therefore, w (v) = k i =2 c (v i ) = k i =2 c(v i ) = w(v).
The following lemma gives a lower bound on the I/Os performed by any schedule.

Lemma 5.

No schedule can compute a tree T performing strictly less than W (T ) I/Os.

Proof. We proceed by induction on the number of nodes of T . The base case consists of a tree T that can be scheduled without any I/O. For contradiction, assume that W (T ) > 0. Then there exists a node v of T such that w(v) > 0 and a child v i of v such that c(v i ) = 1. Then, by definition of c(v i ) and of l (v), l (v) > M . However, according to Lemma 2, "any schedule uses at least l (v) slots to compute T (v)", so T (v), and thus T , cannot be scheduled without I/Os. Hence, a contradiction; thus W (T ) = 0.

Consider a tree T that cannot be scheduled without I/Os, and a schedule P on T that minimizes the total volume of I/Os.

First, by Lemma 1, there exists a node v such that l (v) > M . Otherwise, POSTORDER would be able to schedule T without I/Os, which would violate our assumption on T . Then, the label of the root r of T also satisfies l (r ) > M .

Let s be the first node to be stored under P . Then, the subtree T (s) has been scheduled without I/Os so, by Lemma 2, we have l (s) ≤ M and, hence, no node of T (s) has a label larger than M . Let µ be the closest ancestor of s to have a label larger than M . µ exists as l (r ) > M and l (s) ≤ M . Let µ 1 , . . . , µ k be the children of µ, ordered such that l (µ i ) ≥ l (µ i +1 ). Let j be such that µ j is either s or one of its ancestors. Let

t = min{i ∈ [1; k] | l (µ i ) + i -1 > M } (t
exists because, by definition, l (µ) > M ). See Figure 1 for an illustration of the tree.

Let T be the tree obtained from T by replacing s by a leaf, therefore replacing the subtree T (s) by a single node s. As T (s) cannot be empty, T contains fewer nodes than T . Consider a schedule P on T that executes the same operations as P on T and in the same order, except for the ones concerning T (s).

We use the following notation: as above, l , m, c, w are defined on nodes of the tree T , whereas l , m , c , w refer to the same values on the tree T . The nodes in T share the same names as their equivalent in T .

We define, as in the proof of Lemma 4, an ordering µ 1 , . . . , µ k on the children of µ, l (µ i ) ≥ l (µ i +1 ). Furthermore, we assume that this order is consistent with the original one, which means the following. Let j be such that µ j = µ j . Note that j ≥ j . For i ∈ [ j + 1; j ], we have µ i = µ i -1 ; at j , µ j = µ j ; for i ∉ [ j ; j ], we have µ i = µ i . In particular, we have µ j = µ j -1 if j > j and µ j = µ j if j = j .

Note that, except s and its ancestors, every node v of T satisfies l (v) = l (v) and w(v) = w (v). Our objective is to prove that W (T ) ≥ W (T ) -1. We first prove that l (µ) ≥ M . We split into cases based on the value of t defined above: 1. t < j . The labels of µ 1 , . . . , µ t are left unchanged so l (µ) ≥ l (µ t ) + t -1 > M .

2. t = j . By definition of µ, we have l (µ j ) ≤ M , so we cannot have t = j = 1. The labels of µ 1 , . . . , µ t -1 are left unchanged, and l (µ t -1 ) ≥ l (µ t ), so

l (µ) ≥ l (µ t -1 ) + t -2 ≥ l (µ t ) + t -1 -1 > M -1.
3. t > j . Among µ 1 , . . . , µ t , the only label that changed is µ j . Therefore there are t -2 nodes that have a label l larger than that of µ t . Hence,

l (µ) ≥ l (µ t ) + t -2 > M -1.
Now, we prove that w (µ) ≥ w(µ) -1, by showing that there exists at most one index i such that c(µ i ) = 1 and c (µ i ) = 0. Let I be the set of such indexes. Note that no index strictly smaller than j can be in I as the relevant labels are identical in both trees.

The following studies how the labels c and c can differ. We consider two cases:

1. c(µ j ) = 0. Thus j ∉ I . Let a = min{i ∈ [ j + 1, k] | c(µ i ) = 1}.
There are several cases; in each we show that I contains at most one element.

(a) First, a does not exist. Then I is empty.

(b) Assume a > j . No index in [1; j ] can be in I , and thus no index in [1; j ]. In particular, c(v l ) = 0 for l ∈ [ j ; j ] by definition of a. Because node µ j appears right after node µ j in T , then m

(µ j ) = m (µ j ) + (1 -c(µ j )) = (m(µ j ) -(1 -c(µ j ))) + (1 -c(µ j )) = m(µ j ) + c(µ j ) -c(µ j ) = m(µ j )
. Therefore, we have m (µ j ) = m(µ j ). As l (µ j ) ≤ l (µ j ), we get m (µ j ) + l (µ j ) ≤ m(µ j ) + l (µ j ). Then, because l (µ j ) = l (µ j ), and by the definition of c, we conclude that c (µ j ) ≤ c(µ j ).

By definition, j ≥ j . Because a > j , if j > j , then c(µ j ) = 0 by definition of a. Otherwise j = j and we use the assumption c(µ j ) = 0 to conclude that in all cases c(µ j ) = 0. Combined with c (µ j ) ≤ c(µ j ) this gives us c (µ j ) = 0.

Recall that the labels in [1; j -1] are left unchanged, so c(

µ i ) = c (µ i ) for i ∈ [1; j -1].
From what precedes, c (µ j ) = c(µ j ) = 0. By definition of a and because j < a, c(µ i ) = 0 for i ∈ [ j + 1; j ]. Thus, all these nodes have the same label l in T and T , and all of them have m (µ i ) ≤ m(µ i ) (by definition of m: they are preceded by the same nodes so their sums have the same terms, except node µ j ). Therefore, for all these nodes c (µ i ) = 0 and thus c (µ i ) = c(µ i ). Hence, m(µ j +1 ) = m (µ j +1 ). Because l (µ j +1 ) = l (µ j +1 ) we conclude that c(µ j +1 ) = c (µ j +1 ). We then proceed by a simple induction on the nodes with a larger index to prove that I is empty.

(c) Now, assume a ≤ j . Once again, because the labels in [1; j -1] are left unchanged, and because c(µ j ) = 0, no index in [1; j ] can be in I , and thus no index in [1; a -1] can be in I .

We have two cases to consider, depending on whether a is equal to 2 (recall that by definition a ≥ j + 1 ≥ 2).

µ i ) = c (µ i ) for i ∈ [1; j -1]. Moreover, by definition of a, c(µ i ) = 0 for all i ∈ [ j +1; a -1]. Therefore, because c(µ j ) = 0, for all i ∈ [ j + 1; a -1] m (µ i ) = m(µ i ) -1 and thus c (µ i ) = c(µ i ) = 0. Also, m (µ a ) = m(µ a ) -1. Then l (µ a ) + m (µ a ) = l (µ a ) + m(µ a ) -1 = M from what precedes. Therefore, c (µ a ) = 0. Because c (µ a ) = 0, m (µ a+1 ) = m(µ a+1 ). Then, by an immediate induction, m (µ i ) = m(µ i ) for i ∈ [a + 1; j ]. Therefore [a + 1; j ] ∩ I = .
In order to prove that [ j + 1; k] ∩ I = , we have two cases to consider:

i. c (µ j ) = 1. Here, we have m (µ j +1 ) = m(µ j +1 ). Indeed, the only nodes with an index not larger than j that have different values for c and c are µ j and a. Therefore c (µ j +1 ) = c(µ j +1 ). We can then proceed by induction to show that no index larger than j belongs to I .

ii. c (µ j ) = 0. Here, we have m (µ j +1 ) = m(µ j +1 ) + 1, and therefore c (µ j +1 ) ≥ c(µ j +1 ). We can then proceed by induction to show that for any index i larger than j we have m (µ i ) ≥ m(µ i ) and c (µ i ) ≥ c(µ i ).

Inria Therefore, we have I = {a}.

2. c(µ j ) = 1. Recall that the labels in [1; j -1] are left unchanged, so no index in [1; j -1] can be in I . We now want to show that no index in [ j + 1; k] can be in I . By definition of m and since c(µ j ) = 1, we have m(µ j -1 ) = m(µ j ). Then for all i ∈ [ j + 1; j ], we have l (µ i ) = l (µ i ), and we get by an immediate induction that for all i ∈ [ j + 1; j ], we have c(µ i ) = c (µ i ). In order to prove the result on the interval [ j + 1; k], we have two cases to consider:

(a) c (µ j ) = 1. Here, we have m (µ j +1 ) = m(µ j +1 ), and therefore c (µ j +1 ) = c(µ j +1 ). We can then proceed by induction to show that no index larger than j belongs to I .

(b) c (µ j ) = 0. Here, we have m (µ j +1 ) = m(µ j +1 ) + 1, and therefore c (µ j +1 ) ≥ c(µ j +1 ). We can then proceed by induction to show that for any index i larger than j we have m

(µ i ) ≥ m(µ i ) and c (µ i ) ≥ c(µ i ).
Therefore, I ⊆ { j }.

Putting things together, no node of T (s) has a label l larger than M , so none has a positive label w. Between µ and s, no node had a label l larger than M . Therefore, except µ and its ancestors, all the nodes satisfy w (v) = w(v).

As l (µ) ≥ M , all the ancestors v of µ satisfy l (v) ≥ M , so by Lemma 4, they also satisfy

w (v) = w(v). Then, as w (µ) ∈ {w(µ) -1, w(µ)}, we have W (T ) ≥ W (T ) -1.
By the induction hypothesis, P executes at least W (T ) = W (T ) -1 I/Os, so P executes at least W (T ) I/Os, which proves the lemma.

We are now ready to prove Theorem 4.

Proof of Theorem 4. Because of Lemma 3 and of Lemma 5, POSTORDER is optimal for homogeneous trees. However, POSTORDERMINIO is a post-order that minimizes the volume of I/O minimization. Hence, it is also optimal for homogeneous trees.

Note that, on homogeneous trees, POSTORDER and POSTORDERMINIO are almost identical: POS-TORDER sorts children by non-increasing l i , while POSTORDERMINIO sorts them by non-increasing A i = mi n(M , l i -1). In particular, for children with l i > M , the order is not significant for POSTORDER-MINIO.

Postorder traversals are not competitive

Previous research has shown that the best postorder traversal for the MINMEM problem is arbitrarily far from the optimal traversal [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF]. We prove here that postorder traversals may also have bad performance for the MINIO problem. More specifically, we prove that there exist problem instances on which POSTORDERMINIO performs arbitrarily more I/O than the optimal I/O amount. We could exhibit an example where the optimal traversal does not perform any I/O and POSTORDERMINIO performs some I/O, but we rather present a more general example where the optimal traversal performs some I/O: in the following example, the optimal traversal requires 1 I/O, when POSTORDERMINIO requires Ω(nM ) I/Os. The tree used in this instance is depicted on Figure 2(a).

It is possible to traverse the tree of Figure 2(a) with a memory of size M using only a single I/O, by executing the nodes in increasing order of the labels next to the nodes. After processing the minimal subtree including the two leftmost leaves, our strategy is to process leaves from left to right. Before processing a new leaf, we complete the previous subtree up to a node of weight 1; this way the leaf and the actives nodes can both fit in memory.

M /2 6 1 2 M 1 M /2 5 1 4 M 3 M /2 9 M -1 8 M /2 13 M -1 12
(a) Example of a tree showing that POSTORDERMINIO is not an approximation algorithm.

root 2k 4k + 4 3k 4k + 3 2k -1 4k -2 3k + 1 4k -3 • • • k 4 4k 3 2k 4k + 2 3k 4k + 1 2k -1 4k 3k + 1 4k -1 • • • k 2 4k 1
Example of a tree showing that OPTMINMEM is not an approximation algorithm (M = 4k).

Inria

On the other hand, the best postorder traversal must perform a volume of I/O equal to M /2 -1 before it can start any leaf except for the first leaf it processes. This is because the least common ancestor of any two leaf nodes has two nodes of size M /2 as children, and all leaves have size at least M -1. Thus, any postorder traversal incurs at least M /2 -1 I/Os for all but one leaf node (3M /2 -2 for the example here). We can extend the tree in Figure 2(a): we replace root by a node of size 1, add to it a parent of size M /2 which is the left child of the new root; the right child of the new root is then a chain containing a leaf of size M -1 and its parent of size M /2. Doing this repeatedly until n nodes are used gives the lower bound of Ω(nM ). Therefore, POSTORDERMINIO is not constant-factor competitive.

OPTMINMEM is not competitive

Minimizing the amount of I/O in an out-of-core execution seems close to minimizing the peak memory when the memory in unbounded. Thus, in order to derive a good solution for MINIO, it seems reasonable to use an optimal algorithm for MINMEM, such as the OPTMINMEM algorithm presented by Liu [START_REF] Liu | An application of generalized tree pebbling to sparse matrix factorization[END_REF], to compute a schedule σ and then to perform I/Os using the FiF policy. In the following, we also use OPTMINMEM to denote this strategy for MINIO. We prove here that there exist problem instances on which this strategy will also perform arbitrarily more I/Os than the optimal traversal.

We first exhibit in Figure 2(b) a tree showing that OPTMINMEM does not always lead to minimum I/Os in our model. Let M = 6. The tree of Figure 2(b) can be completed with 3 I/Os, by doing one chain after the other. This corresponds to a peak memory of 9. But OPTMINMEM achieves a peak memory of 8 at the cost of 4 I/Os by executing the nodes in increasing order of the labels next to the nodes.

This example can be extended to show that OPTMINMEM may perform arbitrarily more I/Os than the optimal strategy. The extended tree is illustrated on Figure 2(c). It contains two identical chains of length 2k + 2, for a given parameter k, and the memory size is set to 4k. The weights of the tasks in each chain (in order from root to leaf ) are defined by interleaving two sequences: {2k, 2k -1, . . . , k} and {3k, 3k + 1, . . . , 4k}. As above, it is possible to schedule this tree with only 2k I/Os, but with a memory peak of 6k, by computing first one entire chain. However, OPTMINMEM achieves a memory peak of 5k by switching chains on each node with a weight smaller than 2k, as represented by the labels besides the nodes. Doing so, OPTMINMEM incurs k I/Os on each of the k + 1 smallest nodes, leading to a cost of k(k + 1) I/Os. The competitive ratio is then larger than k/2. Therefore, OPTMINMEM is not constant-factor competitive in the MINIO problem.

Complexity unknown

As shown above, polynomial-time approaches based on similar problems fail to even give a constantcompetitive ratio. The main issue facing a polynomial approach is the highly nonlocal aspect of the optimal solution. For example, since postorder traversals are not optimal, it may be highly useful to stop at intermediate points of a subtree's execution in order to process entirely different subtrees.

We conjecture that this problem is NP-hard due to these difficult dependencies. As mentioned above, if we require entire nodes to be written to disk, the problem has been shown to be NP-hard by reduction to Partition [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF]. However, this proof depends entirely on indivisible nodes, rather than on the tree's recursive structure. Taking advantage of the structure of our problem to give an NP-hardness result could lead to an interesting understanding of optimal solutions, and possibly further heuristics. We leave this as an open problem.

Heuristic

We now move to the design of a novel heuristic FULLRECEXPAND whose goal is to improve the performance of OPTMINMEM for the MINIO problem. The main idea of this heuristic is to run OPTMINMEM several times: when we detect that some I/O is needed on some node, we force this I/O by transforming the tree. This way, the following iterations of OPTMINMEM will benefit from the knowledge of this I/O. We continue transforming the tree until no more I/Os are necessary.

w i ⇒ w i w i -τ(i ) w i
In order to enforce I/Os, we use the technique of expanding a node (illustrated on Figure 3). Under an I/O function τ, we define the expansion of a node i as the substitution of this node by a chain of three nodes i 1 , i 2 , i 3 of respective weights w i , w i -τ(i ) and w i . The expansion of a node actually mimics the action of executing I/Os: the weight of the three tasks represent which amount of main memory is occupied by this node 1) when it is first completed (w i 1 = w i ), 2) when part of it is moved to disk (w i = w i -τ(i )), and 3) when the whole data is transferred back to main memory (w i 3 = w i ).

This technique first allows us to prove Theorem 2, which states that given an I/O function τ, we can find a schedule σ such that (σ, τ) is a valid traversal if there exists one.

Proof of Theorem 2. Consider the tree G obtained from G by expanding all the nodes for which τ is not null. Then, consider the schedule σ obtained by OPTMINMEM on G , and let σ be the corresponding schedule on G. Then, the memory used by σ on G during the execution of a node i is the same as the one used by σ on G during the execution of the same node i , or of i 1 if i is expanded. Then, as OPTMINMEM achieves the optimal memory peak on G , we know that σ uses as little main memory as possible under the I/O function τ. Then, (σ, τ) is a valid traversal of G.

The heuristic FULLRECEXPAND is described in Algorithm 2. The main idea of the heuristic is to expand nodes in order to obtain a tree that can be scheduled without I/O, which is equivalent to building an I/O function.

First, the heuristic recursively calls itself on the subtrees rooted at the children of the root, so that each subtree can be scheduled without I/O (but using expansions). Then, the algorithm computes OPTMINMEM on this new tree, and if I/Os are necessary, it determines which node should be expanded next. This selection is the only part where FULLRECEXPAND can deviate from an optimal strategy. Our choice is to select a node on which the FiF policy would incur I/Os; if there are several such nodes, we choose the one whose parent is scheduled the latest. After the expansion, the algorithm recomputes OPTMINMEM on the modified tree, and proceeds until no more I/O are necessary.

At the end of the computation, the returned schedule is obtained by running OPTMINMEM on the final tree computed by FULLRECEXPAND, and by transposing it on the original tree. The I/O performance of this schedule is then equal to the sum of the expansions.

FULLRECEXPAND is only a heuristic: it may give suboptimal results but also achieve better performance than OPTMINMEM, as illustrated on several examples Appendix A.

Unfortunately, the complexity of FULLRECEXPAND is not polynomial, as the number of iterations of the while loop at Line 3 cannot be bounded by the number of nodes, but may depend also on their weights. We therefore propose a simpler variant, named RECEXPAND, where the while loop at Line 3 is exited after 2 iterations. In this variant, the resulting tree G might need I/Os to be executed. The final schedule is computed as in FULLRECEXPAND, by running OPTMINMEM on this tree G. We later show that this variant gives results which are very similar to the original version. In this section, we compare the performance of the two existing strategies OPTMINMEM and POS-TORDERMINIO, and the two proposed heuristics FULLRECEXPAND and RECEXPAND. All algorithms are compared through simulations on two datasets described below. Because of its high computational complexity, FULLRECEXPAND is only tested on the first smaller dataset.

Datasets

The first dataset, named SYNTH, is composed of 330 instances of synthetic binary trees of 3000 nodes, generated uniformly at random among all binary trees. As we considered small trees, we simply used half-Catalan numbers in order to draw a tree, similarly to the method described at the beginning of [START_REF] Mäkinen | Generating random binary trees-a survey[END_REF]. The memory weight of each task is uniformly drawn from [1; 100]. The second dataset, named TREES, is composed of 329 elimination trees of actual sparse matrices from the University of Florida Sparse Matrix Collection1 (see [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF] for more details on elimination trees and the data set). Our datasets corresponds to the 329 smallest of the 640 trees presented in [START_REF] Jacquelin | On optimal tree traversals for sparse matrix factorization[END_REF], with trees ranging from 2000 to 40000 nodes.

For each tree of the two datasets, we first computed the minimal memory size necessary to process the tree nodes: LB = max i wi . We also computed the minimal peak memory for an incore execution Peak incore (using OPTMINMEM). We eliminated some trees from the TREES dataset where Peak incore = LB, leaving us with 133 remaining trees in this dataset. In all other cases, note that the possible range for the memory bound M such that some I/Os are necessary is [LB, Peak incore -1]. We chose to set M to the middle of this interval M = (LB + Peak incore -1)/2. Simulations using other values of M in this interval are presented in Appendix B.

Results

Our objective in this study is to minimize the total amount of I/Os needed to process the tree. In order to summarize and compare the performance of the different strategies we choose here to consider the number of I/Os and the memory bound M : performing 10 I/Os when the optimal only needs 1 does not have the same significance if the main memory consists of M = 10 slots or of M = 1000 slots. Therefore, in this section, if a schedule performs k I/Os, we define its performance as (M + k)/M . Then, a schedule with no I/O operations has a performance of 1 while a schedule needing M I/Os has a performance of 2.

In order to compare the performance of these algorithms, we use a generic tool called performance profile [START_REF] Dolan | Benchmarking optimization software with performance profiles[END_REF]. For a given dataset, we compute the performance of each algorithm on each tree and for each memory limit. Then, instead of computing an average above all the cases, a performance profile reports a cumulative distribution function. Given a heuristic and a threshold τ expressed in percentage, we compute the fraction of test cases in which the performance of this heuristic is at most τ% larger than the best observed performance, and plot these results. Therefore, the higher the curve, the better the method: for instance, for an overhead τ = 5%, the performance profile shows how often a given method lies within 5% of the smallest performance obtained. The left plot of Figure 4 presents the performance profile of the four heuristics for the complete dataset SYNTH. The first result is the poor performance of POSTORDERMINIO in this dataset: it almost always has at least 50% of overhead, and even a 100% overhead in 75% of the cases. Then, RECEXPAND performs far better than OPTMINMEM. The right plot of the figure presents the performance profiles of exclusively OPTMINMEM, RECEXPAND and FULLRECEXPAND. RECEXPAND performs strictly less I/Os than OPTMINMEM on 90% of the instances, and on half of them, OPTMINMEM has a 4% overhead. We can also note that FULLRECEXPAND performs only slightly better than RECEXPAND, but both heuristics are far ahead of OPTMINMEM, so the gain in the complexity of the algorithm is only balanced by a small loss of performance. For instance, RECEXPAND has an overhead of more than 2% over FULLRECEXPAND on only 3% of the instances.

The left plot of Figure 5 presents the performance profiles of the three heuristics POSTORDER-MINIO, RECEXPAND and OPTMINMEM for the complete dataset TREES. The first remark is that the three heuristics are equal on more than 90% of the 329 instances. Therefore, we now focus on the right plot, which presents the same performance profile for the 25 cases where the heuristics do not all give equal performance. We can see that the hierarchy is the same as in the previous dataset (RECEXPAND is never outperformed, and OPTMINMEM performs better than POSTORDERMINIO) but with smaller discrepancies between the heuristics. POSTORDERMINIO and OPTMINMEM respectively have more than 5% of overhead on only 40% and 10% of these instances.

Conclusion

In this paper, we revisited the problem of minimizing I/O operations in the out-of-core execution of task trees. We proved that existing solutions allow to optimally solve the problem when all output data have identical size, but that none of them has a constant competitive factor compared to the optimal solution. We proposed a novel heuristic solution that improves on an existing strategy and proved very efficient in practice. Despite our efforts, the complexity of the problem remains open. Determining this complexity would definetely be a major step, although our findings already lays the bases for more advanced studies. This includes moving to parallel out-of-core execution, as we already did for parallel incore execution [START_REF] Eyraud-Dubois | Parallel scheduling of task trees with limited memory[END_REF], but also designing competitive algorithm for the sequential problem.

A Illustration of FULLRECEXPAND on some examples

The left-hand side of Figure 6 provides an example where FULLRECEXPAND performs better than OPT-MINMEM. OPTMINMEM computes the left branch first until node a, then the right branch until node b, before completing the left branch. The memory peak reached is 12, but this schedule incurs 4 I/Os with a memory limit of 10: 7 provides an example where FULLRECEXPAND does not improve OPTMINMEM. On this instance, OPTMINMEM performs 4 I/Os, 2 on node a then 2 on node b, where POSTORDERMINIO executes first the left subtree and consumes only 3 I/Os on node c. This instance shows an example where no optimal solution perform an I/O on a node where OPTMINMEM performs an I/O. So the strategy of FULLRECEXPAND cannot be optimal, even if we used a different priority at Line 6.

Figure 1 :

 1 Figure 1: Scheme of the composition of the tree T .

i. a = 2 .

 2 Then j = 1. Therefore, in T , µ a is the first child and, by definition of c, c (µ a ) = 0. ii. a > 2. By definition of a, c(µ a ) = 1. Then, either a = j + 1 and then a -1 = j and c(µ a-1 ) = c(µ j ) = 0, or a > j + 1 and then c(µ a-1 ) = 0 by definition of a. In all cases, c(µ a-1 ) = 0. Therefore, l (µ a-1 ) + m(µ a-1 ) ≤ M . Because l (µ a-1 ) ≥ l (µ a ) and m(µ a ) = m(µ a-1 ) + 1, l (µ a ) + m(µ a ) ≤ M + 1. Because c(µ a ) = 1 by definition of a, l (µ a ) = m(µ a ) ≤ M + 1. Recall (for the third time) that the labels in [1; j -1] are left unchanged, so c(

  Example of a tree where OPTMINMEM is not optimal for MINIO (M = 6).

Figure 2 :

 2 Figure 2: The label inside node i represents w i . The label next to the nodes indicate in the leftmost figure the optimal schedule, and in the other two figures the OPTMINMEM schedule.

Figure 3 :

 3 Figure 3: Example of node expansion.

Inria

Algorithm 2 :1 foreach child i of r do 2 G 5 τ 6 i 7 modify

 22567 FULLRECEXPAND (G, r, M )Input: tree G, root of exploration r Output: Return a tree G r which can be executed without I/O, obtained from G by expanding several nodes i ← FULLRECEXPAND(G, i , M )3 G r ← tree formed by the root r and the subtrees G i 4 while OPTMINMEM(G r , r ) needs more than a memory M do ← I/O function obtained from OPTMINMEM(G r , r ) using the FiF policy ← node for which τ(i ) > 0 whose parent is scheduled the latest in OPTMINMEM(G r , r ) G r by expanding node i according to τ(i )

Figure 4 :

 4 Figure 4: Performance profiles of FULLRECEXPAND, RECEXPAND, OPTMINMEM and POSTORDER-MINIO on the SYNTH dataset (right: same performance profile without POSTORDERMINIO).

Figure 5 :

 5 Figure 5: Performance profiles for the complete TREES dataset (left) and restricted to instances where the heuristics differ (right)

Figure 6 :

 6 Figure 6: Example where FULLRECEXPAND is optimal whereas OPTMINMEM and POSTORDERMINIO are not. Let M = 10. The left tree is the original one, and the others are obtained during the execution of FULLRECEXPAND after the expansion of b.

Figure

  Figure 7 provides an example where FULLRECEXPAND does not improve OPTMINMEM. On this instance, OPTMINMEM performs 4 I/Os, 2 on node a then 2 on node b, where POSTORDERMINIO executes first the left subtree and consumes only 3 I/Os on node c. This instance shows an example where no optimal solution perform an I/O on a node where OPTMINMEM performs an I/O. So the strategy of FULLRECEXPAND cannot be optimal, even if we used a different priority at Line 6.

7 Figure 7 :

 77 Figure 7: Example where FULLRECEXPAND and OPTMINMEM are not optimal whereas POSTORDER-MINIO is. M = 7 in this example.

  Performance profile of FULLRECEXPAND, RECEXPAND, OPTMINMEM and POSTORDER-MINIO on the SYNTH dataset with the M 2 memory bound (right: same performance profile without POSTORDERMINIO). Performance profiles for the complete TREES dataset with the M 2 memory bound (left) and for the instances where the heuristics differ (right) SYNTH and TREES dataset can be found in Figures10 and 11. With this memory bound, OPTMINMEM, RECEXPAND and FULLRECEXPAND are always equal, and only POSTORDERMINIO has worse performances. This can be explained by the fact that M 2 is right below the memory requires by OPTMINMEM to compute a tree without I/Os. Therefore, we can argue that it is closer to the optimal algorithm and FULLRECEXPAND does not improve the few I/Os performed by MINMEM. Nevertheless, the overhead of POSTORDERMINIO is smaller than with the other memory bounds.

	Fraction of test cases	0.25 0.50 0.75 1.00					Fraction of test cases	0.25 0.50 0.75 1.00
		0.00						0.00
		0%	50%	100%	150%	200%		-50%	-25%	0%	25%	50%
			Maximal overhead					Maximal overhead
		Algorithm	OPTMINMEM	RECEXPAND		POSTORDERMINIO	FULLRECEXPAND
	Figure 10: 0.00 0.25 0.50 0.75 1.00 Fraction of test cases					Fraction of test cases	0.00 0.25 0.50 0.75 1.00
		0%	1%	2%	3%	4%	5%	0%	1%	2%	3%	4%
			Maximal overhead					Maximal overhead
			Algorithm	OPTMINMEM	RECEXPAND	POSTORDERMINIO
	Figure 11:

Inria

RESEARCH CENTRE GRENOBLE -RHÔNE-ALPES

Inovallée 655 avenue de l'Europe Montbonnot 38334 Saint Ismier Cedex Publisher Inria Domaine de Voluceau -Rocquencourt BP 105 -78153 Le Chesnay Cedex inria.fr ISSN 0249-6399

RR n°9025

http://www.cise.ufl.edu/research/sparse/matrices/ RR n°9025

Acknowledgment

This material is based upon research supported by the SOLHAR project operated by the French National Research Agency (ANR) and the Chateaubriand Fellowship of the Office for Science and Technology of the Embassy of France in the United States.

In this section, we present numerical results on the same datasets than the ones presented in Section 6, but with different memory bounds.

First, we use the memory bound M 1 = LB, which is defined in Section 6, and represents the minimum memory bound for which it is possible to compute a given tree. We plot the corresponding performance profiles for the SYNTH dataset in Figure 8 and the TREES dataset in Figure 9. The main conclusion that can be made comparing to the results of Section 6 is that the difference between OPT-MINMEM and RECEXPAND is significantly larger with this memory bound. Indeed, there is a 10% of overhead for OPTMINMEM in 90% of the cases whereas such an overhead was reached in only 15% of the cases previously. This can be explained by the fact that the memory bound considered here is further from the memory required by MINMEM. On the other hand, the difference between POSTORDER-MINIO and RECEXPAND are smaller in this case: there is a 100% of overhead for POSTORDERMINIO in half of the cases whereas we had this property in 75% of the cases with a higher memory bound. The same tendency can be observed for the TREES dataset in Figure 9, even if it is less significant.

Second, we use the memory bound M 2 = Peak incore -1, which is on the opposite the largest memory bound for which I/Os are requires in order to compute a tree. The corresponding profiles for the Inria