Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
llvm
Hercules
Merge requests
!144
Forkify fixes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Forkify fixes
forkify-fixes
into
main
Overview
2
Commits
31
Pipelines
6
Changes
1
Merged
Xavier Routh
requested to merge
forkify-fixes
into
main
2 months ago
Overview
2
Commits
31
Pipelines
6
Changes
1
Expand
0
0
Merge request reports
Viewing commit
acf060c7
Prev
Next
Show latest version
1 file
+
36
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
acf060c7
read schedule from file
· acf060c7
Xavier Routh
authored
2 months ago
juno_scheduler/src/lib.rs
+
36
−
0
Options
@@ -146,6 +146,42 @@ pub fn run_schedule_on_hercules(
.map_err
(|
e
|
format!
(
"Scheduling Error: {}"
,
e
))
}
pub
fn
run_schedule_from_file_on_hercules
(
module
:
Module
,
sched_filename
:
Option
<
String
>
,
)
->
Result
<
Module
,
String
>
{
let
sched
=
process_schedule
(
sched_filename
)
?
;
// Prepare the scheduler's string table and environment
// For this, we put all of the Hercules function names into the environment
// and string table
let
mut
strings
=
StringTable
::
new
();
let
mut
env
=
Env
::
new
();
env
.open_scope
();
for
(
idx
,
func
)
in
module
.functions
.iter
()
.enumerate
()
{
let
func_name
=
strings
.lookup_string
(
func
.name
.clone
());
env
.insert
(
func_name
,
Value
::
HerculesFunction
{
func
:
FunctionID
::
new
(
idx
),
},
);
}
env
.open_scope
();
schedule_module
(
module
,
sched
,
strings
,
env
,
JunoFunctions
{
func_ids
:
vec!
[]
},
)
.map_err
(|
e
|
format!
(
"Scheduling Error: {}"
,
e
))
}
pub
fn
schedule_hercules
(
module
:
Module
,
sched_filename
:
Option
<
String
>
,
Loading