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
2d474942
Commit
2d474942
authored
2 years ago
by
Ghofrane Amaimi
Browse files
Options
Downloads
Patches
Plain Diff
add SpawnThreads: not safe
parent
3020bee9
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Feature/ufscc emptiness check
Pipeline
#4948
passed
2 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
src/algorithm/CNDFS.cpp
+22
-4
22 additions, 4 deletions
src/algorithm/CNDFS.cpp
src/algorithm/CNDFS.h
+2
-1
2 additions, 1 deletion
src/algorithm/CNDFS.h
src/main.cpp
+8
-6
8 additions, 6 deletions
src/main.cpp
with
34 additions
and
11 deletions
CMakeLists.txt
+
2
−
0
View file @
2d474942
...
@@ -68,6 +68,8 @@ target_include_directories(cli11 INTERFACE "${THIRD_PARTY_INCLUDE_DIR}/cli11")
...
@@ -68,6 +68,8 @@ target_include_directories(cli11 INTERFACE "${THIRD_PARTY_INCLUDE_DIR}/cli11")
include_directories
(
src
)
include_directories
(
src
)
add_subdirectory
(
src
)
add_subdirectory
(
src
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-pthread"
)
# add tests
# add tests
# enable_testing()
# enable_testing()
# add_subdirectory(tests)
# add_subdirectory(tests)
This diff is collapsed.
Click to expand it.
src/algorithm/CNDFS.cpp
+
22
−
4
View file @
2d474942
...
@@ -4,13 +4,31 @@
...
@@ -4,13 +4,31 @@
#include
"CNDFS.h"
#include
"CNDFS.h"
#include
"ModelCheckBaseMT.h"
#include
"ModelCheckBaseMT.h"
#include
<iostream>
#include
<iostream>
#include
<spot/tl/apcollect.hh>
#include
<spot/twa/twagraph.hh>
#include
<spot/twa/twagraph.hh>
#include
<thread>
#include
<vector>
using
namespace
std
;
using
namespace
std
;
bool
red
=
false
;
bool
blue
=
false
;
thread_local
bool
cyan
=
false
;
CNDFS
::~
CNDFS
()
=
default
;
CNDFS
::~
CNDFS
()
=
default
;
void
CNDFS
::
DfsBlue
(
ModelCheckBaseMT
&
mcl
,
shared_ptr
<
spot
::
twa_graph
>
af
)
{
void
CNDFS
::
DfsBlue
(
ModelCheckBaseMT
&
m
,
shared_ptr
<
spot
::
twa_graph
>
a
)
{
cout
<<
"First state SOG from CNDFS "
<<
mcl
.
getInitialMetaState
()
<<
endl
;
cout
<<
"First state SOG from CNDFS "
<<
m
.
getInitialMetaState
()
<<
endl
;
cout
<<
"First state BA from CNDFS "
<<
af
->
acc
()
<<
endl
;
cout
<<
"First state BA from CNDFS "
<<
a
->
get_init_state
()
<<
endl
;
}
void
CNDFS
::
spawnThreads
(
int
n
,
ModelCheckBaseMT
&
mcl
,
shared_ptr
<
spot
::
twa_graph
>
af
)
{
std
::
vector
<
thread
>
threads
(
n
);
// spawn n threads:
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
threads
.
push_back
(
thread
(
DfsBlue
,
ref
(
mcl
),
af
));
}
for
(
auto
&
th
:
threads
)
{
th
.
join
();
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/algorithm/CNDFS.h
+
2
−
1
View file @
2d474942
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
class
CNDFS
{
class
CNDFS
{
public:
public:
virtual
~
CNDFS
();
virtual
~
CNDFS
();
void
DfsBlue
(
ModelCheckBaseMT
&
mcl
,
shared_ptr
<
spot
::
twa_graph
>
af
);
static
void
DfsBlue
(
ModelCheckBaseMT
&
mcl
,
shared_ptr
<
spot
::
twa_graph
>
af
);
static
void
spawnThreads
(
int
n
,
ModelCheckBaseMT
&
mcl
,
shared_ptr
<
spot
::
twa_graph
>
af
);
};
};
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
8
−
6
View file @
2d474942
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include
"Hybrid/MCHybridPOR/MCHybridSOGPOR.h"
#include
"Hybrid/MCHybridPOR/MCHybridSOGPOR.h"
#include
"algorithm/CNDFS.h"
#include
"algorithm/CNDFS.h"
#include
<typeinfo>
#include
<typeinfo>
#include
<atomic>
using
namespace
std
;
using
namespace
std
;
...
@@ -509,6 +510,7 @@ int main(int argc, char **argv)
...
@@ -509,6 +510,7 @@ int main(int argc, char **argv)
// build automata of the negation of the formula
// build automata of the negation of the formula
auto
d
=
spot
::
make_bdd_dict
();
auto
d
=
spot
::
make_bdd_dict
();
spot
::
twa_graph_ptr
af
=
formula2Automaton
(
negate_formula
.
f
,
d
,
dot_formula
);
spot
::
twa_graph_ptr
af
=
formula2Automaton
(
negate_formula
.
f
,
d
,
dot_formula
);
// twa_graph class
shared_ptr
<
spot
::
twa_graph
>
aa
=
formula2Automaton
(
negate_formula
.
f
,
d
,
dot_formula
);
shared_ptr
<
spot
::
twa_graph
>
aa
=
formula2Automaton
(
negate_formula
.
f
,
d
,
dot_formula
);
// create the SOG
// create the SOG
...
@@ -519,14 +521,14 @@ int main(int argc, char **argv)
...
@@ -519,14 +521,14 @@ int main(int argc, char **argv)
if
(
algorithm
==
"UFSCC"
||
algorithm
==
"CNDFS"
)
if
(
algorithm
==
"UFSCC"
||
algorithm
==
"CNDFS"
)
{
{
cout
<<
"pointeur sur le sog "
<<
typeid
(
mcl
).
name
()
<<
endl
;
cout
<<
"pointeur sur le sog "
<<
typeid
(
mcl
).
name
()
<<
endl
;
//cout << "pointeur sur le BA "<< typeid(af).name() <<endl;
cout
<<
"pointeur sur le BA "
<<
typeid
(
aa
).
name
()
<<
endl
;
cout
<<
"pointeur sur le BA "
<<
typeid
(
aa
).
name
()
<<
endl
;
//atomic<ModelCheckBaseMT> (*mcl);
//shared_ptr< atomic<spot::twa_graph>> aa;
CNDFS
n
;
CNDFS
n
;
//n.DfsBlue();
//n.DfsBlue(*mcl, aa);
n
.
DfsBlue
(
*
mcl
,
aa
);
n
.
spawnThreads
(
4
,
*
mcl
,
aa
);
return
(
0
);
return
(
0
);
//exit(0);
}
}
else
// run on the fly sequential model-checking
else
// run on the fly sequential model-checking
...
...
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