コード例 #1
0
def submit_ca():
    runfile = (
        "FILEPATH/"
        "analysis.py")
    ijs = incomplete_jobs()
    for loc in locs:
        any_submitted = False
        for a in ages:
            if "%s/%s_%s.h5" % (outdir, loc, a) in ijs:
                any_submitted = True
                sge.qsub(
                        runfile,
                        'anem_%s' % loc,
                        parameters=[loc, a, ndraws, max_iters, sex_id_list,
                                    year_id_list, consecutive_small_changes,
                                    small_change, scale_factor, data_dir,
                                    h5_dir, outdir],
                        conda_env='anemia_17_v5',
                        slots=7,
                        memory=14,
                        project='proj_anemia',
                        stdout="FILEPATH",
                        stderr="FILEPATH")
        if any_submitted:
            sleep(5)
コード例 #2
0
ファイル: submit_jobs.py プロジェクト: zhouxm4/ihme-modeling
def submit_upload_prep():
    runfile = (
        "{FILEPATH}/"
        "uploads/write_standard_files.py")
    for loc in locs:
        sge.qsub(
                runfile,
                'anem_wsf_%s' % loc,
                parameters=[loc],
                conda_env='anemia',
                project='proj_anemia',
                slots=2,
                memory=4)
コード例 #3
0
def launch_failed():
    with open("strCodeDir/miss_squeeze.csv") as f:
        relaunch = f.readlines()
    relaunch = [r.split(".")[0].split("_") for r in relaunch]
    for r in relaunch:
        runfile = "strCodeDir/squeeze_em_all.py"
        params = ['--location_id', r[0], '--year_id', r[1], '--sex_id', r[2]]
        sge.qsub(runfile,
                 'sqz_%s_%s_%s' % (r[0], r[1], r[2]),
                 parameters=params,
                 slots=30,
                 memory=60,
                 project='proj_como',
                 conda_env="isqueeze")
コード例 #4
0
def submit_upload_prep():
    runfile = (
        "FILEPATH/"
        "uploads/write_standard_files_uc.py")
    for loc in locs:
        sge.qsub(
                runfile,
                'anem_wsf_%s' % loc,
                parameters=[loc],
                conda_env='anemia_17_v5',
                project='proj_anemia',
                slots=4,
                memory=8,
                stdout="FILEPATH",
                stderr="FILEPATH")
コード例 #5
0
 def dependent_submit(location_id, hold_ids):
     node = lt.get_node_by_id(location_id)
     nodelvl = lt.get_nodelvl_by_id(location_id)
     num_children = len(node.children)
     if num_children == 0:
         return 0
     else:
         jids = []
         for y in range(1990, 2016, 5):
             job_name = "dm_%s_%s_%s_%s_%s" % (
                 mvid, location_id, sex[0], str(y)[2:], cv_iter)
             if location_id == 1:
                 num_slots = 20
             else:
                 num_slots = min(20, num_children * 2)
             if (location_id, sex, y, cv_iter) in rrs:
                 params = [mvid, location_id, sex, y, cv_iter]
                 jid = sge.qsub(runfile,
                                job_name,
                                project=project,
                                holds=hold_ids,
                                slots=num_slots,
                                memory=int(math.ceil(num_slots * 2.5)),
                                parameters=params,
                                conda_env='cascade_ode',
                                prepend_to_path=
                                '/ihme/code/central_comp/anaconda/bin',
                                stderr='%s/%s.error' %
                                (logdir, job_name))
                 jids.append(jid)
                 all_jids.append(jid)
         for c in node.children:
             dependent_submit(c.id, jids)
コード例 #6
0
ファイル: submit_jobs.py プロジェクト: zhouxm4/ihme-modeling
def submit_rf():
    runfile = (
        "/{FILEPATH}/"
        "uploads/nutrition_iron_exposure.py")
    ijs = rf_incomplete_jobs()
    for loc in locs:
        if "{FILEPATH}/exp_%s.csv" % loc in ijs:
            sge.qsub(
                    runfile,
                    'anem_rf_%s' % loc,
                    parameters=[loc],
                    conda_env='anemia',
                    project='proj_anemia',
                    jobtype='python',
                    slots=6,
                    memory=12,
                    stdout="{STD OUTPUT FILEPATH",
                    stderr="{STD ERROR FILEPATH}")
コード例 #7
0
def submit_cf():
    runfile = (
        "FILEPATH"
        "calculate_cf.py")
    for y in year_id_list:
        for s in sex_id_list:
            for a in ages:
                sge.qsub(
                    runfile,
                    'cf_%s_%s_%s' % (y, s, a),
                    parameters=[y, s, a],
                    conda_env='anemia_17_v5',
                    project='proj_anemia',
                    jobtype='python',
                    slots=1,
                    memory=2,
                    stdout="FILEPATH",
                    stderr="FILEPATH")
