Commit 740fa2dc authored by Ramon Nou's avatar Ramon Nou
Browse files

Use $HOME to look for the host_file as a fallback, it is better to use a fixed directory.

parent 96665c42
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -183,9 +183,13 @@ if [ "${NA_LAYER}" == "bmi" ] || [ "${NA_LAYER}" == "all" ]; then
fi
# get libfabric
if [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then
    # getting specific libpsm2 version to compile into libfabric
    if [[ ("${CLUSTER}" == "mogon2") ]]; then
       wgetdeps "psm2" "https://github.com/intel/opa-psm2/archive/PSM2_11.2.77.tar.gz" & 
   fi
    # No need to get libfabric for mogon2 as it is already installed
    if [[ ("${CLUSTER}" != "mogon2") ]]; then
        wgetdeps "libfabric" "https://github.com/ofiwg/libfabric/releases/download/v1.7.2/libfabric-1.7.2.tar.gz" &
        wgetdeps "libfabric" "https://github.com/ofiwg/libfabric/releases/download/v1.8.1rc1/libfabric-1.8.1rc1.tar.gz" 
    fi
fi
# get Mercury
+8 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
#include <csignal>
#include <random>
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <pwd.h>

using namespace std;

@@ -138,6 +140,12 @@ void load_hosts() {
    try {
        hosts_file = gkfs::get_env_own("HOSTS_FILE");
    } catch (const exception& e) {
        char* homedir = NULL;
        struct passwd *pw = getpwuid(getuid());
        if (pw) {
            homedir = pw->pw_dir;
            hosts_file = string(homedir)+"/gkfs_hosts.txt"s;
        }
        CTX->log()->info("{}() Failed to get hosts file path"
                         " from environment, using default: '{}'",
                         __func__, DEFAULT_HOSTS_FILE);