Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfpm_pdata
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
Container 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
argupta
openfpm_pdata
Commits
00d063fa
Commit
00d063fa
authored
9 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Fixing install script
parent
81cd91db
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
script/py/pack_examples.py
+93
-0
93 additions, 0 deletions
script/py/pack_examples.py
script/py/process_examples.py
+20
-0
20 additions, 0 deletions
script/py/process_examples.py
src/Makefile.am
+1
-1
1 addition, 1 deletion
src/Makefile.am
with
114 additions
and
1 deletion
script/py/pack_examples.py
0 → 100644
+
93
−
0
View file @
00d063fa
__author__
=
'
i-bird
'
import
os
import
shutil
,
errno
import
configparser
from
os
import
listdir
from
os.path
import
isdir
,
join
class
pack_example
:
temporary
=
os
.
sep
+
"
tmp
"
+
os
.
sep
+
"
pack_example
"
base_dir
=
""
# Get the files to copy
def
get_files
(
self
,
dir
):
config
=
configparser
.
ConfigParser
()
config
.
read
(
dir
+
os
.
sep
+
"
config.cfg
"
)
files
=
[]
if
"
pack
"
in
config
:
if
"
files
"
in
config
[
"
pack
"
]:
files
=
config
[
"
pack
"
][
"
files
"
]
files
=
str
.
split
(
files
)
# for each filr add the prefix
for
i
in
range
(
0
,
len
(
files
)):
files
[
i
]
=
dir
+
os
.
sep
+
files
[
i
]
return
files
# If the directory is an example
def
is_example
(
self
,
dir
):
return
os
.
path
.
isfile
(
dir
+
os
.
sep
+
"
config.cfg
"
)
# Get the files to pack
def
copy_example
(
self
,
dir
):
print
(
"
Processing:
"
+
dir
)
files
=
self
.
get_files
(
dir
)
try
:
# Create the temporary folder
os
.
makedirs
(
self
.
temporary
)
except
FileExistsError
:
pass
# make the example directory
if
len
(
files
)
!=
0
:
head
,
tail
=
os
.
path
.
split
(
files
[
0
])
try
:
os
.
makedirs
(
self
.
temporary
+
os
.
sep
+
head
[
len
(
self
.
base_dir
):])
except
FileExistsError
:
pass
for
file
in
files
:
print
(
"
copy src:
"
+
file
+
"
dst:
"
+
self
.
temporary
+
os
.
sep
+
file
[
len
(
self
.
base_dir
):])
shutil
.
copy
(
file
,
self
.
temporary
+
os
.
sep
+
file
[
len
(
self
.
base_dir
):])
# Add examples in a recursive way
def
add_r
(
self
,
dir
):
if
self
.
is_example
(
dir
):
self
.
copy_example
(
dir
)
# copy Makefile
print
(
"
copy src:
"
+
dir
+
os
.
sep
+
"
Makefile
"
+
"
dst:
"
+
self
.
temporary
+
os
.
sep
+
"
Makefile
"
)
shutil
.
copy
(
dir
+
os
.
sep
+
"
Makefile
"
,
self
.
temporary
+
os
.
sep
+
"
Makefile
"
)
# List all the folder in the directory
onlydir
=
[
f
for
f
in
listdir
(
dir
)
if
isdir
(
join
(
dir
,
f
))
]
for
example_dir
in
onlydir
:
self
.
add_r
(
dir
+
os
.
sep
+
example_dir
)
# Add an example path
def
pack
(
self
,
dir
,
file
):
# Remove temporary folders and recreate it
if
os
.
path
.
exists
(
self
.
temporary
):
shutil
.
rmtree
(
self
.
temporary
)
os
.
makedirs
(
self
.
temporary
)
if
self
.
is_example
(
dir
):
self
.
copy_example
(
dir
)
self
.
base_dir
=
dir
# copy Makefile
print
(
"
copy src:
"
+
dir
+
os
.
sep
+
"
Makefile
"
+
"
dst:
"
+
self
.
temporary
+
os
.
sep
+
"
Makefile
"
)
shutil
.
copy
(
dir
+
os
.
sep
+
"
Makefile
"
,
self
.
temporary
+
os
.
sep
+
"
Makefile
"
)
# List all the folder in the directory
onlydir
=
[
f
for
f
in
listdir
(
dir
)
if
isdir
(
join
(
dir
,
f
))
]
for
example_dir
in
onlydir
:
self
.
add_r
(
dir
+
os
.
sep
+
example_dir
)
# make an archive
shutil
.
make_archive
(
file
,
"
bztar
"
,
self
.
base_dir
)
This diff is collapsed.
Click to expand it.
script/py/process_examples.py
0 → 100644
+
20
−
0
View file @
00d063fa
# python script that process the examples in particular it pack the examples, it generates the vtk files,
# the images out of the vtk files, the mardown wiki pages
import
argparse
import
os
from
os
import
listdir
from
os.path
import
isdir
,
join
from
pack_examples
import
pack_example
parser
=
argparse
.
ArgumentParser
(
description
=
'
Pack the examples, generate the vtk files to generate images, create the markdown pages for the wiki
'
)
parser
.
add_argument
(
'
directory
'
,
help
=
'
directory where are located the examples
'
)
args
=
parser
.
parse_args
()
# List all the folder in the directory
onlydir
=
[
f
for
f
in
listdir
(
args
.
directory
)
if
isdir
(
join
(
args
.
directory
,
f
))
]
p
=
pack_example
()
p
.
pack
(
args
.
directory
,
args
.
directory
+
os
.
sep
+
"
examples
"
)
This diff is collapsed.
Click to expand it.
src/Makefile.am
+
1
−
1
View file @
00d063fa
...
...
@@ -11,7 +11,7 @@ nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/commo
Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp
\
Vector/vector_dist.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp
\
config/config.h
\
SubdomainGraphNodes.hpp
metis_util.hpp dec_optimizer.hpp
SubdomainGraphNodes.hpp
.cu.o
:
$(
NVCC
)
$(
NVCCFLAGS
)
-o
$@
-c
$<
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