Skip to content

Commit e8ee357

Browse files
minor changes after MPI merge
1 parent 9fb8abb commit e8ee357

14 files changed

Lines changed: 82 additions & 63 deletions

File tree

src/Particles/SphereParticles/processorBoundarySphereParticles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool pFlow::processorBoundarySphereParticles::acceleration(const timeInfo &ti, c
2626
auto I = Particles().I().BoundaryField(thisIndex).neighborProcField().deviceView();
2727
auto cf = Particles().contactForce().BoundaryField(thisIndex).neighborProcField().deviceView();
2828
auto ct = Particles().contactTorque().BoundaryField(thisIndex).neighborProcField().deviceView();
29-
auto acc = Particles().accelertion().BoundaryField(thisIndex).neighborProcField().deviceView();
29+
auto acc = Particles().acceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
3030
auto rAcc = Particles().rAcceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
3131

3232
Kokkos::parallel_for(

src/phasicFlow/MPIParallelization/dataIOMPI/dataIOMPIs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ template class pFlow::MPI::dataIOMPI<pFlow::uint32x3>;
1616

1717
template class pFlow::MPI::dataIOMPI<pFlow::uint64>;
1818

19-
template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
19+
//template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
2020

2121
template class pFlow::MPI::dataIOMPI<pFlow::real>;
2222

src/phasicFlow/MPIParallelization/domain/MPISimulationDomain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include "scatteredMasterDistribute.hpp"
2525
#include "scatteredMasterDistributeChar.hpp"
2626

27-
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control)
27+
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control, real maxBSphere)
2828
:
29-
simulationDomain(control),
29+
simulationDomain(control, maxBSphere),
3030
communication_(pFlowProcessors()),
3131
subDomainsAll_(pFlowProcessors()),
3232
numPointsAll_(pFlowProcessors()),

src/phasicFlow/MPIParallelization/domain/MPISimulationDomain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MPISimulationDomain : public simulationDomain
6161

6262
TypeInfo("simulationDomain<MPI>");
6363

64-
explicit MPISimulationDomain(systemControl& control);
64+
explicit MPISimulationDomain(systemControl& control, real maxBSphere);
6565

6666
~MPISimulationDomain() final = default;
6767

src/phasicFlow/MPIParallelization/pointField/processorBoundaryField.cpp

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pFlow::MPI::processorBoundaryField<T, MemorySpace>::updateBoundary(
4747
)
4848
{
4949
#ifndef BoundaryModel1
50-
if(!this->boundary().performBoundarytUpdate())
50+
if(!this->boundary().performBoundaryUpdate())
5151
return true;
5252
#endif
5353

@@ -128,21 +128,19 @@ const typename pFlow::MPI::processorBoundaryField<T, MemorySpace>::
128128

129129
template<class T, class MemorySpace>
130130
bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
131-
real t,
132-
real dt,
133-
uint32 iter,
131+
const timeInfo & ti,
134132
const message& msg,
135133
const anyList& varList
136134
)
137135
{
138-
BoundaryFieldType::hearChanges(t,dt,iter, msg,varList);
136+
139137
if(msg.equivalentTo(message::BNDR_PROC_SIZE_CHANGED))
140138
{
141-
auto newProcSize = varList.getObject<uint32>("size");
139+
auto newProcSize = varList.getObject<uint32>(
140+
message::eventName(message::BNDR_PROC_SIZE_CHANGED));
142141
neighborProcField_.resize(newProcSize);
143142
}
144-
145-
if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
143+
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
146144
{
147145
const auto& indices = varList.getObject<uint32Vector_D>(
148146
message::eventName(message::BNDR_PROCTRANSFER_SEND)
@@ -169,7 +167,6 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
169167
thisFieldInNeighbor_.sendData(pFlowProcessors(),transferData);
170168
}
171169

172-
173170
}
174171
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_RECIEVE))
175172
{
@@ -182,30 +179,38 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
182179
{
183180

184181
uint32 numRecieved = neighborProcField_.waitBufferForUse();
185-
186-
if(msg.equivalentTo(message::CAP_CHANGED))
182+
if(numRecieved == 0u)
187183
{
188-
auto newCap = varList.getObject<uint32>(
189-
message::eventName(message::CAP_CHANGED));
190-
this->internal().field().reserve(newCap);
191-
184+
return true;
192185
}
193-
if(msg.equivalentTo(message::SIZE_CHANGED))
186+
187+
if(msg.equivalentTo(message::RANGE_CHANGED))
194188
{
195-
auto newSize = varList.getObject<uint32>(
196-
message::eventName(message::SIZE_CHANGED));
197-
this->internal().field().resize(newSize);
189+
auto newRange = varList.getObject<rangeU32>(
190+
message::eventName(message::RANGE_CHANGED));
191+
this->internal().field().resize(newRange.end());
198192
}
199193

200-
const auto& indices = varList.getObject<uint32IndexContainer>(
201-
message::eventName(message::ITEM_INSERT));
202-
203-
this->internal().field().insertSetElement(indices, neighborProcField_.buffer().deviceView());
204-
205-
return true;
194+
if(msg.equivalentTo(message::ITEMS_INSERT))
195+
{
196+
const auto& indices = varList.getObject<uint32IndexContainer>(
197+
message::eventName(message::ITEMS_INSERT));
198+
199+
this->internal().field().insertSetElement(
200+
indices,
201+
neighborProcField_.buffer().deviceView());
202+
}
203+
}
204+
else
205+
{
206+
if(!BoundaryFieldType::hearChanges(ti, msg,varList) )
207+
{
208+
return false;
209+
}
206210
}
207211

208212
return true;
213+
209214
}
210215
template <class T, class MemorySpace>
211216
void pFlow::MPI::processorBoundaryField<T, MemorySpace>::sendBackData() const

