Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dtk
dtk
Commits
1c8541b8
Commit
1c8541b8
authored
Aug 04, 2014
by
NICLAUSSE Nicolas
Browse files
add send/receive for arrays of primitives types
parent
30731ea2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dtkDistributed/dtkDistributedCommunicator.cpp
View file @
1c8541b8
...
...
@@ -150,6 +150,36 @@ void dtkDistributedCommunicator::send(char *data, qint64 size, qint32 target, qi
return
this
->
send
(
data
,
size
,
Char
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
bool
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Bool
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
int
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Int
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
long
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Long
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
qlonglong
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Int64
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
float
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Float
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
double
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
)
{
return
this
->
send
(
data
,
size
,
Double
,
target
,
tag
);
}
void
dtkDistributedCommunicator
::
send
(
const
QVariant
&
v
,
qint32
target
,
qint32
tag
)
{
QByteArray
bytes
;
...
...
@@ -163,6 +193,36 @@ void dtkDistributedCommunicator::receive(char *data, qint64 size, qint32 source,
return
this
->
receive
(
data
,
size
,
Char
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
bool
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Bool
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
int
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Int
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
long
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Long
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
qlonglong
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Int64
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
float
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Float
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
double
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
)
{
return
this
->
receive
(
data
,
size
,
Double
,
source
,
tag
);
}
void
dtkDistributedCommunicator
::
receive
(
QVariant
&
v
,
qint32
target
,
qint32
tag
)
{
QByteArray
bytes
;
...
...
@@ -171,37 +231,37 @@ void dtkDistributedCommunicator::receive(QVariant &v, qint32 target, qint32 tag)
stream
>>
v
;
}
void
dtkDistributedCommunicator
::
reduce
(
void
*
send
,
void
*
recv
,
qint64
size
,
DataType
dataType
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
void
*
send
,
void
*
recv
,
qint64
size
,
DataType
dataType
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
qCritical
()
<<
"Default operator for reduce, not implemented"
;
}
void
dtkDistributedCommunicator
::
reduce
(
bool
*
send
,
bool
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
bool
*
send
,
bool
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Bool
,
operationType
,
target
,
all
);
}
void
dtkDistributedCommunicator
::
reduce
(
char
*
send
,
char
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
char
*
send
,
char
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Char
,
operationType
,
target
,
all
);
}
void
dtkDistributedCommunicator
::
reduce
(
int
*
send
,
int
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
int
*
send
,
int
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Int
,
operationType
,
target
,
all
);
}
void
dtkDistributedCommunicator
::
reduce
(
qlonglong
*
send
,
qlonglong
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
qlonglong
*
send
,
qlonglong
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Int64
,
operationType
,
target
,
all
);
}
void
dtkDistributedCommunicator
::
reduce
(
float
*
send
,
float
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
float
*
send
,
float
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Float
,
operationType
,
target
,
all
);
}
void
dtkDistributedCommunicator
::
reduce
(
double
*
send
,
double
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
)
void
dtkDistributedCommunicator
::
reduce
(
double
*
send
,
double
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
)
{
return
this
->
reduce
(
send
,
recv
,
size
,
Double
,
operationType
,
target
,
all
);
}
src/dtkDistributed/dtkDistributedCommunicator.h
View file @
1c8541b8
...
...
@@ -87,7 +87,13 @@ public:
virtual
void
put
(
qint32
dest
,
qlonglong
position
,
void
*
data
,
qlonglong
buffer_id
,
qlonglong
nelements
=
1
)
=
0
;
public:
virtual
void
send
(
void
*
data
,
qint64
size
,
DataType
dataType
,
qint32
target
,
qint32
tag
)
=
0
;
virtual
void
send
(
void
*
data
,
qint64
size
,
DataType
dataType
,
qint32
target
,
qint32
tag
)
=
0
;
virtual
void
send
(
bool
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
int
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
long
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
qint64
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
float
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
double
*
data
,
qint64
size
,
qint32
target
,
int
tag
);
virtual
void
send
(
char
*
data
,
qint64
size
,
qint32
target
,
qint32
tag
);
virtual
void
send
(
QByteArray
&
array
,
qint32
target
,
qint32
tag
)
=
0
;
virtual
void
send
(
const
QVariant
&
v
,
qint32
target
,
qint32
tag
);
...
...
@@ -100,6 +106,12 @@ public:
public:
virtual
void
receive
(
void
*
data
,
qint64
size
,
DataType
dataType
,
qint32
source
,
qint32
tag
)
=
0
;
virtual
void
receive
(
bool
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
int
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
long
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
qint64
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
float
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
double
*
data
,
qint64
size
,
qint32
source
,
int
tag
);
virtual
void
receive
(
char
*
data
,
qint64
size
,
qint32
source
,
qint32
tag
);
virtual
void
receive
(
QByteArray
&
v
,
qint32
source
,
qint32
tag
)
=
0
;
virtual
void
receive
(
QByteArray
&
v
,
qint32
source
,
qint32
tag
,
dtkDistributedCommunicatorStatus
&
status
)
=
0
;
...
...
@@ -107,13 +119,13 @@ public:
/* virtual void receive(QVariant &v, qint32 source, qint32 tag, dtkDistributedCommunicatorStatus& status) = 0; */
public:
virtual
void
reduce
(
void
*
send
,
void
*
recv
,
qint64
size
,
DataType
dataType
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
bool
*
send
,
bool
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
char
*
send
,
char
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
int
*
send
,
int
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
qlonglong
*
send
,
qlonglong
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
float
*
send
,
float
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
double
*
send
,
double
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
16
target
,
bool
all
=
false
);
virtual
void
reduce
(
void
*
send
,
void
*
recv
,
qint64
size
,
DataType
dataType
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
bool
*
send
,
bool
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
char
*
send
,
char
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
int
*
send
,
int
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
qlonglong
*
send
,
qlonglong
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
float
*
send
,
float
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
virtual
void
reduce
(
double
*
send
,
double
*
recv
,
qint64
size
,
OperationType
operationType
,
qint
32
target
,
bool
all
=
false
);
public:
virtual
void
spawn
(
QStringList
hostnames
,
qlonglong
np
,
dtkDistributedWorker
&
worker
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment