DIY 2.0 data-parallel out-of-core C++ library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List

queue-policy.hpp
1 #ifndef DIY_QUEUE_POLICY_HPP
2 #define DIY_QUEUE_POLICY_HPP
3
4
5 namespace diy
6 {
7 struct Master::QueuePolicy
8 {
9 virtual ~QueuePolicy() {}
10 bool unload_incoming(const Master& master, int from, int to, size_t size) const =0;
11 bool unload_outgoing(const Master& master, int from, size_t size) const =0;
12 };
13
14 struct Master::QueueSizePolicy: public QueuePolicy
15 {
16 QueueSizePolicy(size_t sz): size(sz) {}
17 bool unload_incoming(const Master& master, int from, int to, size_t sz) const { return sz > size; }
18 bool unload_outgoing(const Master& master, int from, size_t sz) const { return sz > size; } // FIXME
19
20 size_t size;
21 };
22 }
23
24 #endif
diy
diy::Master::Master
Master(mpi::communicator comm, int threads=1, int limit=-1, CreateBlock create=0, DestroyBlock destroy=0, ExternalStorage *storage=0, SaveBlock save=0, LoadBlock load=0, QueuePolicy *q_policy=new QueueSizePolicy(4096))
The main DIY object.
Definition: master.hpp:131
diy::Master::size
unsigned size() const
return the number of local blocks
Definition: master.hpp:201