1.syntax error fix 2.allocate temporary buffers only once per sim
This commit is contained in:
@@ -103,6 +103,11 @@ void singlesContribution
|
||||
// -- TIJK
|
||||
// , DataPtr<F> Tijk
|
||||
, DataFieldType<F>* Tijk_
|
||||
#if defined(HAVE_CUDA)
|
||||
// -- tmp buffers
|
||||
, DataFieldType<F>* _t_buffer
|
||||
, DataFieldType<F>* _vhhh
|
||||
#endif
|
||||
);
|
||||
// Doubles contribution:1 ends here
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ Info info;
|
||||
|
||||
// [[file:~/cuda/atrip/atrip.org::*Attributes][Attributes:2]]
|
||||
DataPtr<F> data;
|
||||
#if defined(HAVE_CUDA && !defined ATRIP_SOURCES_IN_GPU)
|
||||
#if defined(HAVE_CUDA) && !defined (ATRIP_SOURCES_IN_GPU)
|
||||
F* mpi_data;
|
||||
#endif
|
||||
// Attributes:2 ends here
|
||||
@@ -456,7 +456,7 @@ void unwrapAndMarkReady() {
|
||||
if (errorCode != MPI_SUCCESS)
|
||||
throw "Atrip: Unexpected error MPI ERROR";
|
||||
|
||||
#if defined(HAVE_CUDA && !defined ATRIP_SOURCES_IN_GPU)
|
||||
#if defined(HAVE_CUDA) && !defined(ATRIP_SOURCES_IN_GPU)
|
||||
// copy the retrieved mpi data to the device
|
||||
WITH_CHRONO("cuda:memcpy",
|
||||
_CHECK_CUDA_SUCCESS("copying mpi data to device",
|
||||
@@ -488,7 +488,7 @@ void unwrapAndMarkReady() {
|
||||
Slice(size_t size_)
|
||||
: info({})
|
||||
, data(DataNullPtr)
|
||||
#if defined(HAVE_CUDA && !defined ATRIP_SOURCES_IN_GPU)
|
||||
#if defined(HAVE_CUDA) && !defined(ATRIP_SOURCES_IN_GPU)
|
||||
, mpi_data(nullptr)
|
||||
#endif
|
||||
, size(size_)
|
||||
|
||||
@@ -405,6 +405,7 @@ template <typename F=double>
|
||||
, sliceSize(std::accumulate(sliceLength.begin(),
|
||||
sliceLength.end(),
|
||||
1UL, std::multiplies<size_t>()))
|
||||
|
||||
#if defined(ATRIP_SOURCES_IN_GPU)
|
||||
, sources(rankMap.nSources())
|
||||
#else
|
||||
@@ -417,6 +418,7 @@ template <typename F=double>
|
||||
{ // constructor begin
|
||||
|
||||
LOG(0,"Atrip") << "INIT SliceUnion: " << name << "\n";
|
||||
printf("sliceSize %d, number of slices %d\n\n\n", sliceSize, sources.size());
|
||||
|
||||
#if defined(ATRIP_SOURCES_IN_GPU)
|
||||
for (auto& ptr: sources) {
|
||||
@@ -571,7 +573,7 @@ template <typename F=double>
|
||||
if (slice.info.state == Slice<F>::Fetch) { // if-1
|
||||
// TODO: do it through the slice class
|
||||
slice.info.state = Slice<F>::Dispatched;
|
||||
#if defined(HAVE_CUDA && defined ATRIP_SOURCES_IN_GPU)
|
||||
#if defined(HAVE_CUDA) && defined(ATRIP_SOURCES_IN_GPU)
|
||||
# if !defined(ATRIP_CUDA_AWARE_MPI)
|
||||
# error "You need CUDA aware MPI to have slices on the GPU"
|
||||
# endif
|
||||
|
||||
Reference in New Issue
Block a user