src/phasicFlow/MPIParallelization/pointField/processorBoundaryField.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ class processorBoundaryField
9191
}
9292

9393
bool hearChanges(
94-
real t,
95-
real dt,
96-
uint32 iter,
94+
const timeInfo & ti,
9795
const message& msg,
9896
const anyList& varList
9997
) override;

src/phasicFlow/MPIParallelization/pointStructure/boundaries/boundaryProcessor.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
8383
else if(step == 2 )
8484
{
8585

86-
#ifdef BoundaryModel1
87-
callAgain = true;
88-
#else
89-
if(!performBoundarytUpdate())
90-
{
91-
callAgain = false;
92-
return true;
93-
}
94-
#endif
86+
#ifdef BoundaryModel1
87+
callAgain = true;
88+
#else
89+
if(!performBoundaryUpdate())
90+
{
91+
callAgain = false;
92+
return true;
93+
}
94+
#endif
9595

9696
thisNumPoints_ = size();
9797

@@ -136,7 +136,7 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
136136

137137
varList.emplaceBack(msg.addAndName(message::BNDR_PROC_SIZE_CHANGED), neighborProcNumPoints_);
138138

139-
if( !notify(ti.iter(), ti.t(), ti.dt(), msg, varList) )
139+
if( !notify(ti, msg, varList) )
140140
{
141141
fatalErrorInFunction;
142142
callAgain = false;
@@ -343,8 +343,9 @@ bool pFlow::MPI::boundaryProcessor::transferData(
343343
neighborProcPoints_.waitBufferForUse();
344344
internal().insertPointsOnly(neighborProcPoints_.buffer(), msg, varList);
345345

346-
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEM_INSERT));
346+
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEMS_INSERT));
347347

348+
// creates a view (does not copy data)
348349
auto indView = deviceViewType1D<uint32>(indices.deviceView().data(), indices.deviceView().size());
349350

350351
uint32Vector_D newIndices("newIndices", indView);
@@ -356,7 +357,7 @@ bool pFlow::MPI::boundaryProcessor::transferData(
356357
return false;
357358
}
358359

359-
const auto ti = internal().time().TimeInfo();
360+
const auto& ti = internal().time().TimeInfo();
360361
if(!notify(ti, msg, varList))
361362
{
362363
fatalErrorInFunction;

src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class boundaryField
114114
return true;
115115
}
116116

117-
fatalErrorInFunction<<"Event"<< msg.eventNames()<<"with code "<< msg <<
118-
" is not handled in boundaryField."<<endl;
117+
fatalErrorInFunction<<"Event "<< msg.eventNames()<<" with code "<< msg <<
118+
" is not handled in boundaryField "<< name()<<endl;
119119
return false;
120120
}
121121

src/phasicFlow/containers/pointField/internalField/internalField.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ bool pFlow::internalField<T, MemorySpace>:: hearChanges
223223
else
224224
{
225225
fatalErrorInFunction<<"hear changes in internal field is not processing "<<
226-
message::eventName(message::RANGE_CHANGED)<<
226+
msg.eventNames()<<
227227
" event with message code "<< msg<<endl;
228228
return false;
229229
}

src/phasicFlow/streams/dataIO/dataIORegulars.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ template class pFlow::dataIORegular<pFlow::uint32x3>;
2525
template class pFlow::dataIO<pFlow::uint64>;
2626
template class pFlow::dataIORegular<pFlow::uint64>;
2727

28-
template class pFlow::dataIO<size_t>;
29-
template class pFlow::dataIORegular<size_t>;
28+
//template class pFlow::dataIO<size_t>;
29+
//template class pFlow::dataIORegular<size_t>;
3030

3131
template class pFlow::dataIO<pFlow::real>;
3232
template class pFlow::dataIORegular<pFlow::real>;

0 commit comments

Comments
 (0)