コード例 #8
0
def launch_squeeze(autism_value=0.29, idiopathic=95.0, autism_resid=0.05):
    locations = dbtrees.loctree(None, 35)

    runfile = "strCodeDir/squeeze_em_all.py"
    for location_id in [l.id for l in locations.leaves()]:
        for year_id in [1990, 1995, 2000, 2005, 2010, 2015]:
            for sex_id in [1, 2]:
                params = [
                    '--location_id', location_id, '--year_id', year_id,
                    '--sex_id', sex_id
                ]
                sge.qsub(runfile,
                         'sqz_%s_%s_%s' % (location_id, year_id, sex_id),
                         parameters=params,
                         slots=30,
                         memory=60,
                         project='proj_como',
                         conda_env="isqueeze")
コード例 #9
0
ファイル: submit_jobs.py プロジェクト: zhouxm4/ihme-modeling
def submit_uncertainty():
    runfile = (
        "{FILEPATH}/"
        "add_uncertainty.py")
    meids = pd.read_excel("/{FILEPATH}/priors/in_out_meid_map.xlsx", "out_meids")
    meids = meids.filter(like='modelable_entity').values.flatten()
    for meid in meids:
        sge.qsub(
            runfile,
            'anem_un_%s' % meid,
            parameters = [meid, ndraws],
            conda_env='anemia',
            project='proj_anemia',
            jobtype='python',
            slots=40,
            memory=25,
            stdout="{STD OUTPUT FILEPATH}",
            stderr="{STD ERROR FILEPATH}")
コード例 #10
0
ファイル: submit_jobs.py プロジェクト: zhouxm4/ihme-modeling
def submit_save_results():
    runfile = (
        "/{FILEPATH}/"
        "save_custom.py")


    meids = pd.read_excel("/{FILEPATH}/priors/in_out_meid_map.xlsx", "out_meids")
    meids = meids.filter(like='modelable_entity').values.flatten()
    for meid in meids:

        sge.qsub(
                runfile,
                'anem_sr_%s' % meid,
                parameters=[meid],
                conda_env='anemia',
                project='proj_anemia',
                jobtype='python',
                slots=30,
                memory=20,
                stdout="{STD OUTPUT FILEPATH}",
                stderr="{STD ERROR FILEPATH}")
コード例 #11
0
ファイル: run_all.py プロジェクト: zhouxm4/ihme-modeling
def submit_global(mvid, project):
    """ Submit the global dismod_ode job """
    dirs = get_directories(mvid)
    logdir = dirs['logdir']
    gfile = "%s/run_global.py" % settings.this_path
    jobname = 'dm_%s_boot' % mvid
    jid = sge.qsub(gfile,
                   jobname,
                   project=project,
                   slots=15,
                   memory=30,
                   parameters=[mvid],
                   conda_env='cascade_ode',
                   prepend_to_path='strDir',
                   stderr='%s/%s.error' % (logdir, jobname))
    return jid
コード例 #12
0
 def submit_jobtree(self, cv_iter):
     """Submits a jobtree, which manages a given full/cross-validation
     run from global on down through the cascade"""
     jobname = 'dm_{}_G{}'.format(self.mvid, cv_iter)
     jid = sge.qsub(gfile,
                    jobname,
                    project=self.project,
                    slots=20,
                    memory=40,
                    parameters=[
                        self.mvid, '--submit_stage', 'jt', '--cv_iter',
                        cv_iter
                    ],
                    conda_env='cascade_ode',
                    prepend_to_path='strDir',
                    stderr='{}/{}.error'.format(self.logdir, jobname))
     return jid
コード例 #13
0
 def resubmit_self_check(self, hold_jids):
     """Submits a job that checks that all child location-year-sex groups
     have run succesfully. If any have failed, it resubmits the below-global
     levels of the cascade (i.e. the submit_cascade function)"""
     jobname = 'dm_{}_G{}'.format(self.mvid, self.cv_iter_id)
     jid = sge.qsub(gfile,
                    jobname,
                    project=self.project,
                    slots=20,
                    memory=40,
                    holds=hold_jids,
                    parameters=[
                        self.mvid, '--submit_stage', 'jt', '--cv_iter',
                        self.cv_iter_id
                    ],
                    conda_env='cascade_ode',
                    prepend_to_path='strDir',
                    stderr='{}/{}.error'.format(self.logdir, jobname))
     return jid
