Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Spot
go2pins
Commits
ec0f2d13
Commit
ec0f2d13
authored
Dec 23, 2020
by
Etienne Renault
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go2pins: enable multithreading for backends
* Makefile, benchs/run-benchmark.sh, boilerplate/main.go: Here.
parent
2eaa308e
Pipeline
#24570
passed with stage
in 2 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
10 deletions
+31
-10
Makefile
Makefile
+2
-2
benchs/run-benchmark.sh
benchs/run-benchmark.sh
+10
-4
boilerplate/main.go
boilerplate/main.go
+19
-4
No files found.
Makefile
View file @
ec0f2d13
...
...
@@ -24,7 +24,7 @@ all:
"Consider
\"
make release
\"
for a more efficient version "
release
:
@
go build
-ldflags
"-s -w"
&&
go build
-o
ltlrec ltl/desugar/main.go
@
go build
-ldflags
"-s -w"
&&
go build
-o
ltlrec ltl/desugar/main.go
build-image
:
Dockerfile
docker build
--no-cache
-t
registry.lrde.epita.fr/go2pins-debian .
...
...
@@ -39,7 +39,7 @@ check: go2pins
@
cd
tests
&&
./run.sh
benchmark
:
@
make clean release
&&
cd
benchs
&&
./run-benchmark.sh
@
make clean release
&&
cd
benchs
&&
./run-benchmark.sh
$(nbthreads)
clean
:
go clean
...
...
benchs/run-benchmark.sh
View file @
ec0f2d13
...
...
@@ -70,10 +70,16 @@ FILES="RERS/2016-Problem10-reach.go \
RERS/2019-Problem14-reach.go
\
RERS/2019-Problem15-reach.go "
OUTPUT
=
benchs.csv
OUTPUT_BB
=
benchs-bb.csv
OUTPUT_REACH
=
benchs-reach.csv
OUTPUT_LTL
=
benchs-ltl.csv
NBTHREADS
=
1
if
[
$#
-eq
1
]
;
then
NBTHREADS
=
$1
fi
OUTPUT
=
"benchs-
$NBTHREADS
.csv"
OUTPUT_BB
=
"benchs-bb-
$NBTHREADS
.csv"
OUTPUT_REACH
=
"benchs-reach-
$NBTHREADS
.csv"
OUTPUT_LTL
=
"benchs-ltl-
$NBTHREADS
.csv"
echo
"##################################"
...
...
boilerplate/main.go
View file @
ec0f2d13
...
...
@@ -32,6 +32,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"unsafe"
)
...
...
@@ -376,6 +377,7 @@ var (
kripke_ss
=
flag
.
Bool
(
"kripke-size"
,
false
,
"The size of the state space (only spot backend)"
)
list_var
=
flag
.
Bool
(
"list-variables"
,
false
,
"Display the list of variable names."
)
ltl
=
flag
.
String
(
"ltl"
,
""
,
"The LTL formulae to check"
)
nb_threads
=
flag
.
Int
(
"nb-threads"
,
1
,
"The number of threads to use"
)
)
func
init
()
{
...
...
@@ -450,15 +452,28 @@ func main() {
if
*
ltl
!=
""
{
var
mcCmd
*
exec
.
Cmd
if
*
backend
==
"ltsmin"
{
mcCmd
=
exec
.
Command
(
ltsmin_path
(),
"--threads"
,
"1"
,
mcCmd
=
exec
.
Command
(
ltsmin_path
(),
"--threads"
,
strconv
.
Itoa
(
*
nb_threads
),
"--ltl"
,
*
ltl
,
maindve2C
)
}
else
if
*
backend
==
"spot"
||
*
backend
==
""
{
if
!
spot_dev_version
()
{
if
*
nb_threads
!=
1
{
panic
(
"This version of spot does not support multithreading"
)
}
mcCmd
=
exec
.
Command
(
spot_path
(),
maindve2C
,
"!"
+*
ltl
)
}
else
{
mcCmd
=
exec
.
Command
(
spot_path
(),
"-e"
,
"--model"
,
maindve2C
,
"--formula"
,
"!"
+*
ltl
)
// Use BDD based algorithms
if
*
nb_threads
==
1
{
mcCmd
=
exec
.
Command
(
spot_path
(),
"-e"
,
"--model"
,
maindve2C
,
"--formula"
,
"!"
+*
ltl
)
}
else
{
// Use parallel algorithms
mcCmd
=
exec
.
Command
(
spot_path
(),
"-e"
,
"--model"
,
maindve2C
,
"--formula"
,
"!"
+*
ltl
,
"--parallel"
,
strconv
.
Itoa
(
*
nb_threads
))
}
}
}
else
{
panic
(
"backend '"
+
*
backend
+
"' unknown!"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment