Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CTA-LAPP
PHOENIX_LIBS
PhoenixHPCProxy
Commits
d3b80b5c
Commit
d3b80b5c
authored
Dec 12, 2020
by
Pierre Aubert
Browse files
Update error check and argument output
parent
3b8b2f9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
src/BackEnd/backend_proxy_loader.cpp
src/BackEnd/backend_proxy_loader.cpp
+5
-3
src/Representation/representation.cpp
src/Representation/representation.cpp
+1
-1
No files found.
src/BackEnd/backend_proxy_loader.cpp
View file @
d3b80b5c
...
...
@@ -113,7 +113,7 @@ std::string cpp_backendProxyLoaderParseArchFileSource(const PVecArchLib & vecArc
body
+=
"bool "
+
className
+
"::parseArchFile(const std::string & archfileName){
\n
"
;
body
+=
"
\t
FILE * fp = fopen(archfileName.c_str(),
\"
r
\"
);
\n
"
;
body
+=
"
\t
if(fp == NULL){
\n
"
;
body
+=
"
\t\t
std::cerr <<
\"
Cannot open file '
/proc/cpuinfo
'
\"
<< std::endl;
\n
"
;
body
+=
"
\t\t
std::cerr <<
\"
Cannot open file '
\"
<< archfileName <<
\"
'
\"
<< std::endl;
\n
"
;
body
+=
"
\t\t
return false;
\n
"
;
body
+=
"
\t
}
\n
"
;
body
+=
"
\t
//Let's get the file size
\n
"
;
...
...
@@ -128,6 +128,7 @@ std::string cpp_backendProxyLoaderParseArchFileSource(const PVecArchLib & vecArc
body
+=
"
\t
//And load the file
\n
"
;
body
+=
"
\t
if(fread(procCpuInfo, sizeof(char), fileSize, fp) != fileSize){return false;}
\n
"
;
body
+=
"
\t
//Let's check the avalaible architectures
\n
"
;
body
+=
"
\t
bool isLibFound(true);
\n
"
;
std
::
string
strElse
(
"
\t
"
);
for
(
PVecArchLib
::
const_reverse_iterator
it
(
vecArchLib
.
rbegin
());
it
!=
vecArchLib
.
rend
();
++
it
){
body
+=
strElse
+
"if(strstr(procCpuInfo,
\"
"
+
it
->
getArchitecture
()
+
"
\"
) != NULL){
\n
"
;
...
...
@@ -136,10 +137,11 @@ std::string cpp_backendProxyLoaderParseArchFileSource(const PVecArchLib & vecArc
body
+=
"
\t
}"
;
strElse
=
"else "
;
}
body
+=
"else{
\n\t\t
isLibFound = false;
\n\t
}
\n
"
;
body
+=
"
\n
"
;
body
+=
"
\t
fclose(fp);
\n
"
;
body
+=
"
\t
delete [] procCpuInfo;
\n
"
;
body
+=
"
\t
return
true
;
\n
"
;
body
+=
"
\t
return
isLibFound
;
\n
"
;
body
+=
"}
\n\n
"
;
return
body
;
}
...
...
@@ -226,7 +228,7 @@ std::string cpp_backendProxyLoaderSource(const PVecSource & vecSource, const PVe
body
+=
"
\n
#include
\"
"
+
className
+
".h
\"\n\n
"
;
body
+=
"///Variable which will load automatically the right library by respect to the given architecture
\n
"
;
body
+=
className
+
" PROXY_LOADER;
\n\n
"
;
std
::
string
defaultLib
(
getLibraryFile
(
vecArchLib
));
std
::
string
defaultLib
(
getFileName
(
getLibraryFile
(
vecArchLib
))
)
;
body
+=
cpp_backendProxyLoaderConstructorSource
(
className
,
defaultLib
);
body
+=
cpp_backendProxyLoaderDesonstructorSource
(
className
);
body
+=
cpp_backendProxyLoaderLoadSource
(
className
);
...
...
src/Representation/representation.cpp
View file @
d3b80b5c
...
...
@@ -33,7 +33,7 @@ PArchLib createArchLib(const std::string & arch, const std::string & libName){
*/
void
addArch
(
PVecArchLib
&
vecArch
,
const
std
::
string
&
arch
,
const
std
::
string
&
libName
){
if
(
libName
!=
""
){
vecArch
.
push_back
(
createArchLib
(
"any
arch
"
,
libName
));
vecArch
.
push_back
(
createArchLib
(
arch
,
libName
));
}
}
...
...
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