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
d4282aec
Commit
d4282aec
authored
Jun 18, 2019
by
EYRAUD-DUBOIS Lionel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New utility to compute number of tasks and depth of instances
parent
78cc9963
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
CMakeLists.txt
CMakeLists.txt
+2
-0
instanceinfo.cpp
instanceinfo.cpp
+60
-0
No files found.
CMakeLists.txt
View file @
d4282aec
...
...
@@ -58,3 +58,5 @@ if(THREADS_FOUND)
target_link_libraries
(
pmtool Threads::Threads
)
endif
()
add_executable
(
instanceinfo instanceinfo.cpp
)
target_link_libraries
(
instanceinfo core
)
instanceinfo.cpp
0 → 100644
View file @
d4282aec
#include <iostream>
#include <getopt.h>
#include <string>
#include <vector>
#include "instance.h"
#include "util.h"
using
namespace
std
;
static
const
int
opt_no_convert
=
10
;
static
const
int
opt_no_header
=
12
;
static
struct
option
long_options
[]
=
{
{
"no-convert"
,
no_argument
,
0
,
opt_no_convert
},
{
"no-header"
,
no_argument
,
0
,
opt_no_header
},
{
0
,
0
,
0
,
0
}
};
static
const
char
*
optstring
=
""
;
int
main
(
int
argc
,
char
*
argv
[])
{
bool
convertIndices
=
true
;
bool
printHeader
=
true
;
vector
<
string
>
inputFiles
;
int
longindex
=
0
;
int
opt
=
getopt_long
(
argc
,
argv
,
optstring
,
long_options
,
&
longindex
);
while
(
opt
!=
-
1
)
{
switch
(
opt
)
{
case
opt_no_convert
:
convertIndices
=
false
;
break
;
case
opt_no_header
:
printHeader
=
false
;
break
;
default:
break
;
}
opt
=
getopt_long
(
argc
,
argv
,
optstring
,
long_options
,
&
longindex
);
}
for
(
int
a
=
optind
;
a
<
argc
;
++
a
)
inputFiles
.
push_back
(
string
(
argv
[
a
]));
if
(
printHeader
)
{
cout
<<
"input nbTasks depth"
<<
endl
;
}
for
(
string
&
file
:
inputFiles
)
{
Instance
*
instance
=
new
Instance
(
file
,
convertIndices
);
int
nbTasks
=
instance
->
nbTasks
;
int
depth
=
getMax
(
instance
->
computeUnitRank
());
cout
<<
file
<<
" "
<<
nbTasks
<<
" "
<<
depth
<<
endl
;
delete
instance
;
}
}
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