MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Distribute

Method Distribute

parallel/parallelvvector.cpp:425–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423
424 template <typename SCAL>
425 void S_ParallelBaseVectorPtr<SCAL> :: Distribute() const
426 {
427 if (status != CUMULATED) return;
428 this->SetStatus(DISTRIBUTED);
429
430 auto rank = paralleldofs->GetCommunicator().Rank();
431
432 if (paralleldofs->GetEntrySize() == 1) {
433 // this is a bit faster for BS = 1
434 auto fv = this->template FV<SCAL>();
435 for (auto p : paralleldofs->GetDistantProcs())
436 if (p < rank)
437 for (auto dof : paralleldofs->GetExchangeDofs(p))
438 fv[dof] = 0;
439 }
440 else {
441 for (auto p : paralleldofs->GetDistantProcs())
442 if (p < rank)
443 for (auto dof : paralleldofs->GetExchangeDofs(p))
444 (*this)(dof) = 0;
445 }
446
447 }
448
449
450 template < class SCAL >

Callers

nothing calls this directly

Calls 4

GetEntrySizeMethod · 0.80
GetDistantProcsMethod · 0.80
GetExchangeDofsMethod · 0.80
GetCommunicatorMethod · 0.45

Tested by

no test coverage detected