Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
caisar
Commits
e58920f9
Commit
e58920f9
authored
3 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
Remove temporary files only in app mode (keep them with verbosity activated).
parent
6f81e06c
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
config.ml
+2
-2
2 additions, 2 deletions
config.ml
engine.ml
+4
-4
4 additions, 4 deletions
engine.ml
marabou.ml
+1
-1
1 addition, 1 deletion
marabou.ml
utils.ml
+14
-0
14 additions, 0 deletions
utils.ml
utils.mli
+9
-0
9 additions, 0 deletions
utils.mli
with
30 additions
and
7 deletions
config.ml
+
2
−
2
View file @
e58920f9
...
...
@@ -41,7 +41,7 @@ let exe_path_of_solver solver =
with
End_of_file
->
false
,
S
.
exe_name
in
Stdlib
.
close_in
in_channel
;
Sy
s
.
remove
tmp
;
Util
s
.
remove
_on_app_mode
tmp
;
if
found
then
Ok
exe
else
begin
...
...
@@ -167,7 +167,7 @@ let detect_default_solvers () =
Stdlib
.
close_in
in_channel
;
Buffer
.
contents
buf
in
Sy
s
.
remove
tmp
;
Util
s
.
remove
_on_app_mode
tmp
;
if
retcode
<>
0
then
begin
Logs
.
info
(
fun
m
->
m
"No solver `%s' found."
S
.
name
);
...
...
This diff is collapsed.
Click to expand it.
engine.ml
+
4
−
4
View file @
e58920f9
...
...
@@ -45,7 +45,7 @@ let check_availability solver config =
let
retcode
=
Sys
.
command
cmd
in
let
in_channel
=
Stdlib
.
open_in
tmp
in
Stdlib
.
close_in
in_channel
;
Sy
s
.
remove
tmp
;
Util
s
.
remove
_on_app_mode
tmp
;
if
retcode
=
0
then
Ok
()
...
...
@@ -199,7 +199,7 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
Logs
.
info
(
fun
m
->
m
"Executing command `%s'."
cmd
);
try
let
retcode
=
Sys
.
command
cmd
in
Sy
s
.
remove
prop
;
Util
s
.
remove
_on_app_mode
prop
;
if
retcode
<>
0
then
Error
(
Format
.
sprintf
"Command `%s' has failed."
cmd
)
else
begin
...
...
@@ -207,14 +207,14 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
let
result
=
extract_result
solver
~
log
~
output
in
Logs
.
app
(
fun
m
->
m
"Result of `%s': %a."
task
.
id
Solver
.
Result
.
pretty
result
);
Sy
s
.
remove
output
;
Util
s
.
remove
_on_app_mode
output
;
if
Solver
.
Result
.
equal
result
Solver
.
Result
.
Failure
then
Logs
.
app
(
fun
m
->
m
"See error messages in `%s' for more information."
log
)
else
Sy
s
.
remove
log
;
Util
s
.
remove
_on_app_mode
log
;
Ok
result
end
with
_
->
...
...
This diff is collapsed.
Click to expand it.
marabou.ml
+
1
−
1
View file @
e58920f9
...
...
@@ -33,7 +33,7 @@ let options ~model ~property ~output =
|
Some
Info
->
1
|
Some
Debug
->
2
in
[
"--property"
;
property
;
[
"--property"
;
property
;
"--input"
;
model
;
"--verbosity"
;
Int
.
to_string
verbosity_level
;
"--summary-file"
;
output
]
...
...
This diff is collapsed.
Click to expand it.
utils.ml
0 → 100644
+
14
−
0
View file @
e58920f9
(**************************************************************************)
(* *)
(* This file is part of Caisar. *)
(* *)
(**************************************************************************)
let
remove_on_app_mode
filename
=
let
is_app
=
match
Logs
.
level
()
with
|
Some
App
->
true
|
_
->
false
in
if
is_app
then
Sys
.
remove
filename
This diff is collapsed.
Click to expand it.
utils.mli
0 → 100644
+
9
−
0
View file @
e58920f9
(**************************************************************************)
(* *)
(* This file is part of Caisar. *)
(* *)
(**************************************************************************)
(** [remove_on_app_mode filename] removes the given file from the file system
when caisar is run in application mode only. *)
val
remove_on_app_mode
:
string
->
unit
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