예제 #1
0
def get(flag='target'):
    chpl_jemalloc = overrides.get('CHPL_JEMALLOC')
    chpl_host_jemalloc = overrides.get('CHPL_HOST_JEMALLOC')
    chpl_target_jemalloc = overrides.get('CHPL_TARGET_JEMALLOC')

    mem_val = chpl_mem.get(flag)
    platform_val = chpl_platform.get(flag)

    darwin = platform_val.startswith('darwin')
    cygwin = platform_val.startswith('cygwin')
    linux = not darwin and not cygwin

    if flag == 'target':
        if chpl_target_jemalloc:
            jemalloc_val = chpl_target_jemalloc
            if chpl_jemalloc:
                warning("CHPL_JEMALLOC and CHPL_TARGET_JEMALLOC are both set, "
                        "taking value from CHPL_TARGET_JEMALLOC")
        elif chpl_jemalloc:
            jemalloc_val = chpl_jemalloc
        elif mem_val == 'jemalloc':
            jemalloc_val = 'bundled'
        else:
            jemalloc_val = 'none'
    elif flag == 'host':
        if chpl_host_jemalloc:
            jemalloc_val = chpl_host_jemalloc
        elif linux and mem_val == 'jemalloc':
            jemalloc_val = 'bundled'
        elif darwin and mem_val == 'jemalloc':
            jemalloc_val = 'system'
        else:
            jemalloc_val = 'none'
    else:
        error("Invalid flag: '{0}'".format(flag), ValueError)

    if flag == 'host':
        if linux and mem_val == 'jemalloc' and jemalloc_val == 'system':
            error(
                "CHPL_HOST_JEMALLOC=system is not supported on Linux for host builds"
            )

        if darwin and mem_val == 'jemalloc' and jemalloc_val == 'bundled':
            error(
                "CHPL_HOST_JEMALLOC=bundled is not supported on Mac for host builds"
            )

    if mem_val == 'jemalloc' and jemalloc_val == 'none':
        error("CHPL_JEMALLOC must not be 'none' when CHPL_MEM is jemalloc")

    if mem_val != 'jemalloc' and jemalloc_val != 'none':
        error("CHPL_JEMALLOC must be 'none' when CHPL_MEM is not jemalloc")

    return jemalloc_val
예제 #2
0
def get():
    jemalloc_val = overrides.get('CHPL_JEMALLOC')
    mem_val = chpl_mem.get('target')
    if not jemalloc_val:
        if mem_val == 'jemalloc':
            jemalloc_val = 'jemalloc'
        else:
            jemalloc_val = 'none'

    if mem_val == 'jemalloc' and jemalloc_val == 'none':
        error("CHPL_JEMALLOC must not be 'none' when CHPL_MEM is jemalloc")

    if mem_val != 'jemalloc' and jemalloc_val != 'none':
        error("CHPL_JEMALLOC must not be none when CHPL_MEM is not jemalloc")

    return jemalloc_val
예제 #3
0
def get():
    jemalloc_val = overrides.get('CHPL_JEMALLOC')
    mem_val = chpl_mem.get('target')
    if not jemalloc_val:
        if mem_val == 'jemalloc':
            jemalloc_val = 'jemalloc'
        else:
            jemalloc_val = 'none'

    if mem_val == 'jemalloc' and jemalloc_val == 'none':
      error("CHPL_JEMALLOC must not be 'none' when CHPL_MEM is jemalloc")

    if mem_val != 'jemalloc' and jemalloc_val != 'none':
      error("CHPL_JEMALLOC must not be none when CHPL_MEM is not jemalloc")

    return jemalloc_val
예제 #4
0
def get():
    jemalloc_val = overrides.get('CHPL_JEMALLOC')
    mem_val = chpl_mem.get('target')
    if not jemalloc_val:
        if mem_val == 'jemalloc':
            jemalloc_val = 'bundled'
        else:
            jemalloc_val = 'none'

    if mem_val == 'jemalloc' and jemalloc_val == 'none':
        error("CHPL_JEMALLOC must not be 'none' when CHPL_MEM is jemalloc")

    if mem_val != 'jemalloc' and jemalloc_val != 'none':
        error("CHPL_JEMALLOC must be 'none' when CHPL_MEM is not jemalloc")

    if jemalloc_val == 'jemalloc':
        sys.stderr.write("Warning: CHPL_JEMALLOC=jemalloc is deprecated. "
                         "Use CHPL_JEMALLOC=bundled instead\n")
        jemalloc_val = 'bundled'

    return jemalloc_val
예제 #5
0
     values=['none', 'gasnet'],
     default=chpl_comm.get(),
     help_text='Chapel communication ({var_name}) value to build.',
 ),
 Dimension(
     'task',
     'CHPL_TASKS',
     values=['fifo', 'qthreads'],
     default=chpl_tasks.get(),
     help_text='Tasks ({var_name}) values to build.',
 ),
 Dimension(
     'mem',
     'CHPL_MEM',
     values=['cstdlib', 'jemalloc'],
     default=chpl_mem.get('target'),
     help_text='Memory allocator ({var_name}) values to build.',
 ),
 Dimension(
     'launcher',
     'CHPL_LAUNCHER',
     values=['none', 'pbs-aprun', 'aprun', 'slurm-srun'],
     default=chpl_launcher.get(),
     help_text='Launcher ({var_name}) to build.',
 ),
 Dimension(
     'gmp',
     'CHPL_GMP',
     values=['none', 'gmp', 'system'],
     default=chpl_gmp.get(),
     help_text='GMP ({var_name}) values to build.',
예제 #6
0
 Dimension(
     'comm', 'CHPL_COMM',
     values=['none', 'gasnet'],
     default=chpl_comm.get(),
     help_text='Chapel communcation ({var_name}) value to build.',
 ),
 Dimension(
     'task', 'CHPL_TASKS',
     values=['fifo', 'qthreads'],
     default=chpl_tasks.get(),
     help_text='Tasks ({var_name}) values to build.',
 ),
 Dimension(
     'mem', 'CHPL_MEM',
     values=['cstdlib', 'tcmalloc', 'jemalloc', 'dlmalloc'],
     default=chpl_mem.get('target'),
     help_text='Memory allocator ({var_name}) values to build.',
 ),
 Dimension(
     'launcher', 'CHPL_LAUNCHER',
     values=['none', 'pbs-aprun', 'aprun', 'slurm-srun'],
     default=chpl_launcher.get(),
     help_text='Launcher ({var_name}) to build.',
 ),
 Dimension(
     'gmp', 'CHPL_GMP',
     values=['none', 'gmp', 'system'],
     default=chpl_gmp.get(),
     help_text='GMP ({var_name}) values to build.',
 ),
 Dimension(
예제 #7
0
def get_uniq_cfg_path():
    def_uniq_cfg = third_party_utils.default_uniq_cfg_path()
    lm = chpl_locale_model.get();
    target_mem = chpl_mem.get('target')
    hwloc = chpl_hwloc.get()
    return '{0}-{1}-{2}-{3}'.format(def_uniq_cfg, lm, target_mem, hwloc)
예제 #8
0
def get_uniq_cfg_path():
    def_uniq_cfg = third_party_utils.default_uniq_cfg_path()
    lm = chpl_locale_model.get()
    target_mem = chpl_mem.get('target')
    hwloc = chpl_hwloc.get()
    return '{0}-{1}-{2}-{3}'.format(def_uniq_cfg, lm, target_mem, hwloc)