partition.h 2.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2015 Peter W. Draper (p.w.draper@durham.ac.uk)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/
#ifndef SWIFT_PARTITION_H
#define SWIFT_PARTITION_H

#include "space.h"
23
#include "task.h"
24

25
/* Initial partitioning types. */
26
enum partition_type {
27
28
29
30
31
32
33
  INITPART_GRID = 0,
  INITPART_VECTORIZE,
  INITPART_METIS_WEIGHT,
  INITPART_METIS_NOWEIGHT
};

/* Simple descriptions of types for reports. */
34
extern const char *initial_partition_name[];
35
36

/* The selected initial partition type and any related metadata. */
37
38
struct partition {
  enum partition_type type;
39
40
41
  int grid[3];
};
/* Repartition type to use. */
42
enum repartition_type {
43
44
45
  REPART_NONE = 0,
  REPART_METIS_BOTH,
  REPART_METIS_VERTEX,
46
47
  REPART_METIS_EDGE,
  REPART_METIS_VERTEX_EDGE
48
49
50
};

/* Simple descriptions of types for reports. */
51
extern const char *repartition_name[];
52

53
void partition_repartition(enum repartition_type reparttype, int nodeID,
Matthieu Schaller's avatar
Matthieu Schaller committed
54
55
                           int nr_nodes, struct space *s, struct task *tasks,
                           int nr_tasks);
56
57
void partition_initial_partition(struct partition *initial_partition,
                                 int nodeID, int nr_nodes, struct space *s);
58

59
60
int partition_space_to_space(double *oldh, double *oldcdim, int *oldnodeID,
                             struct space *s);
61
#endif /* SWIFT_PARTITION_H */