int muxer_usage() { trace::println(); trace::println(_X("Microsoft .NET Core Shared Framework Host")); trace::println(); trace::println(_X(" Version : %s"), _STRINGIFY(HOST_FXR_PKG_VER)); trace::println(_X(" Build : %s"), _STRINGIFY(REPO_COMMIT_HASH)); trace::println(); trace::println(_X("Usage: dotnet [common-options] [[options] path-to-application]")); trace::println(); trace::println(_X("Common Options:")); trace::println(_X(" --help Display .NET Core Shared Framework Host help.")); trace::println(_X(" --version Display .NET Core Shared Framework Host version.")); trace::println(); trace::println(_X("Options:")); trace::println(_X(" --fx-version <version> Version of the installed Shared Framework to use to run the application.")); trace::println(_X(" --additionalprobingpath <path> Path containing probing policy and assemblies to probe for.")); trace::println(); trace::println(_X("Path to Application:")); trace::println(_X(" The path to a .NET Core managed application, dll or exe file to execute.")); trace::println(); trace::println(_X("If you are debugging the Shared Framework Host, set 'COREHOST_TRACE' to '1' in your environment.")); trace::println(); trace::println(_X("To get started on developing applications for .NET Core, install .NET SDK from:")); trace::println(_X(" %s"), s_dotnet_sdk_download_url); return StatusCode::InvalidArgFailure; }
/** * Given a directory and a version, find if the package relative * dir under the given directory contains hostpolicy.dll */ bool to_hostpolicy_package_dir(const pal::string_t& dir, const pal::string_t& version, pal::string_t* candidate) { assert(!version.empty()); candidate->clear(); // Ensure the relative dir contains platform directory separators. pal::string_t rel_dir = _STRINGIFY(HOST_POLICY_PKG_REL_DIR); if (DIR_SEPARATOR != '/') { replace_char(&rel_dir, '/', DIR_SEPARATOR); } // Construct the path to directory containing hostpolicy. pal::string_t path = dir; append_path(&path, _STRINGIFY(HOST_POLICY_PKG_NAME)); // package name append_path(&path, version.c_str()); // package version append_path(&path, rel_dir.c_str()); // relative dir containing hostpolicy library // Check if "path" contains the required library. if (!library_exists_in_dir(path, LIBHOSTPOLICY_NAME, nullptr)) { trace::verbose(_X("Did not find %s in directory %s"), LIBHOSTPOLICY_NAME, path.c_str()); return false; } // "path" contains the directory containing hostpolicy library. *candidate = path; trace::verbose(_X("Found %s in directory %s"), LIBHOSTPOLICY_NAME, path.c_str()); return true; }
bool hostpolicy_exists_in_svc(pal::string_t* resolved_dir) { pal::string_t svc_dir; if (!pal::getenv(_X("DOTNET_SERVICING"), &svc_dir)) { trace::verbose(_X("Servicing root doesn't exist")); return false; } pal::string_t rel_dir = _STRINGIFY(HOST_POLICY_PKG_REL_DIR); if (DIR_SEPARATOR != '/') { replace_char(&rel_dir, '/', DIR_SEPARATOR); } pal::string_t path = svc_dir; append_path(&path, _STRINGIFY(HOST_POLICY_PKG_NAME)); append_path(&path, _STRINGIFY(HOST_POLICY_PKG_VER)); append_path(&path, rel_dir.c_str()); append_path(&path, LIBHOSTPOLICY_NAME); if (!pal::realpath(&path)) { trace::verbose(_X("Servicing root ::realpath(%s) doesn't exist"), path.c_str()); return false; } if (library_exists_in_dir(path, LIBHOSTPOLICY_NAME, nullptr)) { resolved_dir->assign(path); trace::verbose(_X("[%s] exists in servicing [%s]"), LIBHOSTPOLICY_NAME, path.c_str()); return true; } trace::verbose(_X("[%s] doesn't exist in servicing [%s]"), LIBHOSTPOLICY_NAME, path.c_str()); return false; }
bool pal::load_library(const char_t* path, dll_t* dll) { // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: // In portable apps, coreclr would come from another directory than the host, // so make sure coreclr dependencies can be resolved from coreclr.dll load dir. *dll = ::LoadLibraryExW(path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (*dll == nullptr) { trace::error(_X("Failed to load the dll from [%s], HRESULT: 0x%X"), path, HRESULT_FROM_WIN32(GetLastError())); return false; } // Pin the module HMODULE dummy_module; if (!::GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, path, &dummy_module)) { trace::error(_X("Failed to pin library [%s] in [%s]"), path, _STRINGIFY(__FUNCTION__)); return false; } if (trace::is_enabled()) { pal::char_t buf[PATH_MAX]; ::GetModuleFileNameW(*dll, buf, PATH_MAX); trace::info(_X("Loaded library from %s"), buf); } return true; }
pal::string_t get_own_rid() { #if defined(TARGET_RUNTIME_ID) return _STRINGIFY(TARGET_RUNTIME_ID); #else #error "Cannot build the host without knowing host's root RID" #endif }
bool pal::touch_file(const pal::string_t& path) { int fd = open(path.c_str(), (O_CREAT | O_EXCL), (S_IRUSR | S_IRGRP | S_IROTH)); if (fd == -1) { trace::warning(_X("open(%s) failed in %s"), path.c_str(), _STRINGIFY(__FUNCTION__)); return false; } (void) close(fd); return true; }
SHARED_API int hostfxr_main_startupinfo(const int argc, const pal::char_t* argv[], const pal::char_t* host_path, const pal::char_t* dotnet_root, const pal::char_t* app_path) { trace::setup(); trace::info(_X("--- Invoked hostfxr v2 [commit hash: %s] main"), _STRINGIFY(REPO_COMMIT_HASH)); host_startup_info_t startup_info(host_path, dotnet_root, app_path); fx_muxer_t muxer; return muxer.execute(pal::string_t(), argc, argv, startup_info, nullptr, 0, nullptr); }
SHARED_API int hostfxr_main(const int argc, const pal::char_t* argv[]) { trace::setup(); trace::info(_X("--- Invoked hostfxr [commit hash: %s] main"), _STRINGIFY(REPO_COMMIT_HASH)); host_startup_info_t startup_info; startup_info.parse(argc, argv); fx_muxer_t muxer; return muxer.execute(pal::string_t(), argc, argv, startup_info, nullptr, 0, nullptr); }
SHARED_API int corehost_main(const int argc, const pal::char_t* argv[]) { if (trace::is_enabled()) { trace::info(_X("--- Invoked hostpolicy [commit hash: %s] [%s,%s,%s][%s] main = {"), _STRINGIFY(REPO_COMMIT_HASH), _STRINGIFY(HOST_POLICY_PKG_NAME), _STRINGIFY(HOST_POLICY_PKG_VER), _STRINGIFY(HOST_POLICY_PKG_REL_DIR), get_arch()); for (int i = 0; i < argc; ++i) { trace::info(_X("%s"), argv[i]); } trace::info(_X("}")); trace::info(_X("Deps file: %s"), g_init.deps_file.c_str()); for (const auto& probe : g_init.probe_paths) { trace::info(_X("Additional probe dir: %s"), probe.c_str()); } } // Take care of arguments arguments_t args; if (!parse_arguments(g_init, argc, argv, &args)) { return StatusCode::LibHostInvalidArgs; } if (trace::is_enabled()) { args.print(); } return run(args); }
// // Determines the directory location of the SDK accounting for // global.json and multi-level lookup policy. // // Invoked via MSBuild SDK resolver to locate SDK props and targets // from an msbuild other than the one bundled by the CLI. // // Parameters: // exe_dir // The main directory where SDKs are located in sdk\[version] // sub-folders. Pass the directory of a dotnet executable to // mimic how that executable would search in its own directory. // It is also valid to pass nullptr or empty, in which case // multi-level lookup can still search other locations if // it has not been disabled by the user's environment. // // working_dir // The directory where the search for global.json (which can // control the resolved SDK version) starts and proceeds // upwards. // // flags // Bitwise flags that influence resolution. // disallow_prerelease (0x1) // do not allow resolution to return a prerelease SDK version // unless prerelease version was specified via global.json. // // result // Callback invoked to return values. It can be invoked more // than once. String values passed are valid only for the // duration of a call. // // If resolution succeeds, result will be invoked with // resolved_sdk_dir key and the value will hold the // path to the resolved SDK director, otherwise it will // be null. // // If global.json is used then result will be invoked with // global_json_path key and the value will hold the path // to global.json. If there was no global.json found, // or the contents of global.json did not impact resolution // (e.g. no version specified), then result will not be // invoked with global_json_path key. // // Return value: // 0 on success, otherwise failure // 0x8000809b - SDK could not be resolved (SdkResolverResolveFailure) // // String encoding: // Windows - UTF-16 (pal::char_t is 2 byte wchar_t) // Unix - UTF-8 (pal::char_t is 1 byte char) // SHARED_API int32_t hostfxr_resolve_sdk2( const pal::char_t* exe_dir, const pal::char_t* working_dir, int32_t flags, hostfxr_resolve_sdk2_result_fn result) { trace::setup(); trace::info(_X("--- Invoked hostfxr [commit hash: %s] hostfxr_resolve_sdk2"), _STRINGIFY(REPO_COMMIT_HASH)); if (exe_dir == nullptr) { exe_dir = _X(""); } if (working_dir == nullptr) { working_dir = _X(""); } pal::string_t resolved_sdk_dir; pal::string_t global_json_path; bool success = sdk_resolver_t::resolve_sdk_dotnet_path( exe_dir, working_dir, &resolved_sdk_dir, (flags & hostfxr_resolve_sdk2_flags_t::disallow_prerelease) != 0, &global_json_path); if (success) { result( hostfxr_resolve_sdk2_result_key_t::resolved_sdk_dir, resolved_sdk_dir.c_str()); } if (!global_json_path.empty()) { result( hostfxr_resolve_sdk2_result_key_t::global_json_path, global_json_path.c_str()); } return success ? StatusCode::Success : StatusCode::SdkResolverResolveFailure; }
// [OBSOLETE] Replaced by hostfxr_resolve_sdk2 // // Determines the directory location of the SDK accounting for // global.json and multi-level lookup policy. // // Invoked via MSBuild SDK resolver to locate SDK props and targets // from an msbuild other than the one bundled by the CLI. // // Parameters: // exe_dir // The main directory where SDKs are located in sdk\[version] // sub-folders. Pass the directory of a dotnet executable to // mimic how that executable would search in its own directory. // It is also valid to pass nullptr or empty, in which case // multi-level lookup can still search other locations if // it has not been disabled by the user's environment. // // working_dir // The directory where the search for global.json (which can // control the resolved SDK version) starts and proceeds // upwards. // // buffer // The buffer where the resolved SDK path will be written. // // buffer_size // The size of the buffer argument in pal::char_t units. // // Return value: // <0 - Invalid argument // 0 - SDK could not be found. // >0 - The number of characters (including null terminator) // required to store the located SDK. // // If resolution succeeds and the positive return value is less than // or equal to buffer_size (i.e. the the buffer is large enough), // then the resolved SDK path is copied to the buffer and null // terminated. Otherwise, no data is written to the buffer. // // String encoding: // Windows - UTF-16 (pal::char_t is 2 byte wchar_t) // Unix - UTF-8 (pal::char_t is 1 byte char) // SHARED_API int32_t hostfxr_resolve_sdk( const pal::char_t* exe_dir, const pal::char_t* working_dir, pal::char_t buffer[], int32_t buffer_size) { trace::setup(); trace::info(_X("--- Invoked hostfxr [commit hash: %s] hostfxr_resolve_sdk"), _STRINGIFY(REPO_COMMIT_HASH)); if (buffer_size < 0 || (buffer_size > 0 && buffer == nullptr)) { trace::error(_X("hostfxr_resolve_sdk received an invalid argument.")); return -1; } if (exe_dir == nullptr) { exe_dir = _X(""); } if (working_dir == nullptr) { working_dir = _X(""); } pal::string_t cli_sdk; if (!sdk_resolver_t::resolve_sdk_dotnet_path(exe_dir, working_dir, &cli_sdk)) { // sdk_resolver_t::resolve_sdk_dotnet_path handles tracing for this error case. return 0; } if (cli_sdk.size() < buffer_size) { size_t length = cli_sdk.copy(buffer, buffer_size - 1); assert(length == cli_sdk.size()); assert(length < buffer_size); buffer[length] = 0; } else { trace::info(_X("hostfxr_resolve_sdk received a buffer that is too small to hold the located SDK path.")); } return cli_sdk.size() + 1; }
bool pal::load_library(const string_t* in_path, dll_t* dll) { string_t path = *in_path; // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: // In framework-dependent apps, coreclr would come from another directory than the host, // so make sure coreclr dependencies can be resolved from coreclr.dll load dir. if (LongFile::IsPathNotFullyQualified(path)) { if (!pal::realpath(&path)) { trace::error(_X("Failed to load the dll from [%s], HRESULT: 0x%X"), path.c_str(), HRESULT_FROM_WIN32(GetLastError())); return false; } } //Adding the assert to ensure relative paths which are not just filenames are not used for LoadLibrary Calls assert(!LongFile::IsPathNotFullyQualified(path) || !LongFile::ContainsDirectorySeparator(path)); *dll = ::LoadLibraryExW(path.c_str(), NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (*dll == nullptr) { trace::error(_X("Failed to load the dll from [%s], HRESULT: 0x%X"), path.c_str(), HRESULT_FROM_WIN32(GetLastError())); return false; } // Pin the module HMODULE dummy_module; if (!::GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, path.c_str(), &dummy_module)) { trace::error(_X("Failed to pin library [%s] in [%s]"), path.c_str(), _STRINGIFY(__FUNCTION__)); return false; } if (trace::is_enabled()) { string_t buf; GetModuleFileNameWrapper(*dll, &buf); trace::info(_X("Loaded library from %s"), buf.c_str()); } return true; }
/* * do_config * Accepts: * - want_all: boolean flag; TRUE -> display all options * FALSE -> display selected options * * This function displays all the options with which the current * installation of ompi was configured. There are many options here * that are carried forward from OMPI-7 and are not mca parameters * in OMPI-10. I have to dig through the invalid options and replace * them with OMPI-10 options. */ void ompi_info_do_config(bool want_all) { char *cxx; char *fortran_mpifh; char *fortran_usempi; char *fortran_usempif08; char *fortran_usempif08_compliance; char *fortran_have_ignore_tkr; char *fortran_have_f08_assumed_rank; char *fortran_build_f08_subarrays; char *fortran_have_optional_args; char *fortran_have_interface; char *fortran_have_iso_fortran_env; char *fortran_have_storage_size; char *fortran_have_bind_c; char *fortran_have_iso_c_binding; char *fortran_have_bind_c_sub; char *fortran_have_bind_c_type; char *fortran_have_bind_c_type_name; char *fortran_have_private; char *fortran_have_protected; char *fortran_have_abstract; char *fortran_have_asynchronous; char *fortran_have_procedure; char *fortran_have_use_only; char *fortran_have_c_funloc; char *fortran_08_using_wrappers_for_choice_buffer_functions; char *fortran_build_sizeof; char *java; char *heterogeneous; char *memprofile; char *memdebug; char *debug; char *mpi_interface_warning; char *cprofiling; char *cxxprofiling; char *fortran_mpifh_profiling; char *fortran_usempi_profiling; char *fortran_usempif08_profiling; char *cxxexceptions; char *threads; char *have_dl; #if OMPI_RTE_ORTE char *mpirun_prefix_by_default; #endif char *sparse_groups; char *wtime_support; char *symbol_visibility; char *ft_support; char *crdebug_support; char *topology_support; char *ipv6_support; /* Do a little preprocessor trickery here to figure opal_info_out the * tri-state of MPI_PARAM_CHECK (which will be either 0, 1, or * ompi_mpi_param_check). The preprocessor will only allow * comparisons against constants, so you'll get a warning if you * check MPI_PARAM_CHECK against 0 or 1, but its real value is the * char *ompi_mpi_param_check. So define ompi_mpi_param_check to * be a constant, and then all the preprocessor comparisons work * opal_info_out ok. Note that we chose the preprocessor * comparison ropal_info_oute because it is not sufficient to * simply set the variable ompi_mpi_param_check to a non-0/non-1 * value. This is because the compiler will generate a warning * that that C variable is unused when MPI_PARAM_CHECK is * hard-coded to 0 or 1. */ char *paramcheck; #define ompi_mpi_param_check 999 #if 0 == MPI_PARAM_CHECK paramcheck = "never"; #elif 1 == MPI_PARAM_CHECK paramcheck = "always"; #else paramcheck = "runtime"; #endif /* The current mpi_f08 implementation does not support Fortran subarrays. However, someday it may/will. Hence, I'm leaving in all the logic that checks to see whether subarrays are supported, but I'm just hard-coding OMPI_BUILD_FORTRAN_F08_SUBARRAYS to 0 (we used to have a prototype mpi_f08 module that implemented a handful of descriptor-based interfaces and supported subarrays, but that has been removed). */ const int OMPI_BUILD_FORTRAN_F08_SUBARRAYS = 0; /* setup the strings that don't require allocations*/ cxx = OMPI_BUILD_CXX_BINDINGS ? "yes" : "no"; if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPI_BINDINGS) { if (OMPI_FORTRAN_HAVE_IGNORE_TKR) { fortran_usempi = "yes (full: ignore TKR)"; } else { fortran_usempi = "yes (limited: overloading)"; } } else { fortran_usempi = "no"; } fortran_usempif08 = OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPIF08_BINDINGS ? "yes" : "no"; fortran_have_f08_assumed_rank = OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK ? "yes" : "no"; fortran_build_f08_subarrays = OMPI_BUILD_FORTRAN_F08_SUBARRAYS ? "yes" : "no"; fortran_have_optional_args = OMPI_FORTRAN_HAVE_OPTIONAL_ARGS ? "yes" : "no"; fortran_have_interface = OMPI_FORTRAN_HAVE_INTERFACE ? "yes" : "no"; fortran_have_iso_fortran_env = OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV ? "yes" : "no"; fortran_have_storage_size = OMPI_FORTRAN_HAVE_STORAGE_SIZE ? "yes" : "no"; fortran_have_bind_c = OMPI_FORTRAN_HAVE_BIND_C ? "yes" : "no"; fortran_have_iso_c_binding = OMPI_FORTRAN_HAVE_ISO_C_BINDING ? "yes" : "no"; fortran_have_bind_c_sub = OMPI_FORTRAN_HAVE_BIND_C_SUB ? "yes" : "no"; fortran_have_bind_c_type = OMPI_FORTRAN_HAVE_BIND_C_TYPE ? "yes" : "no"; fortran_have_bind_c_type_name = OMPI_FORTRAN_HAVE_BIND_C_TYPE_NAME ? "yes" : "no"; fortran_have_private = OMPI_FORTRAN_HAVE_PRIVATE ? "yes" : "no"; fortran_have_protected = OMPI_FORTRAN_HAVE_PROTECTED ? "yes" : "no"; fortran_have_abstract = OMPI_FORTRAN_HAVE_ABSTRACT ? "yes" : "no"; fortran_have_asynchronous = OMPI_FORTRAN_HAVE_ASYNCHRONOUS ? "yes" : "no"; fortran_have_procedure = OMPI_FORTRAN_HAVE_PROCEDURE ? "yes" : "no"; fortran_have_use_only = OMPI_FORTRAN_HAVE_USE_ONLY ? "yes" : "no"; fortran_have_c_funloc = OMPI_FORTRAN_HAVE_C_FUNLOC ? "yes" : "no"; fortran_08_using_wrappers_for_choice_buffer_functions = OMPI_FORTRAN_NEED_WRAPPER_ROUTINES ? "yes" : "no"; fortran_build_sizeof = OMPI_FORTRAN_BUILD_SIZEOF ? "yes" : "no"; /* Build a string describing what level of compliance the mpi_f08 module has */ char f08_msg[1024]; if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPIF08_BINDINGS) { /* Do we have everything? (not including PROTECTED, which isn't *needed* for the mpi_f08 module compliance -- it's just *nice to have*) */ if (OMPI_BUILD_FORTRAN_F08_SUBARRAYS && OMPI_FORTRAN_HAVE_PRIVATE && OMPI_FORTRAN_HAVE_ABSTRACT && OMPI_FORTRAN_HAVE_ASYNCHRONOUS && OMPI_FORTRAN_HAVE_PROCEDURE && OMPI_FORTRAN_HAVE_USE_ONLY && OMPI_FORTRAN_HAVE_C_FUNLOC && OMPI_FORTRAN_NEED_WRAPPER_ROUTINES) { fortran_usempif08_compliance = "The mpi_f08 module is available, and is fully compliant. w00t!"; } else { int first = 1; snprintf(f08_msg, sizeof(f08_msg), "The mpi_f08 module is available, but due to limitations in the %s compiler and/or Open MPI, does not support the following: ", OMPI_FC); if (!OMPI_BUILD_FORTRAN_F08_SUBARRAYS) { append(f08_msg, sizeof(f08_msg), &first, "array subsections"); } if (!OMPI_FORTRAN_HAVE_PRIVATE) { append(f08_msg, sizeof(f08_msg), &first, "private MPI_Status members"); } if (!OMPI_FORTRAN_HAVE_ABSTRACT) { append(f08_msg, sizeof(f08_msg), &first, "ABSTRACT INTERFACE function pointers"); } if (!OMPI_FORTRAN_HAVE_ASYNCHRONOUS) { append(f08_msg, sizeof(f08_msg), &first, "Fortran '08-specified ASYNCHRONOUS behavior"); } if (!OMPI_FORTRAN_HAVE_PROCEDURE) { append(f08_msg, sizeof(f08_msg), &first, "PROCEDUREs"); } if (!OMPI_FORTRAN_HAVE_USE_ONLY) { append(f08_msg, sizeof(f08_msg), &first, "USE_ONLY"); } if (!OMPI_FORTRAN_HAVE_C_FUNLOC) { append(f08_msg, sizeof(f08_msg), &first, "C_FUNLOCs"); } if (OMPI_FORTRAN_NEED_WRAPPER_ROUTINES) { append(f08_msg, sizeof(f08_msg), &first, "direct passthru (where possible) to underlying Open MPI's C functionality"); } fortran_usempif08_compliance = f08_msg; } } else { fortran_usempif08_compliance = "The mpi_f08 module was not built"; } java = OMPI_WANT_JAVA_BINDINGS ? "yes" : "no"; heterogeneous = OPAL_ENABLE_HETEROGENEOUS_SUPPORT ? "yes" : "no"; memprofile = OPAL_ENABLE_MEM_PROFILE ? "yes" : "no"; memdebug = OPAL_ENABLE_MEM_DEBUG ? "yes" : "no"; debug = OPAL_ENABLE_DEBUG ? "yes" : "no"; mpi_interface_warning = OMPI_WANT_MPI_INTERFACE_WARNING ? "yes" : "no"; cprofiling = "yes"; cxxprofiling = OMPI_BUILD_CXX_BINDINGS ? "yes" : "no"; cxxexceptions = (OMPI_BUILD_CXX_BINDINGS && OMPI_HAVE_CXX_EXCEPTION_SUPPORT) ? "yes" : "no"; fortran_mpifh_profiling = (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_MPIFH_BINDINGS) ? "yes" : "no"; fortran_usempi_profiling = (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPI_BINDINGS) ? "yes" : "no"; fortran_usempif08_profiling = (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPIF08_BINDINGS) ? "yes" : "no"; have_dl = OPAL_HAVE_DL_SUPPORT ? "yes" : "no"; #if OMPI_RTE_ORTE mpirun_prefix_by_default = ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT ? "yes" : "no"; #endif sparse_groups = OMPI_GROUP_SPARSE ? "yes" : "no"; wtime_support = OPAL_TIMER_USEC_NATIVE ? "native" : "gettimeofday"; symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no"; topology_support = "yes"; ipv6_support = OPAL_ENABLE_IPV6 ? "yes" : "no"; /* setup strings that require allocation */ if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_MPIFH_BINDINGS) { (void)asprintf(&fortran_mpifh, "yes (%s)", (OPAL_HAVE_WEAK_SYMBOLS ? "all" : (OMPI_FORTRAN_CAPS ? "caps" : (OMPI_FORTRAN_PLAIN ? "lower case" : (OMPI_FORTRAN_SINGLE_UNDERSCORE ? "single underscore" : "double underscore"))))); } else { fortran_mpifh = strdup("no"); } if (OMPI_FORTRAN_HAVE_IGNORE_TKR) { /* OMPI_FORTRAN_IGNORE_TKR_PREDECL is already in quotes; it didn't work consistently to put it in _STRINGIFY because sometimes the compiler would actually interpret the pragma in there before stringify-ing it. */ (void)asprintf(&fortran_have_ignore_tkr, "yes (%s)", OMPI_FORTRAN_IGNORE_TKR_PREDECL); } else { fortran_have_ignore_tkr = strdup("no"); } #if OMPI_RTE_ORTE (void)asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: yes, OPAL support: yes, OMPI progress: %s, ORTE progress: yes, Event lib: yes)", "posix", OPAL_ENABLE_PROGRESS_THREADS ? "yes" : "no"); #else (void)asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: yes, OPAL support: yes, OMPI progress: %s, Event lib: yes)", "posix", OPAL_ENABLE_PROGRESS_THREADS ? "yes" : "no"); #endif (void)asprintf(&ft_support, "%s (checkpoint thread: %s)", OPAL_ENABLE_FT ? "yes" : "no", OPAL_ENABLE_FT_THREAD ? "yes" : "no"); (void)asprintf(&crdebug_support, "%s", OPAL_ENABLE_CRDEBUG ? "yes" : "no"); /* output values */ opal_info_out("Configured by", "config:user", OPAL_CONFIGURE_USER); opal_info_out("Configured on", "config:timestamp", OPAL_CONFIGURE_DATE); opal_info_out("Configure host", "config:host", OPAL_CONFIGURE_HOST); opal_info_out("Configure command line", "config:cli", OPAL_CONFIGURE_CLI); opal_info_out("Built by", "build:user", OMPI_BUILD_USER); opal_info_out("Built on", "build:timestamp", OMPI_BUILD_DATE); opal_info_out("Built host", "build:host", OMPI_BUILD_HOST); opal_info_out("C bindings", "bindings:c", "yes"); opal_info_out("C++ bindings", "bindings:cxx", cxx); opal_info_out("Fort mpif.h", "bindings:mpif.h", fortran_mpifh); free(fortran_mpifh); opal_info_out("Fort use mpi", "bindings:use_mpi", fortran_usempi); opal_info_out("Fort use mpi size", "bindings:use_mpi:size", ompi_info_deprecated_value); opal_info_out("Fort use mpi_f08", "bindings:use_mpi_f08", fortran_usempif08); opal_info_out("Fort mpi_f08 compliance", "bindings:use_mpi_f08:compliance", fortran_usempif08_compliance); opal_info_out("Fort mpi_f08 subarrays", "bindings:use_mpi_f08:subarrays-supported", fortran_build_f08_subarrays); opal_info_out("Java bindings", "bindings:java", java); opal_info_out("Wrapper compiler rpath", "compiler:all:rpath", WRAPPER_RPATH_SUPPORT); opal_info_out("C compiler", "compiler:c:command", OPAL_CC); opal_info_out("C compiler absolute", "compiler:c:absolute", OPAL_CC_ABSOLUTE); opal_info_out("C compiler family name", "compiler:c:familyname", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME)); opal_info_out("C compiler version", "compiler:c:version", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR)); if (want_all) { opal_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char)); /* JMS: should be fixed in MPI-2.2 to differentiate between C _Bool and C++ bool. For the moment, the code base assumes that they are the same. Because of opal_config_bottom.h, we can sizeof(bool) here, so we might as well -- even though this technically isn't right. This should be fixed when we update to MPI-2.2. See below for note about C++ bool alignment. */ opal_info_out_int("C bool size", "compiler:c:sizeof:bool", sizeof(bool)); opal_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short)); opal_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int)); opal_info_out_int("C long size", "compiler:c:sizeof:long", sizeof(long)); opal_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float)); opal_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double)); opal_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *)); opal_info_out_int("C char align", "compiler:c:align:char", OPAL_ALIGNMENT_CHAR); #if OMPI_BUILD_CXX_BINDINGS /* JMS: See above for note about C++ bool size. We don't have the bool alignment the way configure currently runs -- need to clean this up when we update for MPI-2.2. */ opal_info_out_int("C bool align", "compiler:c:align:bool", OPAL_ALIGNMENT_CXX_BOOL); #else opal_info_out("C bool align", "compiler:c:align:bool", "skipped"); #endif opal_info_out_int("C int align", "compiler:c:align:int", OPAL_ALIGNMENT_INT); opal_info_out_int("C float align", "compiler:c:align:float", OPAL_ALIGNMENT_FLOAT); opal_info_out_int("C double align", "compiler:c:align:double", OPAL_ALIGNMENT_DOUBLE); } opal_info_out("C++ compiler", "compiler:cxx:command", OMPI_CXX); opal_info_out("C++ compiler absolute", "compiler:cxx:absolute", OMPI_CXX_ABSOLUTE); opal_info_out("Fort compiler", "compiler:fortran:command", OMPI_FC); opal_info_out("Fort compiler abs", "compiler:fortran:absolute", OMPI_FC_ABSOLUTE); opal_info_out("Fort ignore TKR", "compiler:fortran:ignore_tkr", fortran_have_ignore_tkr); free(fortran_have_ignore_tkr); opal_info_out("Fort 08 assumed shape", "compiler:fortran:f08_assumed_rank", fortran_have_f08_assumed_rank); opal_info_out("Fort optional args", "compiler:fortran:optional_arguments", fortran_have_optional_args); opal_info_out("Fort INTERFACE", "compiler:fortran:interface", fortran_have_interface); opal_info_out("Fort ISO_FORTRAN_ENV", "compiler:fortran:iso_fortran_env", fortran_have_iso_fortran_env); opal_info_out("Fort STORAGE_SIZE", "compiler:fortran:storage_size", fortran_have_storage_size); opal_info_out("Fort BIND(C) (all)", "compiler:fortran:bind_c", fortran_have_bind_c); opal_info_out("Fort ISO_C_BINDING", "compiler:fortran:iso_c_binding", fortran_have_iso_c_binding); opal_info_out("Fort SUBROUTINE BIND(C)", "compiler:fortran:subroutine_bind_c", fortran_have_bind_c_sub); opal_info_out("Fort TYPE,BIND(C)", "compiler:fortran:type_bind_c", fortran_have_bind_c_type); opal_info_out("Fort T,BIND(C,name=\"a\")", "compiler:fortran:type_name_bind_c", fortran_have_bind_c_type_name); opal_info_out("Fort PRIVATE", "compiler:fortran:private", fortran_have_private); opal_info_out("Fort PROTECTED", "compiler:fortran:protected", fortran_have_protected); opal_info_out("Fort ABSTRACT", "compiler:fortran:abstract", fortran_have_abstract); opal_info_out("Fort ASYNCHRONOUS", "compiler:fortran:asynchronous", fortran_have_asynchronous); opal_info_out("Fort PROCEDURE", "compiler:fortran:procedure", fortran_have_procedure); opal_info_out("Fort USE...ONLY", "compiler:fortran:use_only", fortran_have_use_only); opal_info_out("Fort C_FUNLOC", "compiler:fortran:c_funloc", fortran_have_c_funloc); opal_info_out("Fort f08 using wrappers", "compiler:fortran:08_wrappers", fortran_08_using_wrappers_for_choice_buffer_functions); opal_info_out("Fort MPI_SIZEOF", "compiler:fortran:mpi_sizeof", fortran_build_sizeof); if (want_all) { /* Will always have the size of Fortran integer */ opal_info_out_int("Fort integer size", "compiler:fortran:sizeof:integer", OMPI_SIZEOF_FORTRAN_INTEGER); opal_info_out_int("Fort logical size", "compiler:fortran:sizeof:logical", OMPI_SIZEOF_FORTRAN_LOGICAL); opal_info_out_int("Fort logical value true", "compiler:fortran:value:true", OMPI_FORTRAN_VALUE_TRUE); /* May or may not have the other Fortran sizes */ if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_MPIFH_BINDINGS) { opal_info_out("Fort have integer1", "compiler:fortran:have:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? "yes" : "no"); opal_info_out("Fort have integer2", "compiler:fortran:have:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? "yes" : "no"); opal_info_out("Fort have integer4", "compiler:fortran:have:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? "yes" : "no"); opal_info_out("Fort have integer8", "compiler:fortran:have:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? "yes" : "no"); opal_info_out("Fort have integer16", "compiler:fortran:have:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? "yes" : "no"); opal_info_out("Fort have real4", "compiler:fortran:have:real4", OMPI_HAVE_FORTRAN_REAL4 ? "yes" : "no"); opal_info_out("Fort have real8", "compiler:fortran:have:real8", OMPI_HAVE_FORTRAN_REAL8 ? "yes" : "no"); opal_info_out("Fort have real16", "compiler:fortran:have:real16", OMPI_HAVE_FORTRAN_REAL16 && OMPI_REAL16_MATCHES_C ? "yes" : "no"); opal_info_out("Fort have complex8", "compiler:fortran:have:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? "yes" : "no"); opal_info_out("Fort have complex16", "compiler:fortran:have:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? "yes" : "no"); opal_info_out("Fort have complex32", "compiler:fortran:have:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 && OMPI_REAL16_MATCHES_C ? "yes" : "no"); opal_info_out_int("Fort integer1 size", "compiler:fortran:sizeof:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? OMPI_SIZEOF_FORTRAN_INTEGER1 : -1); opal_info_out_int("Fort integer2 size", "compiler:fortran:sizeof:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? OMPI_SIZEOF_FORTRAN_INTEGER2 : -1); opal_info_out_int("Fort integer4 size", "compiler:fortran:sizeof:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? OMPI_SIZEOF_FORTRAN_INTEGER4 : -1); opal_info_out_int("Fort integer8 size", "compiler:fortran:sizeof:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? OMPI_SIZEOF_FORTRAN_INTEGER8 : -1); opal_info_out_int("Fort integer16 size", "compiler:fortran:sizeof:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? OMPI_SIZEOF_FORTRAN_INTEGER16 : -1); opal_info_out_int("Fort real size", "compiler:fortran:sizeof:real", OMPI_SIZEOF_FORTRAN_REAL); opal_info_out_int("Fort real4 size", "compiler:fortran:sizeof:real4", OMPI_HAVE_FORTRAN_REAL4 ? OMPI_SIZEOF_FORTRAN_REAL4 : -1); opal_info_out_int("Fort real8 size", "compiler:fortran:sizeof:real8", OMPI_HAVE_FORTRAN_REAL8 ? OMPI_SIZEOF_FORTRAN_REAL8 : -1); opal_info_out_int("Fort real16 size", "compiler:fortran:sizeof:real17", OMPI_HAVE_FORTRAN_REAL16 ? OMPI_SIZEOF_FORTRAN_REAL16 : -1); opal_info_out_int("Fort dbl prec size", "compiler:fortran:sizeof:double_precision", OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION); opal_info_out_int("Fort cplx size", "compiler:fortran:sizeof:complex", OMPI_SIZEOF_FORTRAN_COMPLEX); opal_info_out_int("Fort dbl cplx size", "compiler:fortran:sizeof:double_complex", OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_SIZEOF_FORTRAN_DOUBLE_COMPLEX : -1); opal_info_out_int("Fort cplx8 size", "compiler:fortran:sizeof:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_SIZEOF_FORTRAN_COMPLEX8 : -1); opal_info_out_int("Fort cplx16 size", "compiler:fortran:sizeof:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? OMPI_SIZEOF_FORTRAN_COMPLEX16 : -1); opal_info_out_int("Fort cplx32 size", "compiler:fortran:sizeof:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 ? OMPI_SIZEOF_FORTRAN_COMPLEX32 : -1); opal_info_out_int("Fort integer align", "compiler:fortran:align:integer", OMPI_ALIGNMENT_FORTRAN_INTEGER); opal_info_out_int("Fort integer1 align", "compiler:fortran:align:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? OMPI_ALIGNMENT_FORTRAN_INTEGER1 : -1); opal_info_out_int("Fort integer2 align", "compiler:fortran:align:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? OMPI_ALIGNMENT_FORTRAN_INTEGER2 : -1); opal_info_out_int("Fort integer4 align", "compiler:fortran:align:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? OMPI_ALIGNMENT_FORTRAN_INTEGER4 : -1); opal_info_out_int("Fort integer8 align", "compiler:fortran:align:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? OMPI_ALIGNMENT_FORTRAN_INTEGER8 : -1); opal_info_out_int("Fort integer16 align", "compiler:fortran:align:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? OMPI_ALIGNMENT_FORTRAN_INTEGER16 : -1); opal_info_out_int("Fort real align", "compiler:fortran:align:real", OMPI_ALIGNMENT_FORTRAN_REAL); opal_info_out_int("Fort real4 align", "compiler:fortran:align:real4", OMPI_HAVE_FORTRAN_REAL4 ? OMPI_ALIGNMENT_FORTRAN_REAL4 : -1); opal_info_out_int("Fort real8 align", "compiler:fortran:align:real8", OMPI_HAVE_FORTRAN_REAL8 ? OMPI_ALIGNMENT_FORTRAN_REAL8 : -1); opal_info_out_int("Fort real16 align", "compiler:fortran:align:real16", OMPI_HAVE_FORTRAN_REAL16 ? OMPI_ALIGNMENT_FORTRAN_REAL16 : -1); opal_info_out_int("Fort dbl prec align", "compiler:fortran:align:double_precision", OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION); opal_info_out_int("Fort cplx align", "compiler:fortran:align:complex", OMPI_ALIGNMENT_FORTRAN_COMPLEX); opal_info_out_int("Fort dbl cplx align", "compiler:fortran:align:double_complex", OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_ALIGNMENT_FORTRAN_DOUBLE_COMPLEX : -1); opal_info_out_int("Fort cplx8 align", "compiler:fortran:align:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX8 : -1); opal_info_out_int("Fort cplx16 align", "compiler:fortran:align:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX16 : -1); opal_info_out_int("Fort cplx32 align", "compiler:fortran:align:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX32 : -1); } else { opal_info_out("Fort real size", "compiler:fortran:sizeof:real", "skipped"); opal_info_out("Fort dbl prec size", "compiler:fortran:sizeof:double_precision", "skipped"); opal_info_out("Fort cplx size", "compiler:fortran:sizeof:complex", "skipped"); opal_info_out("Fort dbl cplx size", "compiler:fortran:sizeof:double_complex", "skipped"); opal_info_out("Fort integer align", "compiler:fortran:align:integer", "skipped"); opal_info_out("Fort real align", "compiler:fortran:align:real", "skipped"); opal_info_out("Fort dbl prec align", "compiler:fortran:align:double_precision","skipped"); opal_info_out("Fort cplx align", "compiler:fortran:align:complex", "skipped"); opal_info_out("Fort dbl cplx align", "compiler:fortran:align:double_complex", "skipped"); } } opal_info_out("C profiling", "option:profiling:c", cprofiling); opal_info_out("C++ profiling", "option:profiling:cxx", cxxprofiling); opal_info_out("Fort mpif.h profiling", "option:profiling:mpif.h", fortran_mpifh_profiling); opal_info_out("Fort use mpi profiling", "option:profiling:use_mpi", fortran_usempi_profiling); opal_info_out("Fort use mpi_f08 prof", "option:profiling:use_mpi_f08", fortran_usempif08_profiling); opal_info_out("C++ exceptions", "option:cxx_exceptions", cxxexceptions); opal_info_out("Thread support", "option:threads", threads); free(threads); opal_info_out("Sparse Groups", "option:sparse:groups", sparse_groups); if (want_all) { /* Don't display the build CPPFLAGS or CXXCPPFLAGS because they're * just -I$(top_srcdir)/include, etc. Hence, they're a) boring, * and c) specific for ompi_info. */ opal_info_out("Build CFLAGS", "option:build:cflags", OMPI_BUILD_CFLAGS); opal_info_out("Build CXXFLAGS", "option:build:cxxflags", OMPI_BUILD_CXXFLAGS); opal_info_out("Build FCFLAGS", "option:build:fcflags", OMPI_BUILD_FCFLAGS); opal_info_out("Build LDFLAGS", "option:build:ldflags", OMPI_BUILD_LDFLAGS); opal_info_out("Build LIBS", "option:build:libs", OMPI_BUILD_LIBS); opal_info_out("Wrapper extra CFLAGS", "option:wrapper:extra_cflags", WRAPPER_EXTRA_CFLAGS); opal_info_out("Wrapper extra CXXFLAGS", "option:wrapper:extra_cxxflags", WRAPPER_EXTRA_CXXFLAGS); opal_info_out("Wrapper extra FCFLAGS", "option:wrapper:extra_fcflags", WRAPPER_EXTRA_FCFLAGS); opal_info_out("Wrapper extra LDFLAGS", "option:wrapper:extra_ldflags", WRAPPER_EXTRA_LDFLAGS); opal_info_out("Wrapper extra LIBS", "option:wrapper:extra_libs", WRAPPER_EXTRA_LIBS); } opal_info_out("Internal debug support", "option:debug", debug); opal_info_out("MPI interface warnings", "option:mpi-interface-warning", mpi_interface_warning); opal_info_out("MPI parameter check", "option:mpi-param-check", paramcheck); opal_info_out("Memory profiling support", "option:mem-profile", memprofile); opal_info_out("Memory debugging support", "option:mem-debug", memdebug); opal_info_out("dl support", "option:dlopen", have_dl); opal_info_out("Heterogeneous support", "options:heterogeneous", heterogeneous); #if OMPI_RTE_ORTE opal_info_out("mpirun default --prefix", "mpirun:prefix_by_default", mpirun_prefix_by_default); #endif opal_info_out("MPI_WTIME support", "options:mpi-wtime", wtime_support); opal_info_out("Symbol vis. support", "options:visibility", symbol_visibility); opal_info_out("Host topology support", "options:host-topology", topology_support); opal_info_out("IPv6 support", "options:ipv6", ipv6_support); opal_info_out("MPI extensions", "options:mpi_ext", OMPI_MPIEXT_COMPONENTS); opal_info_out("FT Checkpoint support", "options:ft_support", ft_support); free(ft_support); opal_info_out("C/R Enabled Debugging", "options:crdebug_support", crdebug_support); free(crdebug_support); opal_info_out_int("MPI_MAX_PROCESSOR_NAME", "options:mpi-max-processor-name", MPI_MAX_PROCESSOR_NAME); opal_info_out_int("MPI_MAX_ERROR_STRING", "options:mpi-max-error-string", MPI_MAX_ERROR_STRING); opal_info_out_int("MPI_MAX_OBJECT_NAME", "options:mpi-max-object-name", MPI_MAX_OBJECT_NAME); opal_info_out_int("MPI_MAX_INFO_KEY", "options:mpi-max-info-key", MPI_MAX_INFO_KEY); opal_info_out_int("MPI_MAX_INFO_VAL", "options:mpi-max-info-val", MPI_MAX_INFO_VAL); opal_info_out_int("MPI_MAX_PORT_NAME", "options:mpi-max-port-name", MPI_MAX_PORT_NAME); opal_info_out_int("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string", MPI_MAX_DATAREP_STRING); }
gasneti_handler_fn_t gasnetc_handler[GASNETC_MAX_NUMHANDLERS]; /* shadow handler table */ #endif /* GASNETC_MAX_NUMHANDLERS */ #if GASNET_TRACE extern void gasnetc_enteringHandler_hook(amudp_category_t cat, int isReq, int handlerId, void *token, void *buf, size_t nbytes, int numargs, uint32_t *args); extern void gasnetc_leavingHandler_hook(amudp_category_t cat, int isReq); #endif #if defined(GASNET_CSPAWN_CMD) #define GASNETC_DEFAULT_SPAWNFN C GASNETI_IDENT(gasnetc_IdentString_Default_CSpawnCommand, "$GASNetCSpawnCommand: " GASNET_CSPAWN_CMD " $"); #else /* AMUDP implicit ssh startup */ #define GASNETC_DEFAULT_SPAWNFN S #endif GASNETI_IDENT(gasnetc_IdentString_DefaultSpawnFn, "$GASNetDefaultSpawnFunction: " _STRINGIFY(GASNETC_DEFAULT_SPAWNFN) " $"); /* ------------------------------------------------------------------------------------ */ /* Initialization ============== */ /* called at startup to check configuration sanity */ static void gasnetc_check_config(void) { gasneti_check_config_preinit(); gasneti_assert(GASNET_MAXNODES <= AMUDP_MAX_SPMDPROCS); gasneti_assert(AMUDP_MAX_NUMHANDLERS >= 256); gasneti_assert(AMUDP_MAX_SEGLENGTH == (uintptr_t)-1); gasneti_assert(GASNET_ERR_NOT_INIT == AM_ERR_NOT_INIT);
static int gasnetc_init(int *argc, char ***argv) { int retval = GASNET_OK; /* check system sanity */ gasnetc_check_config(); /* --------- begin Master code ------------ */ if (!AMUDP_SPMDIsWorker(argv?*argv:NULL)) { /* assume we're an implicit master (we don't currently support explicit workers spawned without using the AMUDP SPMD API) */ int num_nodes; int i; char spawnfn; amudp_spawnfn_t fp = (amudp_spawnfn_t)NULL; if (!argv) { gasneti_fatalerror("implicit-master without argv not supported - use amudprun"); } /* pretend we're node 0, for purposes of verbose env reporting */ gasneti_init_done = 1; gasneti_mynode = 0; #if defined(GASNET_CSPAWN_CMD) { /* set configure default cspawn cmd */ const char *cmd = gasneti_getenv_withdefault("GASNET_CSPAWN_CMD",GASNET_CSPAWN_CMD); gasneti_setenv("GASNET_CSPAWN_CMD",cmd); } #endif /* parse node count from command line */ if (*argc < 2) { fprintf(stderr, "GASNet: Missing parallel node count\n"); fprintf(stderr, "GASNet: Specify node count as first argument, or use upcrun/tcrun spawner script to start job\n"); fprintf(stderr, "GASNet: Usage '%s <num_nodes> {program arguments}'\n", (*argv)[0]); exit(-1); } /* * argv[1] is number of nodes; argv[0] is program name; argv is * list of arguments including program name and number of nodes. * We need to remove argv[1] when the argument array is passed * to the tic_main(). */ num_nodes = atoi((*argv)[1]); if (num_nodes < 1) { fprintf (stderr, "GASNet: Invalid number of nodes: %s\n", (*argv)[1]); fprintf (stderr, "GASNet: Usage '%s <num_nodes> {program arguments}'\n", (*argv)[0]); exit (1); } /* remove the num_nodes argument */ for (i = 1; i < (*argc)-1; i++) { (*argv)[i] = (*argv)[i+1]; } (*argv)[(*argc)-1] = NULL; (*argc)--; /* get spawnfn */ spawnfn = *gasneti_getenv_withdefault("GASNET_SPAWNFN", _STRINGIFY(GASNETC_DEFAULT_SPAWNFN)); { /* ensure we pass the effective spawnfn to worker env */ char spawnstr[2]; spawnstr[0] = toupper(spawnfn); spawnstr[1] = '\0'; gasneti_setenv("GASNET_SPAWNFN",spawnstr); } /* ensure reliable localhost operation by forcing use of 127.0.0.1 * setting GASNET_MASTERIP to the empty string will prevent this */ if (('L' == toupper(spawnfn)) && !gasneti_getenv("GASNET_MASTERIP")) { gasneti_setenv("GASNET_MASTERIP","127.0.0.1"); } for (i=0; AMUDP_Spawnfn_Desc[i].abbrev; i++) { if (toupper(spawnfn) == toupper(AMUDP_Spawnfn_Desc[i].abbrev)) { fp = AMUDP_Spawnfn_Desc[i].fnptr; break; } } if (!fp) { fprintf (stderr, "GASNet: Invalid spawn function specified in GASNET_SPAWNFN\n"); fprintf (stderr, "GASNet: The following mechanisms are available:\n"); for (i=0; AMUDP_Spawnfn_Desc[i].abbrev; i++) { fprintf(stderr, " '%c' %s\n", toupper(AMUDP_Spawnfn_Desc[i].abbrev), AMUDP_Spawnfn_Desc[i].desc); } exit(1); } #if GASNET_DEBUG_VERBOSE /* note - can't call trace macros during gasnet_init because trace system not yet initialized */ fprintf(stderr,"gasnetc_init(): about to spawn...\n"); fflush(stderr); #endif retval = AMUDP_SPMDStartup(argc, argv, num_nodes, 0, fp, NULL, &gasnetc_bundle, &gasnetc_endpoint); /* master startup should never return */ gasneti_fatalerror("master AMUDP_SPMDStartup() failed"); } /* --------- begin Worker code ------------ */ AMLOCK(); if (gasneti_init_done) INITERR(NOT_INIT, "GASNet already initialized"); gasneti_freezeForDebugger(); AMUDP_VerboseErrors = gasneti_VerboseErrors; AMUDP_SPMDkillmyprocess = gasneti_killmyprocess; /* perform job spawn */ retval = AMUDP_SPMDStartup(argc, argv, 0, 0, NULL, /* dummies */ &gasnetc_networkpid, &gasnetc_bundle, &gasnetc_endpoint); if (retval != AM_OK) INITERR(RESOURCE, "slave AMUDP_SPMDStartup() failed"); gasneti_init_done = 1; /* enable early to allow tracing */ gasneti_conduit_getenv = (/* cast drops const */ gasneti_getenv_fn_t*)&AMUDP_SPMDgetenvMaster; gasneti_mynode = AMUDP_SPMDMyProc(); gasneti_nodes = AMUDP_SPMDNumProcs(); /* enable tracing */ gasneti_trace_init(argc, argv); GASNETI_AM_SAFE(AMUDP_SPMDSetExitCallback(gasnetc_traceoutput)); /* for local spawn, assume we want to wait-block */ if (gasneti_getenv("GASNET_SPAWNFN") && *gasneti_getenv("GASNET_SPAWNFN") == 'L') { GASNETI_TRACE_PRINTF(C,("setting gasnet_set_waitmode(GASNET_WAIT_BLOCK) for localhost spawn")); gasnet_set_waitmode(GASNET_WAIT_BLOCK); } #if GASNET_DEBUG_VERBOSE fprintf(stderr,"gasnetc_init(): spawn successful - node %i/%i starting...\n", gasneti_mynode, gasneti_nodes); fflush(stderr); #endif gasneti_nodemapInit(&gasnetc_bootstrapExchange, NULL, 0, 0); #if GASNET_PSHM gasneti_pshm_init(&gasnetc_bootstrapSNodeBroadcast, 0); #endif #if GASNET_SEGMENT_FAST || GASNET_SEGMENT_LARGE { uintptr_t limit; #if HAVE_MMAP limit = gasneti_mmapLimit((uintptr_t)-1, (uint64_t)-1, &gasnetc_bootstrapExchange, &gasnetc_bootstrapBarrier); #else limit = (intptr_t)-1; #endif gasneti_segmentInit(limit, &gasnetc_bootstrapExchange); } #elif GASNET_SEGMENT_EVERYTHING /* segment is everything - nothing to do */ #else #error Bad segment config #endif #if GASNET_BLCR gasneti_checkpoint_guid = gasnetc_networkpid; gasneti_checkpoint_init(NULL); #endif AMUNLOCK(); gasneti_auxseg_init(); /* adjust max seg values based on auxseg */ gasneti_assert(retval == GASNET_OK); return retval; done: /* error return while locked */ AMUNLOCK(); GASNETI_RETURN(retval); }
// // Returns the list of all available SDKs ordered by ascending version. // // Invoked by MSBuild resolver when the latest SDK used without global.json // present is incompatible with the current MSBuild version. It will select // the compatible SDK that is closest to the end of this list. // // Parameters: // exe_dir // The path to the dotnet executable. // // result // Callback invoke to return the list of SDKs by their directory paths. // String array and its elements are valid for the duration of the call. // // Return value: // 0 on success, otherwise failure // // String encoding: // Windows - UTF-16 (pal::char_t is 2 byte wchar_t) // Unix - UTF-8 (pal::char_t is 1 byte char) // SHARED_API int32_t hostfxr_get_available_sdks( const pal::char_t* exe_dir, hostfxr_get_available_sdks_result_fn result) { trace::setup(); trace::info(_X("--- Invoked hostfxr [commit hash: %s] hostfxr_get_available_sdks"), _STRINGIFY(REPO_COMMIT_HASH)); if (exe_dir == nullptr) { exe_dir = _X(""); } std::vector<sdk_info> sdk_infos; sdk_info::get_all_sdk_infos(exe_dir, &sdk_infos); if (sdk_infos.empty()) { result(0, nullptr); } else { std::vector<const pal::char_t*> sdk_dirs; sdk_dirs.reserve(sdk_infos.size()); for (const auto& sdk_info : sdk_infos) { sdk_dirs.push_back(sdk_info.full_path.c_str()); } result(sdk_dirs.size(), &sdk_dirs[0]); } return StatusCode::Success; }
// // Returns the native directories of the runtime based upon // the specified app. // // Returned format is a list of paths separated by PATH_SEPARATOR // which is a semicolon (;) on Windows and a colon (:) otherwise. // The returned string is null-terminated. // // Invoked from ASP.NET in order to help load a native assembly // before the clr is initialized (through a custom host). // // Parameters: // argc // The number of argv arguments // // argv // The standard arguments normally passed to dotnet.exe // for launching the application. // // buffer // The buffer where the native paths and null terminator // will be written. // // buffer_size // The size of the buffer argument in pal::char_t units. // // required_buffer_size // If the return value is HostApiBufferTooSmall, then // required_buffer_size is set to the minimium buffer // size necessary to contain the result including the // null terminator. // // Return value: // 0 on success, otherwise failure // 0x800080980 - Buffer is too small (HostApiBufferTooSmall) // // String encoding: // Windows - UTF-16 (pal::char_t is 2 byte wchar_t) // Unix - UTF-8 (pal::char_t is 1 byte char) // SHARED_API int32_t hostfxr_get_native_search_directories(const int argc, const pal::char_t* argv[], pal::char_t buffer[], int32_t buffer_size, int32_t* required_buffer_size) { trace::setup(); trace::info(_X("--- Invoked hostfxr_get_native_search_directories [commit hash: %s] main"), _STRINGIFY(REPO_COMMIT_HASH)); if (buffer_size < 0 || (buffer_size > 0 && buffer == nullptr) || required_buffer_size == nullptr) { trace::error(_X("hostfxr_get_native_search_directories received an invalid argument.")); return InvalidArgFailure; } host_startup_info_t startup_info; startup_info.parse(argc, argv); fx_muxer_t muxer; int rc = muxer.execute(_X("get-native-search-directories"), argc, argv, startup_info, buffer, buffer_size, required_buffer_size); return rc; }
"$GASNetConfig: (pgen.o) " GASNET_CONFIG_STRING " $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_UPCRConfig_obj, "$UPCRConfig: (pgen.o) " UPCR_CONFIG_STRING UPCRI_THREADCONFIG_STR " $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_translator, "$UPCTranslator: (pgen.o) /usr/local/upc/2.22.0/translator/install/targ (aphid) $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_upcver, "$UPCVersion: (pgen.o) 2.22.0 $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_compileline, "$UPCCompileLine: (pgen.o) /usr/local/upc/2.22.0/runtime/inst/bin/upcc.pl --at-remote-http -translator=/usr/local/upc/2.22.0/translator/install/targ --arch-size=64 --network=smp --pthreads 2 --lines --trans --sizes-file=upcc-sizes pgen.i $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_compiletime, "$UPCCompileTime: (pgen.o) " __DATE__ " " __TIME__ " $"); #ifndef UPCRI_CC /* ensure backward compatilibity for http netcompile */ #define UPCRI_CC <unknown> #endif GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_backendcompiler, "$UPCRBackendCompiler: (pgen.o) " _STRINGIFY(UPCRI_CC) " $"); #ifdef GASNETT_CONFIGURE_MISMATCH GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_configuremismatch, "$UPCRConfigureMismatch: (pgen.o) 1 $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_configuredcompiler, "$UPCRConfigureCompiler: (pgen.o) " GASNETT_PLATFORM_COMPILER_IDSTR " $"); GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_buildcompiler, "$UPCRBuildCompiler: (pgen.o) " PLATFORM_COMPILER_IDSTR " $"); #endif /**************************************************************************/ GASNETT_IDENT(UPCRI_IdentString_pgen_o_1459047607_transver_2, "$UPCTranslatorVersion: (pgen.o) 2.22.0, built on Oct 27 2015 at 17:48:24, host aphid linux-x86_64/64, gcc v4.2.4 (Ubuntu 4.2.4-1ubuntu4) $"); GASNETT_IDENT(UPCRI_IdentString_INIT_pgen_6953898206118,"$UPCRInitFn: (pgen.trans.c) UPCRI_INIT_pgen_6953898206118 $"); GASNETT_IDENT(UPCRI_IdentString_ALLOC_pgen_6953898206118,"$UPCRAllocFn: (pgen.trans.c) UPCRI_ALLOC_pgen_6953898206118 $");
} MEDIUM_HANDLER(gasnete_vis_pcthunk_reqh,1,1, (token,addr,nbytes, a0), (token,addr,nbytes, a0)); /*---------------------------------------------------------------------------------*/ #define GASNETI_GASNET_REFVIS_C 1 #include "vis/gasnet_vector.c" #include "vis/gasnet_indexed.c" #define GASNETE_STRIDED_VERSION 2.0 #include "vis/gasnet_strided.c" GASNETI_IDENT(gasneti_IdentString_StridedVersion, "$GASNetStridedVersion: " _STRINGIFY(GASNETE_STRIDED_VERSION)" $"); GASNETI_IDENT(gasneti_IdentString_StridedLoopDims, "$GASNetStridedLoopingDims: "_STRINGIFY(GASNETE_LOOPING_DIMS)" $"); GASNETI_IDENT(gasneti_IdentString_StridedDirDims, "$GASNetStridedDirectDims: " _STRINGIFY(GASNETE_DIRECT_DIMS)" $"); #if GASNETE_USE_AMPIPELINE GASNETI_IDENT(gasneti_IdentString_VISNPAM, "$GASNetVISNPAM: " _STRINGIFY(GASNETE_VIS_NPAM)" $"); #endif GASNETI_IDENT(gasneti_IdentString_VISMinPackBuf, "$GASNetVISMinPackBuffer: " _STRINGIFY(GASNETE_VIS_MIN_PACKBUFFER)" $"); #undef GASNETI_GASNET_REFVIS_C /*---------------------------------------------------------------------------------*/ /* *** Progress Function *** */ /*---------------------------------------------------------------------------------*/ gasnete_vis_epdata_t gasnete_vis_epdata_THUNK; /* signal a visop dummy eop/iop, unlink it and free it */
int run(const arguments_t& args) { // Load the deps resolver deps_resolver_t resolver(g_init, args); pal::string_t resolver_errors; if (!resolver.valid(&resolver_errors)) { trace::error(_X("Error initializing the dependency resolver: %s"), resolver_errors.c_str()); return StatusCode::ResolverInitFailure; } // Setup breadcrumbs pal::string_t policy_name = _STRINGIFY(HOST_POLICY_PKG_NAME); pal::string_t policy_version = _STRINGIFY(HOST_POLICY_PKG_VER); // Always insert the hostpolicy that the code is running on. std::unordered_set<pal::string_t> breadcrumbs; breadcrumbs.insert(policy_name); breadcrumbs.insert(policy_name + _X(",") + policy_version); probe_paths_t probe_paths; if (!resolver.resolve_probe_paths(&probe_paths, &breadcrumbs)) { return StatusCode::ResolverResolveFailure; } pal::string_t clr_path = probe_paths.coreclr; if (clr_path.empty() || !pal::realpath(&clr_path)) { trace::error(_X("Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment variable to 1"));; return StatusCode::CoreClrResolveFailure; } pal::string_t clrjit_path = probe_paths.clrjit; if (clrjit_path.empty()) { trace::warning(_X("Could not resolve CLRJit path")); } else if (pal::realpath(&clrjit_path)) { trace::verbose(_X("The resolved JIT path is '%s'"), clrjit_path.c_str()); } else { clrjit_path.clear(); trace::warning(_X("Could not resolve symlink to CLRJit path '%s'"), probe_paths.clrjit.c_str()); } // Build CoreCLR properties std::vector<const char*> property_keys = { "TRUSTED_PLATFORM_ASSEMBLIES", "NATIVE_DLL_SEARCH_DIRECTORIES", "PLATFORM_RESOURCE_ROOTS", "AppDomainCompatSwitch", // Workaround: mscorlib does not resolve symlinks for AppContext.BaseDirectory dotnet/coreclr/issues/2128 "APP_CONTEXT_BASE_DIRECTORY", "APP_CONTEXT_DEPS_FILES", "FX_DEPS_FILE" }; // Note: these variables' lifetime should be longer than coreclr_initialize. std::vector<char> tpa_paths_cstr, app_base_cstr, native_dirs_cstr, resources_dirs_cstr, fx_deps, deps, clrjit_path_cstr; pal::pal_clrstring(probe_paths.tpa, &tpa_paths_cstr); pal::pal_clrstring(args.app_dir, &app_base_cstr); pal::pal_clrstring(probe_paths.native, &native_dirs_cstr); pal::pal_clrstring(probe_paths.resources, &resources_dirs_cstr); pal::pal_clrstring(resolver.get_fx_deps_file(), &fx_deps); pal::pal_clrstring(resolver.get_deps_file() + _X(";") + resolver.get_fx_deps_file(), &deps); std::vector<const char*> property_values = { // TRUSTED_PLATFORM_ASSEMBLIES tpa_paths_cstr.data(), // NATIVE_DLL_SEARCH_DIRECTORIES native_dirs_cstr.data(), // PLATFORM_RESOURCE_ROOTS resources_dirs_cstr.data(), // AppDomainCompatSwitch "UseLatestBehaviorWhenTFMNotSpecified", // APP_CONTEXT_BASE_DIRECTORY app_base_cstr.data(), // APP_CONTEXT_DEPS_FILES, deps.data(), // FX_DEPS_FILE fx_deps.data() }; if (!clrjit_path.empty()) { pal::pal_clrstring(clrjit_path, &clrjit_path_cstr); property_keys.push_back("JIT_PATH"); property_values.push_back(clrjit_path_cstr.data()); } bool set_app_paths = false; // Runtime options config properties. for (int i = 0; i < g_init.cfg_keys.size(); ++i) { // Provide opt-in compatible behavior by using the switch to set APP_PATHS if (pal::cstrcasecmp(g_init.cfg_keys[i].data(), "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths") == 0) { set_app_paths = (pal::cstrcasecmp(g_init.cfg_values[i].data(), "true") == 0); } property_keys.push_back(g_init.cfg_keys[i].data()); property_values.push_back(g_init.cfg_values[i].data()); } // App paths and App NI paths if (set_app_paths) { property_keys.push_back("APP_PATHS"); property_keys.push_back("APP_NI_PATHS"); property_values.push_back(app_base_cstr.data()); property_values.push_back(app_base_cstr.data()); } size_t property_size = property_keys.size(); assert(property_keys.size() == property_values.size()); // Add API sets to the process DLL search pal::setup_api_sets(resolver.get_api_sets()); // Bind CoreCLR pal::string_t clr_dir = get_directory(clr_path); trace::verbose(_X("CoreCLR path = '%s', CoreCLR dir = '%s'"), clr_path.c_str(), clr_dir.c_str()); if (!coreclr::bind(clr_dir)) { trace::error(_X("Failed to bind to CoreCLR at '%s'"), clr_path.c_str()); return StatusCode::CoreClrBindFailure; } // Verbose logging if (trace::is_enabled()) { for (size_t i = 0; i < property_size; ++i) { pal::string_t key, val; pal::clr_palstring(property_keys[i], &key); pal::clr_palstring(property_values[i], &val); trace::verbose(_X("Property %s = %s"), key.c_str(), val.c_str()); } } std::vector<char> own_path; pal::pal_clrstring(args.own_path, &own_path); // Initialize CoreCLR coreclr::host_handle_t host_handle; coreclr::domain_id_t domain_id; auto hr = coreclr::initialize( own_path.data(), "clrhost", property_keys.data(), property_values.data(), property_size, &host_handle, &domain_id); if (!SUCCEEDED(hr)) { trace::error(_X("Failed to initialize CoreCLR, HRESULT: 0x%X"), hr); return StatusCode::CoreClrInitFailure; } // Initialize clr strings for arguments std::vector<std::vector<char>> argv_strs(args.app_argc); std::vector<const char*> argv(args.app_argc); for (int i = 0; i < args.app_argc; i++) { pal::pal_clrstring(args.app_argv[i], &argv_strs[i]); argv[i] = argv_strs[i].data(); } if (trace::is_enabled()) { pal::string_t arg_str; for (int i = 0; i < argv.size(); i++) { pal::string_t cur; pal::clr_palstring(argv[i], &cur); arg_str.append(cur); arg_str.append(_X(",")); } trace::info(_X("Launch host: %s, app: %s, argc: %d, args: %s"), args.own_path.c_str(), args.managed_application.c_str(), args.app_argc, arg_str.c_str()); } std::vector<char> managed_app; pal::pal_clrstring(args.managed_application, &managed_app); // Leave breadcrumbs for servicing. breadcrumb_writer_t writer(&breadcrumbs); writer.begin_write(); // Previous hostpolicy trace messages must be printed before executing assembly trace::flush(); // Execute the application unsigned int exit_code = 1; hr = coreclr::execute_assembly( host_handle, domain_id, argv.size(), argv.data(), managed_app.data(), &exit_code); if (!SUCCEEDED(hr)) { trace::error(_X("Failed to execute managed app, HRESULT: 0x%X"), hr); return StatusCode::CoreClrExeFailure; } // Shut down the CoreCLR hr = coreclr::shutdown(host_handle, domain_id); if (!SUCCEEDED(hr)) { trace::warning(_X("Failed to shut down CoreCLR, HRESULT: 0x%X"), hr); } coreclr::unload(); // Finish breadcrumb writing writer.end_write(); return exit_code; }
#include <sqlite3.h> #include <string.h> #include <glib.h> #include <xmms/xmms_config.h> #include <xmmspriv/xmms_statfs.h> #include <xmmspriv/xmms_utils.h> #include <xmmspriv/xmms_collection.h> #include <xmmsc/xmmsc_idnumbers.h> /* increment this whenever there are incompatible db structure changes */ #define DB_VERSION 36 #define _STRINGIFY(x) #x const char set_version_stm[] = "PRAGMA user_version=" _STRINGIFY(DB_VERSION); /* Tables and unique constraints */ const char *tables[] = { /* Media */ "CREATE TABLE Media (id INTEGER, key, value, source INTEGER, " "intval INTEGER DEFAULT NULL)", /* Media unique constraint */ "CREATE UNIQUE INDEX key_idx ON Media (id, key, source)", /* Sources */ "CREATE TABLE Sources (id INTEGER PRIMARY KEY AUTOINCREMENT, source)", /* CollectionAttributes */ "CREATE TABLE CollectionAttributes (collid INTEGER, key TEXT, value TEXT)", /* CollectionAttributes unique constraint */
/* * do_config * Accepts: * - want_all: boolean flag; TRUE -> display all options * FALSE -> display selected options * * This function displays all the options with which the current * installation of ompi was configured. There are many options here * that are carried forward from OMPI-7 and are not mca parameters * in OMPI-10. I have to dig through the invalid options and replace * them with OMPI-10 options. */ void ompi_info_do_config(bool want_all) { char *cxx; char *f77; char *f90; char *f90_size; char *heterogeneous; char *memprofile; char *memdebug; char *debug; char *mpi_interface_warning; char *cprofiling; char *cxxprofiling; char *f77profiling; char *f90profiling; char *cxxexceptions; char *threads; char *want_libltdl; char *mpirun_prefix_by_default; char *sparse_groups; char *have_mpi_io; char *wtime_support; char *symbol_visibility; char *ft_support; char *topology_support; char *vt_support; /* Do a little preprocessor trickery here to figure ompi_info_out the * tri-state of MPI_PARAM_CHECK (which will be either 0, 1, or * ompi_mpi_param_check). The preprocessor will only allow * comparisons against constants, so you'll get a warning if you * check MPI_PARAM_CHECK against 0 or 1, but its real value is the * char *ompi_mpi_param_check. So define ompi_mpi_param_check to * be a constant, and then all the preprocessor comparisons work ompi_info_out * ok. Note that we chose the preprocessor comparison rompi_info_oute because * it is not sufficient to simply set the variable * ompi_mpi_param_check to a non-0/non-1 value. This is because the * compiler will generate a warning that that C variable is unused * when MPI_PARAM_CHECK is hard-coded to 0 or 1. */ char *paramcheck; #define ompi_mpi_param_check 999 #if 0 == MPI_PARAM_CHECK paramcheck = "never"; #elif 1 == MPI_PARAM_CHECK paramcheck = "always"; #else paramcheck = "runtime"; #endif /* setup the strings that don't require allocations*/ cxx = OMPI_WANT_CXX_BINDINGS ? "yes" : "no"; f90 = OMPI_WANT_F90_BINDINGS ? "yes" : "no"; f90_size = OMPI_F90_BUILD_SIZE; heterogeneous = OPAL_ENABLE_HETEROGENEOUS_SUPPORT ? "yes" : "no"; memprofile = OPAL_ENABLE_MEM_PROFILE ? "yes" : "no"; memdebug = OPAL_ENABLE_MEM_DEBUG ? "yes" : "no"; debug = OPAL_ENABLE_DEBUG ? "yes" : "no"; mpi_interface_warning = OMPI_WANT_MPI_INTERFACE_WARNING ? "yes" : "no"; cprofiling = OMPI_ENABLE_MPI_PROFILING ? "yes" : "no"; cxxprofiling = (OMPI_WANT_CXX_BINDINGS && OMPI_ENABLE_MPI_PROFILING) ? "yes" : "no"; cxxexceptions = (OMPI_WANT_CXX_BINDINGS && OMPI_HAVE_CXX_EXCEPTION_SUPPORT) ? "yes" : "no"; f77profiling = (OMPI_ENABLE_MPI_PROFILING && OMPI_WANT_F77_BINDINGS) ? "yes" : "no"; f90profiling = (OMPI_ENABLE_MPI_PROFILING && OMPI_WANT_F90_BINDINGS) ? "yes" : "no"; want_libltdl = OPAL_WANT_LIBLTDL ? "yes" : "no"; mpirun_prefix_by_default = ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT ? "yes" : "no"; sparse_groups = OMPI_GROUP_SPARSE ? "yes" : "no"; have_mpi_io = OMPI_PROVIDE_MPI_FILE_INTERFACE ? "yes" : "no"; wtime_support = OPAL_TIMER_USEC_NATIVE ? "native" : "gettimeofday"; symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no"; topology_support = OPAL_HAVE_HWLOC ? "yes" : "no"; vt_support = OMPI_ENABLE_CONTRIB_vt ? "yes" : "no"; /* setup strings that require allocation */ if (OMPI_WANT_F77_BINDINGS) { asprintf(&f77, "yes (%s)", (OPAL_HAVE_WEAK_SYMBOLS ? "all" : (OMPI_F77_CAPS ? "caps" : (OMPI_F77_PLAIN ? "lower case" : (OMPI_F77_SINGLE_UNDERSCORE ? "single underscore" : "double underscore"))))); } else { f77 = strdup("no"); } if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: %s, progress: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), OMPI_ENABLE_THREAD_MULTIPLE ? "yes" : "no", OPAL_ENABLE_PROGRESS_THREADS ? "yes" : "no"); } else { threads = strdup("no"); } asprintf(&ft_support, "%s (checkpoint thread: %s)", OPAL_ENABLE_FT ? "yes" : "no", OPAL_ENABLE_FT_THREAD ? "yes" : "no");; /* output values */ ompi_info_out("Configured by", "config:user", OMPI_CONFIGURE_USER); ompi_info_out("Configured on", "config:timestamp", OMPI_CONFIGURE_DATE); ompi_info_out("Configure host", "config:host", OMPI_CONFIGURE_HOST); ompi_info_out("Built by", "build:user", OMPI_BUILD_USER); ompi_info_out("Built on", "build:timestamp", OMPI_BUILD_DATE); ompi_info_out("Built host", "build:host", OMPI_BUILD_HOST); ompi_info_out("C bindings", "bindings:c", "yes"); ompi_info_out("C++ bindings", "bindings:cxx", cxx); ompi_info_out("Fortran77 bindings", "bindings:f77", f77); free(f77); ompi_info_out("Fortran90 bindings", "bindings:f90", f90); ompi_info_out("Fortran90 bindings size", "bindings:f90:size", OMPI_WANT_F90_BINDINGS ? f90_size : "na"); ompi_info_out("C compiler", "compiler:c:command", OPAL_CC); ompi_info_out("C compiler absolute", "compiler:c:absolute", OPAL_CC_ABSOLUTE); ompi_info_out("C compiler family name", "compiler:c:familyname", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME)); ompi_info_out("C compiler version", "compiler:c:version", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR)); if (want_all) { ompi_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char)); /* JMS: should be fixed in MPI-2.2 to differentiate between C _Bool and C++ bool. For the moment, the code base assumes that they are the same. Because of opal_config_bottom.h, we can sizeof(bool) here, so we might as well -- even though this technically isn't right. This should be fixed when we update to MPI-2.2. See below for note about C++ bool alignment. */ ompi_info_out_int("C bool size", "compiler:c:sizeof:bool", sizeof(bool)); ompi_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short)); ompi_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int)); ompi_info_out_int("C long size", "compiler:c:sizeof:long", sizeof(long)); ompi_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float)); ompi_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double)); ompi_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *)); ompi_info_out_int("C char align", "compiler:c:align:char", OPAL_ALIGNMENT_CHAR); #if OMPI_WANT_CXX_BINDINGS /* JMS: See above for note about C++ bool size. We don't have the bool alignment the way configure currently runs -- need to clean this up when we update for MPI-2.2. */ ompi_info_out_int("C bool align", "compiler:c:align:bool", OPAL_ALIGNMENT_CXX_BOOL); #else ompi_info_out("C bool align", "compiler:c:align:bool", "skipped"); #endif ompi_info_out_int("C int align", "compiler:c:align:int", OPAL_ALIGNMENT_INT); ompi_info_out_int("C float align", "compiler:c:align:float", OPAL_ALIGNMENT_FLOAT); ompi_info_out_int("C double align", "compiler:c:align:double", OPAL_ALIGNMENT_DOUBLE); } ompi_info_out("C++ compiler", "compiler:cxx:command", OMPI_CXX); ompi_info_out("C++ compiler absolute", "compiler:cxx:absolute", OMPI_CXX_ABSOLUTE); ompi_info_out("Fortran77 compiler", "compiler:f77:command", OMPI_F77); ompi_info_out("Fortran77 compiler abs", "compiler:f77:absolute", OMPI_F77_ABSOLUTE); ompi_info_out("Fortran90 compiler", "compiler:f90:command", OMPI_F90); ompi_info_out("Fortran90 compiler abs", "compiler:f90:absolute", OMPI_F90_ABSOLUTE); if (want_all) { /* Will always have the size of Fortran integer */ ompi_info_out_int("Fort integer size", "compiler:fortran:sizeof:integer", OMPI_SIZEOF_FORTRAN_INTEGER); ompi_info_out_int("Fort logical size", "compiler:fortran:sizeof:logical", OMPI_SIZEOF_FORTRAN_LOGICAL); ompi_info_out_int("Fort logical value true", "compiler:fortran:value:true", OMPI_FORTRAN_VALUE_TRUE); /* May or may not have the other Fortran sizes */ if (OMPI_WANT_F77_BINDINGS || OMPI_WANT_F90_BINDINGS) { ompi_info_out("Fort have integer1", "compiler:fortran:have:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? "yes" : "no"); ompi_info_out("Fort have integer2", "compiler:fortran:have:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? "yes" : "no"); ompi_info_out("Fort have integer4", "compiler:fortran:have:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? "yes" : "no"); ompi_info_out("Fort have integer8", "compiler:fortran:have:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? "yes" : "no"); ompi_info_out("Fort have integer16", "compiler:fortran:have:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? "yes" : "no"); ompi_info_out("Fort have real4", "compiler:fortran:have:real4", OMPI_HAVE_FORTRAN_REAL4 ? "yes" : "no"); ompi_info_out("Fort have real8", "compiler:fortran:have:real8", OMPI_HAVE_FORTRAN_REAL8 ? "yes" : "no"); ompi_info_out("Fort have real16", "compiler:fortran:have:real16", OMPI_HAVE_FORTRAN_REAL16 && OMPI_REAL16_MATCHES_C ? "yes" : "no"); ompi_info_out("Fort have complex8", "compiler:fortran:have:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? "yes" : "no"); ompi_info_out("Fort have complex16", "compiler:fortran:have:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? "yes" : "no"); ompi_info_out("Fort have complex32", "compiler:fortran:have:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 && OMPI_REAL16_MATCHES_C ? "yes" : "no"); ompi_info_out_int("Fort integer1 size", "compiler:fortran:sizeof:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? OMPI_SIZEOF_FORTRAN_INTEGER1 : -1); ompi_info_out_int("Fort integer2 size", "compiler:fortran:sizeof:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? OMPI_SIZEOF_FORTRAN_INTEGER2 : -1); ompi_info_out_int("Fort integer4 size", "compiler:fortran:sizeof:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? OMPI_SIZEOF_FORTRAN_INTEGER4 : -1); ompi_info_out_int("Fort integer8 size", "compiler:fortran:sizeof:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? OMPI_SIZEOF_FORTRAN_INTEGER8 : -1); ompi_info_out_int("Fort integer16 size", "compiler:fortran:sizeof:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? OMPI_SIZEOF_FORTRAN_INTEGER16 : -1); ompi_info_out_int("Fort real size", "compiler:fortran:sizeof:real", OMPI_SIZEOF_FORTRAN_REAL); ompi_info_out_int("Fort real4 size", "compiler:fortran:sizeof:real4", OMPI_HAVE_FORTRAN_REAL4 ? OMPI_SIZEOF_FORTRAN_REAL4 : -1); ompi_info_out_int("Fort real8 size", "compiler:fortran:sizeof:real8", OMPI_HAVE_FORTRAN_REAL8 ? OMPI_SIZEOF_FORTRAN_REAL8 : -1); ompi_info_out_int("Fort real16 size", "compiler:fortran:sizeof:real17", OMPI_HAVE_FORTRAN_REAL16 ? OMPI_SIZEOF_FORTRAN_REAL16 : -1); ompi_info_out_int("Fort dbl prec size", "compiler:fortran:sizeof:double_precision", OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION); ompi_info_out_int("Fort cplx size", "compiler:fortran:sizeof:complex", OMPI_SIZEOF_FORTRAN_COMPLEX); ompi_info_out_int("Fort dbl cplx size", "compiler:fortran:sizeof:double_complex", OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_SIZEOF_FORTRAN_DOUBLE_COMPLEX : -1); ompi_info_out_int("Fort cplx8 size", "compiler:fortran:sizeof:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_SIZEOF_FORTRAN_COMPLEX8 : -1); ompi_info_out_int("Fort cplx16 size", "compiler:fortran:sizeof:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? OMPI_SIZEOF_FORTRAN_COMPLEX16 : -1); ompi_info_out_int("Fort cplx32 size", "compiler:fortran:sizeof:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 ? OMPI_SIZEOF_FORTRAN_COMPLEX32 : -1); ompi_info_out_int("Fort integer align", "compiler:fortran:align:integer", OMPI_ALIGNMENT_FORTRAN_INTEGER); ompi_info_out_int("Fort integer1 align", "compiler:fortran:align:integer1", OMPI_HAVE_FORTRAN_INTEGER1 ? OMPI_ALIGNMENT_FORTRAN_INTEGER1 : -1); ompi_info_out_int("Fort integer2 align", "compiler:fortran:align:integer2", OMPI_HAVE_FORTRAN_INTEGER2 ? OMPI_ALIGNMENT_FORTRAN_INTEGER2 : -1); ompi_info_out_int("Fort integer4 align", "compiler:fortran:align:integer4", OMPI_HAVE_FORTRAN_INTEGER4 ? OMPI_ALIGNMENT_FORTRAN_INTEGER4 : -1); ompi_info_out_int("Fort integer8 align", "compiler:fortran:align:integer8", OMPI_HAVE_FORTRAN_INTEGER8 ? OMPI_ALIGNMENT_FORTRAN_INTEGER8 : -1); ompi_info_out_int("Fort integer16 align", "compiler:fortran:align:integer16", OMPI_HAVE_FORTRAN_INTEGER16 ? OMPI_ALIGNMENT_FORTRAN_INTEGER16 : -1); ompi_info_out_int("Fort real align", "compiler:fortran:align:real", OMPI_ALIGNMENT_FORTRAN_REAL); ompi_info_out_int("Fort real4 align", "compiler:fortran:align:real4", OMPI_HAVE_FORTRAN_REAL4 ? OMPI_ALIGNMENT_FORTRAN_REAL4 : -1); ompi_info_out_int("Fort real8 align", "compiler:fortran:align:real8", OMPI_HAVE_FORTRAN_REAL8 ? OMPI_ALIGNMENT_FORTRAN_REAL8 : -1); ompi_info_out_int("Fort real16 align", "compiler:fortran:align:real16", OMPI_HAVE_FORTRAN_REAL16 ? OMPI_ALIGNMENT_FORTRAN_REAL16 : -1); ompi_info_out_int("Fort dbl prec align", "compiler:fortran:align:double_precision", OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION); ompi_info_out_int("Fort cplx align", "compiler:fortran:align:complex", OMPI_ALIGNMENT_FORTRAN_COMPLEX); ompi_info_out_int("Fort dbl cplx align", "compiler:fortran:align:double_complex", OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX ? OMPI_ALIGNMENT_FORTRAN_DOUBLE_COMPLEX : -1); ompi_info_out_int("Fort cplx8 align", "compiler:fortran:align:complex8", OMPI_HAVE_FORTRAN_COMPLEX8 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX8 : -1); ompi_info_out_int("Fort cplx16 align", "compiler:fortran:align:complex16", OMPI_HAVE_FORTRAN_COMPLEX16 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX16 : -1); ompi_info_out_int("Fort cplx32 align", "compiler:fortran:align:complex32", OMPI_HAVE_FORTRAN_COMPLEX32 ? OMPI_ALIGNMENT_FORTRAN_COMPLEX32 : -1); } else { ompi_info_out("Fort real size", "compiler:fortran:sizeof:real", "skipped"); ompi_info_out("Fort dbl prec size", "compiler:fortran:sizeof:double_precision", "skipped"); ompi_info_out("Fort cplx size", "compiler:fortran:sizeof:complex", "skipped"); ompi_info_out("Fort dbl cplx size", "compiler:fortran:sizeof:double_complex", "skipped"); ompi_info_out("Fort integer align", "compiler:fortran:align:integer", "skipped"); ompi_info_out("Fort real align", "compiler:fortran:align:real", "skipped"); ompi_info_out("Fort dbl prec align", "compiler:fortran:align:double_precision","skipped"); ompi_info_out("Fort cplx align", "compiler:fortran:align:complex", "skipped"); ompi_info_out("Fort dbl cplx align", "compiler:fortran:align:double_complex", "skipped"); } } ompi_info_out("C profiling", "option:profiling:c", cprofiling); ompi_info_out("C++ profiling", "option:profiling:cxx", cxxprofiling); ompi_info_out("Fortran77 profiling", "option:profiling:f77", f77profiling); ompi_info_out("Fortran90 profiling", "option:profiling:f90", f90profiling); ompi_info_out("C++ exceptions", "option:cxx_exceptions", cxxexceptions); ompi_info_out("Thread support", "option:threads", threads); free(threads); ompi_info_out("Sparse Groups", "option:sparse:groups", sparse_groups); if (want_all) { /* Don't display the build CPPFLAGS or CXXCPPFLAGS because they're * just -I$(top_srcdir)/include, etc. Hence, they're a) boring, * and c) specific for ompi_info. */ ompi_info_out("Build CFLAGS", "option:build:cflags", OMPI_BUILD_CFLAGS); ompi_info_out("Build CXXFLAGS", "option:build:cxxflags", OMPI_BUILD_CXXFLAGS); ompi_info_out("Build FFLAGS", "option:build:fflags", OMPI_BUILD_FFLAGS); ompi_info_out("Build FCFLAGS", "option:build:fcflags", OMPI_BUILD_FCFLAGS); ompi_info_out("Build LDFLAGS", "option:build:ldflags", OMPI_BUILD_LDFLAGS); ompi_info_out("Build LIBS", "option:build:libs", OMPI_BUILD_LIBS); ompi_info_out("Wrapper extra CFLAGS", "option:wrapper:extra_cflags", WRAPPER_EXTRA_CFLAGS); ompi_info_out("Wrapper extra CXXFLAGS", "option:wrapper:extra_cxxflags", WRAPPER_EXTRA_CXXFLAGS); ompi_info_out("Wrapper extra FFLAGS", "option:wrapper:extra_fflags", WRAPPER_EXTRA_FFLAGS); ompi_info_out("Wrapper extra FCFLAGS", "option:wrapper:extra_fcflags", WRAPPER_EXTRA_FCFLAGS); ompi_info_out("Wrapper extra LDFLAGS", "option:wrapper:extra_ldflags", WRAPPER_EXTRA_LDFLAGS); ompi_info_out("Wrapper extra LIBS", "option:wrapper:extra_libs", WRAPPER_EXTRA_LIBS); } ompi_info_out("Internal debug support", "option:debug", debug); ompi_info_out("MPI interface warnings", "option:mpi-interface-warning", mpi_interface_warning); ompi_info_out("MPI parameter check", "option:mpi-param-check", paramcheck); ompi_info_out("Memory profiling support", "option:mem-profile", memprofile); ompi_info_out("Memory debugging support", "option:mem-debug", memdebug); ompi_info_out("libltdl support", "option:dlopen", want_libltdl); ompi_info_out("Heterogeneous support", "options:heterogeneous", heterogeneous); ompi_info_out("mpirun default --prefix", "mpirun:prefix_by_default", mpirun_prefix_by_default); ompi_info_out("MPI I/O support", "options:mpi-io", have_mpi_io); ompi_info_out("MPI_WTIME support", "options:mpi-wtime", wtime_support); ompi_info_out("Symbol vis. support", "options:visibility", symbol_visibility); ompi_info_out("Host topology support", "options:host-topology", topology_support); ompi_info_out("MPI extensions", "options:mpi_ext", OMPI_EXT_COMPONENTS); ompi_info_out("FT Checkpoint support", "options:ft_support", ft_support); free(ft_support); ompi_info_out("VampirTrace support", "options:vt", vt_support); ompi_info_out_int("MPI_MAX_PROCESSOR_NAME", "options:mpi-max-processor-name", MPI_MAX_PROCESSOR_NAME); ompi_info_out_int("MPI_MAX_ERROR_STRING", "options:mpi-max-error-string", MPI_MAX_ERROR_STRING); ompi_info_out_int("MPI_MAX_OBJECT_NAME", "options:mpi-max-object-name", MPI_MAX_OBJECT_NAME); ompi_info_out_int("MPI_MAX_INFO_KEY", "options:mpi-max-info-key", MPI_MAX_INFO_KEY); ompi_info_out_int("MPI_MAX_INFO_VAL", "options:mpi-max-info-val", MPI_MAX_INFO_VAL); ompi_info_out_int("MPI_MAX_PORT_NAME", "options:mpi-max-port-name", MPI_MAX_PORT_NAME); #if OMPI_PROVIDE_MPI_FILE_INTERFACE ompi_info_out_int("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string", MPI_MAX_DATAREP_STRING); #else ompi_info_out("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string", "IO interface not provided"); #endif }
/* * do_config * Accepts: * - want_all: boolean flag; TRUE -> display all options * FALSE -> display selected options * * This function displays all the options with which the current * installation of orcm was configured. There are many options here * that are carried forward from ORCM-7 and are not mca parameters * in ORCM-10. I have to dig through the invalid options and replace * them with ORCM-10 options. */ void orcm_info_do_config(bool want_all) { char *heterogeneous; char *memprofile; char *memdebug; char *debug; char *threads; char *want_libltdl; char *symbol_visibility; char *ft_support; /* setup the strings that don't require allocations*/ heterogeneous = OPAL_ENABLE_HETEROGENEOUS_SUPPORT ? "yes" : "no"; memprofile = OPAL_ENABLE_MEM_PROFILE ? "yes" : "no"; memdebug = OPAL_ENABLE_MEM_DEBUG ? "yes" : "no"; debug = OPAL_ENABLE_DEBUG ? "yes" : "no"; want_libltdl = OPAL_WANT_LIBLTDL ? "yes" : "no"; symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no"; /* setup strings that require allocation */ if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { asprintf(&threads, "%s (mpi: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), OPAL_ENABLE_MULTI_THREADS ? "yes" : "no"); } else { threads = strdup("no"); } asprintf(&ft_support, "%s (checkpoint thread: %s)", OPAL_ENABLE_FT ? "yes" : "no", OPAL_ENABLE_FT_THREAD ? "yes" : "no");; /* output values */ orcm_info_out("Configured by", "config:user", ORCM_CONFIGURE_USER); orcm_info_out("Configured on", "config:timestamp", ORCM_CONFIGURE_DATE); orcm_info_out("Configure host", "config:host", ORCM_CONFIGURE_HOST); orcm_info_out("Built by", "build:user", ORCM_BUILD_USER); orcm_info_out("Built on", "build:timestamp", ORCM_BUILD_DATE); orcm_info_out("Built host", "build:host", ORCM_BUILD_HOST); orcm_info_out("C compiler", "compiler:c:command", OPAL_CC); orcm_info_out("C compiler family name", "compiler:c:familyname", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME)); orcm_info_out("C compiler version", "compiler:c:version", _STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR)); if (want_all) { orcm_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char)); /* JMS: should be fixed in MPI-2.2 to differentiate between C _Bool and C++ bool. For the moment, the code base assumes that they are the same. Because of opal_config_bottom.h, we can sizeof(bool) here, so we might as well -- even though this technically isn't right. This should be fixed when we update to MPI-2.2. See below for note about C++ bool alignment. */ orcm_info_out_int("C bool size", "compiler:c:sizeof:bool", sizeof(bool)); orcm_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short)); orcm_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int)); orcm_info_out_int("C long size", "compiler:c:sizeof:long", sizeof(long)); orcm_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float)); orcm_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double)); orcm_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *)); orcm_info_out_int("C char align", "compiler:c:align:char", OPAL_ALIGNMENT_CHAR); orcm_info_out("C bool align", "compiler:c:align:bool", "skipped"); orcm_info_out_int("C int align", "compiler:c:align:int", OPAL_ALIGNMENT_INT); orcm_info_out_int("C float align", "compiler:c:align:float", OPAL_ALIGNMENT_FLOAT); orcm_info_out_int("C double align", "compiler:c:align:double", OPAL_ALIGNMENT_DOUBLE); } if (want_all) { orcm_info_out("Thread support", "option:threads", threads); free(threads); orcm_info_out("Build CFLAGS", "option:build:cflags", ORCM_BUILD_CFLAGS); orcm_info_out("Build LDFLAGS", "option:build:ldflags", ORCM_BUILD_LDFLAGS); orcm_info_out("Build LIBS", "option:build:libs", ORCM_BUILD_LIBS); orcm_info_out("Wrapper extra CFLAGS", "option:wrapper:extra_cflags", WRAPPER_EXTRA_CFLAGS); orcm_info_out("Wrapper extra CXXFLAGS", "option:wrapper:extra_cxxflags", WRAPPER_EXTRA_CXXFLAGS); orcm_info_out("Wrapper extra LDFLAGS", "option:wrapper:extra_ldflags", WRAPPER_EXTRA_LDFLAGS); orcm_info_out("Wrapper extra LIBS", "option:wrapper:extra_libs", WRAPPER_EXTRA_LIBS); } orcm_info_out("Internal debug support", "option:debug", debug); orcm_info_out("Memory profiling support", "option:mem-profile", memprofile); orcm_info_out("Memory debugging support", "option:mem-debug", memdebug); orcm_info_out("libltdl support", "option:dlopen", want_libltdl); orcm_info_out("Heterogeneous support", "options:heterogeneous", heterogeneous); orcm_info_out("Symbol vis. support", "options:visibility", symbol_visibility); orcm_info_out("FT Checkpoint support", "options:ft_support", ft_support); free(ft_support); }
/** * Given own location, FX location, app binary and specified --depsfile and probe paths * return location that is expected to contain hostpolicy */ bool fx_muxer_t::resolve_hostpolicy_dir(host_mode_t mode, const pal::string_t& own_dir, const pal::string_t& fx_dir, const pal::string_t& app_candidate, const pal::string_t& specified_deps_file, const pal::string_t& specified_fx_version, const std::vector<pal::string_t>& probe_realpaths, const runtime_config_t& config, pal::string_t* impl_dir) { // Obtain deps file for the given configuration. pal::string_t resolved_deps = get_deps_file(fx_dir, app_candidate, specified_deps_file, config); // Resolve hostpolicy version out of the deps file. pal::string_t version = resolve_hostpolicy_version_from_deps(resolved_deps); if (trace::is_enabled() && version.empty() && pal::file_exists(resolved_deps)) { trace::warning(_X("Dependency manifest %s does not contain an entry for %s"), resolved_deps.c_str(), _STRINGIFY(HOST_POLICY_PKG_NAME)); } // Check if the given version of the hostpolicy exists in servicing. if (hostpolicy_exists_in_svc(version, impl_dir)) { return true; } // Get the expected directory that would contain hostpolicy. pal::string_t expected; if (config.get_portable()) { if (!pal::directory_exists(fx_dir)) { pal::string_t fx_version = specified_fx_version.empty() ? config.get_fx_version() : specified_fx_version; handle_missing_framework_error(config.get_fx_name(), fx_version, fx_dir); return false; } expected = fx_dir; } else { // Standalone apps can be activated by muxer or by standalone host or "corehost" // 1. When activated with dotnet.exe or corehost.exe, check for hostpolicy in the deps dir or // app dir. // 2. When activated with app.exe, the standalone host, check own directory. assert(mode == host_mode_t::muxer || mode == host_mode_t::standalone || mode == host_mode_t::split_fx); expected = (mode == host_mode_t::standalone) ? own_dir : get_directory(specified_deps_file.empty() ? app_candidate : specified_deps_file); } // Check if hostpolicy exists in "expected" directory. trace::verbose(_X("The expected %s directory is [%s]"), LIBHOSTPOLICY_NAME, expected.c_str()); if (library_exists_in_dir(expected, LIBHOSTPOLICY_NAME, nullptr)) { impl_dir->assign(expected); return true; } trace::verbose(_X("The %s was not found in [%s]"), LIBHOSTPOLICY_NAME, expected.c_str()); // Start probing for hostpolicy in the specified probe paths. pal::string_t candidate; if (resolve_hostpolicy_dir_from_probe_paths(version, probe_realpaths, &candidate)) { impl_dir->assign(candidate); return true; } // If it still couldn't be found, somebody upstack messed up. Flag an error for the "expected" location. trace::error(_X("A fatal error was encountered. The library '%s' required to execute the application was not found in '%s'."), LIBHOSTPOLICY_NAME, expected.c_str()); return false; }
"$GASNetConfig: (upc_pthread_hello_world.o) " GASNET_CONFIG_STRING " $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_UPCRConfig_obj, "$UPCRConfig: (upc_pthread_hello_world.o) " UPCR_CONFIG_STRING UPCRI_THREADCONFIG_STR " $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_translator, "$UPCTranslator: (upc_pthread_hello_world.o) /Users/vanka1/research/compilers/bupc/berkeley_upc-2.14.2/trans/targ (africanlily.llnl.gov) $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_upcver, "$UPCVersion: (upc_pthread_hello_world.o) 2.14.2 $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_compileline, "$UPCCompileLine: (upc_pthread_hello_world.o) /Users/vanka1/research/compilers/bupc/berkeley_upc-2.14.2/opt/bin/upcc.pl -pthreads upc_pthread_hello_world.upc -o upc_pthread_hello_world_translated.c $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_compiletime, "$UPCCompileTime: (upc_pthread_hello_world.o) " __DATE__ " " __TIME__ " $"); #ifndef UPCRI_CC /* ensure backward compatilibity for http netcompile */ #define UPCRI_CC <unknown> #endif GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_backendcompiler, "$UPCRBackendCompiler: (upc_pthread_hello_world.o) " _STRINGIFY(UPCRI_CC) " $"); #ifdef GASNETT_CONFIGURE_MISMATCH GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_configuremismatch, "$UPCRConfigureMismatch: (upc_pthread_hello_world.o) 1 $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_configuredcompiler, "$UPCRConfigureCompiler: (upc_pthread_hello_world.o) " GASNETT_PLATFORM_COMPILER_IDSTR " $"); GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_buildcompiler, "$UPCRBuildCompiler: (upc_pthread_hello_world.o) " PLATFORM_COMPILER_IDSTR " $"); #endif /**************************************************************************/ GASNETT_IDENT(UPCRI_IdentString_upc_pthread_hello_world_o_1338921989_transver_2, "$UPCTranslatorVersion: (upc_pthread_hello_world.o) 2.14.2, built on May 14 2012 at 17:11:26, host africanlily.llnl.gov darwin-i686/32, Apple gcc v4.2.1 (Apple Inc. build 5646) $"); GASNETT_IDENT(UPCRI_IdentString_ALLOC_upc_pthread_hello_world_2672127685,"$UPCRAllocFn: (upc_pthread_hello_world.trans.c) UPCRI_ALLOC_upc_pthread_hello_world_2672127685 $"); GASNETT_IDENT(UPCRI_IdentString_INIT_upc_pthread_hello_world_2672127685,"$UPCRInitFn: (upc_pthread_hello_world.trans.c) UPCRI_INIT_upc_pthread_hello_world_2672127685 $");
static int gasnetc_init(int *argc, char ***argv, gex_Flags_t flags) { int retval = GASNET_OK; /* check system sanity */ gasnetc_check_config(); /* --------- begin Master code ------------ */ if (!AMUDP_SPMDIsWorker(argv?*argv:NULL)) { /* assume we're an implicit master (we don't currently support explicit workers spawned without using the AMUDP SPMD API) */ int num_nodes; int i; char spawnfn; amudp_spawnfn_t fp = (amudp_spawnfn_t)NULL; if (!argv) { gasneti_fatalerror("implicit-master without argv not supported - use amudprun"); } /* pretend we're node 0, for purposes of verbose env reporting */ gasneti_init_done = 1; gasneti_mynode = 0; #if defined(GASNET_CSPAWN_CMD) { /* set configure default cspawn cmd */ const char *cmd = gasneti_getenv_withdefault("GASNET_CSPAWN_CMD",GASNET_CSPAWN_CMD); gasneti_setenv("GASNET_CSPAWN_CMD",cmd); } #endif /* parse node count from command line */ if (*argc < 2) { fprintf(stderr, "GASNet: Missing parallel node count\n"); fprintf(stderr, "GASNet: Specify node count as first argument, or use upcrun/tcrun spawner script to start job\n"); fprintf(stderr, "GASNet: Usage '%s <num_nodes> {program arguments}'\n", (*argv)[0]); exit(-1); } /* * argv[1] is number of nodes; argv[0] is program name; argv is * list of arguments including program name and number of nodes. * We need to remove argv[1] when the argument array is passed * to the tic_main(). */ num_nodes = atoi((*argv)[1]); if (num_nodes < 1) { fprintf (stderr, "GASNet: Invalid number of nodes: %s\n", (*argv)[1]); fprintf (stderr, "GASNet: Usage '%s <num_nodes> {program arguments}'\n", (*argv)[0]); exit (1); } /* remove the num_nodes argument */ for (i = 1; i < (*argc)-1; i++) { (*argv)[i] = (*argv)[i+1]; } (*argv)[(*argc)-1] = NULL; (*argc)--; /* get spawnfn */ spawnfn = *gasneti_getenv_withdefault("GASNET_SPAWNFN", _STRINGIFY(GASNETC_DEFAULT_SPAWNFN)); { /* ensure we pass the effective spawnfn to worker env */ char spawnstr[2]; spawnstr[0] = toupper(spawnfn); spawnstr[1] = '\0'; gasneti_setenv("GASNET_SPAWNFN",spawnstr); } /* ensure reliable localhost operation by forcing use of 127.0.0.1 * setting GASNET_MASTERIP to the empty string will prevent this */ if (('L' == toupper(spawnfn)) && !gasneti_getenv("GASNET_MASTERIP")) { gasneti_setenv("GASNET_MASTERIP","127.0.0.1"); } for (i=0; AMUDP_Spawnfn_Desc[i].abbrev; i++) { if (toupper(spawnfn) == toupper(AMUDP_Spawnfn_Desc[i].abbrev)) { fp = AMUDP_Spawnfn_Desc[i].fnptr; break; } } if (!fp) { fprintf (stderr, "GASNet: Invalid spawn function specified in GASNET_SPAWNFN\n"); fprintf (stderr, "GASNet: The following mechanisms are available:\n"); for (i=0; AMUDP_Spawnfn_Desc[i].abbrev; i++) { fprintf(stderr, " '%c' %s\n", toupper(AMUDP_Spawnfn_Desc[i].abbrev), AMUDP_Spawnfn_Desc[i].desc); } exit(1); } #if GASNET_DEBUG_VERBOSE /* note - can't call trace macros during gasnet_init because trace system not yet initialized */ fprintf(stderr,"gasnetc_init(): about to spawn...\n"); fflush(stderr); #endif retval = AMUDP_SPMDStartup(argc, argv, num_nodes, 0, fp, NULL, &gasnetc_bundle, &gasnetc_endpoint); /* master startup should never return */ gasneti_fatalerror("master AMUDP_SPMDStartup() failed"); } /* --------- begin Worker code ------------ */ AMLOCK(); if (gasneti_init_done) INITERR(NOT_INIT, "GASNet already initialized"); gasneti_freezeForDebugger(); AMX_VerboseErrors = gasneti_VerboseErrors; AMUDP_SPMDkillmyprocess = gasneti_killmyprocess; #if GASNETI_CALIBRATE_TSC // Early x86*/Linux timer initialization before AMUDP_SPMDStartup() // // udp-conduit does not support user-provided values for GASNET_TSC_RATE* // (which fine-tune timer calibration on x86/Linux). This is partially due // to a dependency cycle at startup with envvar propagation, but more // importantly because the retransmission algorithm (and hence all conduit // comms) rely on gasnet timers to be accurate (at least approximately), so // we don't allow the user to weaken or disable their calibration. gasneti_unsetenv("GASNET_TSC_RATE"); gasneti_unsetenv("GASNET_TSC_RATE_TOLERANCE"); gasneti_unsetenv("GASNET_TSC_RATE_HARD_TOLERANCE"); GASNETI_TICKS_INIT(); #endif /* perform job spawn */ retval = AMUDP_SPMDStartup(argc, argv, 0, 0, NULL, /* dummies */ &gasnetc_networkpid, &gasnetc_bundle, &gasnetc_endpoint); if (retval != AM_OK) INITERR(RESOURCE, "slave AMUDP_SPMDStartup() failed"); gasneti_init_done = 1; /* enable early to allow tracing */ gasneti_getenv_hook = (/* cast drops const */ gasneti_getenv_fn_t*)&AMUDP_SPMDgetenvMaster; gasneti_mynode = AMUDP_SPMDMyProc(); gasneti_nodes = AMUDP_SPMDNumProcs(); #if !GASNETI_CALIBRATE_TSC /* Must init timers after global env, and preferably before tracing */ GASNETI_TICKS_INIT(); #endif /* enable tracing */ gasneti_trace_init(argc, argv); GASNETI_AM_SAFE(AMUDP_SPMDSetExitCallback(gasnetc_traceoutput)); /* for local spawn, assume we want to wait-block */ if (gasneti_getenv("GASNET_SPAWNFN") && *gasneti_getenv("GASNET_SPAWNFN") == 'L') { GASNETI_TRACE_PRINTF(C,("setting gasnet_set_waitmode(GASNET_WAIT_BLOCK) for localhost spawn")); gasnet_set_waitmode(GASNET_WAIT_BLOCK); } #if GASNET_DEBUG_VERBOSE fprintf(stderr,"gasnetc_init(): spawn successful - node %i/%i starting...\n", gasneti_mynode, gasneti_nodes); fflush(stderr); #endif gasneti_nodemapInit(&gasnetc_bootstrapExchange, NULL, 0, 0); #if GASNET_PSHM gasneti_pshm_init(&gasnetc_bootstrapSNodeBroadcast, 0); #endif uintptr_t mmap_limit; #if HAVE_MMAP mmap_limit = gasneti_mmapLimit((uintptr_t)-1, (uint64_t)-1, &gasnetc_bootstrapExchange, &gasnetc_bootstrapBarrier); #else // TODO-EX: we can at least look at rlimits but such logic belongs in conduit-indep code mmap_limit = (intptr_t)-1; #endif /* allocate and attach an aux segment */ gasneti_auxsegAttach(mmap_limit, &gasnetc_bootstrapExchange); /* determine Max{Local,GLobal}SegmentSize */ gasneti_segmentInit(mmap_limit, &gasnetc_bootstrapExchange, flags); #if GASNET_BLCR gasneti_checkpoint_guid = gasnetc_networkpid; gasneti_checkpoint_init(NULL); #endif AMUNLOCK(); gasneti_assert(retval == GASNET_OK); return retval; done: /* error return while locked */ AMUNLOCK(); GASNETI_RETURN(retval); }