def create_cud_from_task(task, placeholder_dict, prof=None):
    """
    Purpose: Create a Compute Unit description based on the defined Task.

    :arguments:
        :task: EnTK Task object
        :placeholder_dict: dictionary holding the values for placeholders

    :return: ComputeUnitDescription
    """

    try:

        logger.debug('Creating CU from Task %s' % (task.uid))

        if prof:
            prof.prof('cud from task - create', uid=task.uid)

        cud = rp.ComputeUnitDescription()
        cud.name = '%s,%s,%s,%s,%s,%s' % (task.uid, task.name,
                                          task.parent_stage['uid'], task.parent_stage['name'],
                                          task.parent_pipeline['uid'], task.parent_pipeline['name'])
        cud.pre_exec = task.pre_exec
        cud.executable = task.executable
        cud.arguments = resolve_arguments(task.arguments, placeholder_dict)
        cud.post_exec = task.post_exec
        if task.tag:
            if task.parent_pipeline['name']:
                cud.tag = resolve_tags( tag=task.tag,
                                        parent_pipeline_name=task.parent_pipeline['name'],
                                        placeholder_dict=placeholder_dict)

        cud.cpu_processes = task.cpu_reqs['processes']
        cud.cpu_threads = task.cpu_reqs['threads_per_process']
        cud.cpu_process_type = task.cpu_reqs['process_type']
        cud.cpu_thread_type = task.cpu_reqs['thread_type']
        cud.gpu_processes = task.gpu_reqs['processes']
        cud.gpu_threads = task.gpu_reqs['threads_per_process']
        cud.gpu_process_type = task.gpu_reqs['process_type']
        cud.gpu_thread_type = task.gpu_reqs['thread_type']
        if task.lfs_per_process:
            cud.lfs_per_process = task.lfs_per_process

        if task.stdout:
            cud.stdout = task.stdout
        if task.stderr:
            cud.stderr = task.stderr

        cud.input_staging = get_input_list_from_task(task, placeholder_dict)
        cud.output_staging = get_output_list_from_task(task, placeholder_dict)

        if prof:
            prof.prof('cud from task - done', uid=task.uid)

        logger.debug('CU %s created from Task %s' % (cud.name, task.uid))

        return cud

    except Exception, ex:
        logger.exception('CU creation failed, error: %s' % ex)
        raise
def create_cud_from_task ( task , placeholder_dict , prof = None ) : try : logger . debug ( 'Creating CU from Task %s' % ( task . uid ) ) if prof : prof . prof ( 'cud from task - create' , uid = task . uid ) cud = rp . ComputeUnitDescription ( ) cud . name = '%s,%s,%s,%s,%s,%s' % ( task . uid , task . name , task . parent_stage [ 'uid' ] , task . parent_stage [ 'name' ] , task . parent_pipeline [ 'uid' ] , task . parent_pipeline [ 'name' ] ) cud . pre_exec = task . pre_exec cud . executable = task . executable cud . arguments = resolve_arguments ( task . arguments , placeholder_dict ) cud . post_exec = task . post_exec if task . tag : if task . parent_pipeline [ 'name' ] : cud . tag = resolve_tags ( tag = task . tag , parent_pipeline_name = task . parent_pipeline [ 'name' ] , placeholder_dict = placeholder_dict ) cud . cpu_processes = task . cpu_reqs [ 'processes' ] cud . cpu_threads = task . cpu_reqs [ 'threads_per_process' ] cud . cpu_process_type = task . cpu_reqs [ 'process_type' ] cud . cpu_thread_type = task . cpu_reqs [ 'thread_type' ] cud . gpu_processes = task . gpu_reqs [ 'processes' ] cud . gpu_threads = task . gpu_reqs [ 'threads_per_process' ] cud . gpu_process_type = task . gpu_reqs [ 'process_type' ] cud . gpu_thread_type = task . gpu_reqs [ 'thread_type' ] if task . lfs_per_process : cud . lfs_per_process = task . lfs_per_process if task . stdout : cud . stdout = task . stdout if task . stderr : cud . stderr = task . stderr cud . input_staging = get_input_list_from_task ( task , placeholder_dict ) cud . output_staging = get_output_list_from_task ( task , placeholder_dict ) if prof : prof . prof ( 'cud from task - done' , uid = task . uid ) logger . debug ( 'CU %s created from Task %s' % ( cud . name , task . uid ) ) return cud except Exception , ex : logger . exception ( 'CU creation failed, error: %s' % ex ) raise
Purpose: Create a Compute Unit description based on the defined Task.

    :arguments:
        :task: EnTK Task object
        :placeholder_dict: dictionary holding the values for placeholders

    :return: ComputeUnitDescription