Commit f090b5c3 authored by Mario Andres Serruya's avatar Mario Andres Serruya
Browse files

Finally working

parent 27f6151c
Showing with 26 additions and 12 deletions
+26 -12
tucan
compute-9-1
compute-9-2
compute-9-3
compute-11-5
compute-11-8
compute-11-6
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 && mpirun -np 1 -hostfile hosfile python3 imss_cli.py
#EXECUTION COMMAND: > metadata && mpiexec -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\tFIRST 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()
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment