Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
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
Container Registry
Model registry
Operate
Environments
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
verimag
synchrone
sasa
Commits
851fdc07
Commit
851fdc07
authored
6 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Fix the result of -rif when not used with custum demon
parent
6929ab22
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/sasa.ml
+14
-6
14 additions, 6 deletions
bin/sasa.ml
with
14 additions
and
6 deletions
bin/sasa.ml
+
14
−
6
View file @
851fdc07
(* Time-stamp: <modified the 10/03/2019 (at
16:1
8) by Erwan Jahier> *)
(* Time-stamp: <modified the 10/03/2019 (at
21:0
8) by Erwan Jahier> *)
(* XXX Je pourrais utiliser Lwt pour rendre step non-bloquant, ce qui
permettrait d'accelerer la simu sur les machines qui ont plusieurs
...
...
@@ -67,8 +67,16 @@ exception Silent of int
let
(
print_step
:
int
->
int
->
Env
.
t
->
Process
.
t
list
->
string
->
unit
)
=
fun
n
i
e
pl
str
->
if
SasArg
.
args
.
rif
then
(
Printf
.
eprintf
"
\n
#step %s
\n
"
(
string_of_int
(
n
-
i
+
1
))
;
Printf
.
eprintf
"%s #outs "
str
;
flush
stderr
;
if
SasArg
.
args
.
demon
=
Demon
.
Custom
then
(
(* in custom mode, to be able to talk with lurette, this should not be
printed on stdout
*)
Printf
.
eprintf
"
\n
#step %s
\n
"
(
string_of_int
(
n
-
i
+
1
))
;
Printf
.
eprintf
"%s #outs "
str
;
flush
stderr
)
else
(
Printf
.
printf
"
\n
#step %s
\n
"
(
string_of_int
(
n
-
i
+
1
))
;
Printf
.
printf
"%s #outs "
str
;
flush
stdout
);
Printf
.
printf
"%s
\n
"
(
StringOf
.
env_rif
e
pl
);
flush
stdout
)
...
...
@@ -108,7 +116,7 @@ let rec (simu: int -> int -> Process.t list ->
(* update the env *)
let
ne
=
List
.
fold_left
update_env
e
lenv_list
in
let
al_str
=
if
args
.
demon
=
Demon
.
Custom
then
let
al_str
=
if
args
.
rif
then
input_string
else
"("
^
String
.
concat
","
...
...
@@ -119,7 +127,7 @@ let rec (simu: int -> int -> Process.t list ->
(* | [_] -> () *)
|
[]
->
assert
false
|
_
->
if
i
>
0
then
simu
n
(
i
-
1
)
pl
pl_n
ne
else
(
if
SasArg
.
args
.
rif
then
(
if
SasArg
.
args
.
rif
&&
args
.
demon
=
Custom
then
(
print_string
"q
\n
"
;
flush
stdout
))
...
...
@@ -169,6 +177,6 @@ let () =
let
str
=
if
SasArg
.
args
.
rif
then
"#"
else
""
in
Printf
.
printf
"%sThis algo is silent after %i steps
\n
"
str
i
;
flush
stdout
;
if
SasArg
.
args
.
rif
then
(
if
SasArg
.
args
.
rif
&&
args
.
demon
=
Custom
then
(
print_string
"q
\n
"
;
flush
stdout
)
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