Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batmen
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
sepia-pub
mael
batmen
Commits
98ae38e3
Commit
98ae38e3
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
refac: removed misleading job_order option in CLI
parent
be2aa4d9
No related branches found
No related tags found
1 merge request
!13
Some cleanup the repo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+17
-32
17 additions, 32 deletions
src/main.cpp
with
17 additions
and
32 deletions
src/main.cpp
+
17
−
32
View file @
98ae38e3
...
...
@@ -11,7 +11,6 @@
#include
<loguru.hpp>
#include
"scheds/fcfs.hpp"
#include
"external/taywee_args.hpp"
#include
"decision.hpp"
...
...
@@ -20,6 +19,7 @@
#include
"network.hpp"
#include
"pempek_assert.hpp"
#include
"queue.hpp"
#include
"scheds/easy_bf.hpp"
#include
"scheds/fcfs.hpp"
#include
"scheds/bin_packing.hpp"
...
...
@@ -50,13 +50,10 @@ int main(int argc, char **argv)
{
const
set
<
string
>
variants_set
=
{
"fcfs"
,
"easy_bf"
,
"multicore_filler"
,
"bin_packing"
,
"bin_packing_energy"
};
const
set
<
string
>
policies_set
=
{
"basic"
,
"contiguous"
};
const
set
<
string
>
queue_orders_set
=
{
"fcfs"
,
"lcfs"
,
"desc_bounded_slowdown"
,
"desc_slowdown"
,
"asc_size"
,
"desc_size"
,
"asc_walltime"
,
"desc_walltime"
};
const
set
<
string
>
verbosity_levels_set
=
{
"debug"
,
"info"
,
"quiet"
,
"silent"
};
const
string
variants_string
=
"{"
+
boost
::
algorithm
::
join
(
variants_set
,
", "
)
+
"}"
;
const
string
policies_string
=
"{"
+
boost
::
algorithm
::
join
(
policies_set
,
", "
)
+
"}"
;
const
string
queue_orders_string
=
"{"
+
boost
::
algorithm
::
join
(
queue_orders_set
,
", "
)
+
"}"
;
const
string
verbosity_levels_string
=
"{"
+
boost
::
algorithm
::
join
(
verbosity_levels_set
,
", "
)
+
"}"
;
ISchedulingAlgorithm
*
algo
=
nullptr
;
...
...
@@ -81,8 +78,6 @@ int main(int argc, char **argv)
"Sets the scheduling variant options as the content of the given filepath. Overrides the variant_options "
"options."
,
{
"variant_options_filepath"
},
""
);
args
::
ValueFlag
<
string
>
flag_queue_order
(
parser
,
"order"
,
"Sets the queue order. Available values are "
+
queue_orders_string
,
{
'o'
,
"queue_order"
},
"fcfs"
);
args
::
ValueFlag
<
string
>
flag_verbosity_level
(
parser
,
"verbosity-level"
,
"Sets the verbosity level. Available values are "
+
verbosity_levels_string
,
{
"verbosity"
},
"info"
);
args
::
ValueFlag
<
bool
>
flag_call_make_decisions_on_single_nop
(
parser
,
"flag"
,
...
...
@@ -97,10 +92,6 @@ int main(int argc, char **argv)
throw
args
::
ValidationError
(
str
(
format
(
"Invalid '%1%' parameter value (%2%): Must be non-negative."
)
%
flag_rjms_delay
.
Name
()
%
flag_rjms_delay
.
Get
()));
if
(
queue_orders_set
.
find
(
flag_queue_order
.
Get
())
==
queue_orders_set
.
end
())
throw
args
::
ValidationError
(
str
(
format
(
"Invalid '%1%' value (%2%): Not in %3%"
)
%
flag_queue_order
.
Name
()
%
flag_queue_order
.
Get
()
%
queue_orders_string
));
if
(
variants_set
.
find
(
flag_scheduling_variant
.
Get
())
==
variants_set
.
end
())
throw
args
::
ValidationError
(
str
(
format
(
"Invalid '%1%' value (%2%): Not in %3%"
)
%
flag_scheduling_variant
.
Name
()
%
flag_scheduling_variant
.
Get
()
%
variants_string
));
...
...
@@ -130,7 +121,6 @@ int main(int argc, char **argv)
string
socket_endpoint
=
flag_socket_endpoint
.
Get
();
string
scheduling_variant
=
flag_scheduling_variant
.
Get
();
string
selection_policy
=
flag_selection_policy
.
Get
();
string
queue_order
=
flag_queue_order
.
Get
();
string
variant_options
=
flag_variant_options
.
Get
();
string
variant_options_filepath
=
flag_variant_options_filepath
.
Get
();
string
verbosity_level
=
flag_verbosity_level
.
Get
();
...
...
@@ -156,26 +146,6 @@ int main(int argc, char **argv)
// Scheduling parameters
SchedulingDecision
decision
;
// Queue order
if
(
queue_order
==
"fcfs"
)
order
=
new
FCFSOrder
;
else
if
(
queue_order
==
"lcfs"
)
order
=
new
LCFSOrder
;
else
if
(
queue_order
==
"desc_bounded_slowdown"
)
order
=
new
DescendingBoundedSlowdownOrder
(
1
);
else
if
(
queue_order
==
"desc_slowdown"
)
order
=
new
DescendingSlowdownOrder
;
else
if
(
queue_order
==
"asc_size"
)
order
=
new
AscendingSizeOrder
;
else
if
(
queue_order
==
"desc_size"
)
order
=
new
DescendingSizeOrder
;
else
if
(
queue_order
==
"asc_walltime"
)
order
=
new
AscendingWalltimeOrder
;
else
if
(
queue_order
==
"desc_walltime"
)
order
=
new
DescendingWalltimeOrder
;
queue
=
new
Queue
(
order
);
// Resource selector
if
(
selection_policy
==
"basic"
)
selector
=
new
BasicResourceSelector
;
...
...
@@ -219,17 +189,32 @@ int main(int argc, char **argv)
}
LOG_F
(
1
,
"variant_options = '%s'"
,
variant_options
.
c_str
());
// Job order
if
(
scheduling_variant
==
"easy_bf"
||
scheduling_variant
==
"multicore_filler"
){
order
=
new
FCFSOrder
;
queue
=
new
Queue
(
order
);
}
if
(
scheduling_variant
==
"bin_packing"
||
scheduling_variant
==
"bin_packing_energy"
){
order
=
new
DescendingSizeOrder
;
queue
=
new
Queue
(
order
);
}
// Scheduling variant
if
(
scheduling_variant
==
"fcfs"
)
algo
=
new
FCFS
(
&
w
,
&
decision
,
queue
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
algo
=
new
FCFS
(
&
w
,
&
decision
,
nullptr
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
else
if
(
scheduling_variant
==
"easy_bf"
)
algo
=
new
EasyBackfilling
(
&
w
,
&
decision
,
queue
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
else
if
(
scheduling_variant
==
"multicore_filler"
)
algo
=
new
MulticoreFiller
(
&
w
,
&
decision
,
queue
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
else
if
(
scheduling_variant
==
"bin_packing"
)
algo
=
new
BinPacking
(
&
w
,
&
decision
,
queue
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
else
if
(
scheduling_variant
==
"bin_packing_energy"
)
algo
=
new
BinPackingEnergy
(
&
w
,
&
decision
,
queue
,
selector
,
rjms_delay
,
&
json_doc_variant_options
);
// Network
Network
n
;
n
.
bind
(
socket_endpoint
);
...
...
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