Commit 984a812c authored by Castillo's avatar Castillo

ram and cores params

parent d78c36b5
......@@ -10,6 +10,7 @@ from InterUnion import Utils
import simplejson as json
import os
import datetime
import pprint
def lineal_comparisons( years ):
D = {}
......@@ -112,8 +113,17 @@ class Period:
class Phylo:
def __init__(self , t=[] , minK=4 , minJ=0.0):
self.sc = SparkContext("local","simple app")
def __init__(self , t=[] , minK=4 , minJ=0.0 , memm="4g" , ncores="12" ):
SparkContext.setSystemProperty('spark.executor.memory', memm)
SparkContext.setSystemProperty('spark.driver.memory', memm)
# SparkContext.setSystemProperty('spark.executor.cores', 12)
# SparkContext.setSystemProperty('spark.driver.cores', 12)
self.sc = SparkContext("local["+ncores+"]","simple app")
print("")
print("")
pprint.pprint( self.sc._conf.getAll() )
print("")
print("")
self.utls = Utils()
self.years = list( range( t[0], t[1]+1 ) ) # combinations(self.years, 2)
self.pairs, self.pairsD = lineal_comparisons( self.years )
......
......@@ -31,6 +31,8 @@ class BabelForm(Form):
minsupp = DecimalField('Min. support', [validators.NumberRange(min=0.00, max=0.99)])
minfsetsize = IntegerField('Min. FI size', [validators.NumberRange(min=1, max=10)])
minjaccard = DecimalField('Min. Jaccard', [validators.NumberRange(min=0.00, max=0.99)])
ram = StringField('RAM', validators=[DataRequired()])
cores = StringField('#cores', validators=[DataRequired()])
# cooccs = IntegerField('Min. term voisinage', [validators.NumberRange(min=1, max=10)])
def flash_errors(form):
......@@ -57,7 +59,9 @@ def form_example():
sID = p_["instname"]
if sID not in I:
I[ sID ] = Phylo( t=[ p_["from_"] , p_["to_"] ] , minJ=p_["minjaccard"])
periods_ = [ p_["from_"] , p_["to_"] ]
minjaccard = p_["minjaccard"]
I[ sID ] = Phylo( t=periods_ , minJ=minjaccard , memm=p_["ram"] , ncores=p_["cores"])
# executes a fp-growth per year
I[ sID ].FPG_chain()
......
......@@ -12,6 +12,8 @@
{{ form.minsupp.label }} {{ form.minsupp(value="0.0001") }} <br>
{{ form.minfsetsize.label }} {{ form.minfsetsize(value="4") }} <br>
{{ form.minjaccard.label }} {{ form.minjaccard(value="0.2") }} <br>
{{ form.ram.label }} {{ form.ram(value="5g") }} <br>
{{ form.cores.label }} {{ form.cores(value="8") }} <br>
{{ form.csrf_token }}
</p>
<p>
......
Markdown is supported
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