Changeset: 78746884c56f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78746884c56f Modified Files: monetdb5/extras/dvf/dvf.c monetdb5/extras/dvf/opt_dvf.c Branch: DVframework Log Message:
defend the dynamic part of the plan against the dataflow. diffs (112 lines): diff --git a/monetdb5/extras/dvf/dvf.c b/monetdb5/extras/dvf/dvf.c --- a/monetdb5/extras/dvf/dvf.c +++ b/monetdb5/extras/dvf/dvf.c @@ -48,6 +48,7 @@ int get_column_num(str schema_name, str str plan_modifier(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) { str data_table_identifier = "data"; + str barrier_to_defend_against_dataflow_identifier = "dataflow_defender"; str mountRef = putName("mount", 5); str miniseedRef = putName("miniseed", 8); str dvfRef = putName("dvf", 3); @@ -57,6 +58,7 @@ str plan_modifier(Client cntxt, MalBlkPt int i, j, k, limit, slimit, actions = 0; int num_fl = 0, num_fi = 0; int* file_ids = NULL; + int var_bar = -1; BUN b1 = 0, b2 = 0, b3 = 0, b4 = 0; /* Declarations for copying of vars into stack and making a recursive runMALsequence call */ @@ -172,6 +174,18 @@ str plan_modifier(Client cntxt, MalBlkPt startpc = i; pushInstruction(mb, copyInstruction(old[i])); } + else if(p->barrier == BARRIERsymbol && + getVarConstant(mb, getArg(p, 1)).val.sval != NULL && + strcmp(getVarConstant(mb, getArg(p, 1)).val.sval, barrier_to_defend_against_dataflow_identifier) == 0) + { + var_bar = getArg(p, 0); + continue; + } + else if(p->barrier == EXITsymbol && + getArg(p, 0) == var_bar) + { + continue; + } /* check for * v7 := sql.bind(..., schema_name, data_table_name, ..., ...); */ diff --git a/monetdb5/extras/dvf/opt_dvf.c b/monetdb5/extras/dvf/opt_dvf.c --- a/monetdb5/extras/dvf/opt_dvf.c +++ b/monetdb5/extras/dvf/opt_dvf.c @@ -111,6 +111,7 @@ OPTdvfImplementation(Client cntxt, MalBl str dvfRef = putName("dvf", 3); str planmodifierRef = putName("plan_modifier", 13); str fetchfileidsandlocationsRef = putName("fetch_file_ids_and_locations", 28); + str barrier_to_defend_against_dataflow_identifier = "dataflow_defender"; str fetchRef = putName("fetch", 5); @@ -122,7 +123,7 @@ OPTdvfImplementation(Client cntxt, MalBl // - InstrPtr *old = NULL, q = NULL, r = NULL, t = NULL, b = NULL, m = NULL, e = NULL, f = NULL, ffiali = NULL, *ps_iter = NULL; + InstrPtr *old = NULL, q = NULL, r = NULL, t = NULL, b = NULL, bar = NULL, m = NULL, e = NULL, f = NULL, ffiali = NULL, *ps_iter = NULL; int i, limit, which_column, actions = 0; int last_bind_return_var_id = -1; int last_data_tid_return_var_id = -1; @@ -132,6 +133,7 @@ OPTdvfImplementation(Client cntxt, MalBl int last_subdelta_return_var_id = -1; int var_sql_mvc; + int barrier_to_defend_against_dataflow = 0; stk = stk; //to escape 'unused' parameter error. pci = pci; //to escape 'unused' parameter error. @@ -453,7 +455,16 @@ OPTdvfImplementation(Client cntxt, MalBl else q = pushInt(mb, q, 1); + /* create barrier instruction */ + bar = newInstruction(mb, ASSIGNsymbol); + bar->barrier = BARRIERsymbol; + bar = pushReturn(mb, bar, newTmpVariable(mb, TYPE_any)); + bar = pushStr(mb, bar, barrier_to_defend_against_dataflow_identifier); + + /* insert the new instructions in pc i2+1 */ + insertInstruction(mb, bar, i2+1); + barrier_to_defend_against_dataflow = 1; insertInstruction(mb, q, i2+1); insertInstruction(mb, ffiali, i2+1); @@ -462,7 +473,7 @@ OPTdvfImplementation(Client cntxt, MalBl // insertInstruction(mb, s, i2+1); insertInstruction(mb, r, i2+1); - actions += 4; + actions += 5; state = 3; } @@ -683,6 +694,19 @@ OPTdvfImplementation(Client cntxt, MalBl actions += 3; } + /* put the exit instruction of the dataflow defender barrier */ + else if(p->token == ENDsymbol && barrier_to_defend_against_dataflow) + { + /* create exit instruction */ + e = newInstruction(mb, ASSIGNsymbol); + e->barrier = EXITsymbol; + e = pushReturn(mb, e, getArg(bar, 0)); /* o */ + insertInstruction(mb, e, i); + i++; + barrier_to_defend_against_dataflow = 0; + } + + } return actions; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list