Loading [MathJax]/extensions/tex2jax.js
Collective Variables Module - Developer Documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
colvarproxy_smp Class Reference

Methods for SMP parallelization. More...

#include <colvarproxy.h>

Inheritance diagram for colvarproxy_smp:
Inheritance graph
[legend]

Public Types

enum class  smp_mode_t { cvcs , inner_loop , none }
 

Public Member Functions

 colvarproxy_smp ()
 Constructor.
 
virtual ~colvarproxy_smp ()
 Destructor.
 
virtual smp_mode_t get_smp_mode () const
 Get the current SMP mode.
 
virtual int set_smp_mode (smp_mode_t mode)
 Set the current SMP mode.
 
virtual int smp_loop (int n_items, std::function< int(int)> const &worker)
 Distribute computation over threads using OpenMP, unless overridden in the backend (e.g. NAMD)
 
virtual int smp_biases_loop ()
 Distribute calculation of biases across threads.
 
virtual int smp_biases_script_loop ()
 Distribute calculation of biases across threads 2nd through last, with all scripted biased on 1st thread.
 
virtual int smp_thread_id ()
 Index of this thread.
 
virtual int smp_num_threads ()
 Number of threads sharing this address space.
 
virtual int smp_lock ()
 Lock the proxy's shared data for access by a thread, if threads are implemented; if not implemented, does nothing.
 
virtual int smp_trylock ()
 Attempt to lock the proxy's shared data.
 
virtual int smp_unlock ()
 Release the lock.
 

Protected Attributes

omp_lock_t * omp_lock_state
 Lock state for OpenMP.
 
smp_mode_t smp_mode
 

Detailed Description

Methods for SMP parallelization.

Member Data Documentation

◆ smp_mode

smp_mode_t colvarproxy_smp::smp_mode
protected

Whether threaded parallelization should be used (TODO: make this a cvm::deps feature)


The documentation for this class was generated from the following files: