Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
02b5af72
Commit
02b5af72
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Call vectorised dopair2_force_vec.
parent
83d2a266
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!440
Dopair2 vectorisation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact.h
+50
-0
50 additions, 0 deletions
src/runner_doiact.h
with
50 additions
and
0 deletions
src/runner_doiact.h
+
50
−
0
View file @
02b5af72
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#define _DOPAIR1(f) PASTE(runner_dopair1, f)
#define _DOPAIR1(f) PASTE(runner_dopair1, f)
#define DOPAIR1 _DOPAIR1(FUNCTION)
#define DOPAIR1 _DOPAIR1(FUNCTION)
#define _DOPAIR2_BRANCH(f) PASTE(runner_dopair2_branch, f)
#define DOPAIR2_BRANCH _DOPAIR2_BRANCH(FUNCTION)
#define _DOPAIR2(f) PASTE(runner_dopair2, f)
#define _DOPAIR2(f) PASTE(runner_dopair2, f)
#define DOPAIR2 _DOPAIR2(FUNCTION)
#define DOPAIR2 _DOPAIR2(FUNCTION)
...
@@ -1197,6 +1200,49 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
...
@@ -1197,6 +1200,49 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
TIMER_TOC
(
TIMER_DOPAIR
);
TIMER_TOC
(
TIMER_DOPAIR
);
}
}
/**
* @brief Determine which version of DOPAIR2 needs to be called depending on the
* orientation of the cells or whether DOPAIR2 needs to be called at all.
*
* @param r #runner
* @param ci #cell ci
* @param cj #cell cj
*
*/
void
DOPAIR2_BRANCH
(
struct
runner
*
r
,
struct
cell
*
ci
,
struct
cell
*
cj
)
{
// const struct engine *restrict e = r->e;
//
// /* Anything to do here? */
// if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
//
// /* Check that cells are drifted. */
// if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e))
// error("Interacting undrifted cells.");
//
// /* Get the sort ID. */
// double shift[3] = {0.0, 0.0, 0.0};
// const int sid = space_getsid(e->s, &ci, &cj, shift);
//
// /* Have the cells been sorted? */
// if (!(ci->sorted & (1 << sid)) ||
// ci->dx_max_sort_old > space_maxreldx * ci->dmin)
// error("Interacting unsorted cells.");
// if (!(cj->sorted & (1 << sid)) ||
// cj->dx_max_sort_old > space_maxreldx * cj->dmin)
// error("Interacting unsorted cells.");
//
//#if defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \
// (DOPAIR2_BRANCH == runner_dopair2_force_branch)
// if (!sort_is_corner(sid))
// runner_dopair2_force_vec(r, ci, cj, sid, shift);
// else
// DOPAIR2(r, ci, cj, sid, shift);
//#else
// DOPAIR2(r, ci, cj, sid, shift);
//#endif
}
/**
/**
* @brief Compute the cell self-interaction (non-symmetric).
* @brief Compute the cell self-interaction (non-symmetric).
*
*
...
@@ -1992,7 +2038,11 @@ void DOSUB_PAIR2(struct runner *r, struct cell *ci, struct cell *cj, int sid,
...
@@ -1992,7 +2038,11 @@ void DOSUB_PAIR2(struct runner *r, struct cell *ci, struct cell *cj, int sid,
error
(
"Interacting unsorted cells."
);
error
(
"Interacting unsorted cells."
);
/* Compute the interactions. */
/* Compute the interactions. */
#if defined(WITH_VECTORIZATION) && defined(GADGET2_SPH)
runner_dopair2_force_vec
(
r
,
ci
,
cj
);
#else
DOPAIR2
(
r
,
ci
,
cj
);
DOPAIR2
(
r
,
ci
,
cj
);
#endif
}
}
if
(
gettimer
)
TIMER_TOC
(
TIMER_DOSUB_PAIR
);
if
(
gettimer
)
TIMER_TOC
(
TIMER_DOSUB_PAIR
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment