diff --git a/.gitignore b/.gitignore index 944a82c91f..973f0327df 100644 --- a/.gitignore +++ b/.gitignore @@ -216,6 +216,7 @@ ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-sizeof.f90 ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-sizeof.h +ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h ompi/mpi/fortran/use-mpi-tkr/fortran_kinds.sh ompi/mpi/fortran/use-mpi-tkr/fortran_sizes.h diff --git a/ompi/mca/rte/pmix/rte_pmix.h b/ompi/mca/rte/pmix/rte_pmix.h index c7d125ac4c..57d2458a10 100644 --- a/ompi/mca/rte/pmix/rte_pmix.h +++ b/ompi/mca/rte/pmix/rte_pmix.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2012-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -49,10 +49,9 @@ typedef uint32_t ompi_vpid_t; /* some local storage */ OMPI_DECLSPEC extern opal_process_name_t pmix_name_wildcard; -OMPI_DECLSPEC extern opal_process_name_t pmix_proc_my_name; OMPI_DECLSPEC extern hwloc_cpuset_t ompi_proc_applied_binding; -#define OMPI_PROC_MY_NAME (&pmix_proc_my_name) +#define OMPI_PROC_MY_NAME (&pmix_process_info.my_name) #define OMPI_NAME_WILDCARD (&pmix_name_wildcard) typedef uint8_t ompi_rte_cmp_bitmask_t; @@ -62,7 +61,9 @@ typedef uint8_t ompi_rte_cmp_bitmask_t; #define OMPI_RTE_CMP_ALL 0x04 #define OMPI_RTE_CMP_WILD 0x10 -#define OMPI_NAME_PRINT(a) OPAL_NAME_PRINT((*(a))) +OMPI_DECLSPEC char* ompi_pmix_print_name(const ompi_process_name_t *name); + +#define OMPI_NAME_PRINT(a) ompi_pmix_print_name(a) OMPI_DECLSPEC int ompi_rte_compare_name_fields(ompi_rte_cmp_bitmask_t mask, const opal_process_name_t* name1, const opal_process_name_t* name2); @@ -71,11 +72,17 @@ OMPI_DECLSPEC int ompi_rte_convert_string_to_process_name(opal_process_name_t *n OMPI_DECLSPEC int ompi_rte_convert_process_name_to_string(char** name_string, const opal_process_name_t *name); -#define OMPI_LOCAL_JOBID(jobid) jobid -#define OMPI_JOB_FAMILY(jobid) 0 -/* do a little with the "family" param to avoid compiler warnings */ -#define OMPI_CONSTRUCT_JOBID(family,local) \ - ((family & 0x0000) | local) +#define OMPI_LOCAL_JOBID(n) \ + ( (n) & 0x0000ffff) +#define OMPI_JOB_FAMILY(n) \ + (((n) >> 16) & 0x0000ffff) +#define OMPI_CONSTRUCT_LOCAL_JOBID(local, job) \ + ( ((local) & 0xffff0000) | ((job) & 0x0000ffff) ) +#define OMPI_CONSTRUCT_JOB_FAMILY(n) \ + ( ((n) << 16) & 0xffff0000) + +#define OMPI_CONSTRUCT_JOBID(family, local) \ + OMPI_CONSTRUCT_LOCAL_JOBID(OMPI_CONSTRUCT_JOB_FAMILY(family), local) /* This is the DSS tag to serialize a proc name */ #define OMPI_NAME OPAL_NAME diff --git a/ompi/mca/rte/pmix/rte_pmix_module.c b/ompi/mca/rte/pmix/rte_pmix_module.c index 4b264f8ff0..a8b0601142 100644 --- a/ompi/mca/rte/pmix/rte_pmix_module.c +++ b/ompi/mca/rte/pmix/rte_pmix_module.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2012-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2012-2014 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. @@ -34,11 +34,13 @@ #include "opal/util/opal_getcwd.h" #include "opal/util/os_path.h" #include "opal/util/os_dirpath.h" +#include "opal/util/printf.h" #include "opal/util/proc.h" #include "opal/util/show_help.h" #include "opal/mca/hwloc/base/base.h" #include "opal/mca/pmix/base/base.h" #include "opal/threads/threads.h" +#include "opal/threads/tsd.h" #include "opal/class/opal_list.h" #include "opal/dss/dss.h" @@ -57,7 +59,6 @@ extern ompi_rte_component_t mca_rte_pmix_component; /* storage to support OMPI */ opal_process_name_t pmix_name_wildcard = {UINT32_MAX-1, UINT32_MAX-1}; opal_process_name_t pmix_name_invalid = {UINT32_MAX, UINT32_MAX}; -opal_process_name_t pmix_proc_my_name = {0, 0}; hwloc_cpuset_t ompi_proc_applied_binding = NULL; pmix_process_info_t pmix_process_info = {0}; bool pmix_proc_is_bound = false; @@ -69,11 +70,175 @@ static bool added_app_ctx = false; static char* pre_condition_transports_print(uint64_t *unique_key); static int _setup_job_session_dir(char **sdir); -#define ORTE_SCHEMA_DELIMITER_CHAR '.' -#define ORTE_SCHEMA_WILDCARD_CHAR '*' -#define ORTE_SCHEMA_WILDCARD_STRING "*" -#define ORTE_SCHEMA_INVALID_CHAR '$' -#define ORTE_SCHEMA_INVALID_STRING "$" +#define OPAL_SCHEMA_DELIMITER_CHAR '.' +#define OPAL_SCHEMA_WILDCARD_CHAR '*' +#define OPAL_SCHEMA_WILDCARD_STRING "*" +#define OPAL_SCHEMA_INVALID_CHAR '$' +#define OPAL_SCHEMA_INVALID_STRING "$" + +#define OPAL_PRINT_NAME_ARGS_MAX_SIZE 50 +#define OPAL_PRINT_NAME_ARG_NUM_BUFS 16 + +static bool fns_init=false; +static opal_tsd_key_t print_args_tsd_key; +static char* opal_print_args_null = "NULL"; +typedef struct { + char *buffers[OPAL_PRINT_NAME_ARG_NUM_BUFS]; + int cntr; +} opal_print_args_buffers_t; + +static void +buffer_cleanup(void *value) +{ + int i; + opal_print_args_buffers_t *ptr; + + if (NULL != value) { + ptr = (opal_print_args_buffers_t*)value; + for (i=0; i < OPAL_PRINT_NAME_ARG_NUM_BUFS; i++) { + free(ptr->buffers[i]); + } + free (ptr); + } +} + +static opal_print_args_buffers_t* +get_print_name_buffer(void) +{ + opal_print_args_buffers_t *ptr; + int ret, i; + + if (!fns_init) { + /* setup the print_args function */ + if (OPAL_SUCCESS != (ret = opal_tsd_key_create(&print_args_tsd_key, buffer_cleanup))) { + OPAL_ERROR_LOG(ret); + return NULL; + } + fns_init = true; + } + + ret = opal_tsd_getspecific(print_args_tsd_key, (void**)&ptr); + if (OPAL_SUCCESS != ret) return NULL; + + if (NULL == ptr) { + ptr = (opal_print_args_buffers_t*)malloc(sizeof(opal_print_args_buffers_t)); + for (i=0; i < OPAL_PRINT_NAME_ARG_NUM_BUFS; i++) { + ptr->buffers[i] = (char *) malloc((OPAL_PRINT_NAME_ARGS_MAX_SIZE+1) * sizeof(char)); + } + ptr->cntr = 0; + ret = opal_tsd_setspecific(print_args_tsd_key, (void*)ptr); + } + + return (opal_print_args_buffers_t*) ptr; +} + +static char* ompi_pmix_print_jobids(const opal_jobid_t job) +{ + opal_print_args_buffers_t *ptr; + unsigned long tmp1, tmp2; + + ptr = get_print_name_buffer(); + + if (NULL == ptr) { + OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); + return opal_print_args_null; + } + + /* cycle around the ring */ + if (OPAL_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) { + ptr->cntr = 0; + } + + if (OPAL_JOBID_INVALID == job) { + snprintf(ptr->buffers[ptr->cntr++], OPAL_PRINT_NAME_ARGS_MAX_SIZE, "[INVALID]"); + } else if (OPAL_JOBID_WILDCARD == job) { + snprintf(ptr->buffers[ptr->cntr++], OPAL_PRINT_NAME_ARGS_MAX_SIZE, "[WILDCARD]"); + } else { + tmp1 = OMPI_JOB_FAMILY((unsigned long)job); + tmp2 = OMPI_LOCAL_JOBID((unsigned long)job); + snprintf(ptr->buffers[ptr->cntr++], + OPAL_PRINT_NAME_ARGS_MAX_SIZE, + "[%lu,%lu]", tmp1, tmp2); + } + return ptr->buffers[ptr->cntr-1]; +} + +static char* ompi_pmix_print_vpids(const opal_vpid_t vpid) +{ + opal_print_args_buffers_t *ptr; + + ptr = get_print_name_buffer(); + + if (NULL == ptr) { + OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); + return opal_print_args_null; + } + + /* cycle around the ring */ + if (OPAL_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) { + ptr->cntr = 0; + } + + if (OPAL_VPID_INVALID == vpid) { + snprintf(ptr->buffers[ptr->cntr++], OPAL_PRINT_NAME_ARGS_MAX_SIZE, "INVALID"); + } else if (OPAL_VPID_WILDCARD == vpid) { + snprintf(ptr->buffers[ptr->cntr++], OPAL_PRINT_NAME_ARGS_MAX_SIZE, "WILDCARD"); + } else { + snprintf(ptr->buffers[ptr->cntr++], + OPAL_PRINT_NAME_ARGS_MAX_SIZE, + "%ld", (long)vpid); + } + return ptr->buffers[ptr->cntr-1]; +} + +char* ompi_pmix_print_name(const ompi_process_name_t *name) +{ + opal_print_args_buffers_t *ptr; + char *job, *vpid; + + /* protect against NULL names */ + if (NULL == name) { + /* get the next buffer */ + ptr = get_print_name_buffer(); + if (NULL == ptr) { + OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); + return opal_print_args_null; + } + /* cycle around the ring */ + if (OPAL_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) { + ptr->cntr = 0; + } + snprintf(ptr->buffers[ptr->cntr++], OPAL_PRINT_NAME_ARGS_MAX_SIZE, "[NO-NAME]"); + return ptr->buffers[ptr->cntr-1]; + } + + /* get the jobid, vpid strings first - this will protect us from + * stepping on each other's buffer. This also guarantees + * that the print_args function has been initialized, so + * we don't need to duplicate that here + */ + job = ompi_pmix_print_jobids(name->jobid); + vpid = ompi_pmix_print_vpids(name->vpid); + + /* get the next buffer */ + ptr = get_print_name_buffer(); + + if (NULL == ptr) { + OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); + return opal_print_args_null; + } + + /* cycle around the ring */ + if (OPAL_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) { + ptr->cntr = 0; + } + + snprintf(ptr->buffers[ptr->cntr++], + OPAL_PRINT_NAME_ARGS_MAX_SIZE, + "[%s,%s]", job, vpid); + + return ptr->buffers[ptr->cntr-1]; +} int ompi_rte_compare_name_fields(ompi_rte_cmp_bitmask_t fields, const opal_process_name_t* name1, @@ -154,7 +319,7 @@ int ompi_rte_convert_string_to_process_name(opal_process_name_t *name, } temp = strdup(name_string); /** copy input string as the strtok process is destructive */ - token = strchr(temp, ORTE_SCHEMA_DELIMITER_CHAR); /** get first field -> jobid */ + token = strchr(temp, OPAL_SCHEMA_DELIMITER_CHAR); /** get first field -> jobid */ /* check for error */ if (NULL == token) { @@ -168,9 +333,9 @@ int ompi_rte_convert_string_to_process_name(opal_process_name_t *name, /* check for WILDCARD character - assign * value accordingly, if found */ - if (0 == strcmp(temp, ORTE_SCHEMA_WILDCARD_STRING)) { + if (0 == strcmp(temp, OPAL_SCHEMA_WILDCARD_STRING)) { job = pmix_name_wildcard.jobid; - } else if (0 == strcmp(temp, ORTE_SCHEMA_INVALID_STRING)) { + } else if (0 == strcmp(temp, OPAL_SCHEMA_INVALID_STRING)) { job = pmix_name_invalid.jobid; } else { job = strtoul(temp, NULL, 10); @@ -179,9 +344,9 @@ int ompi_rte_convert_string_to_process_name(opal_process_name_t *name, /* check for WILDCARD character - assign * value accordingly, if found */ - if (0 == strcmp(token, ORTE_SCHEMA_WILDCARD_STRING)) { + if (0 == strcmp(token, OPAL_SCHEMA_WILDCARD_STRING)) { vpid = pmix_name_wildcard.vpid; - } else if (0 == strcmp(token, ORTE_SCHEMA_INVALID_STRING)) { + } else if (0 == strcmp(token, OPAL_SCHEMA_INVALID_STRING)) { vpid = pmix_name_invalid.vpid; } else { vpid = strtoul(token, NULL, 10); @@ -210,19 +375,19 @@ int ompi_rte_convert_process_name_to_string(char** name_string, * it is passed back to us later */ if (pmix_name_wildcard.jobid == name->jobid) { - asprintf(&tmp, "%s", ORTE_SCHEMA_WILDCARD_STRING); + asprintf(&tmp, "%s", OPAL_SCHEMA_WILDCARD_STRING); } else if (pmix_name_invalid.jobid == name->jobid) { - asprintf(&tmp, "%s", ORTE_SCHEMA_INVALID_STRING); + asprintf(&tmp, "%s", OPAL_SCHEMA_INVALID_STRING); } else { asprintf(&tmp, "%lu", (unsigned long)name->jobid); } if (pmix_name_wildcard.vpid == name->vpid) { - asprintf(&tmp2, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, ORTE_SCHEMA_WILDCARD_STRING); + asprintf(&tmp2, "%s%c%s", tmp, OPAL_SCHEMA_DELIMITER_CHAR, OPAL_SCHEMA_WILDCARD_STRING); } else if (pmix_name_invalid.vpid == name->vpid) { - asprintf(&tmp2, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, ORTE_SCHEMA_INVALID_STRING); + asprintf(&tmp2, "%s%c%s", tmp, OPAL_SCHEMA_DELIMITER_CHAR, OPAL_SCHEMA_INVALID_STRING); } else { - asprintf(&tmp2, "%s%c%lu", tmp, ORTE_SCHEMA_DELIMITER_CHAR, (unsigned long)name->vpid); + asprintf(&tmp2, "%s%c%lu", tmp, OPAL_SCHEMA_DELIMITER_CHAR, (unsigned long)name->vpid); } asprintf(name_string, "%s", tmp2); @@ -233,12 +398,103 @@ int ompi_rte_convert_process_name_to_string(char** name_string, return OPAL_SUCCESS; } +static int ompi_pmix_convert_string_to_jobid(opal_jobid_t *jobid, const char* jobidstring) +{ + if (NULL == jobidstring) { /* got an error */ + OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM); + *jobid = OPAL_JOBID_INVALID; + return OPAL_ERR_BAD_PARAM; + } + + /** check for wildcard character - handle appropriately */ + if (0 == strcmp(OPAL_SCHEMA_WILDCARD_STRING, jobidstring)) { + *jobid = OPAL_JOBID_WILDCARD; + return OPAL_SUCCESS; + } + + /* check for invalid value */ + if (0 == strcmp(OPAL_SCHEMA_INVALID_STRING, jobidstring)) { + *jobid = OPAL_JOBID_INVALID; + return OPAL_SUCCESS; + } + + *jobid = strtoul(jobidstring, NULL, 10); + + return OPAL_SUCCESS; +} + +static int ompi_pmix_snprintf_jobid(char *jobid_string, size_t size, const opal_jobid_t jobid) +{ + int rc; + + /* check for wildcard value - handle appropriately */ + if (OPAL_JOBID_WILDCARD == jobid) { + (void)strncpy(jobid_string, OPAL_SCHEMA_WILDCARD_STRING, size); + } else { + rc = snprintf(jobid_string, size, "%ld", (long) jobid); + if (0 > rc) { + return OPAL_ERROR; + } + } + + return OPAL_SUCCESS; +} + + +/** + * Static functions used to configure the interactions between the OPAL and + * the runtime. + */ + +static char* +_process_name_print_for_opal(const opal_process_name_t procname) +{ + ompi_process_name_t* rte_name = (ompi_process_name_t*)&procname; + return ompi_pmix_print_name(rte_name); +} + +static char* +_jobid_print_for_opal(const opal_jobid_t jobid) +{ + return ompi_pmix_print_jobids(jobid); +} + +static char* +_vpid_print_for_opal(const opal_vpid_t vpid) +{ + return ompi_pmix_print_vpids(vpid); +} + +static int +_process_name_compare(const opal_process_name_t p1, const opal_process_name_t p2) +{ + return ompi_rte_compare_name_fields(OMPI_RTE_CMP_ALL, &p1, &p2); +} + +static int _convert_string_to_process_name(opal_process_name_t *name, + const char* name_string) +{ + return ompi_rte_convert_string_to_process_name(name, name_string); +} + +static int _convert_process_name_to_string(char** name_string, + const opal_process_name_t *name) +{ + return ompi_rte_convert_process_name_to_string(name_string, name); +} + +static int +_convert_string_to_jobid(opal_jobid_t *jobid, const char *jobid_string) +{ + return ompi_pmix_convert_string_to_jobid(jobid, jobid_string); +} + int ompi_rte_init(int *pargc, char ***pargv) { int ret; char *error = NULL; opal_process_name_t pname; - opal_proc_t *myname; + opal_proc_t *myproc; int u32, *u32ptr; uint16_t u16, *u16ptr; char **peers=NULL, *mycpuset; @@ -253,6 +509,16 @@ int ompi_rte_init(int *pargc, char ***pargv) u16ptr = &u16; memset(&pmix_process_info, 0, sizeof(pmix_process_info)); + /* Convince OPAL to use our naming scheme */ + opal_process_name_print = _process_name_print_for_opal; + opal_vpid_print = _vpid_print_for_opal; + opal_jobid_print = _jobid_print_for_opal; + opal_compare_proc = _process_name_compare; + opal_convert_string_to_process_name = _convert_string_to_process_name; + opal_convert_process_name_to_string = _convert_process_name_to_string; + opal_snprintf_jobid = ompi_pmix_snprintf_jobid; + opal_convert_string_to_jobid = _convert_string_to_jobid; + /* initialize the opal layer */ if (OPAL_SUCCESS != (ret = opal_init(pargc, pargv))) { error = "opal_init"; @@ -284,14 +550,15 @@ int ompi_rte_init(int *pargc, char ***pargv) } /* opal_pmix.init will have filled in proc name fields in * OPAL, so transfer them here */ - myname = opal_proc_local_get(); - pmix_proc_my_name = myname->proc_name; + pmix_process_info.my_name.jobid = OPAL_PROC_MY_NAME.jobid; + pmix_process_info.my_name.vpid = OPAL_PROC_MY_NAME.vpid; /* get our hostname */ - pmix_process_info.nodename = opal_get_proc_hostname(myname); + myproc = opal_proc_local_get(); + pmix_process_info.nodename = opal_get_proc_hostname(myproc); /* get our local rank from PMI */ OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_RANK, - &pmix_proc_my_name, &u16ptr, OPAL_UINT16); + &pmix_process_info.my_name, &u16ptr, OPAL_UINT16); if (OPAL_SUCCESS != ret) { error = "getting local rank"; goto error; @@ -300,7 +567,7 @@ int ompi_rte_init(int *pargc, char ***pargv) /* get our node rank from PMI */ OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_NODE_RANK, - &pmix_proc_my_name, &u16ptr, OPAL_UINT16); + &pmix_process_info.my_name, &u16ptr, OPAL_UINT16); if (OPAL_SUCCESS != ret) { error = "getting node rank"; goto error; @@ -308,8 +575,10 @@ int ompi_rte_init(int *pargc, char ***pargv) pmix_process_info.my_node_rank = u16; /* get job size */ + pname.jobid = pmix_process_info.my_name.jobid; + pname.vpid = OPAL_VPID_WILDCARD; OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_JOB_SIZE, - &pmix_name_wildcard, &u32ptr, OPAL_UINT32); + &pname, &u32ptr, OPAL_UINT32); if (OPAL_SUCCESS != ret) { error = "getting job size"; goto error; @@ -319,8 +588,8 @@ int ompi_rte_init(int *pargc, char ***pargv) /* push into the environ for pickup in MPI layer for * MPI-3 required info key */ - if (NULL == getenv(OPAL_MCA_PREFIX"orte_ess_num_procs")) { - asprintf(&ev1, OPAL_MCA_PREFIX"orte_ess_num_procs=%d", pmix_process_info.num_procs); + if (NULL == getenv(OPAL_MCA_PREFIX"opal_ess_num_procs")) { + asprintf(&ev1, OPAL_MCA_PREFIX"opal_ess_num_procs=%d", pmix_process_info.num_procs); putenv(ev1); added_num_procs = true; } @@ -332,7 +601,7 @@ int ompi_rte_init(int *pargc, char ***pargv) /* get our app number from PMI - ok if not found */ OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_APPNUM, - &pmix_proc_my_name, &u32ptr, OPAL_UINT32); + &pmix_process_info.my_name, &u32ptr, OPAL_UINT32); if (OPAL_SUCCESS == ret) { pmix_process_info.app_num = u32; } else { @@ -342,7 +611,7 @@ int ompi_rte_init(int *pargc, char ***pargv) /* get the number of local peers - required for wireup of * shared memory BTL */ OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_SIZE, - &pmix_name_wildcard, &u32ptr, OPAL_UINT32); + &pname, &u32ptr, OPAL_UINT32); if (OPAL_SUCCESS == ret) { pmix_process_info.num_local_peers = u32 - 1; // want number besides ourselves } else { @@ -353,17 +622,17 @@ int ompi_rte_init(int *pargc, char ***pargv) * we can use the jobfam and stepid as unique keys * because they are unique values assigned by the RM */ - if (NULL == getenv(OPAL_MCA_PREFIX"orte_precondition_transports")) { - unique_key[0] = (pmix_proc_my_name.jobid & 0xff00) >> 16; - unique_key[1] = pmix_proc_my_name.jobid & 0x00ff; + if (NULL == getenv(OPAL_MCA_PREFIX"opal_precondition_transports")) { + unique_key[0] = (pmix_process_info.my_name.jobid & 0xff00) >> 16; + unique_key[1] = pmix_process_info.my_name.jobid & 0x00ff; if (NULL == (string_key = pre_condition_transports_print(unique_key))) { OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); return OPAL_ERR_OUT_OF_RESOURCE; } opal_output_verbose(2, ompi_rte_base_framework.framework_output, "%s transport key %s", - OPAL_NAME_PRINT(pmix_proc_my_name), string_key); - asprintf(&envar, OPAL_MCA_PREFIX"orte_precondition_transports=%s", string_key); + OPAL_NAME_PRINT(pmix_process_info.my_name), string_key); + asprintf(&envar, OPAL_MCA_PREFIX"opal_precondition_transports=%s", string_key); putenv(envar); added_transport_keys = true; /* cannot free the envar as that messes up our environ */ @@ -371,7 +640,7 @@ int ompi_rte_init(int *pargc, char ***pargv) } /* retrieve temp directories info */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_NSDIR, &pmix_name_wildcard, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_NSDIR, &pname, &val, OPAL_STRING); if (OPAL_SUCCESS == ret && NULL != val) { pmix_process_info.job_session_dir = val; val = NULL; @@ -394,7 +663,7 @@ int ompi_rte_init(int *pargc, char ***pargv) } /* retrieve the local peers */ OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_PEERS, - &pmix_name_wildcard, &val, OPAL_STRING); + &pname, &val, OPAL_STRING); if (OPAL_SUCCESS == ret && NULL != val) { peers = opal_argv_split(val, ','); free(val); @@ -410,16 +679,16 @@ int ompi_rte_init(int *pargc, char ***pargv) /* identify our location */ val = NULL; OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, - &pmix_proc_my_name, &val, OPAL_STRING); + &pmix_process_info.my_name, &val, OPAL_STRING); if (OPAL_SUCCESS == ret && NULL != val) { mycpuset = val; } else { mycpuset = NULL; } - pname.jobid = pmix_proc_my_name.jobid; + pname.jobid = pmix_process_info.my_name.jobid; for (i=0; NULL != peers[i]; i++) { pname.vpid = strtoul(peers[i], NULL, 10); - if (pname.vpid == pmix_proc_my_name.vpid) { + if (pname.vpid == pmix_process_info.my_name.vpid) { /* we are fully local to ourselves */ u16 = OPAL_PROC_ALL_LOCAL; } else { @@ -439,7 +708,7 @@ int ompi_rte_init(int *pargc, char ***pargv) kv->type = OPAL_UINT16; OPAL_OUTPUT_VERBOSE((1, ompi_rte_base_framework.framework_output, "%s locality: proc %s locality %s", - OPAL_NAME_PRINT(pmix_proc_my_name), + OPAL_NAME_PRINT(pmix_process_info.my_name), OPAL_NAME_PRINT(pname), opal_hwloc_base_print_locality(u16))); kv->data.uint16 = u16; ret = opal_pmix.store_local(&pname, kv); @@ -514,10 +783,10 @@ int ompi_rte_finalize(void) * so we leave that structure intact */ if (added_transport_keys) { - unsetenv(OPAL_MCA_PREFIX"orte_precondition_transports"); + unsetenv(OPAL_MCA_PREFIX"opal_precondition_transports"); } if (added_num_procs) { - unsetenv(OPAL_MCA_PREFIX"orte_ess_num_procs"); + unsetenv(OPAL_MCA_PREFIX"opal_ess_num_procs"); } if (added_app_ctx) { unsetenv("OMPI_APP_CTX_NUM_PROCS"); @@ -750,7 +1019,7 @@ static int _setup_job_session_dir(char **sdir) "%s/ompi.%s.%lu/jf.0/%u", tmpdir, pmix_process_info.nodename, (unsigned long)uid, - pmix_proc_my_name.jobid)) { + pmix_process_info.my_name.jobid)) { pmix_process_info.job_session_dir = NULL; return OPAL_ERR_OUT_OF_RESOURCE; } diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index 554a5eaa60..abf92257bb 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved. * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. @@ -1524,7 +1524,11 @@ static uint64_t calculate_total_mem (void) if (NULL == machine) { return 0; } +#if HWLOC_API_VERSION < 0x20000 return machine->memory.total_memory; +#else + return machine->total_memory; +#endif } /* couldn't find it */ diff --git a/opal/mca/hwloc/base/base.h b/opal/mca/hwloc/base/base.h index bb4b64f598..e45d71db31 100644 --- a/opal/mca/hwloc/base/base.h +++ b/opal/mca/hwloc/base/base.h @@ -175,10 +175,6 @@ OPAL_DECLSPEC unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t t hwloc_obj_type_t target, unsigned cache_level, opal_hwloc_resource_type_t rtype); -OPAL_DECLSPEC hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t topo, - hwloc_obj_t obj, - hwloc_obj_type_t target, - unsigned cache_leve); OPAL_DECLSPEC void opal_hwloc_base_clear_usage(hwloc_topology_t topo); OPAL_DECLSPEC hwloc_obj_t opal_hwloc_base_get_obj_by_type(hwloc_topology_t topo, diff --git a/opal/mca/hwloc/base/hwloc_base_frame.c b/opal/mca/hwloc/base/hwloc_base_frame.c index ea57fef56d..a56c5e065d 100644 --- a/opal/mca/hwloc/base/hwloc_base_frame.c +++ b/opal/mca/hwloc/base/hwloc_base_frame.c @@ -415,21 +415,14 @@ char* opal_hwloc_base_print_locality(opal_hwloc_locality_t locality) static void obj_data_const(opal_hwloc_obj_data_t *ptr) { - ptr->available = NULL; ptr->npus_calculated = false; ptr->npus = 0; ptr->idx = UINT_MAX; ptr->num_bound = 0; } -static void obj_data_dest(opal_hwloc_obj_data_t *ptr) -{ - if (NULL != ptr->available) { - hwloc_bitmap_free(ptr->available); - } -} OBJ_CLASS_INSTANCE(opal_hwloc_obj_data_t, opal_object_t, - obj_data_const, obj_data_dest); + obj_data_const, NULL); static void sum_const(opal_hwloc_summary_t *ptr) { diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index fcc5f6d4ad..f37e85259a 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2011-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2012-2017 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. @@ -23,6 +23,7 @@ * $HEADER$ */ +#define OPAL_HWLOC_WANT_SHMEM 1 #include "opal_config.h" @@ -149,7 +150,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo) avail = hwloc_bitmap_alloc(); hwloc_bitmap_and(avail, root->online_cpuset, root->allowed_cpuset); #else - avail = hwloc_bitmap_dup(root->allowed_cpuset); + avail = hwloc_bitmap_dup(root->cpuset); #endif OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, "hwloc:base: no cpus specified - using root available cpuset")); @@ -173,7 +174,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo) hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset); #else hwloc_bitmap_free(pucpus); - pucpus = hwloc_bitmap_dup(pu->allowed_cpuset); + pucpus = hwloc_bitmap_dup(pu->cpuset); #endif hwloc_bitmap_or(res, avail, pucpus); hwloc_bitmap_copy(avail, res); @@ -195,7 +196,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo) hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset); #else hwloc_bitmap_free(pucpus); - pucpus = hwloc_bitmap_dup(pu->allowed_cpuset); + pucpus = hwloc_bitmap_dup(pu->cpuset); #endif hwloc_bitmap_or(res, avail, pucpus); hwloc_bitmap_copy(avail, res); @@ -560,30 +561,6 @@ int opal_hwloc_base_report_bind_failure(const char *file, return OPAL_SUCCESS; } -static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt) -{ - unsigned k; - opal_hwloc_obj_data_t *data; - - if (HWLOC_OBJ_CORE == obj->type) { - data = (opal_hwloc_obj_data_t*)obj->userdata; - if (NULL == data) { - data = OBJ_NEW(opal_hwloc_obj_data_t); - obj->userdata = (void*)data; - } - if (NULL == opal_hwloc_base_cpu_list) { - data->npus = 1; - } - *cnt += data->npus; - return; - } - - for (k=0; k < obj->arity; k++) { - df_search_cores(obj->children[k], cnt); - } - return; -} - /* determine if there is a single cpu in a bitmap */ bool opal_hwloc_base_single_cpu(hwloc_cpuset_t cpuset) { @@ -628,18 +605,8 @@ unsigned int opal_hwloc_base_get_npus(hwloc_topology_t topo, * count bits in this case as there may be more than * one hwthread/core. Instead, find the number of cores * in the system - * - * NOTE: remember, hwloc can't find "cores" in all - * environments. So first check to see if it found - * "core" at all. */ - if (NULL != hwloc_get_obj_by_type(topo, HWLOC_OBJ_CORE, 0)) { - /* starting at the incoming obj, do a down-first search - * and count the number of cores under it - */ - cnt = 0; - df_search_cores(obj, &cnt); - } + cnt = hwloc_get_nbobjs_inside_cpuset_by_type(topo, obj->cpuset, HWLOC_OBJ_CORE); } else { hwloc_cpuset_t cpuset; @@ -732,14 +699,6 @@ unsigned int opal_hwloc_base_get_obj_idx(hwloc_topology_t topo, * there is a single cache object type, and the level is encoded * in an attribute union. So looking for cache objects involves * a multi-step test :-( - * - * And, of course, we make things even worse because we don't - * always care about what is physically or logically present, - * but rather what is available to us. For example, we don't - * want to map or bind to a cpu that is offline, or one that - * we aren't allowed by use by the OS. So we have to also filter - * the search to avoid those objects that don't have any cpus - * we can use :-(( */ static hwloc_obj_t df_search(hwloc_topology_t topo, hwloc_obj_t start, @@ -747,100 +706,68 @@ static hwloc_obj_t df_search(hwloc_topology_t topo, unsigned cache_level, unsigned int nobj, opal_hwloc_resource_type_t rtype, - unsigned int *idx, unsigned int *num_objs) { unsigned k; hwloc_obj_t obj; opal_hwloc_obj_data_t *data; + int search_depth; - if (target == start->type) { -#if HWLOC_API_VERSION < 0x20000 - if (HWLOC_OBJ_CACHE == start->type && cache_level != start->attr->cache.depth) { - goto notfound; - } + search_depth = hwloc_get_type_depth(topo, target); + if (HWLOC_TYPE_DEPTH_MULTIPLE == search_depth) { + /* either v1.x Cache, or Groups */ +#if HWLOC_API_VERSION >= 0x20000 + return NULL; +#else + if (cache_level != HWLOC_OBJ_CACHE) + return NULL; + search_depth = hwloc_get_cache_type_depth(topo, cache_level, (hwloc_obj_cache_type_t) -1); #endif - if (OPAL_HWLOC_LOGICAL == rtype) { - /* the hwloc tree is composed of LOGICAL objects, so the only - * time we come here is when we are looking for logical caches - */ - if (NULL != num_objs) { - /* we are counting the number of caches at this level */ - *num_objs += 1; - } else if (*idx == nobj) { - /* found the specific instance of the cache level being sought */ - return start; - } - *idx += 1; - return NULL; + } + if (HWLOC_TYPE_DEPTH_UNKNOWN == search_depth) + return NULL; + + if (OPAL_HWLOC_LOGICAL == rtype) { + if (num_objs) + *num_objs = hwloc_get_nbobjs_by_depth(topo, search_depth); + return hwloc_get_obj_by_depth(topo, search_depth, nobj); + } + if (OPAL_HWLOC_PHYSICAL == rtype) { + /* the PHYSICAL object number is stored as the os_index. When + * counting physical objects, we can't just count the number + * that are in the hwloc tree as the only entries in the tree + * are LOGICAL objects - i.e., any physical gaps won't show. So + * we instead return the MAX os_index, as this is the best we + * can do to tell you how many PHYSICAL objects are in the system. + * + * NOTE: if the last PHYSICAL object is not present (e.g., the last + * socket on the node is empty), then the count we return will + * be wrong! + */ + hwloc_obj_t found = NULL; + obj = NULL; + if (num_objs) + *num_objs = 0; + while ((obj = hwloc_get_next_obj_by_depth(topo, search_depth, obj)) != NULL) { + if (num_objs && obj->os_index > *num_objs) + *num_objs = obj->os_index; + if (obj->os_index == nobj) + found = obj; } - if (OPAL_HWLOC_PHYSICAL == rtype) { - /* the PHYSICAL object number is stored as the os_index. When - * counting physical objects, we can't just count the number - * that are in the hwloc tree as the only entries in the tree - * are LOGICAL objects - i.e., any physical gaps won't show. So - * we instead return the MAX os_index, as this is the best we - * can do to tell you how many PHYSICAL objects are in the system. - * - * NOTE: if the last PHYSICAL object is not present (e.g., the last - * socket on the node is empty), then the count we return will - * be wrong! - */ - if (NULL != num_objs) { - /* we are counting the number of these objects */ - if (*num_objs < (unsigned int)start->os_index) { - *num_objs = (unsigned int)start->os_index; - } - } else if (*idx == nobj) { - /* found the specific instance of the cache level being sought */ - return start; - } - *idx += 1; - return NULL; + return found; + } + if (OPAL_HWLOC_AVAILABLE == rtype) { + int idx = 0; + if (num_objs) + *num_objs = hwloc_get_nbobjs_inside_cpuset_by_depth(topo, start->cpuset, search_depth); + obj = NULL; + while ((obj = hwloc_get_next_obj_inside_cpuset_by_depth(topo, start->cpuset, search_depth, obj)) != NULL) { + if (idx == nobj) + return obj; + idx++; } - if (OPAL_HWLOC_AVAILABLE == rtype) { - /* check - do we already know the index of this object */ - data = (opal_hwloc_obj_data_t*)start->userdata; - if (NULL == data) { - data = OBJ_NEW(opal_hwloc_obj_data_t); - start->userdata = (void*)data; - } - /* if we already know our location and it matches, - * then we are good - */ - if (UINT_MAX != data->idx && data->idx == nobj) { - return start; - } - /* see if we already know our available cpuset */ - if (NULL == data->available) { - data->available = hwloc_bitmap_dup(start->cpuset); - } - if (NULL != data->available && !hwloc_bitmap_iszero(data->available)) { - if (NULL != num_objs) { - *num_objs += 1; - } else if (*idx == nobj) { - /* cache the location */ - data->idx = *idx; - return start; - } - *idx += 1; - } - return NULL; - } - /* if it wasn't one of the above, then we are lost */ return NULL; } - -#if HWLOC_API_VERSION < 0x20000 - notfound: -#endif - for (k=0; k < start->arity; k++) { - obj = df_search(topo, start->children[k], target, cache_level, nobj, rtype, idx, num_objs); - if (NULL != obj) { - return obj; - } - } - return NULL; } @@ -849,7 +776,7 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, unsigned cache_level, opal_hwloc_resource_type_t rtype) { - unsigned int num_objs, idx; + unsigned int num_objs; hwloc_obj_t obj; opal_hwloc_summary_t *sum; opal_hwloc_topo_data_t *data; @@ -881,7 +808,6 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, /* for everything else, we have to do some work */ num_objs = 0; - idx = 0; obj = hwloc_get_root_obj(topo); /* first see if the topology already has this summary */ @@ -904,7 +830,7 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, } /* don't already know it - go get it */ - df_search(topo, obj, target, cache_level, 0, rtype, &idx, &num_objs); + df_search(topo, obj, target, cache_level, 0, rtype, &num_objs); /* cache the results for later */ sum = OBJ_NEW(opal_hwloc_summary_t); @@ -921,124 +847,6 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, return num_objs; } -static hwloc_obj_t df_search_min_bound(hwloc_topology_t topo, - hwloc_obj_t start, - hwloc_obj_type_t target, - unsigned cache_level, - unsigned int *min_bound) -{ - unsigned k; - hwloc_obj_t obj, save=NULL; - opal_hwloc_obj_data_t *data; - - if (target == start->type) { - /* only consider procs that are allowed */ - if (0 == (k = opal_hwloc_base_get_npus(topo, start))) { - goto notfound; - } -#if HWLOC_API_VERSION < 0x20000 - if (HWLOC_OBJ_CACHE == start->type && cache_level != start->attr->cache.depth) { - goto notfound; - } -#endif - /* see how many procs are bound to us */ - data = (opal_hwloc_obj_data_t*)start->userdata; - if (NULL == data) { - data = OBJ_NEW(opal_hwloc_obj_data_t); - start->userdata = data; - } - - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:min_bound_under_obj object %s:%u nbound %u min %u", - hwloc_obj_type_string(target), start->logical_index, - data->num_bound, *min_bound)); - if (data->num_bound < *min_bound) { - *min_bound = data->num_bound; - return start; - } - /* if we have more procs bound to us than the min, return NULL */ - return NULL; - } - - notfound: - for (k=0; k < start->arity; k++) { - obj = df_search_min_bound(topo, start->children[k], target, cache_level, min_bound); - if (NULL != obj) { - save = obj; - } - /* if the target level is HWTHREAD and we are NOT treating - * hwthreads as separate cpus, then we can only consider - * the 0th hwthread on a core - */ - if (HWLOC_OBJ_CORE == start->type && HWLOC_OBJ_PU == target && - !opal_hwloc_use_hwthreads_as_cpus) { - break; - } - } - - return save; -} - -hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t topo, - hwloc_obj_t obj, - hwloc_obj_type_t target, - unsigned cache_level) -{ - unsigned int min_bound; - hwloc_obj_t loc; - - /* bozo check */ - if (NULL == topo || NULL == obj) { - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:find_min_bound_under_obj NULL %s", - (NULL == topo) ? "topology" : "object")); - return NULL; - } - - - /* if the object and target is the same type, then there is - * nothing under it, so just return itself - */ - if (target == obj->type) { - /* again, we have to treat caches differently as - * the levels distinguish them - */ -#if HWLOC_API_VERSION < 0x20000 - if (HWLOC_OBJ_CACHE == target && - cache_level < obj->attr->cache.depth) { - goto moveon; - } -#endif - return obj; - } - -#if HWLOC_API_VERSION < 0x20000 - moveon: -#endif - /* the hwloc accessors all report at the topo level, - * so we have to do some work - */ - min_bound = UINT_MAX; - - loc = df_search_min_bound(topo, obj, target, cache_level, &min_bound); - - if (NULL != loc) { -#if HWLOC_API_VERSION < 0x20000 - if (HWLOC_OBJ_CACHE == target) { - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:min_bound_under_obj found min bound of %u on %s:%u:%u", - min_bound, hwloc_obj_type_string(target), - cache_level, loc->logical_index)); - } else -#endif - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:min_bound_under_obj found min bound of %u on %s:%u", - min_bound, hwloc_obj_type_string(target), loc->logical_index)); - } - - return loc; -} - /* as above, only return the Nth instance of the specified object * type from inside the topology */ @@ -1048,7 +856,6 @@ hwloc_obj_t opal_hwloc_base_get_obj_by_type(hwloc_topology_t topo, unsigned int instance, opal_hwloc_resource_type_t rtype) { - unsigned int idx; hwloc_obj_t obj; /* bozo check */ @@ -1069,9 +876,8 @@ hwloc_obj_t opal_hwloc_base_get_obj_by_type(hwloc_topology_t topo, } /* for everything else, we have to do some work */ - idx = 0; obj = hwloc_get_root_obj(topo); - return df_search(topo, obj, target, cache_level, instance, rtype, &idx, NULL); + return df_search(topo, obj, target, cache_level, instance, rtype, NULL); } static void df_clear(hwloc_topology_t topo, @@ -1179,7 +985,6 @@ static int socket_core_to_cpu_set(char *socket_core_list, int lower_range, upper_range; int socket_id, core_id; hwloc_obj_t socket, core; - unsigned int idx; hwloc_obj_type_t obj_type = HWLOC_OBJ_CORE; socket_core = opal_argv_split(socket_core_list, ':'); @@ -1223,10 +1028,9 @@ static int socket_core_to_cpu_set(char *socket_core_list, for (j=0; NULL != list[j]; j++) { core_id = atoi(list[j]); /* get that object */ - idx = 0; if (NULL == (core = df_search(topo, socket, obj_type, 0, core_id, OPAL_HWLOC_AVAILABLE, - &idx, NULL))) { + NULL))) { opal_argv_free(list); opal_argv_free(range); opal_argv_free(socket_core); @@ -1246,10 +1050,9 @@ static int socket_core_to_cpu_set(char *socket_core_list, upper_range = atoi(range[1]); for (core_id=lower_range; core_id <= upper_range; core_id++) { /* get that object */ - idx = 0; if (NULL == (core = df_search(topo, socket, obj_type, 0, core_id, OPAL_HWLOC_AVAILABLE, - &idx, NULL))) { + NULL))) { opal_argv_free(range); opal_argv_free(socket_core); return OPAL_ERR_NOT_FOUND; diff --git a/opal/mca/hwloc/external/configure.m4 b/opal/mca/hwloc/external/configure.m4 index 411d8ad1c1..b8214099ef 100644 --- a/opal/mca/hwloc/external/configure.m4 +++ b/opal/mca/hwloc/external/configure.m4 @@ -63,12 +63,17 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[ # the MCA_hwloc_external_openfabrics_helper define). AS_IF([test "$opal_hwloc_dir" != ""], [opal_hwloc_include="$opal_hwloc_dir/include/hwloc.h" + opal_hwloc_shmem_include="$opal_hwloc_dir/include/hwloc/shmem.h", opal_hwloc_openfabrics_include="$opal_hwloc_dir/include/hwloc/openfabrics-verbs.h"], [opal_hwloc_include="hwloc.h" + opal_hwloc_shmem_include="hwloc/shmem.h" opal_hwloc_openfabrics_include="hwloc/openfabrics-verbs.h"]) AC_DEFINE_UNQUOTED(MCA_hwloc_external_header, ["$opal_hwloc_include"], [Location of external hwloc header]) + AC_DEFINE_UNQUOTED(MCA_hwloc_external_shmem_header, + ["$opal_hwloc_shmem_include"], + [Location of external hwloc shmem header]) AC_DEFINE_UNQUOTED(MCA_hwloc_external_openfabrics_header, ["$opal_hwloc_openfabrics_include"], [Location of external hwloc OpenFabrics header]) diff --git a/opal/mca/hwloc/external/external.h b/opal/mca/hwloc/external/external.h index 6558a0bcbd..1428459755 100644 --- a/opal/mca/hwloc/external/external.h +++ b/opal/mca/hwloc/external/external.h @@ -43,6 +43,15 @@ BEGIN_C_DECLS # endif #endif +#if defined(OPAL_HWLOC_WANT_SHMEM) && OPAL_HWLOC_WANT_SHMEM +# if HWLOC_API_VERSION >= 0x20000 +# include MCA_hwloc_external_shmem_header +# endif +/* Do nothing in the 1.x case because the caller doesn't know HWLOC_API_VERSION when it sets OPAL_HWLOC_WANT_SHMEM. + * Calls to hwloc/shmem.h are protected by HWLOC_API_VERSION >= 0x20000 in the actual code. + */ +#endif + #if HWLOC_API_VERSION < 0x00010b00 #define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE #define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET diff --git a/opal/mca/hwloc/hwloc-internal.h b/opal/mca/hwloc/hwloc-internal.h index c8ba54ef14..ca030d0314 100644 --- a/opal/mca/hwloc/hwloc-internal.h +++ b/opal/mca/hwloc/hwloc-internal.h @@ -139,7 +139,6 @@ typedef uint8_t opal_hwloc_resource_type_t; /* structs for storing info on objects */ typedef struct { opal_object_t super; - hwloc_cpuset_t available; bool npus_calculated; unsigned int npus; unsigned int idx; diff --git a/opal/mca/hwloc/hwloc2a/Makefile.am b/opal/mca/hwloc/hwloc201/Makefile.am similarity index 86% rename from opal/mca/hwloc/hwloc2a/Makefile.am rename to opal/mca/hwloc/hwloc201/Makefile.am index 49cc5325da..93613a5f0d 100644 --- a/opal/mca/hwloc/hwloc2a/Makefile.am +++ b/opal/mca/hwloc/hwloc201/Makefile.am @@ -30,16 +30,16 @@ EXTRA_DIST = \ SUBDIRS = hwloc # Headers and sources -headers = hwloc2a.h -sources = hwloc2a_component.c +headers = hwloc201.h +sources = hwloc201_component.c # We only ever build this component statically -noinst_LTLIBRARIES = libmca_hwloc_hwloc2a.la -libmca_hwloc_hwloc2a_la_SOURCES = $(headers) $(sources) -nodist_libmca_hwloc_hwloc2a_la_SOURCES = $(nodist_headers) -libmca_hwloc_hwloc2a_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc2a_LDFLAGS) -libmca_hwloc_hwloc2a_la_LIBADD = $(opal_hwloc_hwloc2a_LIBS) -libmca_hwloc_hwloc2a_la_DEPENDENCIES = \ +noinst_LTLIBRARIES = libmca_hwloc_hwloc201.la +libmca_hwloc_hwloc201_la_SOURCES = $(headers) $(sources) +nodist_libmca_hwloc_hwloc201_la_SOURCES = $(nodist_headers) +libmca_hwloc_hwloc201_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc201_LDFLAGS) +libmca_hwloc_hwloc201_la_LIBADD = $(opal_hwloc_hwloc201_LIBS) +libmca_hwloc_hwloc201_la_DEPENDENCIES = \ $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la # Since the rest of the code base includes the underlying hwloc.h, we @@ -60,7 +60,6 @@ headers += \ hwloc/include/hwloc/helper.h \ hwloc/include/hwloc/inlines.h \ hwloc/include/hwloc/intel-mic.h \ - hwloc/include/hwloc/myriexpress.h \ hwloc/include/hwloc/nvml.h \ hwloc/include/hwloc/opencl.h \ hwloc/include/hwloc/openfabrics-verbs.h \ diff --git a/opal/mca/hwloc/hwloc201/README-ompi.txt b/opal/mca/hwloc/hwloc201/README-ompi.txt new file mode 100644 index 0000000000..0b069d4f80 --- /dev/null +++ b/opal/mca/hwloc/hwloc201/README-ompi.txt @@ -0,0 +1 @@ +Cherry-picked commits after 2.0.1: diff --git a/opal/mca/hwloc/hwloc2a/configure.m4 b/opal/mca/hwloc/hwloc201/configure.m4 similarity index 53% rename from opal/mca/hwloc/hwloc2a/configure.m4 rename to opal/mca/hwloc/hwloc201/configure.m4 index f5c8db3010..b6e60bc11e 100644 --- a/opal/mca/hwloc/hwloc2a/configure.m4 +++ b/opal/mca/hwloc/hwloc201/configure.m4 @@ -17,43 +17,43 @@ # # Priority # -AC_DEFUN([MCA_opal_hwloc_hwloc2a_PRIORITY], [90]) +AC_DEFUN([MCA_opal_hwloc_hwloc201_PRIORITY], [90]) # # Force this component to compile in static-only mode # -AC_DEFUN([MCA_opal_hwloc_hwloc2a_COMPILE_MODE], [ +AC_DEFUN([MCA_opal_hwloc_hwloc201_COMPILE_MODE], [ AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) $4="static" AC_MSG_RESULT([$$4]) ]) # Include hwloc m4 files -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_pkg.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_attributes.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_visibility.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_vendor.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_components.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_internal.m4) -m4_include(opal/mca/hwloc/hwloc2a/hwloc/config/netloc.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_pkg.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_attributes.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_visibility.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_vendor.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_components.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_internal.m4) +m4_include(opal/mca/hwloc/hwloc201/hwloc/config/netloc.m4) -# MCA_hwloc_hwloc2a_POST_CONFIG() +# MCA_hwloc_hwloc201_POST_CONFIG() # --------------------------------- -AC_DEFUN([MCA_opal_hwloc_hwloc2a_POST_CONFIG],[ - OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc2a_basedir]) +AC_DEFUN([MCA_opal_hwloc_hwloc201_POST_CONFIG],[ + OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc201_basedir]) # If we won, then do all the rest of the setup - AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc2a_support" = "yes"], + AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc201_support" = "yes"], [ # Set this variable so that the framework m4 knows what # file to include in opal/mca/hwloc/hwloc-internal.h - opal_hwloc_hwloc2a_basedir=opal/mca/hwloc/hwloc2a - opal_hwloc_base_include="$opal_hwloc_hwloc2a_basedir/hwloc2a.h" + opal_hwloc_hwloc201_basedir=opal/mca/hwloc/hwloc201 + opal_hwloc_base_include="$opal_hwloc_hwloc201_basedir/hwloc201.h" # Add some stuff to CPPFLAGS so that the rest of the source # tree can be built - file=$opal_hwloc_hwloc2a_basedir/hwloc + file=$opal_hwloc_hwloc201_basedir/hwloc CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS" AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], [CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"]) @@ -66,41 +66,41 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_POST_CONFIG],[ ])dnl -# MCA_hwloc_hwloc2a_CONFIG([action-if-found], [action-if-not-found]) +# MCA_hwloc_hwloc201_CONFIG([action-if-found], [action-if-not-found]) # -------------------------------------------------------------------- -AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[ +AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[ # Hwloc needs to know if we have Verbs support AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) - AC_CONFIG_FILES([opal/mca/hwloc/hwloc2a/Makefile]) + AC_CONFIG_FILES([opal/mca/hwloc/hwloc201/Makefile]) - OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc2a_save_CPPFLAGS opal_hwloc_hwloc2a_save_LDFLAGS opal_hwloc_hwloc2a_save_LIBS opal_hwloc_hwloc2a_save_cairo opal_hwloc_hwloc2a_save_xml opal_hwloc_hwloc2a_save_mode opal_hwloc_hwloc2a_basedir opal_hwloc_hwloc2a_file opal_hwloc_hwloc2a_save_cflags CPPFLAGS_save LIBS_save opal_hwloc_external]) + OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc201_save_CPPFLAGS opal_hwloc_hwloc201_save_LDFLAGS opal_hwloc_hwloc201_save_LIBS opal_hwloc_hwloc201_save_cairo opal_hwloc_hwloc201_save_xml opal_hwloc_hwloc201_save_mode opal_hwloc_hwloc201_basedir opal_hwloc_hwloc201_file opal_hwloc_hwloc201_save_cflags CPPFLAGS_save LIBS_save opal_hwloc_external]) # default to this component not providing support - opal_hwloc_hwloc2a_basedir=opal/mca/hwloc/hwloc2a - opal_hwloc_hwloc2a_support=no + opal_hwloc_hwloc201_basedir=opal/mca/hwloc/hwloc201 + opal_hwloc_hwloc201_support=no AS_IF([test "$with_hwloc" = "internal" || test -z "$with_hwloc" || test "$with_hwloc" = "yes"], [opal_hwloc_external="no"], [opal_hwloc_external="yes"]) - opal_hwloc_hwloc2a_save_CPPFLAGS=$CPPFLAGS - opal_hwloc_hwloc2a_save_LDFLAGS=$LDFLAGS - opal_hwloc_hwloc2a_save_LIBS=$LIBS + opal_hwloc_hwloc201_save_CPPFLAGS=$CPPFLAGS + opal_hwloc_hwloc201_save_LDFLAGS=$LDFLAGS + opal_hwloc_hwloc201_save_LIBS=$LIBS # Run the hwloc configuration - if no external hwloc, then set the prefixi # to minimize the chance that someone will use the internal symbols AS_IF([test "$opal_hwloc_external" = "no" && test "$with_hwloc" != "future"], - [HWLOC_SET_SYMBOL_PREFIX([opal_hwloc2a_])]) + [HWLOC_SET_SYMBOL_PREFIX([opal_hwloc201_])]) # save XML or graphical options - opal_hwloc_hwloc2a_save_cairo=$enable_cairo - opal_hwloc_hwloc2a_save_xml=$enable_xml - opal_hwloc_hwloc2a_save_static=$enable_static - opal_hwloc_hwloc2a_save_shared=$enable_shared - opal_hwloc_hwloc2a_save_plugins=$enable_plugins - opal_hwloc_hwloc2a_save_mode=$hwloc_mode + opal_hwloc_hwloc201_save_cairo=$enable_cairo + opal_hwloc_hwloc201_save_xml=$enable_xml + opal_hwloc_hwloc201_save_static=$enable_static + opal_hwloc_hwloc201_save_shared=$enable_shared + opal_hwloc_hwloc201_save_plugins=$enable_plugins + opal_hwloc_hwloc201_save_mode=$hwloc_mode # never enable hwloc's graphical option enable_cairo=no @@ -131,22 +131,22 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[ # hwloc checks for compiler visibility, and its needs to do # this without "picky" flags. - opal_hwloc_hwloc2a_save_cflags=$CFLAGS + opal_hwloc_hwloc201_save_cflags=$CFLAGS CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY AS_IF([test -n "$opal_datatype_cuda_CPPFLAGS"], [CPPFLAGS="$CPPFLAGS $opal_datatype_cuda_CPPFLAGS"]) - HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc2a/hwloc], + HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc201/hwloc], [AC_MSG_CHECKING([whether hwloc configure succeeded]) AC_MSG_RESULT([yes]) - HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc2a_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc2a_basedir/hwloc/VERSION`" + HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc201_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc201_basedir/hwloc/VERSION`" # Build flags for our Makefile.am - opal_hwloc_hwloc2a_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)' - opal_hwloc_hwloc2a_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc2a_basedir"'/hwloc/hwloc/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)' - opal_hwloc_hwloc2a_support=yes + opal_hwloc_hwloc201_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)' + opal_hwloc_hwloc201_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc201_basedir"'/hwloc/hwloc/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)' + opal_hwloc_hwloc201_support=yes - AC_DEFINE_UNQUOTED([HWLOC_HWLOC2a_HWLOC_VERSION], + AC_DEFINE_UNQUOTED([HWLOC_HWLOC201_HWLOC_VERSION], ["$HWLOC_VERSION"], [Version of hwloc]) @@ -159,35 +159,35 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[ ], [AC_MSG_CHECKING([whether hwloc configure succeeded]) AC_MSG_RESULT([no]) - opal_hwloc_hwloc2a_support=no]) - CFLAGS=$opal_hwloc_hwloc2a_save_cflags + opal_hwloc_hwloc201_support=no]) + CFLAGS=$opal_hwloc_hwloc201_save_cflags # Restore some env variables, if necessary - AS_IF([test -n "$opal_hwloc_hwloc2a_save_cairo"], - [enable_cairo=$opal_hwloc_hwloc2a_save_cairo]) - AS_IF([test -n "$opal_hwloc_hwloc2a_save_xml"], - [enable_xml=$opal_hwloc_hwloc2a_save_xml]) - AS_IF([test -n "$opal_hwloc_hwloc2a_save_static"], - [enable_static=$opal_hwloc_hwloc2a_save_static]) - AS_IF([test -n "$opal_hwloc_hwloc2a_save_shared"], - [enable_shared=$opal_hwloc_hwloc2a_save_shared]) - AS_IF([test -n "$opal_hwloc_hwloc2a_save_plugins"], - [enable_plugins=$opal_hwloc_hwloc2a_save_shared]) + AS_IF([test -n "$opal_hwloc_hwloc201_save_cairo"], + [enable_cairo=$opal_hwloc_hwloc201_save_cairo]) + AS_IF([test -n "$opal_hwloc_hwloc201_save_xml"], + [enable_xml=$opal_hwloc_hwloc201_save_xml]) + AS_IF([test -n "$opal_hwloc_hwloc201_save_static"], + [enable_static=$opal_hwloc_hwloc201_save_static]) + AS_IF([test -n "$opal_hwloc_hwloc201_save_shared"], + [enable_shared=$opal_hwloc_hwloc201_save_shared]) + AS_IF([test -n "$opal_hwloc_hwloc201_save_plugins"], + [enable_plugins=$opal_hwloc_hwloc201_save_shared]) - CPPFLAGS=$opal_hwloc_hwloc2a_save_CPPFLAGS - LDFLAGS=$opal_hwloc_hwloc2a_save_LDFLAGS - LIBS=$opal_hwloc_hwloc2a_save_LIBS + CPPFLAGS=$opal_hwloc_hwloc201_save_CPPFLAGS + LDFLAGS=$opal_hwloc_hwloc201_save_LDFLAGS + LIBS=$opal_hwloc_hwloc201_save_LIBS - AC_SUBST([opal_hwloc_hwloc2a_CFLAGS]) - AC_SUBST([opal_hwloc_hwloc2a_CPPFLAGS]) - AC_SUBST([opal_hwloc_hwloc2a_LDFLAGS]) - AC_SUBST([opal_hwloc_hwloc2a_LIBS]) + AC_SUBST([opal_hwloc_hwloc201_CFLAGS]) + AC_SUBST([opal_hwloc_hwloc201_CPPFLAGS]) + AC_SUBST([opal_hwloc_hwloc201_LDFLAGS]) + AC_SUBST([opal_hwloc_hwloc201_LIBS]) # Finally, add some flags to the wrapper compiler so that our # headers can be found. - hwloc_hwloc2a_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS" - hwloc_hwloc2a_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS" - hwloc_hwloc2a_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc2a_basedir/hwloc/include" + hwloc_hwloc201_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS" + hwloc_hwloc201_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS" + hwloc_hwloc201_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc201_basedir/hwloc/include" # If we are not building the internal hwloc, then indicate that # this component should not be built. NOTE: we still did all the @@ -197,12 +197,12 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[ # distclean" infrastructure to work properly). AS_IF([test "$opal_hwloc_external" = "yes"], [AC_MSG_WARN([using an external hwloc; disqualifying this component]) - opal_hwloc_hwloc2a_support=no], + opal_hwloc_hwloc201_support=no], [AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1]) AC_DEFINE([HAVE_HWLOC_TOPOLOGY_DUP], [1])]) # Done! - AS_IF([test "$opal_hwloc_hwloc2a_support" = "yes"], + AS_IF([test "$opal_hwloc_hwloc201_support" = "yes"], [$1], [$2]) diff --git a/opal/mca/hwloc/hwloc2a/hwloc/AUTHORS b/opal/mca/hwloc/hwloc201/hwloc/AUTHORS similarity index 62% rename from opal/mca/hwloc/hwloc2a/hwloc/AUTHORS rename to opal/mca/hwloc/hwloc201/hwloc/AUTHORS index 740de337b2..7187a723d8 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/AUTHORS +++ b/opal/mca/hwloc/hwloc201/hwloc/AUTHORS @@ -1,29 +1,44 @@ -netloc Authors -============== +hwloc Authors +============= -The following cumulative list contains the names of most individuals who -have committed code to the hwloc repository. +The following cumulative list contains the names of most individuals +who have committed code to the hwloc repository +(either directly or through a third party). Name Affiliation(s) --------------------------- -------------------- +Grzegorz Andrejczuk Intel Cédric Augonnet University of Bordeaux Guillaume Beauchamp Inria Ahmad Boissetri Binzagr Inria Cyril Bordage Inria Nicholas Buroker UWL +Christopher M. Cantalupo Intel Jérôme Clet-Ortega University of Bordeaux Ludovic Courtès Inria +Clément Foyer Inria Nathalie Furmento CNRS +Bryon Gloden Brice Goglin Inria +Gilles Gouaillardet RIST Joshua Hursey UWL Alexey Kardashevskiy IBM +Rob Latham ANL Douglas MacFarland UWL +Marc Marí BSC +Jonathan L Peyton Intel +Piotr Luc Intel Antoine Rougier intern from University of Bordeaux Jeff Squyres Cisco Samuel Thibault University of Bordeaux +Jean-Yves VET DDN +Benjamin Worpitz +Jeff Zhao Zhaoxin Affiliaion abbreviations: ------------------------- +ANL = Argonne National Lab +BSC = Barcelona Supercomputing Center Cisco = Cisco Systems, Inc. CNRS = Centre national de la recherche scientifique (France) UWL = University of Wisconsin-La Crosse diff --git a/opal/mca/hwloc/hwloc2a/hwloc/COPYING b/opal/mca/hwloc/hwloc201/hwloc/COPYING similarity index 100% rename from opal/mca/hwloc/hwloc2a/hwloc/COPYING rename to opal/mca/hwloc/hwloc201/hwloc/COPYING diff --git a/opal/mca/hwloc/hwloc201/hwloc/Makefile.am b/opal/mca/hwloc/hwloc201/hwloc/Makefile.am new file mode 100644 index 0000000000..25fa1e59f3 --- /dev/null +++ b/opal/mca/hwloc/hwloc201/hwloc/Makefile.am @@ -0,0 +1,93 @@ +# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009 Université Bordeaux +# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. +# See COPYING in top-level directory. + +# Note that the -I directory must *exactly* match what was specified +# via AC_CONFIG_MACRO_DIR in configure.ac. +ACLOCAL_AMFLAGS = -I ./config + +# +# "make distcheck" requires that tarballs are able to be able to "make +# dist", so we have to include config/distscript.sh. +# +EXTRA_DIST = \ + README VERSION COPYING AUTHORS \ + config/hwloc_get_version.sh \ + config/distscript.sh + +SUBDIRS = include hwloc + +if HWLOC_BUILD_STANDALONE +if BUILD_NETLOC +SUBDIRS += netloc +endif +SUBDIRS += utils tests contrib/systemd contrib/misc +# We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. +# There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there +SUBDIRS += doc +endif + +# Do not let automake automatically add the non-standalone dirs to the +# distribution tarball if we're building in embedded mode. +DIST_SUBDIRS = $(SUBDIRS) +if HWLOC_BUILD_STANDALONE +if !BUILD_NETLOC +DIST_SUBDIRS += netloc +endif +endif + +# Only install the pkg file if we're building in standalone mode (and not on Windows) +if HWLOC_BUILD_STANDALONE +hwlocpkgconfigdir = $(libdir)/pkgconfig +hwlocpkgconfig_DATA = hwloc.pc +if BUILD_NETLOC +# JMS Need to compare hwloc.pc and netloc.pc -- I think netloc.pc is +# missing some things. +# pkgconfig_DATA += netloc.pc Disabled until the netloc API is public +EXTRA_DIST += netloc.pc +if BUILD_NETLOCSCOTCH +hwlocpkgconfig_DATA += netlocscotch.pc +endif BUILD_NETLOCSCOTCH +endif BUILD_NETLOC +endif HWLOC_BUILD_STANDALONE + +# Only install the valgrind suppressions file if we're building in +# standalone mode +if HWLOC_BUILD_STANDALONE +dist_pkgdata_DATA = contrib/hwloc-valgrind.supp +endif + +# Only install entire visual studio subdirectory if we're building in +# standalone mode +if HWLOC_BUILD_STANDALONE +EXTRA_DIST += contrib/windows +endif + +if HWLOC_BUILD_STANDALONE +dist-hook: + sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)" +endif HWLOC_BUILD_STANDALONE + +if HWLOC_BUILD_STANDALONE +if HWLOC_HAVE_WINDOWS +# +# Winball specific rules +# +install-data-local: + sed -e 's/$$/'$$'\015'/ < $(srcdir)/README > $(DESTDIR)$(prefix)/README.txt + sed -e 's/$$/'$$'\015'/ < $(srcdir)/NEWS > $(DESTDIR)$(prefix)/NEWS.txt + sed -e 's/$$/'$$'\015'/ < $(srcdir)/COPYING > $(DESTDIR)$(prefix)/COPYING.txt +uninstall-local: + rm -f $(DESTDIR)$(prefix)/README.txt $(DESTDIR)$(prefix)/NEWS.txt $(DESTDIR)$(prefix)/COPYING.txt +endif HWLOC_HAVE_WINDOWS +endif HWLOC_BUILD_STANDALONE + +# +# Build the documenation and top-level README file +# +if HWLOC_BUILD_STANDALONE +.PHONY: doc readme +doc readme: + $(MAKE) -C doc +endif HWLOC_BUILD_STANDALONE diff --git a/opal/mca/hwloc/hwloc2a/hwloc/NEWS b/opal/mca/hwloc/hwloc201/hwloc/NEWS similarity index 89% rename from opal/mca/hwloc/hwloc2a/hwloc/NEWS rename to opal/mca/hwloc/hwloc201/hwloc/NEWS index 772e42ae5d..ff503d8aa9 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/NEWS +++ b/opal/mca/hwloc/hwloc201/hwloc/NEWS @@ -1,5 +1,5 @@ Copyright © 2009 CNRS -Copyright © 2009-2017 Inria. All rights reserved. +Copyright © 2009-2018 Inria. All rights reserved. Copyright © 2009-2013 Université Bordeaux Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. @@ -17,116 +17,196 @@ bug fixes (and other actions) for each version of hwloc since version in v0.9.1). +Version 2.0.1 (also included in 1.11.10 when relevant) +------------- +* Bump the library soname to 15:0:0 to avoid conflicts with hwloc 1.11.x + releases. The hwloc 2.0.0 soname was buggy (12:0:0), applications will + have to be recompiled. +* Serialize pciaccess discovery to fix concurrent topology loads in + multiple threads. +* Fix hwloc-dump-hwdata to only process SMBIOS information that correspond + to the KNL and KNM configuration. +* Add a heuristic for guessing KNL/KNM memory and cluster modes when + hwloc-dump-hwdata could not run as root earlier. +* Add --no-text lstopo option to remove text from some boxes in the + graphical output. Mostly useful for removing Group labels. +* Some minor fixes to memory binding. + + Version 2.0.0 ------------- -* The ABI of the library has changed. For instance some hwloc_obj fields - were reordered. - - HWLOC_API_VERSION and hwloc_get_api_version() now give 0x00020000. - - See "How do I handle ABI breaks and API upgrades ?" in the FAQ - and https://github.com/open-mpi/hwloc/wiki/Upgrading-to-v2.0-API -* Major changes +*** The ABI of the library has changed. *** + For instance some hwloc_obj fields were reordered, added or removed, see below. + + HWLOC_API_VERSION and hwloc_get_api_version() now give 0x00020000. + + See "How do I handle ABI breaks and API upgrades ?" in the FAQ + and "Upgrading to hwloc 2.0 API" in the documentation. +* Major API changes + + Memory, I/O and Misc objects are now stored in dedicated children lists, + not in the usual children list that is now only used for CPU-side objects. + - hwloc_get_next_child() may still be used to iterate over these 4 lists + of children at once. + - hwloc_obj_type_is_normal(), _memory() and _io() may be used to check + the kind of a given object type. + Topologies always have at least one NUMA object. On non-NUMA machines, a single NUMA object is added to describe the entire machine memory. The NUMA level cannot be ignored anymore. + + The NUMA level is special since NUMA nodes are not in the main hierarchy + of objects anymore. Its depth is a fake negative depth that should not be + compared with normal levels. + - If all memory objects are attached to parents at the same depth, + it may be retrieved with hwloc_get_memory_parents_depth(). + The HWLOC_OBJ_CACHE type is replaced with 8 types HWLOC_OBJ_L[1-5]CACHE and HWLOC_OBJ_L[1-3]ICACHE that remove the need to disambiguate levels when looking for caches with _by_type() functions. - New hwloc_obj_type_is_{,d,i}cache() functions may be used to check whether a given type is a cache. - + Replace hwloc_topology_ignore*() functions with hwloc_topology_set_type_filter() - and hwloc_topology_set_all_types_filter(). - - Contrary to hwloc_topology_ignore_{type,all}_keep_structure() which - removed individual objects, HWLOC_TYPE_FILTER_KEEP_STRUCTURE only removes - entire levels (so that topology do not become too asymmetric). - + Remove HWLOC_TOPOLOGY_FLAG_ICACHES in favor of hwloc_topology_set_icache_types_filter() - with HWLOC_TYPE_FILTER_KEEP_ALL. - + Remove HWLOC_TOPOLOGY_FLAG_IO_DEVICES, _IO_BRIDGES and _WHOLE_IO in favor of - hwloc_topology_set_io_types_filter() with HWLOC_TYPE_FILTER_KEEP_ALL or - HWLOC_TYPE_FILTER_KEEP_IMPORTANT. + + Reworked ignoring/filtering API + - Replace hwloc_topology_ignore*() functions with hwloc_topology_set_type_filter() + and hwloc_topology_set_all_types_filter(). + . Contrary to hwloc_topology_ignore_{type,all}_keep_structure() which + removed individual objects, HWLOC_TYPE_FILTER_KEEP_STRUCTURE only removes + entire levels (so that topology do not become too asymmetric). + - Remove HWLOC_TOPOLOGY_FLAG_ICACHES in favor of hwloc_topology_set_icache_types_filter() + with HWLOC_TYPE_FILTER_KEEP_ALL. + - Remove HWLOC_TOPOLOGY_FLAG_IO_DEVICES, _IO_BRIDGES and _WHOLE_IO in favor of + hwloc_topology_set_io_types_filter() with HWLOC_TYPE_FILTER_KEEP_ALL or + HWLOC_TYPE_FILTER_KEEP_IMPORTANT. + + The distance API has been completely reworked. It is now described + in hwloc/distances.h. + + Return values + - Most functions in hwloc/bitmap.h now return an int that may be negative + in case of failure to realloc/extend the internal storage of a bitmap. + - hwloc_obj_add_info() also returns an int in case allocations fail. +* Minor API changes + + Object attributes + - obj->memory is removed. + . local_memory and page_types attributes are now in obj->attr->numanode + . total_memory moves obj->total_memory. + - Objects do not have allowed_cpuset and allowed_nodeset anymore. + They are only available for the entire topology using + hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset(). + - Objects now have a "subtype" field that supersedes former "Type" and + "CoProcType" info attributes. + + Object and level depths are now signed ints. + + Object string printing and parsing + - hwloc_type_sscanf() deprecates the old hwloc_obj_type_sscanf(). + - hwloc_type_sscanf_as_depth() is added to convert a type name into + a level depth. + - hwloc_obj_cpuset_snprintf() is deprecated in favor of hwloc_bitmap_snprintf(). + + Misc objects + - Replace hwloc_topology_insert_misc_object_by_cpuset() with + hwloc_topology_insert_group_object() to precisely specify the location + of an additional hierarchy level in the topology. + - Misc objects have their own level and depth to iterate over all of them. + - Misc objects may now only be inserted as a leaf object with + hwloc_topology_insert_misc_object() which deprecates + hwloc_topology_insert_misc_object_by_parent(). + hwloc_topology_restrict() doesn't remove objects that contain memory by default anymore. - The list of existing restrict flags was modified. + + The discovery support array now contains some NUMA specific bits. + XML export functions take an additional flags argument, for instance for exporting XMLs that are compatible with hwloc 1.x. - + The distance API has been completely reworked. It is now described - in hwloc/distances.h. - + Add hwloc/shmem.h for sharing topologies between processes running on - the same machine (for reducing the memory footprint). - + Add the experimental netloc subproject. It is enabled by default when - supported and can be disabled with --disable-netloc. - It currently brings command-line tools to gather and visualize the - topology of InfiniBand fabrics, and an API to convert such topologies - into Scotch architectures for process mapping. - See the documentation for details. - + Remove the online_cpuset from struct hwloc_obj. Offline PUs get unknown - topologies on Linux nowadays, and wrong topology on Solaris. Other OS - do not support them. And one cannot do much about them anyway. Just keep - them in complete_cpuset. - + Remove the custom interface for assembling the topologies of different - nodes as well as the hwloc-assembler tools. - + Remove Kerrighed support from the Linux backend. - + Remove Tru64 (OSF/1) support. - - Remove HWLOC_MEMBIND_REPLICATE which wasn't available anywhere else. -* API - + Objects now have a "subtype" field that supersedes former "Type" and - "CoProcType" info attributes. - + The almost-unused "os_level" attribute has been removed from the - hwloc_obj structure. - + I/O and Misc objects are now stored in a dedicated children list, only - normal children with non-NULL cpusets and nodesets are in the main - children list. - - hwloc_get_next_child() may still be used to iterate over these 3 lists - of children at once. - + Replace hwloc_topology_insert_misc_object_by_cpuset() with - hwloc_topology_insert_group_object() to precisely specify the location - of an additional hierarchy level in the topology. - + Misc objects have their own level and depth to iterate over all of them. - + Misc objects may now only be inserted as a leaf object with - hwloc_topology_insert_misc_object() which deprecates - hwloc_topology_insert_misc_object_by_parent(). - + hwloc_topology_set_fsroot() is removed, the environment variable - HWLOC_FSROOT may be used for the same remote testing/debugging purpose. - + hwloc_type_sscanf() deprecates the old hwloc_obj_type_sscanf(). - + hwloc_type_sscanf_as_depth() is added to convert a type name into - a level depth. - + hwloc_type_name() deprecates the old hwloc_obj_type_string(). - + Remove the deprecated hwloc_obj_snprintf(), hwloc_obj_type_of_string(), - hwloc_distribute[v](). - + hwloc_obj_cpuset_snprintf() is deprecated in favor of hwloc_bitmap_snprintf(). + Functions diff_load_xml*(), diff_export_xml*() and diff_destroy() in hwloc/diff.h do not need a topology as first parameter anymore. + hwloc_parse_cpumap_file () superseded by hwloc_linux_read_path_as_cpumask() in hwloc/linux.h. + + HWLOC_MEMBIND_DEFAULT and HWLOC_MEMBIND_FIRSTTOUCH were clarified. +* New APIs and Features + + Add hwloc/shmem.h for sharing topologies between processes running on + the same machine (for reducing the memory footprint). + + Add the experimental netloc subproject. It is disabled by default + and can be enabled with --enable-netloc. + It currently brings command-line tools to gather and visualize the + topology of InfiniBand fabrics, and an API to convert such topologies + into Scotch architectures for process mapping. + See the documentation for details. +* Removed APIs and features + + Remove the online_cpuset from struct hwloc_obj. Offline PUs get unknown + topologies on Linux nowadays, and wrong topology on Solaris. Other OS + do not support them. And one cannot do much about them anyway. Just keep + them in complete_cpuset. + + Remove the now-unused "System" object type HWLOC_OBJ_SYSTEM, + defined to MACHINE for backward compatibility. + + The almost-unused "os_level" attribute has been removed from the + hwloc_obj structure. + + Remove the custom interface for assembling the topologies of different + nodes as well as the hwloc-assembler tools. + + hwloc_topology_set_fsroot() is removed, the environment variable + HWLOC_FSROOT may be used for the same remote testing/debugging purpose. + + Remove the deprecated hwloc_obj_snprintf(), hwloc_obj_type_of_string(), + hwloc_distribute[v](). + * Remove Myrinet Express interoperability (hwloc/myriexpress.h). + + Remove Kerrighed support from the Linux backend. + + Remove Tru64 (OSF/1) support. + - Remove HWLOC_MEMBIND_REPLICATE which wasn't available anywhere else. +* Backend improvements + + Linux + - OS devices do not have to be attached through PCI anymore, + for instance enabling the discovery of NVDIMM block devices. + - Remove the dependency on libnuma. + - Add a SectorSize attribute to block OS devices. + + Mac OS X + - Fix detection of cores and hyperthreads. + - Add CPUVendor, Model, ... attributes. + + Windows + - Add get_area_memlocation(). * Tools - - lstopo and hwloc-info have a new --filter option matching the new filtering API. - - hwloc-distances was removed and replaced with lstopo --distances. -* Plugin API - + hwloc_fill_object_sets() is renamed into hwloc_obj_add_children_sets(). + + lstopo and hwloc-info have a new --filter option matching the new filtering API. + + lstopo can be given --children-layout=plain to force a basic displaying + of memory and normal children together below their parent. + + hwloc-distances was removed and replaced with lstopo --distances. * Misc - + Linux OS devices do not have to be attached through PCI anymore, - for instance enabling the discovery of NVDIMM block devices. - + Add a SectorSize attribute to block OS devices on Linux. - + Misc MemoryModule objects are only added when full I/O discovery is enabled - (WHOLE_IO topology flag). - + Do not set PCI devices and bridges name automatically. Vendor and device - names are already in info attributes. - + Exporting to synthetic now ignores I/O and Misc objects. - + XML and Synthetic export functions have moved to hwloc/export.h, - automatically included from hwloc.h. - + Separate OS device discovery from PCI discovery. Only the latter is disabled - with --disable-pci at configure time. Both may be disabled with --disable-io. - + The old `libpci' component name from hwloc 1.6 is not supported anymore, - only the `pci' name from hwloc 1.7 is now recognized. - + The `linuxpci' component is now renamed into `linuxio'. - + The HWLOC_PCI___LOCALCPUS environment variables are superseded - with a single HWLOC_PCI_LOCALITY where bus ranges may be specified. - + Add HWLOC_SYNTHETIC environment variable to enforce a synthetic topology - as if hwloc_topology_set_synthetic() had been called. - + HWLOC_COMPONENTS doesn't support xml or synthetic component attributes - anymore, they should be passed in HWLOC_XMLFILE or HWLOC_SYNTHETIC instead. - + HWLOC_COMPONENTS takes precedence over other environment variables - for selecting components. - + Remove the dependency on libnuma on Linux. + + Exports + - Exporting to synthetic now ignores I/O and Misc objects. + + PCI discovery + - Separate OS device discovery from PCI discovery. Only the latter is disabled + with --disable-pci at configure time. Both may be disabled with --disable-io. + - The `linuxpci' component is now renamed into `linuxio'. + - The old `libpci' component name from hwloc 1.6 is not supported anymore, + only the `pci' name from hwloc 1.7 is now recognized. + - The HWLOC_PCI___LOCALCPUS environment variables are superseded + with a single HWLOC_PCI_LOCALITY where bus ranges may be specified. + - Do not set PCI devices and bridges name automatically. Vendor and device + names are already in info attributes. + + Components and discovery + - Add HWLOC_SYNTHETIC environment variable to enforce a synthetic topology + as if hwloc_topology_set_synthetic() had been called. + - HWLOC_COMPONENTS doesn't support xml or synthetic component attributes + anymore, they should be passed in HWLOC_XMLFILE or HWLOC_SYNTHETIC instead. + - HWLOC_COMPONENTS takes precedence over other environment variables + for selecting components. + + hwloc now requires a C99 compliant compiler. + + +Version 1.11.9 +-------------- +* Add support for Zhaoxin ZX-C and ZX-D processors in the x86 backend, + thanks to Jeff Zhao for the patch. +* Fix AMD Epyc 24-core L3 cache locality in the x86 backend. +* Don't crash in the x86 backend when the CPUID vendor string is unknown. +* Fix the missing pu discovery support bit on some OS. +* Fix the management of the lstopoStyle info attribute for custom colors. +* Add verbose warnings when failing to load hwloc v2.0+ XMLs. + + +Version 1.11.8 +-------------- +* Multiple Solaris improvements, thanks to Maureen Chew for the help: + + Detect caches on Sparc. + + Properly detect allowed/disallowed PUs and NUMA nodes with processor sets. + + Add hwloc_get_last_cpu_location() support for the current thread. +* Add support for CUDA compute capability 7.0 and fix support for 6.[12]. +* Tools improvements + + Fix search for objects by physical index in command-line tools. + + Add missing "cpubind:get_thisthread_last_cpu_location" in the output + of hwloc-info --support. + + Add --pid and --name to specify target processes in hwloc-ps. + + Display thread names in lstopo and hwloc-ps on Linux. +* Doc improvements + + Add a FAQ entry about building on Windows. + + Install missing sub-manpage for hwloc_obj_add_info() and + hwloc_obj_get_info_by_name(). Version 1.11.7 diff --git a/opal/mca/hwloc/hwloc2a/hwloc/README b/opal/mca/hwloc/hwloc201/hwloc/README similarity index 69% rename from opal/mca/hwloc/hwloc2a/hwloc/README rename to opal/mca/hwloc/hwloc201/hwloc/README index eadf3bc6a0..5567b4d14e 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/README +++ b/opal/mca/hwloc/hwloc201/hwloc/README @@ -11,12 +11,15 @@ platforms. hwloc is actually made of two subprojects distributed together: * The original hwloc project for describing the internals of computing nodes. - It is described in details between sections Hardware Locality (hwloc) - Introduction and Network Locality (netloc). + It is described in details starting at section Hardware Locality (hwloc) + Introduction. * The network-oriented companion called netloc (Network Locality), described - in details starting at section Network Locality (netloc). Netloc may be - disabled, but the original hwloc cannot. Both hwloc and netloc APIs are - documented after these sections. + in details starting with section Network Locality (netloc). + +See also the Related pages tab above for links to other sections. + +Netloc may be disabled, but the original hwloc cannot. Both hwloc and netloc +APIs are documented after these sections. Installation @@ -26,17 +29,9 @@ www.open-mpi.org/). Note that hwloc does not require any functionality from Open MPI -- it is a wholly separate (and much smaller!) project and code base. It just happens to be hosted as part of the overall Open MPI project. -Nightly development snapshots are available on the web site. Additionally, the -code can be directly cloned from Git: +Basic Installation -shell$ git clone https://github.com/open-mpi/hwloc.git -shell$ cd hwloc -shell$ ./autogen.sh - -Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are required -when building from a Git clone. - -Installation by itself is the fairly common GNU-based process: +Installation is the fairly common GNU-based process: shell$ ./configure --prefix=... shell$ make @@ -60,6 +55,31 @@ Running the "lstopo" tool is a good way to check as a graphical output whether hwloc properly detected the architecture of your node. Netloc command-line tools can be used to display the network topology interconnecting your nodes. +Installing from a Git clone + +Additionally, the code can be directly cloned from Git: + +shell$ git clone https://github.com/open-mpi/hwloc.git +shell$ cd hwloc +shell$ ./autogen.sh + +Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are required +when building from a Git clone. + +Nightly development snapshots are available on the web site, they can be +configured and built without any need for Git or GNU Autotools. + +Questions and Bugs + +Bugs should be reported in the tracker (https://github.com/open-mpi/hwloc/ +issues). Opening a new issue automatically displays lots of hints about how to +debug and report issues. + +Questions may be sent to the users or developers mailing lists (http:// +www.open-mpi.org/community/lists/hwloc.php). + +There is also a #hwloc IRC channel on Freenode (irc.freenode.net). + See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation. diff --git a/opal/mca/hwloc/hwloc2a/hwloc/VERSION b/opal/mca/hwloc/hwloc201/hwloc/VERSION similarity index 93% rename from opal/mca/hwloc/hwloc2a/hwloc/VERSION rename to opal/mca/hwloc/hwloc201/hwloc/VERSION index cb487e94a5..8794398f52 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/VERSION +++ b/opal/mca/hwloc/hwloc201/hwloc/VERSION @@ -9,7 +9,7 @@ major=2 minor=0 -release=0 +release=2 # greek is used for alpha or beta release tags. If it is non-empty, # it will be appended to the version number. It does not have to be @@ -18,7 +18,7 @@ release=0 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=a1 +greek=rc1 # The date when this release was created @@ -28,7 +28,7 @@ date="Unreleased developer copy" # entire hwloc version (i.e., ignore major, minor, release, and # greek). This is only set to 1 when making snapshot tarballs. snapshot=1 -snapshot_version=shmem-20170815.1857.git2478ce8 +snapshot_version=${major}.${minor}.${release}${greek}-git # The shared library version of hwloc's public library. This version # is maintained in accordance with the "Library Interface Versions" @@ -41,7 +41,7 @@ snapshot_version=shmem-20170815.1857.git2478ce8 # 2. Version numbers are described in the Libtool current:revision:age # format. -libhwloc_so_version=0:0:0 +libhwloc_so_version=15:0:0 libnetloc_so_version=0:0:0 # Please also update the lines in contrib/windows/libhwloc.vcxproj diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/distscript.sh b/opal/mca/hwloc/hwloc201/hwloc/config/distscript.sh similarity index 100% rename from opal/mca/hwloc/hwloc2a/hwloc/config/distscript.sh rename to opal/mca/hwloc/hwloc201/hwloc/config/distscript.sh diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc.m4 b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc.m4 similarity index 94% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc.m4 rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc.m4 index b086e7c79b..63bf11d6f5 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc.m4 +++ b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc.m4 @@ -1,6 +1,6 @@ dnl -*- Autoconf -*- dnl -dnl Copyright © 2009-2016 Inria. All rights reserved. +dnl Copyright © 2009-2018 Inria. All rights reserved. dnl Copyright © 2009-2012, 2015-2017 Université Bordeaux dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology @@ -12,6 +12,7 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright © 2006-2017 Cisco Systems, Inc. All rights reserved. dnl Copyright © 2012 Blue Brain Project, BBP/EPFL. All rights reserved. dnl Copyright © 2012 Oracle and/or its affiliates. All rights reserved. +dnl Copyright © 2012 Los Alamos National Security, LLC. All rights reserved. dnl See COPYING in top-level directory. # Main hwloc m4 macro, to be invoked by the user @@ -150,6 +151,14 @@ EOF]) [AC_DEFINE([HWLOC_SYM_TRANSFORM], [0])], [AC_DEFINE([HWLOC_SYM_TRANSFORM], [1])]) + # hwloc 2.0+ requires a C99 compliant compiler + AC_PROG_CC_C99 + # The result of AC_PROG_CC_C99 is stored in ac_cv_prog_cc_c99 + if test "x$ac_cv_prog_cc_c99" = xno ; then + AC_MSG_WARN([hwloc requires a C99 compiler]) + AC_MSG_ERROR([Aborting.]) + fi + # GCC specifics. if test "x$GCC" = "xyes"; then HWLOC_GCC_CFLAGS="-Wall -Wmissing-prototypes -Wundef" @@ -433,12 +442,12 @@ EOF]) [HWLOC_LIBS="-lpicl $HWLOC_LIBS"])]) AC_CHECK_DECLS([_SC_NPROCESSORS_ONLN, - _SC_NPROCESSORS_CONF, - _SC_NPROC_ONLN, - _SC_NPROC_CONF, - _SC_PAGESIZE, - _SC_PAGE_SIZE, - _SC_LARGE_PAGESIZE],,[:],[[#include ]]) + _SC_NPROCESSORS_CONF, + _SC_NPROC_ONLN, + _SC_NPROC_CONF, + _SC_PAGESIZE, + _SC_PAGE_SIZE, + _SC_LARGE_PAGESIZE],,[:],[[#include ]]) AC_HAVE_HEADERS([mach/mach_host.h]) AC_HAVE_HEADERS([mach/mach_init.h], [ @@ -471,27 +480,39 @@ EOF]) AC_CHECK_DECLS([_putenv], [], [], [AC_INCLUDES_DEFAULT]) # Could add mkdir and access for hwloc-gather-cpuid.c on Windows - # Do a full link test instead of just using AC_CHECK_FUNCS, which - # just checks to see if the symbol exists or not. For example, - # the prototype of sysctl uses u_int, which on some platforms - # (such as FreeBSD) is only defined under __BSD_VISIBLE, __USE_BSD - # or other similar definitions. So while the symbols "sysctl" and - # "sysctlbyname" might still be available in libc (which autoconf - # checks for), they might not be actually usable. - AC_TRY_LINK([ - #include - #include - #include - ], - [return sysctl(NULL,0,NULL,NULL,NULL,0);], - AC_DEFINE([HAVE_SYSCTL],[1],[Define to '1' if sysctl is present and usable])) - AC_TRY_LINK([ - #include - #include - #include - ], - [return sysctlbyname(NULL,NULL,NULL,NULL,0);], - AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable])) + if test "x$hwloc_linux" != "xyes" ; then + # Don't detect sysctl* on Linux because its sysctl() syscall is + # long deprecated and unneeded. Some libc still expose the symbol + # and raise a big warning at link time. + + # Do a full link test instead of just using AC_CHECK_FUNCS, which + # just checks to see if the symbol exists or not. For example, + # the prototype of sysctl uses u_int, which on some platforms + # (such as FreeBSD) is only defined under __BSD_VISIBLE, __USE_BSD + # or other similar definitions. So while the symbols "sysctl" and + # "sysctlbyname" might still be available in libc (which autoconf + # checks for), they might not be actually usable. + AC_MSG_CHECKING([for sysctl]) + AC_TRY_LINK([ + #include + #include + #include + ], + [return sysctl(NULL,0,NULL,NULL,NULL,0);], + [AC_DEFINE([HAVE_SYSCTL],[1],[Define to '1' if sysctl is present and usable]) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + AC_MSG_CHECKING([for sysctlbyname]) + AC_TRY_LINK([ + #include + #include + #include + ], + [return sysctlbyname(NULL,NULL,NULL,NULL,0);], + [AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable]) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + fi AC_CHECK_DECLS([getprogname], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_DECLS([getexecname], [], [], [AC_INCLUDES_DEFAULT]) @@ -537,6 +558,13 @@ EOF]) AC_DEFINE_UNQUOTED(hwloc_thread_t, $hwloc_thread_t, [Define this to the thread ID type]) fi + AC_CHECK_DECLS([sched_getcpu],,[:],[[ + #ifndef _GNU_SOURCE + # define _GNU_SOURCE + #endif + #include + ]]) + _HWLOC_CHECK_DECL([sched_setaffinity], [ AC_DEFINE([HWLOC_HAVE_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides a prototype of sched_setaffinity()]) AS_IF([test "$HWLOC_STRICT_ARGS_CFLAGS" = "FAIL"],[ @@ -748,24 +776,38 @@ EOF]) # OpenCL support hwloc_opencl_happy=no if test "x$enable_io" != xno && test "x$enable_opencl" != "xno"; then - hwloc_opencl_happy=yes + hwloc_opencl_happy=yes + case ${target} in + *-*-darwin*) + # On Darwin, only use the OpenCL framework + AC_CHECK_HEADERS([OpenCL/cl_ext.h], [ + AC_MSG_CHECKING([for the OpenCL framework]) + tmp_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -framework OpenCL" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ +#include + ]], [[ +return clGetDeviceIDs(0, 0, 0, NULL, NULL); + ]])], + [AC_MSG_RESULT(yes) + HWLOC_OPENCL_LDFLAGS="-framework OpenCL"], + [AC_MSG_RESULT(no) + hwloc_opencl_happy=no]) + LDFLAGS="$tmp_save_LDFLAGS" + ], [hwloc_opencl_happy=no]) + ;; + *) + # On Others, look for OpenCL at normal locations AC_CHECK_HEADERS([CL/cl_ext.h], [ AC_CHECK_LIB([OpenCL], [clGetDeviceIDs], [HWLOC_OPENCL_LIBS="-lOpenCL"], [hwloc_opencl_happy=no]) ], [hwloc_opencl_happy=no]) + ;; + esac fi + AC_SUBST(HWLOC_OPENCL_CFLAGS) AC_SUBST(HWLOC_OPENCL_LIBS) - # Check if required extensions are available - if test "x$hwloc_opencl_happy" = "xyes"; then - tmp_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $HWLOC_OPENCL_CFLAGS" - tmp_save_LIBS="$LIBS" - LIBS="$LIBS $HWLOC_OPENCL_LIBS" - AC_CHECK_DECLS([CL_DEVICE_TOPOLOGY_AMD],[hwloc_opencl_amd_happy=yes],[:],[[#include ]]) - CFLAGS="$tmp_save_CFLAGS" - LIBS="$tmp_save_LIBS" - # We can't do anything without CL_DEVICE_TOPOLOGY_AMD so far, so disable OpenCL entirely if not found - test "x$hwloc_opencl_amd_happy" != "xyes" && hwloc_opencl_happy=no - fi + AC_SUBST(HWLOC_OPENCL_LDFLAGS) # If we asked for opencl support but couldn't deliver, fail AS_IF([test "$enable_opencl" = "yes" -a "$hwloc_opencl_happy" = "no"], [AC_MSG_WARN([Specified --enable-opencl switch, but could not]) @@ -1085,6 +1127,7 @@ EOF]) HWLOC_REQUIRES="$HWLOC_PCIACCESS_REQUIRES $HWLOC_REQUIRES"]) AS_IF([test "$hwloc_opencl_component" = "static"], [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_OPENCL_LIBS" + HWLOC_LDFLAGS="$HWLOC_LDFLAGS $HWLOC_OPENCL_LDFLAGS" HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_OPENCL_CFLAGS" HWLOC_REQUIRES="$HWLOC_OPENCL_REQUIRES $HWLOC_REQUIRES"]) AS_IF([test "$hwloc_cuda_component" = "static"], @@ -1138,7 +1181,7 @@ EOF]) AC_CONFIG_FILES( hwloc_config_prefix[Makefile] hwloc_config_prefix[include/Makefile] - hwloc_config_prefix[hwloc/Makefile ] + hwloc_config_prefix[hwloc/Makefile] ) # Cleanup @@ -1178,8 +1221,6 @@ AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[ [test "x$hwloc_have_cuda" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_GL], [test "x$hwloc_have_gl" = "xyes"]) - AM_CONDITIONAL([HWLOC_HAVE_MYRIEXPRESS], - [test "x$hwloc_have_myriexpress" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_CUDART], [test "x$hwloc_have_cudart" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_LIBXML2], [test "$hwloc_libxml2_happy" = "yes"]) diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_attributes.m4 b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_attributes.m4 similarity index 99% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_attributes.m4 rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_attributes.m4 index 86444a950c..96348e819e 100644 --- a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_attributes.m4 +++ b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_attributes.m4 @@ -531,3 +531,4 @@ AC_DEFUN([_HWLOC_CHECK_ATTRIBUTES], [ AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_WEAK_ALIAS, [$hwloc_cv___attribute__weak_alias], [Whether your compiler has __attribute__ weak alias or not]) ]) + diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_vendor.m4 b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_vendor.m4 similarity index 100% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_vendor.m4 rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_vendor.m4 diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_visibility.m4 b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_visibility.m4 similarity index 100% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_check_visibility.m4 rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_visibility.m4 diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_components.m4 b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_components.m4 similarity index 100% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_components.m4 rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc_components.m4 diff --git a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_get_version.sh b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_get_version.sh similarity index 75% rename from opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_get_version.sh rename to opal/mca/hwloc/hwloc201/hwloc/config/hwloc_get_version.sh index 815385a828..74bca537ce 100755 --- a/opal/mca/hwloc/hwloc2a/hwloc/config/hwloc_get_version.sh +++ b/opal/mca/hwloc/hwloc201/hwloc/config/hwloc_get_version.sh @@ -29,24 +29,24 @@ else if test -f "$srcfile"; then ompi_vers=`sed -n " - t clear - : clear - s/^major/HWLOC_MAJOR_VERSION/ - s/^minor/HWLOC_MINOR_VERSION/ - s/^release/HWLOC_RELEASE_VERSION/ - s/^greek/HWLOC_GREEK_VERSION/ - s/\\\${major}/\\\${HWLOC_MAJOR_VERSION}/ - s/\\\${minor}/\\\${HWLOC_MINOR_VERSION}/ - s/\\\${release}/\\\${HWLOC_RELEASE_VERSION}/ - s/\\\${greek}/\\\${HWLOC_GREEK_VERSION}/ - s/^date/HWLOC_RELEASE_DATE/ - s/^snapshot_version/HWLOC_SNAPSHOT_VERSION/ - s/^snapshot/HWLOC_SNAPSHOT/ - t print - b - : print - p" < "$srcfile"` - eval "$ompi_vers" + t clear + : clear + s/^major/HWLOC_MAJOR_VERSION/ + s/^minor/HWLOC_MINOR_VERSION/ + s/^release/HWLOC_RELEASE_VERSION/ + s/^greek/HWLOC_GREEK_VERSION/ + s/\\\${major}/\\\${HWLOC_MAJOR_VERSION}/ + s/\\\${minor}/\\\${HWLOC_MINOR_VERSION}/ + s/\\\${release}/\\\${HWLOC_RELEASE_VERSION}/ + s/\\\${greek}/\\\${HWLOC_GREEK_VERSION}/ + s/^date/HWLOC_RELEASE_DATE/ + s/^snapshot_version/HWLOC_SNAPSHOT_VERSION/ + s/^snapshot/HWLOC_SNAPSHOT/ + t print + b + : print + p" < "$srcfile"` + eval "$ompi_vers" HWLOC_VERSION="$HWLOC_MAJOR_VERSION.$HWLOC_MINOR_VERSION.$HWLOC_RELEASE_VERSION${HWLOC_GREEK_VERSION}" @@ -62,14 +62,14 @@ else fi if test "$option" = ""; then - option="--version" + option="--version" fi fi case "$option" in --version) - echo $HWLOC_VERSION - ;; + echo $HWLOC_VERSION + ;; --release-date) echo $HWLOC_RELEASE_DATE ;; @@ -77,7 +77,7 @@ case "$option" in echo $HWLOC_SNAPSHOT ;; -h|--help) - cat <