예제 #1
0
static inline void advancePosVel(NBodyState* st, const int nbody, const real dt)
{
    int i;
    real dtHalf = 0.5 * dt;

  #ifdef _OPENMP
    #pragma omp parallel for private(i) schedule(static)
  #endif
    for (i = 0; i < nbody; ++i)
    {
        bodyAdvanceVel(&st->bodytab[i], st->acctab[i], dtHalf);
        bodyAdvancePos(&st->bodytab[i], dt);
    }
}
예제 #2
0
static inline void advancePosVel(NBodyState* st, const int nbody, const real dt)
{
    int i;
    real dtHalf = 0.5 * dt;
    Body* bodies = mw_assume_aligned(st->bodytab, 16);
    const mwvector* accs = mw_assume_aligned(st->acctab, 16);

  #ifdef _OPENMP
    #pragma omp parallel for private(i) shared(bodies, accs) schedule(dynamic, 4096 / sizeof(accs[0]))
  #endif
    for (i = 0; i < nbody; ++i)
    {
        bodyAdvanceVel(&bodies[i], accs[i], dtHalf);
        bodyAdvancePos(&bodies[i], dt);
    }

}