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
88eddcbb
Commit
88eddcbb
authored
5 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
fix: exit with a gentle message whe the algo firls is empty
parent
4eb263e0
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
lib/sasacore/main.ml
+33
-29
33 additions, 29 deletions
lib/sasacore/main.ml
with
33 additions
and
29 deletions
lib/sasacore/main.ml
+
33
−
29
View file @
88eddcbb
(* Time-stamp: <modified the
06
/03/2020 (at 1
3:22
) by Erwan Jahier> *)
(* Time-stamp: <modified the
12
/03/2020 (at 1
6:55
) by Erwan Jahier> *)
open
Register
...
...
@@ -152,7 +152,7 @@ let (get_outputs_rif_decl: SasArg.t -> 'v Process.t list -> (string * string) li
let
vars
=
List
.
fold_left
(
fun
acc
p
->
let
l
=
SasaState
.
to_rif_decl
p
.
pid
p
.
init
in
let
l
=
List
.
rev
(
SasaState
.
to_rif_decl
p
.
pid
p
.
init
)
in
List
.
fold_left
(
fun
acc
(
n
,
t
)
->
(
n
,
Data
.
type_to_string
t
)
::
acc
)
acc
l
)
vars
...
...
@@ -171,15 +171,15 @@ let (make : bool -> string array -> 'v t) =
fun
dynlink
argv
->
let
args
=
try
SasArg
.
parse
argv
;
with
Failure
(
e
)
->
output_string
stdout
e
;
flush
stdout
;
exit
2
|
e
->
output_string
stdout
(
Printexc
.
to_string
e
);
flush
stdout
;
exit
2
with
Failure
(
e
)
->
output_string
stdout
e
;
flush
stdout
;
exit
2
|
e
->
output_string
stdout
(
Printexc
.
to_string
e
);
flush
stdout
;
exit
2
in
try
let
dynlink
=
if
args
.
output_algos
then
false
else
dynlink
in
...
...
@@ -221,7 +221,7 @@ let (make : bool -> string array -> 'v t) =
Register
.
set_is_directed
(
fun
()
->
g
.
directed
);
Register
.
verbose_level
:=
args
.
verbose
;
if
!
Register
.
verbose_level
>
1
then
Printf
.
eprintf
"==> nodes: %s
\n
"
nstr
;
if
dynlink
then
(
...
...
@@ -232,16 +232,20 @@ let (make : bool -> string array -> 'v t) =
)
else
()
;
let
initl
=
List
.
map
(
fun
n
->
let
algo_id
=
Filename
.
chop_suffix
n
.
Topology
.
file
".ml"
in
let
value_of_string_opt
=
Register
.
get_value_of_string
()
in
if
value_of_string_opt
=
None
||
n
.
Topology
.
init
=
""
then
Register
.
get_init_state
algo_id
(
List
.
length
(
g
.
succ
n
.
id
))
n
.
id
else
match
value_of_string_opt
with
|
None
->
assert
false
(* sno *)
|
Some
f
->
f
n
.
Topology
.
init
)
nl
if
n
.
Topology
.
file
=
""
then
(
Printf
.
eprintf
" [sasa] Empty algo attribute in %s.
\n
%!"
dot_file
;
exit
1
);
let
algo_id
=
Filename
.
chop_suffix
n
.
Topology
.
file
".ml"
in
let
value_of_string_opt
=
Register
.
get_value_of_string
()
in
if
value_of_string_opt
=
None
||
n
.
Topology
.
init
=
""
then
Register
.
get_init_state
algo_id
(
List
.
length
(
g
.
succ
n
.
id
))
n
.
id
else
match
value_of_string_opt
with
|
None
->
assert
false
(* sno *)
|
Some
f
->
f
n
.
Topology
.
init
)
nl
in
if
!
Register
.
verbose_level
>
0
then
Printf
.
eprintf
"==> get_neighors
\n
"
;
...
...
@@ -303,11 +307,11 @@ let (make : bool -> string array -> 'v t) =
args
,
pl_n
,
e
with
|
Dynlink
.
Error
e
->
Printf
.
eprintf
" [sasa] Error when dynlinking (Sasacore.make): %s
\n
%!"
(
Dynlink
.
error_message
e
);
flush_all
()
;
exit
2
Printf
.
eprintf
" [sasa] Error when dynlinking (Sasacore.make): %s
\n
%!"
(
Dynlink
.
error_message
e
);
flush_all
()
;
exit
2
|
e
->
Printf
.
eprintf
" [sasa] Error (Sasacore.make): %s
\n
%!"
(
Printexc
.
to_string
e
);
flush_all
()
;
exit
2
Printf
.
eprintf
" [sasa] Error (Sasacore.make): %s
\n
%!"
(
Printexc
.
to_string
e
);
flush_all
()
;
exit
2
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