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
487a1f08
Commit
487a1f08
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Use atomic definitions
parent
6b6c7c84
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!212
Gravity infrastructure
,
!172
[WIP] Self gravity (Barnes-Hut version)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/map.c
+11
-2
11 additions, 2 deletions
src/map.c
src/queue.c
+0
-7
0 additions, 7 deletions
src/queue.c
with
11 additions
and
9 deletions
src/map.c
+
11
−
2
View file @
487a1f08
...
@@ -18,9 +18,18 @@
...
@@ -18,9 +18,18 @@
*
*
******************************************************************************/
******************************************************************************/
#include
"map.h"
/* Config parameters. */
#include
"../config.h"
/* Some standard headers. */
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdlib.h>
/* This object's header. */
#include
"map.h"
/* Local headers. */
#include
"atomic.h"
#include
"error.h"
#include
"error.h"
/**
/**
...
@@ -97,7 +106,7 @@ void map_cells_plot(struct cell *c, void *data) {
...
@@ -97,7 +106,7 @@ void map_cells_plot(struct cell *c, void *data) {
void
map_cellcheck
(
struct
cell
*
c
,
void
*
data
)
{
void
map_cellcheck
(
struct
cell
*
c
,
void
*
data
)
{
int
*
count
=
(
int
*
)
data
;
int
*
count
=
(
int
*
)
data
;
__sync_fetch_and
_add
(
count
,
c
->
count
);
atomic
_add
(
count
,
c
->
count
);
/* Loop over all parts and check if they are in the cell. */
/* Loop over all parts and check if they are in the cell. */
for
(
int
k
=
0
;
k
<
c
->
count
;
k
++
)
{
for
(
int
k
=
0
;
k
<
c
->
count
;
k
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/queue.c
+
0
−
7
View file @
487a1f08
...
@@ -38,13 +38,6 @@
...
@@ -38,13 +38,6 @@
#include
"const.h"
#include
"const.h"
#include
"error.h"
#include
"error.h"
/* Counter macros. */
#ifdef COUNTER
#define COUNT(c) (__sync_add_and_fetch(&queue_counter[c], 1))
#else
#define COUNT(c)
#endif
/* The counters. */
/* The counters. */
int
queue_counter
[
queue_counter_count
];
int
queue_counter
[
queue_counter_count
];
...
...
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