ASAGI
1.0
a pArallel Server for Adaptive GeoInformation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
transfer
numafull.h
Go to the documentation of this file.
1
38
#ifndef TRANSFER_NUMAFULL_H
39
#define TRANSFER_NUMAFULL_H
40
41
#include <cstring>
42
43
namespace
transfer
44
{
45
49
class
NumaFull
50
{
51
private
:
53
const
unsigned
char
*
m_data
;
54
56
unsigned
long
m_blockCount
;
57
59
unsigned
long
m_blockSize
;
60
62
int
m_rank
;
63
64
public
:
65
NumaFull
()
66
:
m_data
(0L),
67
m_blockCount
(0),
m_blockSize
(0),
68
m_rank
(-1)
69
{
70
}
71
72
virtual
~
NumaFull
()
73
{
74
}
75
79
asagi::Grid::Error
init
(
const
unsigned
char
* data,
80
unsigned
long
blockCount,
81
unsigned
long
blockSize,
82
const
types::Type
&type,
83
const
mpi::MPIComm
&mpiComm,
84
const
numa::NumaComm
&numaComm,
85
cache::CacheManager
&cacheManager)
86
{
87
m_blockCount
= blockCount;
88
m_blockSize
= blockSize * type.
size
();
89
90
// Compute the start of the memory
91
m_data
= &data[-
static_cast<
long
>
(numaComm.
domainId
()
92
*
m_blockSize
*
m_blockCount
)];
93
94
m_rank
= mpiComm.
rank
();
95
96
return
asagi::Grid::SUCCESS
;
97
}
98
108
bool
transfer
(
unsigned
long
blockId,
109
int
remoteRank,
unsigned
int
domainId,
unsigned
long
offset,
110
unsigned
char
* cache)
111
{
112
if
(remoteRank !=
m_rank
)
113
return
false
;
114
115
memcpy(cache, &
m_data
[(
m_blockCount
* domainId + offset) *
m_blockSize
],
116
m_blockSize);
117
118
return
true
;
119
}
120
};
121
122
}
123
124
#endif // TRANSFER_NUMAFULL_H
125
asagi::Grid::Error
Error
Definition:
asagi.h:92
mpi::MPIComm
Definition:
mpicomm.h:73
asagi::Grid::SUCCESS
Definition:
asagi.h:94
transfer::NumaFull::m_rank
int m_rank
Definition:
numafull.h:62
transfer::NumaFull::m_blockSize
unsigned long m_blockSize
Definition:
numafull.h:59
transfer::NumaFull::m_blockCount
unsigned long m_blockCount
Definition:
numafull.h:56
transfer::NumaFull::transfer
bool transfer(unsigned long blockId, int remoteRank, unsigned int domainId, unsigned long offset, unsigned char *cache)
Definition:
numafull.h:108
numa::NumaComm
Definition:
numacomm.h:52
transfer::NumaFull::m_data
const unsigned char * m_data
Definition:
numafull.h:53
cache::CacheManager
Manages a block cache.
Definition:
cachemanager.h:52
transfer::NumaFull::init
asagi::Grid::Error init(const unsigned char *data, unsigned long blockCount, unsigned long blockSize, const types::Type &type, const mpi::MPIComm &mpiComm, const numa::NumaComm &numaComm, cache::CacheManager &cacheManager)
Definition:
numafull.h:79
numa::NumaComm::domainId
unsigned int domainId() const
Definition:
numacomm.h:102
types::Type
Definition:
type.h:60
mpi::MPIComm::rank
int rank() const
Definition:
mpicomm.h:132
transfer::NumaFull
Definition:
numafull.h:49
types::Type::size
virtual unsigned int size() const =0
Generated by
1.8.7