Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dADP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Luca Tornatore
dADP
Commits
8fdf2836
Commit
8fdf2836
authored
4 months ago
by
lykos98
Browse files
Options
Downloads
Patches
Plain Diff
added implementation of private locks for centers pruning
parent
496f23f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/adp/adp.c
+14
-11
14 additions, 11 deletions
src/adp/adp.c
with
14 additions
and
11 deletions
src/adp/adp.c
+
14
−
11
View file @
8fdf2836
...
@@ -737,12 +737,12 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -737,12 +737,12 @@ clusters_t Heuristic1(global_context_t *ctx)
MPI_Win_create
(
to_remove_mask
,
n
*
sizeof
(
heap_node
),
1
,
MPI_INFO_NULL
,
ctx
->
mpi_communicator
,
&
win_to_remove_mask
);
MPI_Win_create
(
to_remove_mask
,
n
*
sizeof
(
heap_node
),
1
,
MPI_INFO_NULL
,
ctx
->
mpi_communicator
,
&
win_to_remove_mask
);
MPI_Win_fence
(
0
,
win_to_remove_mask
);
MPI_Win_fence
(
0
,
win_to_remove_mask
);
//
MPI_Win win_locks;
MPI_Win
win_locks
;
//
MPI_Win_create(lock_array, n * sizeof(lock_t), sizeof(lock_t), MPI_INFO_NULL, ctx -> mpi_communicator, &win_locks);
MPI_Win_create
(
lock_array
,
n
*
sizeof
(
lock_t
),
sizeof
(
lock_t
),
MPI_INFO_NULL
,
ctx
->
mpi_communicator
,
&
win_locks
);
//
MPI_Win_fence(0, win_locks);
MPI_Win_fence
(
0
,
win_locks
);
//
MPI_Win_lock_all(
MPI_LOCK_SHARED
, win_to_remove_mask);
MPI_Win_lock_all
(
0
,
win_to_remove_mask
);
//
MPI_Win_lock_all(
MPI_LOCK_SHARED
, win_locks);
MPI_Win_lock_all
(
0
,
win_locks
);
...
@@ -768,7 +768,6 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -768,7 +768,6 @@ clusters_t Heuristic1(global_context_t *ctx)
* use an array of locks, and compare and swap to actually gain control of the thing
* use an array of locks, and compare and swap to actually gain control of the thing
*
*
* */
* */
/*
#pragma omp critical
#pragma omp critical
{
{
...
@@ -777,7 +776,7 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -777,7 +776,7 @@ clusters_t Heuristic1(global_context_t *ctx)
lock_t
state
=
LOCK_FREE
;
lock_t
state
=
LOCK_FREE
;
//
state = h1_lock_acquire(ctx, win_locks, owner, jpos, state);
state
=
h1_lock_acquire
(
ctx
,
win_locks
,
owner
,
jpos
,
state
);
heap_node
mask_element
;
heap_node
mask_element
;
MPI_Request
request
;
MPI_Request
request
;
...
@@ -797,10 +796,10 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -797,10 +796,10 @@ clusters_t Heuristic1(global_context_t *ctx)
}
}
//
state = h1_lock_free(ctx, win_locks, owner, jpos, state);
state
=
h1_lock_free
(
ctx
,
win_locks
,
owner
,
jpos
,
state
);
}
}
*/
/*
#pragma omp critical (h1_centers_elimination)
#pragma omp critical (h1_centers_elimination)
{
{
int owner = foreign_owner(ctx, jidx);
int owner = foreign_owner(ctx, jidx);
...
@@ -826,12 +825,16 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -826,12 +825,16 @@ clusters_t Heuristic1(global_context_t *ctx)
MPI_Win_unlock(owner, win_to_remove_mask);
MPI_Win_unlock(owner, win_to_remove_mask);
}
}
*/
}
}
}
}
}
}
MPI_Win_unlock_all
(
win_to_remove_mask
);
MPI_Win_unlock_all
(
win_locks
);
MPI_Win_fence
(
0
,
win_to_remove_mask
);
MPI_Win_fence
(
0
,
win_to_remove_mask
);
//
MPI_Win_fence(0, win_locks);
MPI_Win_fence
(
0
,
win_locks
);
MPI_Barrier
(
ctx
->
mpi_communicator
);
MPI_Barrier
(
ctx
->
mpi_communicator
);
/* populate the usual arrays */
/* populate the usual arrays */
...
@@ -881,7 +884,7 @@ clusters_t Heuristic1(global_context_t *ctx)
...
@@ -881,7 +884,7 @@ clusters_t Heuristic1(global_context_t *ctx)
MPI_Win_free
(
&
win_to_remove_mask
);
MPI_Win_free
(
&
win_to_remove_mask
);
free
(
to_remove_mask
);
free
(
to_remove_mask
);
//
MPI_Win_free(&win_locks);
MPI_Win_free
(
&
win_locks
);
free
(
lock_array
);
free
(
lock_array
);
int
n_centers
=
(
int
)
actual_centers
.
count
;
int
n_centers
=
(
int
)
actual_centers
.
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