Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pmtool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
EYRAUD-DUBOIS Lionel
pmtool
Commits
55cc212b
Commit
55cc212b
authored
Mar 05, 2020
by
EYRAUD-DUBOIS Lionel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New option to allow exporting with WorkerOrder
parent
4f782f6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
8 deletions
+32
-8
ProgramOptions.cpp
ProgramOptions.cpp
+10
-2
core/schedAction.cpp
core/schedAction.cpp
+14
-2
include/ProgramOptions.h
include/ProgramOptions.h
+2
-1
include/schedAction.h
include/schedAction.h
+4
-2
pmtool.cpp
pmtool.cpp
+2
-1
No files found.
ProgramOptions.cpp
View file @
55cc212b
...
...
@@ -43,6 +43,7 @@ static const int opt_thread = 16;
static
const
int
opt_tags
=
17
;
static
const
int
opt_submit
=
18
;
static
const
int
opt_export_type
=
19
;
static
const
int
opt_export_order
=
20
;
static
struct
option
long_options
[]
=
{
...
...
@@ -67,6 +68,7 @@ static struct option long_options[] = {
{
"use-tags"
,
no_argument
,
0
,
opt_tags
},
{
"submit-order"
,
no_argument
,
0
,
opt_submit
},
{
"export-type"
,
no_argument
,
0
,
opt_export_type
},
{
"export-order"
,
no_argument
,
0
,
opt_export_order
},
{
0
,
0
,
0
,
0
}
};
...
...
@@ -83,8 +85,11 @@ ProgramOptions::ProgramOptions() {
optRevDep
=
false
;
outputBest
=
false
;
nbThreads
=
1
;
useSubmitOrder
=
false
;
appendTags
=
false
;
useSubmitOrder
=
false
;
appendTags
=
false
;
outputTypeInExport
=
false
;
workerOrderInExport
=
false
;
platform_bw
=
1
;
}
void
ProgramOptions
::
parse
(
int
argc
,
char
**
argv
)
{
...
...
@@ -188,6 +193,9 @@ void ProgramOptions::parse(int argc, char** argv) {
case
opt_export_type
:
outputTypeInExport
=
true
;
break
;
case
opt_export_order
:
workerOrderInExport
=
true
;
break
;
case
'?'
:
case
'h'
:
usage
();
...
...
core/schedAction.cpp
View file @
55cc212b
...
...
@@ -105,8 +105,16 @@ string ExportToString::getResult() {
/* ExportAlloc: exports in .rec format */
ExportAlloc
::
ExportAlloc
(
string
filename
,
Instance
*
ins
,
bool
submitOrder
,
bool
outputType
)
:
output
(
filename
),
instance
(
ins
),
submitOrder
(
submitOrder
),
outputType
(
outputType
)
{
ExportAlloc
::
ExportAlloc
(
string
filename
,
Instance
*
ins
,
bool
submitOrder
,
bool
outputType
,
bool
workerOrder
)
:
output
(
filename
),
instance
(
ins
),
submitOrder
(
submitOrder
),
outputType
(
outputType
),
workerOrder
(
workerOrder
)
{
if
(
workerOrder
)
{
if
(
!
outputType
)
{
workerTaskCount
.
resize
(
instance
->
totalWorkers
,
0
);
}
else
{
cerr
<<
"Export: workerOrder is not compatible with outputType, ignoring."
<<
endl
;
workerOrder
=
false
;
}
}
}
void
ExportAlloc
::
onSchedule
(
int
i
,
int
w
,
double
s
,
double
f
)
{
...
...
@@ -135,6 +143,10 @@ void ExportAlloc::onSchedule(int i, int w, double s, double f) {
output
<<
endl
;
}
else
{
output
<<
"SpecificWorker: "
<<
w
<<
endl
;
if
(
workerOrder
)
{
output
<<
"Workerorder: "
<<
workerTaskCount
[
w
]
<<
endl
;
++
workerTaskCount
[
w
];
}
}
...
...
include/ProgramOptions.h
View file @
55cc212b
...
...
@@ -45,7 +45,8 @@ class ProgramOptions {
int
nbThreads
;
bool
appendTags
;
bool
useSubmitOrder
;
bool
outputTypeInExport
;
bool
outputTypeInExport
;
bool
workerOrderInExport
;
std
::
set
<
std
::
string
>
optionKeys
;
std
::
vector
<
fullAlg
>
algs
;
...
...
include/schedAction.h
View file @
55cc212b
...
...
@@ -58,9 +58,11 @@ class ExportAlloc : public SchedAction {
std
::
ofstream
output
;
Instance
*
instance
;
bool
submitOrder
;
bool
outputType
;
bool
outputType
;
bool
workerOrder
;
std
::
vector
<
int
>
workerTaskCount
;
public:
ExportAlloc
(
std
::
string
filename
,
Instance
*
ins
,
bool
submitOrder
=
false
,
bool
outputType
=
false
);
ExportAlloc
(
std
::
string
filename
,
Instance
*
ins
,
bool
submitOrder
=
false
,
bool
outputType
=
false
,
bool
workerOrder
=
false
);
void
onSchedule
(
int
i
,
int
w
,
double
s
,
double
f
);
~
ExportAlloc
();
};
...
...
pmtool.cpp
View file @
55cc212b
...
...
@@ -52,7 +52,8 @@ void computeAlg(ProgramOptions& progOpt, Instance* ins,
ExportAlloc
*
exportAlloc
=
NULL
;
if
(
opts
.
isPresent
(
"export"
))
{
exportAlloc
=
new
ExportAlloc
(
opts
.
asString
(
"export"
),
ins
,
progOpt
.
useSubmitOrder
,
progOpt
.
outputTypeInExport
);
exportAlloc
=
new
ExportAlloc
(
opts
.
asString
(
"export"
),
ins
,
progOpt
.
useSubmitOrder
,
progOpt
.
outputTypeInExport
,
progOpt
.
workerOrderInExport
);
seq
.
add
(
exportAlloc
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment