Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_vcluster
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argupta
openfpm_vcluster
Commits
86b3170d
Commit
86b3170d
authored
Dec 22, 2018
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working with RUN ON DEVICE with merging
parent
03701b4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
13 deletions
+84
-13
src/VCluster/VCluster.hpp
src/VCluster/VCluster.hpp
+0
-13
src/VCluster/VCluster_meta_function.hpp
src/VCluster/VCluster_meta_function.hpp
+84
-0
No files found.
src/VCluster/VCluster.hpp
View file @
86b3170d
...
...
@@ -941,19 +941,6 @@ static inline bool is_openfpm_init()
return
ofp_initialized
;
}
/*! \brief Return true is
*
*
* \return
*/
static
inline
bool
is_mpi_rdma_cuda_active
()
{
#if defined(MPIX_CUDA_AWARE_SUPPORT) && MPIX_CUDA_AWARE_SUPPORT
return
true
;
#else
return
false
;
#endif
}
/*! \brief Initialize the library
*
...
...
src/VCluster/VCluster_meta_function.hpp
View file @
86b3170d
...
...
@@ -11,6 +11,19 @@
#include "memory/BHeapMemory.hpp"
#include "Packer_Unpacker/has_max_prop.hpp"
/*! \brief Return true is MPI is compiled with CUDA
*
* \return true i MPI is compiled with CUDA
*/
static
inline
bool
is_mpi_rdma_cuda_active
()
{
#if defined(MPIX_CUDA_AWARE_SUPPORT) && MPIX_CUDA_AWARE_SUPPORT
return
true
;
#else
return
false
;
#endif
}
template
<
bool
result
,
typename
T
,
typename
S
,
template
<
typename
>
class
layout_base
,
typename
Memory
>
struct
unpack_selector_with_prp
{
...
...
@@ -705,6 +718,55 @@ struct op_ssend_gg_recv_merge_impl
}
};
//! Helper class to merge data without serialization, using host memory
template
<
bool
sr
>
struct
op_ssend_gg_recv_merge_impl_run_device
{
//! Merge the
template
<
typename
T
,
typename
D
,
typename
S
,
template
<
typename
>
class
layout_base
,
int
...
prp
>
inline
static
void
execute
(
D
&
recv
,
S
&
v2
,
size_t
i
,
size_t
&
start
)
{
// Merge the information
recv
.
template
merge_prp_v
<
replace_
,
typename
T
::
value_type
,
typename
S
::
Memory_type
,
openfpm
::
grow_policy_identity
,
layout_base
,
prp
...>(
v2
,
start
);
recv
.
template
hostToDevice
<
prp
...>();
start
+=
v2
.
size
();
}
};
//! Helper class to merge data without serialization direct transfer to CUDA buffer
template
<
bool
sr
>
struct
op_ssend_gg_recv_merge_impl_run_device_direct
{
//! Merge the
template
<
typename
T
,
typename
D
,
typename
S
,
template
<
typename
>
class
layout_base
,
int
...
prp
>
inline
static
void
execute
(
D
&
recv
,
S
&
v2
,
size_t
i
,
size_t
&
start
)
{
// Merge the information
recv
.
template
merge_prp_device
<
replace_
,
typename
T
::
value_type
,
typename
S
::
Memory_type
,
openfpm
::
grow_policy_identity
,
prp
...>(
v2
,
start
);
start
+=
v2
.
size
();
}
};
//! Helper class to merge data with serialization
template
<
>
struct
op_ssend_gg_recv_merge_impl
<
true
>
...
...
@@ -747,6 +809,28 @@ struct op_ssend_gg_recv_merge
}
};
//! Helper class to merge data
struct
op_ssend_gg_recv_merge_run_device
{
//! starting marker
size_t
start
;
//! constructor
op_ssend_gg_recv_merge_run_device
(
size_t
start
)
:
start
(
start
)
{}
//! execute the merge
template
<
bool
sr
,
typename
T
,
typename
D
,
typename
S
,
template
<
typename
>
class
layout_base
,
int
...
prp
>
void
execute
(
D
&
recv
,
S
&
v2
,
size_t
i
,
size_t
opt
)
{
bool
active
=
is_mpi_rdma_cuda_active
();
if
(
active
==
true
)
{
op_ssend_gg_recv_merge_impl_run_device_direct
<
sr
>::
template
execute
<
T
,
D
,
S
,
layout_base
,
prp
...>(
recv
,
v2
,
i
,
start
);}
else
{
op_ssend_gg_recv_merge_impl_run_device
<
sr
>::
template
execute
<
T
,
D
,
S
,
layout_base
,
prp
...>(
recv
,
v2
,
i
,
start
);}
}
};
//////////////////////////////////////////////////
...
...
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