#include "gmxpre.h"
#include "manage-threading.h"
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <algorithm>
#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
#include "gromacs/listed-forces/listed-forces.h"
#include "gromacs/mdlib/forcerec-threading.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
This file defines functions for managing threading of listed interactions.
- Author
- Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m
|
static void | divide_bondeds_by_locality (int ntype, const ilist_data_t *ild, int nthread, t_idef *idef) |
| Divides listed interactions over threads. More...
|
|
static void | divide_bondeds_over_threads (t_idef *idef, int nthread, int max_nthread_uniform) |
| Divides bonded interactions over threads.
|
|
static void | calc_bonded_reduction_mask (gmx_bitmask_t *mask, const t_idef *idef, int shift, int t, int nt) |
| Construct a reduction mask for which interaction was computed on which thread.
|
|
void | setup_bonded_threading (t_forcerec *fr, t_idef *idef) |
| Divide the listed interactions over the threads. More...
|
|
void | init_bonded_threading (FILE *fplog, t_forcerec *fr, int nenergrp) |
| Initialize the bonded threading data structures.
|
|
|
const int | maxBlockBits = GMX_OPENMP_MAX_THREADS |
| We divide the force array in a maximum of BITMASK_SIZE (default 32) blocks. Minimum force block reduction size is thus 2^6=64.
|
|
static void divide_bondeds_by_locality |
( |
int |
ntype, |
|
|
const ilist_data_t * |
ild, |
|
|
int |
nthread, |
|
|
t_idef * |
idef |
|
) |
| |
|
static |
Divides listed interactions over threads.
This routine attempts to divide all interactions of the ntype bondeds types stored in ild over the threads such that each thread has roughly equal load and different threads avoid touching the same atoms as much as possible.
void setup_bonded_threading |
( |
t_forcerec * |
fr, |
|
|
t_idef * |
idef |
|
) |
| |
Divide the listed interactions over the threads.
Uses fr->nthreads for the number of threads, and sets up the thread-force buffer reduction. This should be called each time the bonded setup changes; i.e. at start-up without domain decomposition and at DD.