Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
amfe
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Aerospace and Mechanical Engineering
amfe
Commits
581d8748
Commit
581d8748
authored
2 years ago
by
Adrien Crovato
Browse files
Options
Downloads
Patches
Plain Diff
Add compile before exec to get clean backtrace
parent
7a60afc9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
amfe v1.0.5
Pipeline
#7108
passed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fwk/wutils.py
+12
-11
12 additions, 11 deletions
fwk/wutils.py
with
12 additions
and
11 deletions
fwk/wutils.py
+
12
−
11
View file @
581d8748
# -*- coding: utf-8 -*-
# Copyright 2020 University of Liège
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
...
@@ -96,7 +96,7 @@ def findbins(modname, dirB=['build','wavesB'], verb=False): # changer wavesB en
print
(
"
[findbins] looking for linux/mingw libs
"
)
libpath
.
append
(
os
.
path
.
join
(
spath
,
'
bin
'
)
)
# also for win-mingw
# check the paths one by one
# check the paths one by one
for
p
in
libpath
:
if
os
.
path
.
isdir
(
p
):
if
verb
:
...
...
@@ -156,12 +156,12 @@ def initMKL(verb=False):
# Display variables
if
verb
:
for
s
in
[
'
OMP
'
,
'
MKL
'
,
'
KMP
'
]:
print
(
'
* %s environment:
'
%
s
)
print
(
'
* %s environment:
'
%
s
)
for
key
,
value
in
os
.
environ
.
items
():
if
s
in
key
:
print
(
'
%s = %s
'
%
(
key
,
value
))
print
(
''
)
# ------------------------------------------------------------------------------
def
setupwdir
(
testname
):
...
...
@@ -183,7 +183,7 @@ def setupwdir(testname):
name
=
"
noname
"
import
os
,
os
.
path
# builds the name of the workspace folder
# builds the name of the workspace folder
#print "__file__=",__file__
dir1
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)
+
os
.
sep
+
"
..
"
)
+
os
.
sep
print
(
"
dir1=
"
,
dir1
)
...
...
@@ -193,7 +193,7 @@ def setupwdir(testname):
resdir
=
testname
[
len
(
common
):].
replace
(
os
.
sep
,
"
_
"
)
resdir
=
os
.
path
.
splitext
(
resdir
)[
0
]
# remove ".py"
if
siz
>
1
:
# append the mpi size if mpi is used
# append the mpi size if mpi is used
# (so that the same test can be run concurrently with
# sevral mpi sizes in ctest)
resdir
+=
"
_mpi%d
"
%
siz
...
...
@@ -215,10 +215,10 @@ def setupwdir(testname):
os
.
remove
(
fpth
)
elif
os
.
path
.
isdir
(
fpth
):
shutil
.
rmtree
(
fpth
)
if
siz
>
1
:
# if multiple process => send sync to slaves.
comm
.
Barrier
()
# we can now safely go into the new folder
os
.
chdir
(
wdir
)
...
...
@@ -300,4 +300,5 @@ def run():
print
(
"
starting test
"
,
testname
)
print
(
"
time:
"
,
time
.
strftime
(
"
%c
"
))
print
(
"
hostname:
"
,
socket
.
gethostname
())
exec
(
open
(
testname
,
'
r
'
,
encoding
=
'
utf8
'
).
read
(),
globals
(),
globals
())
# exec at global level!!
script
=
open
(
testname
,
'
r
'
,
encoding
=
'
utf-8
'
).
read
()
exec
(
compile
(
script
,
testname
,
'
exec
'
),
{
'
__file__
'
:
testname
,
'
__name__
'
:
'
__main__
'
})
# compile to get clean backtrace
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