Example #1
0
    def run(self, nodes, master, user, user_shell, volumes):
        log.info('Running SGE Plus')

        # update qconf complex list to make h_vmem and num_proc consumable
        log.info('Update complex configuration')
        master.ssh.put(opj(self.data_path, 'qconf_c'), '/tmp/qconf_c')
        execute(master, 'qconf -Mc /tmp/qconf_c')
        log.info('Update ms configuration')
        master.ssh.put(opj(self.data_path, 'msconf'), '/tmp/msconf')
        execute(master, 'qconf -Msconf /tmp/msconf')

        for node in nodes:
            self.on_add_node(node, nodes, master, user, user_shell, volumes)
Example #2
0
def update_complex_list(node, num_proc=None):
    """
    Sets a node's h_vmem and num_proc complex values

    :param node: The node to update
    """
    log.info('Updating complex values for {0}'.format(node))
    memtot = execute(node, 'free -g|grep Mem:|grep -oE "[0-9]+"|head -1')[0]

    num_proc = num_proc if num_proc else execute(node, 'nproc')[0]
    # scratch_mb= sp.check_output('df |grep scratch',shell=True).split()[3]
    scratch_mb = 0

    if node.is_master():
        num_proc = int(num_proc / 2)

    execute(node,
            "qconf -rattr exechost complex_values slots={num_proc},num_proc={num_proc},sce_mem={mem}g,sce_scratch={scratch_mb} {node}".format(
                mem=memtot, num_proc=num_proc, node=node.alias, scratch_mb=scratch_mb)
    )

    log.info('Done updating complex values')