def get(flag='host'): if flag == 'host': mem_val = 'cstdlib' elif flag == 'target': mem_val = os.environ.get('CHPL_MEM') if not mem_val: comm_val = chpl_comm.get() #platform_val = chpl_platform.get('host') #arch_val = chpl_arch.get('target', get_lcd=True) #tcmallocCompat = ["gnu", "clang", "clang-included", "intel"] # true if tcmalloc is compatible with the target compiler #if (not (platform_val == 'cray-xc' and arch_val == 'knc') and # (not platform_val.startswith("cygwin")) and # any(sub in chpl_compiler.get('target') for sub in tcmallocCompat)): # return 'tcmalloc' if comm_val == 'gasnet': segment_val = chpl_comm_segment.get() if segment_val == 'fast' or segment_val == 'large': mem_val = 'dlmalloc' else: mem_val = 'cstdlib' elif comm_val == 'ugni': mem_val = 'tcmalloc' else: mem_val = 'cstdlib' else: raise ValueError("Invalid flag: '{0}'".format(flag)) return mem_val
def get_uniq_cfg_path(): base_uniq_cfg = third_party_utils.default_uniq_cfg_path() if chpl_comm_debug.get() == 'debug': base_uniq_cfg += '-debug' substrate = chpl_comm_substrate.get() segment = chpl_comm_segment.get() return base_uniq_cfg + '/substrate-' + substrate + '/seg-' + segment
def get(flag='host'): if flag == 'host': mem_val = 'default' elif flag == 'target': mem_val = os.environ.get('CHPL_MEM') if not mem_val: comm_val = chpl_comm.get() if comm_val == 'gasnet': segment_val = chpl_comm_segment.get() if segment_val == 'fast' or segment_val == 'large': mem_val = 'dlmalloc' else: mem_val = 'default' elif comm_val == 'ugni': mem_val = 'tcmalloc' else: mem_val = 'default' else: raise ValueError("Invalid flag: '{0}'".format(flag)) return mem_val