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
f090b5c3
Commit
f090b5c3
authored
3 years ago
by
Mario Andres Serruya
Browse files
Options
Download
Email Patches
Plain Diff
Finally working
parent
27f6151c
master
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/hostfile
+3
-4
python/hostfile
python/imss_cli.py
+23
-8
python/imss_cli.py
python/pyimss.so
+0
-0
python/pyimss.so
with
26 additions
and
12 deletions
+26
-12
python/hostfile
+
3
-
4
View file @
f090b5c3
tucan
compute-9-1
compute-9-2
compute-9-3
compute-11-5
compute-11-8
compute-11-6
This diff is collapsed.
Click to expand it.
python/imss_cli.py
+
23
-
8
View file @
f090b5c3
import
os
import
sys
import
time
import
pyimss
import
pickle
...
...
@@ -15,11 +16,11 @@ from skimage.util import img_as_ubyte, img_as_float
############## MPI ENVIRONMENT ###############
#REQUIRED MPI VERSION: mpi/mpich3/3.2.1
#EXECUTION COMMAND: > metadata && mpi
run -np 1
-hostfile hosfile python3 imss_cli.py
#EXECUTION COMMAND: > metadata && mpi
exec -n X -
-hostfile hosfile python3
-m mpi4py /tmp/
imss_cli.py
X
comm
=
MPI
.
COMM_WORLD
rank
=
comm
.
Get_rank
()
size
=
comm
.
Get_size
()
rank
=
#FIXME
size
=
#FIXME
##############################################
############## HERCULES ENVMNT ###############
...
...
@@ -33,21 +34,22 @@ smallest_block = 88
metadata
=
"./metadata"
hostfile
=
"./hostfile"
localhost
=
"localhost"
imss_test
=
"imss://berries"
#Initialize storage environment.
pyimss
.
hercules_init
(
rank
,
4194304
,
5555
,
5569
,
2048
,
metadata
)
#Connect to the metadata server.
pyimss
.
stat_init
(
localhost
,
5569
,
rank
)
pyimss
.
stat_init
(
"compute-11-5"
,
5569
,
rank
)
#FIXME: the correct connection address shall be provided.
##############################################
############ IMSS INITIALIZATION #############
#Deploy or connect to the imss.
if
rank
==
0
:
#pyimss.init_imss(imss_test, hostfile, size, 5555, 4192256, 1, "")
pyimss
.
init_imss
(
imss_test
,
hostfile
,
size
,
5555
,
4192256
,
1
,
""
)
MPI
.
COMM_WORLD
.
Barrier
()
time
.
sleep
(
5
)
if
rank
!=
0
:
pyimss
.
open_imss
(
imss_test
)
...
...
@@ -78,11 +80,14 @@ dataset_uri = "imss://berries/" + str(rank)
#Create a dataset.
datasetd
=
pyimss
.
create_dataset
(
dataset_uri
,
"LOCAL"
,
num_pictures
,
1024
,
1
)
print
(
"FIRST PIC: "
+
str
(
first_picture
)
+
" LAST PIC: "
+
str
(
last_picture
)
+
" NUM PICS: "
+
str
(
num_pictures
))
print
(
"RANK "
+
str
(
rank
)
+
"
\t\t
FIRST PIC: "
+
str
(
first_picture
)
+
" LAST PIC: "
+
str
(
last_picture
)
+
" NUM PICS: "
+
str
(
num_pictures
))
sys
.
stdout
.
flush
()
if
rank
==
0
:
print
(
"STORE TIME,PROCESS TIME,TOTAL TIME"
)
print
(
"STORE TIME,PHASE_1,PHASE_2,PHASE_3,PROCESS TIME,TOTAL TIME"
)
sys
.
stdout
.
flush
()
store_pics
=
time
.
perf_counter
()
# TIME_1
...
...
@@ -110,6 +115,8 @@ for pic_id in range(first_picture, last_picture):
covid_pic_ret
=
pickle
.
dumps
(
covid_pic_ret
)
pyimss
.
set_data
(
datasetd
,
pic_id
-
first_picture
,
covid_pic_ret
);
phase_1
=
time
.
perf_counter
()
# TIME_3
for
pic_id
in
range
(
first_picture
,
last_picture
):
#Retrieve the image.
...
...
@@ -121,6 +128,8 @@ for pic_id in range(first_picture, last_picture):
covid_pic_ret
=
pickle
.
dumps
(
covid_pic_ret
)
pyimss
.
set_data
(
datasetd
,
pic_id
-
first_picture
,
covid_pic_ret
);
phase_2
=
time
.
perf_counter
()
# TIME_4
for
pic_id
in
range
(
first_picture
,
last_picture
):
#Retrieve the image.
...
...
@@ -140,7 +149,9 @@ for pic_id in range(first_picture, last_picture):
end
=
time
.
perf_counter
()
# TIME 3
print
(
str
(
process_pics
-
store_pics
)
+
","
+
str
(
end
-
process_pics
)
+
","
+
str
(
end
-
store_pics
))
print
(
str
(
process_pics
-
store_pics
)
+
","
+
str
(
phase_1
-
process_pics
)
+
","
+
str
(
phase_2
-
phase_1
)
+
","
+
str
(
end
-
phase_2
)
+
","
+
str
(
end
-
process_pics
)
+
","
+
str
(
end
-
store_pics
))
exit
()
#Release the used dataset.
pyimss
.
release_dataset
(
datasetd
);
...
...
@@ -149,3 +160,7 @@ pyimss.release_imss(imss_test, 2);
#Release storage and metadata resources.
pyimss
.
stat_release
();
pyimss
.
hercules_release
(
rank
);
time
.
sleep
(
30
)
MPI
.
Finalize
()
This diff is collapsed.
Click to expand it.
python/pyimss.so
+
0
-
0
View file @
f090b5c3
No preview for this file type
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