| 1 |
/* |
| 2 |
* (C) Copyright 2013 ECMWF. |
| 3 |
* |
| 4 |
* This software is licensed under the terms of the Apache Licence Version 2.0 |
| 5 |
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 6 |
* In applying this licence, ECMWF does not waive the privileges and immunities |
| 7 |
* granted to it by virtue of its status as an intergovernmental organisation |
| 8 |
* nor does it submit to any jurisdiction. |
| 9 |
*/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include "atlas/grid/detail/partitioner/Partitioner.h" |
| 14 |
|
| 15 |
namespace atlas { |
| 16 |
namespace grid { |
| 17 |
namespace detail { |
| 18 |
namespace partitioner { |
| 19 |
|
| 20 |
/// @class TransPartitioner |
| 21 |
/// @brief Equal regions partitioning algorithm computed by the IFS trans |
| 22 |
/// library |
| 23 |
/// |
| 24 |
/// The user is advised to use the "EqualRegionsPartitioner" class instead. This |
| 25 |
/// implementation is only here to to guarantee the exact same distribution |
| 26 |
/// as IFS is using. The difference with "EqualRegionsPartitioner" is minimal. |
| 27 |
/// (a few points may be assigned to different partitions). |
| 28 |
class TransPartitioner : public Partitioner { |
| 29 |
public: |
| 30 |
/// @brief Constructor |
| 31 |
TransPartitioner(); |
| 32 |
|
| 33 |
TransPartitioner(const eckit::Parametrisation&); |
| 34 |
|
| 35 |
TransPartitioner(const idx_t nb_partitions, const eckit::Parametrisation& = util::NoConfig()); |
| 36 |
|
| 37 |
virtual ~TransPartitioner(); |
| 38 |
|
| 39 |
using Partitioner::partition; |
| 40 |
/// Warning: this function temporariliy allocates a new Trans, but without the |
| 41 |
/// computations |
| 42 |
/// of the spectral coefficients (LDGRIDONLY=TRUE) |
| 43 |
virtual void partition(const Grid&, int part[]) const; |
| 44 |
|
| 45 |
virtual std::string type() const { return "ectrans"; } |
| 46 |
|
| 47 |
private: |
| 48 |
bool split_y_{true}; |
| 49 |
}; |
| 50 |
|
| 51 |
} // namespace partitioner |
| 52 |
} // namespace detail |
| 53 |
} // namespace grid |
| 54 |
} // namespace atlas |