Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlatools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlatools
Commits
4111431a
Commit
4111431a
authored
Apr 10, 2020
by
Calvin Loncaric
Committed by
Markus Alexander Kuppe
Apr 10, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Allow "-workers auto" to automatically detect available parallelism
[Feature][TLC][Changelog]
parent
6c28e853
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
tlatools/org.lamport.tlatools/src/tlc2/TLC.java
+8
-4
8 additions, 4 deletions
tlatools/org.lamport.tlatools/src/tlc2/TLC.java
with
8 additions
and
4 deletions
tlatools/org.lamport.tlatools/src/tlc2/TLC.java
+
8
−
4
View file @
4111431a
...
@@ -747,7 +747,9 @@ public class TLC {
...
@@ -747,7 +747,9 @@ public class TLC {
{
{
try
try
{
{
int
num
=
Integer
.
parseInt
(
args
[
index
]);
int
num
=
args
[
index
].
strip
().
toLowerCase
().
equals
(
"auto"
)
?
Runtime
.
getRuntime
().
availableProcessors
()
:
Integer
.
parseInt
(
args
[
index
]);
if
(
num
<
1
)
if
(
num
<
1
)
{
{
printErrorMsg
(
"Error: at least one worker required."
);
printErrorMsg
(
"Error: at least one worker required."
);
...
@@ -757,12 +759,12 @@ public class TLC {
...
@@ -757,12 +759,12 @@ public class TLC {
index
++;
index
++;
}
catch
(
Exception
e
)
}
catch
(
Exception
e
)
{
{
printErrorMsg
(
"Error: worker number required. But encountered "
+
args
[
index
]);
printErrorMsg
(
"Error: worker number
or 'auto'
required. But encountered "
+
args
[
index
]);
return
false
;
return
false
;
}
}
}
else
}
else
{
{
printErrorMsg
(
"Error: expect an integer for -workers option."
);
printErrorMsg
(
"Error: expect an integer
or 'auto'
for -workers option."
);
return
false
;
return
false
;
}
}
}
else
if
(
args
[
index
].
equals
(
"-dfid"
))
}
else
if
(
args
[
index
].
equals
(
"-dfid"
))
...
@@ -1438,7 +1440,9 @@ public class TLC {
...
@@ -1438,7 +1440,9 @@ public class TLC {
"an absolute path to a file in which to log user output (for\n"
"an absolute path to a file in which to log user output (for\n"
+
"example, that which is produced by Print)"
,
true
));
+
"example, that which is produced by Print)"
,
true
));
sharedArguments
.
add
(
new
UsageGenerator
.
Argument
(
"-workers"
,
"num"
,
sharedArguments
.
add
(
new
UsageGenerator
.
Argument
(
"-workers"
,
"num"
,
"the number of TLC worker threads; defaults to 1"
,
true
));
"the number of TLC worker threads; defaults to 1. Use 'auto'\n"
+
"to automatically select the number of threads based on the\n"
+
"number of available cores."
,
true
));
sharedArguments
.
add
(
new
UsageGenerator
.
Argument
(
"SPEC"
,
null
));
sharedArguments
.
add
(
new
UsageGenerator
.
Argument
(
"SPEC"
,
null
));
...
...
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