Commit ada5fc03 authored by Iker Martín Álvarez's avatar Iker Martín Álvarez
Browse files

CreateIterDataframe 3 changes. 1- Added column to indicate number of parents...

CreateIterDataframe 3 changes. 1- Added column to indicate number of parents if any an minor related tweaks. 2- Stages is now stored as a list to simplify analysis. 3- Asynch columns data now stores information of the group being created as a tuple. Malltimes bugfix for typo.
parent ca0d5abd
......@@ -36,6 +36,7 @@ class G_enum(Enum):
NC = 1
#Iteration specific
IS_DYNAMIC = 11
N_PARENTS = 17
#columnsG = ["Total_Resizes", "Total_Groups", "Total_Stages", "Granularity", "SDR", "ADR", "DR", "Redistribution_Method", \
# "Redistribution_Strategy", "Spawn_Method", "Spawn_Strategy", "Groups", "FactorS", "Dist", "Stage_Types", "Stage_Times", \
......@@ -47,7 +48,7 @@ class G_enum(Enum):
columnsL = ["NP", "NC", "Total_Stages", "Granularity", "SDR", "ADR", "DR", "Redistribution_Method", \
"Redistribution_Strategy", "Spawn_Method", "Spawn_Strategy", "Is_Dynamic", "FactorS", "Dist", "Stage_Types", "Stage_Times", \
"Stage_Bytes", "Asynch_Iters", "T_iter", "T_stages"] #20
"Stage_Bytes", "N_Parents", "Asynch_Iters", "T_iter", "T_stages"] #20
def copy_iteration(row, dataL_it, group, iteration, is_asynch):
......@@ -55,29 +56,37 @@ def copy_iteration(row, dataL_it, group, iteration, is_asynch):
G_enum.STAGE_TYPES.value, G_enum.STAGE_TIMES.value, G_enum.STAGE_BYTES.value]
basic_asynch = [G_enum.SDR.value, G_enum.ADR.value, G_enum.DR.value]
array_asynch_group = [G_enum.RED_METHOD.value, G_enum.RED_STRATEGY.value, \
G_enum.SPAWN_METHOD.value, G_enum.SPAWN_STRATEGY.value]
G_enum.SPAWN_METHOD.value, G_enum.SPAWN_STRATEGY.value, G_enum.DIST.value]
dataL_it[G_enum.FACTOR_S.value] = row[G_enum.FACTOR_S.value][group]
dataL_it[G_enum.NP.value] = row[G_enum.GROUPS.value][group]
dataL_it[G_enum.DIST.value] = [None, None]
dataL_it[G_enum.DIST.value][0] = row[G_enum.DIST.value][group]
dataL_it[G_enum.ASYNCH_ITERS.value-1] = is_asynch
dataL_it[G_enum.T_ITER.value-1] = row[G_enum.T_ITER.value][group][iteration]
dataL_it[G_enum.T_STAGES.value-1] = row[G_enum.T_STAGES.value][group][iteration]
dataL_it[G_enum.ASYNCH_ITERS.value] = is_asynch
dataL_it[G_enum.T_ITER.value] = row[G_enum.T_ITER.value][group][iteration]
dataL_it[G_enum.T_STAGES.value] = list(row[G_enum.T_STAGES.value][group][iteration])
dataL_it[G_enum.IS_DYNAMIC.value] = True if group > 0 else False
for index in basic_indexes:
dataL_it[index] = row[index]
for index in array_asynch_group:
dataL_it[index] = [None, -1]
dataL_it[index][0] = row[index][group]
dataL_it[G_enum.N_PARENTS.value] = -1
if group > 0:
dataL_it[G_enum.N_PARENTS.value] = row[G_enum.GROUPS.value][group-1]
if is_asynch:
dataL_it[G_enum.NC.value] = row[G_enum.GROUPS.value][group+1]
dataL_it[G_enum.DIST.value][1] = row[G_enum.DIST.value][group+1]
for index in basic_asynch:
dataL_it[index] = row[index]
for index in array_asynch_group:
dataL_it[index] = row[index][group+1]
dataL_it[index][1] = row[index][group+1]
for index in array_asynch_group: # Convert to tuple
dataL_it[index] = tuple(dataL_it[index])
#-----------------------------------------------
......
......@@ -106,7 +106,6 @@ create_resize_dataframe(dfG, dataM)
dfM = pd.DataFrame(dataM, columns=columnsM)
dfM.to_pickle(name + '.pkl')
dfM.to_excel(name + '.xlsx')
print(dfG)
print(dfM)
......@@ -173,7 +173,7 @@ def read_local_file(f, dataG, it, runs_in_file):
real_it = 0
group = 0
for line in f:
for line in f:
lineS = line.split()
if len(lineS) > 0:
......@@ -181,7 +181,7 @@ def read_local_file(f, dataG, it, runs_in_file):
offset += 1
real_it = it - (runs_in_file-offset)
group = int(lineS[1].split(":")[0])
if lineS[0] == "Async_Iters:":
elif lineS[0] == "Async_Iters:":
offset_line = 1
dataG[real_it][G_enum.ASYNCH_ITERS.value][group] = get_value(lineS, offset_line, False)
else:
......
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