Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Mario Andres Serruya
REDIS_TESTS
Commits
48da29e6
Commit
48da29e6
authored
3 years ago
by
Mario Andres Serruya
Browse files
Options
Download
Email Patches
Plain Diff
IMSS and Redis pipelines ready to be tested with multiple processes
parent
72ba01be
master
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
python/hostfile
+3
-1
python/hostfile
python/imss_cli.py
+14
-1
python/imss_cli.py
python/metadata
+0
-0
python/metadata
python/redis_cli.py
+12
-3
python/redis_cli.py
with
29 additions
and
5 deletions
+29
-5
python/hostfile
+
3
-
1
View file @
48da29e6
tucan
compute-9-1
compute-9-2
compute-9-3
This diff is collapsed.
Click to expand it.
python/imss_cli.py
+
14
-
1
View file @
48da29e6
...
...
@@ -8,6 +8,7 @@ import numpy as np
from
mpi4py
import
MPI
from
skimage.color
import
rgb2gray
from
skimage
import
io
,
filters
from
skimage.util
import
img_as_ubyte
##############################################
############## MPI ENVIRONMENT ###############
...
...
@@ -75,6 +76,12 @@ datasetd = pyimss.create_dataset(dataset_uri, "LOCAL", num_pictures, 88, 1)
print
(
"FIRST PIC: "
+
str
(
first_picture
)
+
" LAST PIC: "
+
str
(
last_picture
)
+
" NUM PICS: "
+
str
(
num_pictures
))
if
rank
==
0
:
print
(
"STORE TIME,PROCESS TIME,TOTAL TIME"
)
store_pics
=
time
.
perf_counter
()
#Store the images in the IMSS.
for
pic_id
in
range
(
first_picture
,
last_picture
):
...
...
@@ -83,6 +90,8 @@ for pic_id in range(first_picture, last_picture):
covid_pic
=
pickle
.
dumps
(
covid_pic
)
pyimss
.
set_data
(
datasetd
,
pic_id
-
first_picture
,
covid_pic
);
process_pics
=
time
.
perf_counter
()
##############################################
################# PIPELINE ###################
...
...
@@ -97,11 +106,15 @@ for pic_id in range(first_picture, last_picture):
#Apply the former. SEGMENT.
image_thesholded
=
covid_pic_ret
>
threshold
#Save the files.
io
.
imsave
(
"COVID_TEST/covid_test_"
+
str
(
pic_id
)
+
".png"
,
image_thesholded
)
io
.
imsave
(
"COVID_TEST/covid_test_"
+
str
(
pic_id
)
+
".png"
,
img_as_ubyte
(
image_thesholded
)
)
##############################################
############# RELEASE RESOURCES ##############
end
=
time
.
perf_counter
()
print
(
str
(
process_pics
-
store_pics
)
+
","
+
str
(
end
-
process_pics
)
+
","
+
str
(
end
-
store_pics
))
#Release the used dataset.
pyimss
.
release_dataset
(
datasetd
);
#Close the connection and release the resources required to handle the IMSS.
...
...
This diff is collapsed.
Click to expand it.
python/metadata
+
0
-
0
View file @
48da29e6
No preview for this file type
This diff is collapsed.
Click to expand it.
python/redis_cli.py
+
12
-
3
View file @
48da29e6
...
...
@@ -36,7 +36,7 @@ t_init = time.clock()
##############################################
################ STORE IMAGES ################
total_pictures
=
361
6
total_pictures
=
361
7
#Discover the amount of pictures that this process shall deal with.
num_pictures
=
total_pictures
//
size
...
...
@@ -57,6 +57,12 @@ if first_picture == 0:
first_picture
=
1
if
rank
==
0
:
print
(
"STORE TIME,PROCESS TIME,TOTAL TIME"
)
store_pics
=
time
.
perf_counter
()
for
p_id
in
range
(
first_picture
,
last_picture
):
#Construct the picture path.
...
...
@@ -68,6 +74,8 @@ for p_id in range(first_picture, last_picture):
#Store the image in the Redis Cluster as bytes.
rc
.
set
(
p_id
,
pickle
.
dumps
(
clouds
))
process_pics
=
time
.
perf_counter
()
##############################################
############## RETRIEVE IMAGES ###############
...
...
@@ -88,5 +96,6 @@ for p_id in range(first_picture, last_picture):
#Save the files.
io
.
imsave
(
"COVID_TEST/covid_test_"
+
str
(
p_id
)
+
".png"
,
image_thesholded
)
t_end
=
time
.
clock
()
-
t_init
print
(
t_end
)
end
=
time
.
perf_counter
()
print
(
str
(
process_pics
-
store_pics
)
+
","
+
str
(
end
-
process_pics
)
+
","
+
str
(
end
-
store_pics
))
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets