modifications for MPI+CUDA run

This commit is contained in:
Hamidreza Norouzi 2024-05-22 09:56:06 +03:30
parent 4e8b921514
commit d5ff1d7906
5 changed files with 101 additions and 26 deletions

View File

@ -7,8 +7,8 @@ contactSearch/methods/cellBased/NBS/NBS.cpp
contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp
contactSearch/boundaries/boundaryContactSearch/boundaryContactSearch.cpp contactSearch/boundaries/boundaryContactSearch/boundaryContactSearch.cpp
#contactSearch/boundaries/twoPartContactSearch/twoPartContactSearchKernels.cpp contactSearch/boundaries/twoPartContactSearch/twoPartContactSearchKernels.cpp
#contactSearch/boundaries/twoPartContactSearch/twoPartContactSearch.cpp contactSearch/boundaries/twoPartContactSearch/twoPartContactSearch.cpp
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearchKernels.cpp contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearchKernels.cpp
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearch.cpp contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearch.cpp
contactSearch/boundaries/periodicBoundaryContactSearch/wallBoundaryContactSearch.cpp contactSearch/boundaries/periodicBoundaryContactSearch/wallBoundaryContactSearch.cpp

View File

@ -21,3 +21,80 @@ Licence:
#include "wordVectorHost.hpp" #include "wordVectorHost.hpp"
bool pFlow::VectorSingle<pFlow::word,pFlow::HostSpace>::insertSetElement(
const uint32IndexContainer& indices,
const word& val
)
{
if(indices.empty()) return true;
auto maxInd = indices.max();
if(this->empty() || maxInd > size()-1 )
{
resize(maxInd+1);
}
auto ind = indices.hostView();
auto s = indices.size();
for(uint32 i=0; i< s; i++)
{
container_[ind[i]] = val;
}
return true;
}
bool pFlow::VectorSingle<pFlow::word,pFlow::HostSpace>::insertSetElement(
const uint32IndexContainer& indices,
const std::vector<word>& vals
)
{
if(indices.empty())return true;
if(indices.size() != vals.size())return false;
auto maxInd = indices.max();
if(this->empty() || maxInd > size()-1 )
{
resize(maxInd+1);
}
auto ind = indices.hostView();
auto s = indices.size();
for(uint32 i=0; i< s; i++)
{
container_[ind[i]] = vals[i];
}
return true;
}
bool pFlow::VectorSingle<pFlow::word,pFlow::HostSpace>::insertSetElement(
const uint32IndexContainer& indices,
const ViewType1D<word, memory_space> vals
)
{
if(indices.empty())return true;
if(indices.size() != vals.size())return false;
auto maxInd = indices.max();
if(this->empty() || maxInd > size()-1 )
{
resize(maxInd+1);
}
auto ind = indices.hostView();
auto s = indices.size();
for(uint32 i=0; i< s; i++)
{
container_[ind[i]] = vals[i];
}
return true;
}

View File

@ -372,28 +372,20 @@ public:
return span<word>(const_cast<word*>(container_.data()), container_.size()); return span<word>(const_cast<word*>(container_.data()), container_.size());
} }
INLINE_FUNCTION_H
bool insertSetElement(const uint32IndexContainer& indices, const word& val)
{
notImplementedFunction;
return false;
}
INLINE_FUNCTION_H bool insertSetElement(const uint32IndexContainer& indices, const word& val);
bool insertSetElement(const uint32IndexContainer& indices, const std::vector<word>& vals)
{
notImplementedFunction;
return false; bool insertSetElement(const uint32IndexContainer& indices, const std::vector<word>& vals);
}
INLINE_FUNCTION_H
bool insertSetElement( bool insertSetElement(
const uint32IndexContainer& indices, const uint32IndexContainer& indices,
const ViewType1D<word, memory_space> vals) const ViewType1D<word, memory_space> vals
{ );
notImplementedFunction;
return false;
}
INLINE_FUNCTION_H INLINE_FUNCTION_H
bool reorderItems(const uint32IndexContainer& indices) bool reorderItems(const uint32IndexContainer& indices)

View File

@ -92,9 +92,12 @@ pFlow::boundaryList::boundaryList(pointStructure& pStruct)
: ListPtr<boundaryBase>(pStruct.simDomain().sizeOfBoundaries()), : ListPtr<boundaryBase>(pStruct.simDomain().sizeOfBoundaries()),
pStruct_(pStruct), pStruct_(pStruct),
neighborListUpdateInterval_( neighborListUpdateInterval_(
pStruct.simDomain().subDict("boundaries").getVal<uint32>( max(
"neighborListUpdateInterval" pStruct.simDomain().subDict("boundaries").getVal<uint32>(
) "neighborListUpdateInterval"
),
1u
)
) )
{ {
} }

View File

@ -32,9 +32,12 @@ bool pFlow::regularSimulationDomain::createBoundaryDicts()
auto& rbBoundaries = this->subDict("regularBoundaries"); auto& rbBoundaries = this->subDict("regularBoundaries");
auto neighborLength = boundaries.getVal<real>("neighborLength"); auto neighborLength = boundaries.getVal<real>("neighborLength");
auto boundaryExtntionLengthRatio = auto boundaryExtntionLengthRatio = max(
boundaries.getValOrSet<real>("boundaryExtntionLengthRatio", 0.1); boundaries.getValOrSet<real>("boundaryExtntionLengthRatio", 0.1),
auto updateIntercal = boundaries.getValOrSet<uint32>("updateInterval", 1u); 0.0);
auto updateIntercal = max(
boundaries.getValOrSet<uint32>("updateInterval", 1u),
1u);
for(uint32 i=0; i<sizeOfBoundaries(); i++) for(uint32 i=0; i<sizeOfBoundaries(); i++)
{ {