Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

colvarproxy_smp Class Reference

\brief Methods for SMP parallelization. More...

#include <colvarproxy.h>

Inheritance diagram for colvarproxy_smp:

colvarproxy colvarproxy_vmd List of all members.

Public Methods

 colvarproxy_smp ()
 Constructor. More...

virtual ~colvarproxy_smp ()
 Destructor. More...

virtual int smp_enabled ()
 Whether threaded parallelization is available (TODO: make this a cvm::deps feature). More...

virtual int smp_colvars_loop ()
 Distribute calculation of colvars (and their components) across threads. More...

virtual int smp_biases_loop ()
 Distribute calculation of biases across threads. More...

virtual int smp_biases_script_loop ()
 Distribute calculation of biases across threads 2nd through last, with all scripted biased on 1st thread. More...

virtual int smp_thread_id ()
 Index of this thread. More...

virtual int smp_num_threads ()
 Number of threads sharing this address space. More...

virtual int smp_lock ()
 Lock the proxy's shared data for access by a thread, if threads are implemented; if not implemented, does nothing. More...

virtual int smp_trylock ()
 Attempt to lock the proxy's shared data. More...

virtual int smp_unlock ()
 Release the lock. More...


Public Attributes

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


Protected Attributes

omp_lock_t * omp_lock_state
 Lock state for OpenMP. More...


Detailed Description

\brief Methods for SMP parallelization.

Definition at line 454 of file colvarproxy.h.


Constructor & Destructor Documentation

colvarproxy_smp::colvarproxy_smp  
 

Constructor.

Definition at line 258 of file colvarproxy.C.

References b_smp_active, NULL, and omp_lock_state.

colvarproxy_smp::~colvarproxy_smp   [virtual]
 

Destructor.

Definition at line 271 of file colvarproxy.C.

References omp_lock_state.


Member Function Documentation

int colvarproxy_smp::smp_biases_loop   [virtual]
 

Distribute calculation of biases across threads.

Definition at line 320 of file colvarproxy.C.

References colvarmodule::biases_active, COLVARS_NOT_IMPLEMENTED, colvarmodule::debug, colvarmodule::get_error, colvarmodule::log, colvarmodule::main, colvarbias::name, smp_thread_id, and colvarbias::update.

Referenced by colvarmodule::calc_biases.

int colvarproxy_smp::smp_biases_script_loop   [virtual]
 

Distribute calculation of biases across threads 2nd through last, with all scripted biased on 1st thread.

Definition at line 343 of file colvarproxy.C.

References colvarmodule::biases_active, colvarmodule::calc_scripted_forces, COLVARS_NOT_IMPLEMENTED, colvarmodule::debug, colvarmodule::get_error, colvarmodule::log, colvarmodule::main, colvarbias::name, smp_thread_id, and colvarbias::update.

Referenced by colvarmodule::calc_biases.

int colvarproxy_smp::smp_colvars_loop   [virtual]
 

Distribute calculation of colvars (and their components) across threads.

Definition at line 296 of file colvarproxy.C.

References colvar::calc_cvcs, COLVARS_NOT_IMPLEMENTED, colvarmodule::debug, colvarmodule::get_error, colvarmodule::log, colvarmodule::main, colvar::name, colvarmodule::proxy, smp_num_threads, smp_thread_id, colvarmodule::to_str, colvarmodule::variables_active_smp, and colvarmodule::variables_active_smp_items.

Referenced by colvarmodule::calc_colvars.

int colvarproxy_smp::smp_enabled   [virtual]
 

Whether threaded parallelization is available (TODO: make this a cvm::deps feature).

Definition at line 283 of file colvarproxy.C.

References COLVARS_ERROR, and COLVARS_NOT_IMPLEMENTED.

Referenced by colvarmodule::calc_biases, colvarmodule::calc_colvars, colvarmodule::colvarmodule, colvarmodule::depth, and colvarproxy::io_available.

int colvarproxy_smp::smp_lock   [virtual]
 

Lock the proxy's shared data for access by a thread, if threads are implemented; if not implemented, does nothing.

Definition at line 392 of file colvarproxy.C.

References omp_lock_state.

Referenced by colvarmodule::clear_error, colvarmodule::depth, and colvarmodule::set_error_bits.

int colvarproxy_smp::smp_num_threads   [virtual]
 

Number of threads sharing this address space.

Definition at line 382 of file colvarproxy.C.

Referenced by colvarmodule::depth, and smp_colvars_loop.

int colvarproxy_smp::smp_thread_id   [virtual]
 

Index of this thread.

Definition at line 372 of file colvarproxy.C.

Referenced by colvarmodule::depth, colvarproxy::io_available, smp_biases_loop, smp_biases_script_loop, smp_colvars_loop, and colvarmodule::~colvarmodule.

int colvarproxy_smp::smp_trylock   [virtual]
 

Attempt to lock the proxy's shared data.

Definition at line 401 of file colvarproxy.C.

References COLVARS_ERROR, and omp_lock_state.

int colvarproxy_smp::smp_unlock   [virtual]
 

Release the lock.

Definition at line 411 of file colvarproxy.C.

References omp_lock_state.

Referenced by colvarmodule::clear_error, colvarmodule::depth, and colvarmodule::set_error_bits.


Member Data Documentation

bool colvarproxy_smp::b_smp_active
 

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

Definition at line 466 of file colvarproxy.h.

Referenced by colvarproxy_smp, and colvarmodule::parse_global_params.

omp_lock_t* colvarproxy_smp::omp_lock_state [protected]
 

Lock state for OpenMP.

Definition at line 498 of file colvarproxy.h.

Referenced by colvarproxy_smp, smp_lock, smp_trylock, smp_unlock, and ~colvarproxy_smp.


The documentation for this class was generated from the following files:
Generated on Thu Mar 28 02:45:32 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002