コード例 #14
0
 def dependent_submit(location_id, hold_ids):
     node = loctree.get_node_by_id(location_id)
     num_children = len(node.children)
     if num_children == 0:
         return 0
     else:
         if (location_id, sex, y) in run_set:
             job_name = "casc_%s_%s_%s" % (location_id,
                                           sex[0],
                                           str(y)[2:])
             num_slots = min(8, num_children)
             jid = sge.qsub(
                 runfile,
                 job_name,
                 holds=hold_ids,
                 slots=num_slots,
                 memory=num_slots*2,
                 parameters=[mvid, location_id, sex, y])
             jid = [jid]
         else:
             jid = []
         for c in node.children:
             dependent_submit(c.id, jid)
コード例 #15
0
 def submit_varnish(self, hold_jids):
     """Submits a job that 'varnishes' this run, meaning it:
         1. Uploads fits
         2. Uploads adjusted data
         3. Computes fit statistics
         4. Uploads fit statistics
         5. Attempts to generate diagnostic plots
         5. Computes finals
         6. Uploads finals
         7. Updates the status of the model to finished
     """
     varn_jobname = 'dm_%s_varnish' % (self.mvid)
     varn_jid = sge.qsub(finfile,
                         varn_jobname,
                         project=self.project,
                         slots=20,
                         memory=40,
                         parameters=[self.mvid],
                         holds=hold_jids,
                         conda_env='cascade_ode',
                         prepend_to_path='strDir',
                         stderr='%s/%s.error' % (self.logdir, varn_jobname))
     return varn_jid
コード例 #16
0
 def dependent_submit(location_id, hold_ids):
     node = self.cascade.loctree.get_node_by_id(location_id)
     num_children = len(node.children)
     if num_children == 0:
         return 0
     else:
         jids = []
         for y in [1990, 1995, 2000, 2005, 2010, 2016]:
             job_name = "dm_%s_%s_%s_%s_%s" % (
                 self.mvid, location_id, sex[0], str(y)[2:],
                 self.cv_iter_id)
             if location_id == 1:
                 num_slots = 20
             else:
                 num_slots = min(20, num_children * 2)
             path_to_conda_bin = ('strDir')
             if ((location_id, sex, y, self.cv_iter_id)
                     in incomplete_jobs):
                 params = [
                     self.mvid, location_id, sex, y, self.cv_iter_id
                 ]
                 jid = sge.qsub(
                     cfile,
                     job_name,
                     project=self.project,
                     holds=hold_ids,
                     slots=num_slots,
                     memory=int(math.ceil(num_slots * 2.5)),
                     parameters=params,
                     conda_env='cascade_ode',
                     prepend_to_path=path_to_conda_bin,
                     stderr='%s/%s.error' % (self.logdir, job_name))
                 jids.append(jid)
                 all_jids.append(jid)
         for c in node.children:
             dependent_submit(c.id, jids)
コード例 #17
0
ファイル: save.py プロジェクト: zhusui/ihme-modeling
from jobmon import sge
from glob import glob
import os

dirs = glob("strOutDir/*")
runfile = "save_custom_results"
for d in dirs:
    meid = os.path.basename(d)
    sge.qsub(runfile,
             "ss_save_%s" % meid,
             parameters=[
                 meid, "super-squeeze result", d, '--env', 'prod',
                 '--file_pattern', '{location_id}_{year_id}_{sex_id}.h5',
                 '--h5_tablename', 'draws', '--best'
             ],
             jobtype=None,
             conda_env="como",
             slots=20,
             memory=40,
             project='proj_como')
コード例 #18
0
from hierarchies import dbtrees
from jobmon import sge
import sys

cvid = sys.argv[1]
lt = dbtrees.loctree(None, 35)
runfile = 'smaller_bins.py'
for l in lt.leaves():
    sge.qsub(runfile,
             'sb_%s' % l,
             parameters=[cvid, l],
             jobtype='python',
             project='proj_como',
             conda_env='como')
コード例 #19
0
        cv_run = mvm.cross_validate_id.values[0]
        meid = mvm.modelable_entity_id.values[0]
        if meid in [9422, 7695, 1175]:
            project = "proj_tb"
        else:
            project = "proj_dismod"
        if cv_run == 1:
            cv_iters = range(11)
            jids = []
            for i in cv_iters:
                jobname = 'dm_%s_diag%s' % (mvid, i),
                jid = sge.qsub(
                    thisfile,
                    jobname,
                    project=project,
                    slots=15,
                    memory=30,
                    parameters=[mvid, 0, i],
                    conda_env='cascade_ode',
                    prepend_to_path='/ihme/code/central_comp/anaconda/bin',
                    stderr='%s/%s.error' % (logdir, jobname))
                jids.append(jid)

            # Submit finishing job
            varn_jobname = 'dm_%s_varnish' % (mvid)
            varn_jid = sge.qsub(
                finfile,
                varn_jobname,
                project=project,
                holds=jids,
                slots=15,
                memory=30,