Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mc-sog
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
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
PMC-SOG
mc-sog
Commits
a49f8cc3
Commit
a49f8cc3
authored
5 years ago
by
Chiheb Amer Abid
Browse files
Options
Downloads
Patches
Plain Diff
modifié : src/ModelCheckerTh.cpp
modifié : src/ModelCheckerTh.h
parent
3a95b1b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ModelCheckerTh.cpp
+19
-14
19 additions, 14 deletions
src/ModelCheckerTh.cpp
src/ModelCheckerTh.h
+2
-0
2 additions, 0 deletions
src/ModelCheckerTh.h
with
21 additions
and
14 deletions
src/ModelCheckerTh.cpp
+
19
−
14
View file @
a49f8cc3
...
...
@@ -142,7 +142,11 @@ LDDState * ModelCheckerTh::buildInitialMetaState()
int
j
=
0
;
for
(
auto
it
=
fire
.
begin
();
it
!=
fire
.
end
();
it
++
,
j
++
)
m_st
[
j
%
m_nb_thread
].
push
(
couple_th
(
c
,
*
it
));
cout
<<
"Before barrier 1 "
<<
__func__
<<
endl
;
pthread_barrier_wait
(
&
m_barrier_threads
);
cout
<<
"Before barrier 2 "
<<
__func__
<<
endl
;
pthread_barrier_wait
(
&
m_barrier_builder
);
cout
<<
"Leaving "
<<
__func__
<<
endl
;
return
c
;
}
...
...
@@ -150,13 +154,15 @@ void ModelCheckerTh::buildSucc(LDDState *agregate)
{
if
(
!
agregate
->
isVisited
())
{
agregate
->
setVisited
();
agregate
->
setVisited
();
Set
fire
=
firable_obs
(
agregate
->
getLDDValue
());
int
j
=
0
;
for
(
auto
it
=
fire
.
begin
();
it
!=
fire
.
end
();
it
++
,
j
++
)
m_st
[
j
%
m_nb_thread
].
push
(
couple_th
(
agregate
,
*
it
));
pthread_barrier_wait
(
&
m_barrier_threads
);
pthread_barrier_wait
(
&
m_barrier_builder
);
//Wait for all threads to finish their work
}
...
...
@@ -169,18 +175,18 @@ void * ModelCheckerTh::Compute_successors()
pthread_mutex_lock
(
&
m_mutex
);
id_thread
=
m_id_thread
++
;
pthread_mutex_unlock
(
&
m_mutex
);
Set
fire
;
LDDState
*
reached_class
=
nullptr
;
// size_t max_meta_state_size;
// int min_charge;
cout
<<
"Thread id : "
<<
id_thread
<<
endl
;
do
{
cout
<<
"Before barrier threads "
<<
__func__
<<
" Thread id "
<<
id_thread
<<
endl
;
pthread_barrier_wait
(
&
m_barrier_threads
);
while
(
!
m_st
[
id_thread
].
empty
())
{
cout
<<
"Entering thread "
<<
endl
;
nb_it
++
;
m_terminaison
[
id_thread
]
=
false
;
pthread_spin_lock
(
&
m_spin_stack
[
id_thread
]);
couple_th
elt
=
m_st
[
id_thread
].
top
();
//pthread_spin_lock(&m_accessible);
...
...
@@ -222,7 +228,9 @@ void * ModelCheckerTh::Compute_successors()
}
}
m_terminaison
[
id_thread
]
=
true
;
cout
<<
"Before barrier builder "
<<
__func__
<<
" Thread id "
<<
id_thread
<<
endl
;
pthread_barrier_wait
(
&
m_barrier_builder
);
}
while
(
1
);
...
...
@@ -275,12 +283,9 @@ void ModelCheckerTh::ComputeTh_Succ(){
pthread_mutex_init
(
&
m_graph_mutex
,
NULL
);
pthread_mutex_init
(
&
m_supervise_gc_mutex
,
NULL
);
m_gc
=
0
;
for
(
int
i
=
0
;
i
<
m_nb_thread
;
i
++
)
{
pthread_spin_init
(
&
m_spin_stack
[
i
],
NULL
);
m_charge
[
i
]
=
0
;
m_terminaison
[
i
]
=
false
;
}
pthread_barrier_init
(
&
m_barrier_threads
,
NULL
,
m_nb_thread
);
pthread_barrier_init
(
&
m_barrier_builder
,
NULL
,
m_nb_thread
);
for
(
int
i
=
0
;
i
<
m_nb_thread
-
1
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/ModelCheckerTh.h
+
2
−
0
View file @
a49f8cc3
...
...
@@ -33,6 +33,8 @@ private:
pthread_mutex_t
m_graph_mutex
;
pthread_mutex_t
m_gc_mutex
;
pthread_mutex_t
m_supervise_gc_mutex
;
pthread_barrier_t
m_barrier_threads
,
m_barrier_builder
;
unsigned
int
m_gc
;
pthread_mutex_t
m_mutex_stack
[
128
];
...
...
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