23#ifndef VP_MANAGER_IMPL_H
24#define VP_MANAGER_IMPL_H
88 const size_t vp =
get_vp();
95 return std::ceil(
static_cast< double >(
kernel().mpi_manager.get_num_processes() ) /
n_threads_ );
107 size_t rank_end = rank_start + num_assigned_ranks_per_thread;
112 if ( rank_end >
kernel().mpi_manager.get_num_processes() )
114 rank_end = std::max( rank_start,
kernel().mpi_manager.get_num_processes() );
127 assigned_ranks.
size = assigned_ranks.
end - assigned_ranks.
begin;
128 return assigned_ranks;
size_t get_process_id_of_vp(const size_t vp) const
Return the process id for a given virtual process.
Definition mpi_manager_impl.h:42
size_t get_num_processes() const
Return the number of processes used during simulation.
Definition mpi_manager.h:492
size_t get_rank() const
Get rank of MPI process.
Definition mpi_manager.h:498
size_t node_id_to_vp(const size_t node_id) const
Return a thread number for a given global node id.
Definition vp_manager_impl.h:43
size_t lid_to_node_id(const size_t lid) const
Returns the node ID of a given local index.
Definition vp_manager_impl.h:86
bool is_node_id_vp_local(const size_t node_id) const
Returns true if the given global node exists on this vp.
Definition vp_manager_impl.h:73
size_t get_num_threads() const
Get number of threads.
Definition vp_manager.h:186
size_t get_num_assigned_ranks_per_thread() const
Returns the number of processes that are taken care of by a single thread while processing MPI buffer...
Definition vp_manager_impl.h:93
size_t vp_to_thread(const size_t vp) const
Convert a given VP ID to the corresponding thread ID.
Definition vp_manager_impl.h:49
size_t thread_to_vp(const size_t tid) const
Convert a given thread ID to the corresponding VP ID.
Definition vp_manager_impl.h:67
AssignedRanks get_assigned_ranks(const size_t tid)
Returns assigned ranks per thread to fill MPI buffers.
Definition vp_manager_impl.h:121
size_t get_vp() const
Returns virtual process index.
Definition vp_manager_impl.h:37
size_t get_num_virtual_processes() const
Returns the number of virtual processes.
Definition vp_manager_impl.h:55
size_t n_threads_
Number of threads per process.
Definition vp_manager.h:172
size_t get_thread_id() const
Gets ID of local thread.
Definition vp_manager.h:176
bool is_local_vp(const size_t tid) const
Return true, if the given VP is on the local machine.
Definition vp_manager_impl.h:61
size_t get_start_rank_per_thread(const size_t tid) const
Definition vp_manager_impl.h:99
size_t node_id_to_lid(const size_t node_id) const
Returns thread local index of a given global node.
Definition vp_manager_impl.h:79
size_t get_end_rank_per_thread(const size_t rank_start, const size_t num_assigned_ranks_per_thread) const
Definition vp_manager_impl.h:105
MPIManager mpi_manager
Definition kernel_manager.h:233
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
KernelManager & kernel()
Definition kernel_manager.h:311
Definition vp_manager.h:42
size_t end
Definition vp_manager.h:44
size_t size
Definition vp_manager.h:45
size_t max_size
Definition vp_manager.h:46
size_t begin
Definition vp_manager.h:43