NDDEM
|
Manual multiprocessor handling for OpenMP, for max efficiency & avoiding bugs & race conditions, hopefully. More...
#include <Multiproc.h>
Public Member Functions | |
void | initialise (int NN, int PP, Parameters< d > &Param) |
void | disp_share () |
Display the # of particle on each thread. More... | |
bool | ismine (int ID, int j) |
Check if a particle j belongs to the thread ID. More... | |
void | delaying (int ID, int j, Action< d > &act) |
Record the action to be added later to the relevent atom in sequencial settings, avoid potential race condition if an action was added to an atom that is not owned by the thread. This is for a particle-particle contact. More... | |
void | delayed_clean () |
Clean the record list. More... | |
void | delayingwall (int ID, int j, Action< d > &act) |
Record the action on the wall. Only usefull if the force on the wall needs to be calculated. More... | |
void | delayedwall_clean () |
Clean the record of the force on the wal. More... | |
void | load_balance (ContactStrategies contactstrategy) |
Modify the atom share between threads to achieve better load balance between the threads based on the current speed of each one during the previous iterations. More... | |
void | merge_newcontacts () |
int | merge_oldnew_contacts (int ID) |
void | splitcells (int C) |
auto | contacts2array (ExportData exp, cv2d &X, Parameters< d > &P) |
pack the contact data in a 2d array More... | |
template<class Archive > | |
void | serialize (Archive &ar) |
Public Attributes | |
vector< ContactList< d > > | CLp |
ContactList particle-particle for each processor. More... | |
vector< ContactList< d > > | CLp_new |
New particle-particle contacts for each processor. More... | |
vector< ContactList< d > > | CLw |
ContactList particle-wall for each processor. More... | |
vector< ContactListMesh< d > > | CLm |
ContactList particle-mesh for each processor. More... | |
vector< Contacts< d > > | C |
Dummy Contacts for independent calculation per processor. More... | |
vector< int > | share |
Particle share between threads. A thread ID own particles with index between share[ID] and share[ID+1]. size(share)=P+1. More... | |
vector< int > | sharecell |
Cell share between threads (for contact detection based on cells). A thread ID own cells with index between share[ID] and share[ID+1]. size(share)=P+1. More... | |
vector< double > | timing_contacts |
vector< double > | timing_forces |
Used to record the time spent by each thread. More... | |
int | num_time |
Number of sample of time spent. Resets when load_balance() is called. More... | |
CLp_it_t< d > | CLp_it |
Iterator list for fast access to particle contacts. More... | |
vector< vector< Action< d > > > | delayed |
Records the delayed Action. More... | |
vector< vector< int > > | delayedj |
Records the j id of the particle in the associated delayed action. More... | |
vector< uint > | delayed_size |
Max length of the delayed vector for each thread. Can grow as needed on call to delaying() More... | |
vector< vector< Action< d > > > | delayedwall |
Records the delayed Action. More... | |
vector< vector< int > > | delayedwallj |
Records the j id of the wall in the associated delayed action. More... | |
vector< uint > | delayedwall_size |
Max length of the delayed wall vector for each thread. Can grow as needed on call to delaying() More... | |
int | P |
Number of threads. More... | |
Private Member Functions | |
void | split (int N, int P) |
Function to allocate the grains to threads taking into account the load balance in the contact detection. load_balance() takes over after a few iteration have run, and is usually more efficient. More... | |
Private Attributes | |
v2d | fullcontactinfo |
int | N |
Number of grains. More... | |
Manual multiprocessor handling for OpenMP, for max efficiency & avoiding bugs & race conditions, hopefully.
|
inline |
Check if a particle j belongs to the thread ID.
Dummy Contacts for independent calculation per processor.
vector<ContactListMesh<d> > Multiproc< d >::CLm |
ContactList particle-mesh for each processor.
vector<ContactList<d> > Multiproc< d >::CLp |
ContactList particle-particle for each processor.
Iterator list for fast access to particle contacts.
vector<ContactList<d> > Multiproc< d >::CLp_new |
New particle-particle contacts for each processor.
vector<ContactList<d> > Multiproc< d >::CLw |
ContactList particle-wall for each processor.
Max length of the delayed vector for each thread. Can grow as needed on call to delaying()
Records the j id of the particle in the associated delayed action.
Records the delayed Action.
Max length of the delayed wall vector for each thread. Can grow as needed on call to delaying()
Records the j id of the wall in the associated delayed action.
Number of sample of time spent. Resets when load_balance() is called.
Particle share between threads. A thread ID own particles with index between share[ID] and share[ID+1]. size(share)=P+1.
Cell share between threads (for contact detection based on cells). A thread ID own cells with index between share[ID] and share[ID+1]. size(share)=P+1.
Used to record the time spent by each thread.