Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ addons:
packages:
- ibverbs-utils
- libibverbs-dev
- realpath
- wget
- zsh

Expand Down
4 changes: 2 additions & 2 deletions mpienv/mpienv_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

mkdir -p ${MPIENV_VERSIONS_DIR}

function usage() {
usage() {
echo "Usage: mpienv [command] [options...]"
}

function mpienv() {
mpienv() {
if [ "0" = "${#*}" ]; then
usage
return -1
Expand Down
10 changes: 7 additions & 3 deletions mpienv/py.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

from __future__ import print_function
import errno
import glob
import os
import os.path
import shutil
from subprocess import PIPE
from subprocess import Popen
import sys

import mpienv.pip as pip
Expand Down Expand Up @@ -35,8 +36,11 @@ def __init__(self, libname, conf, name):
mkdir_p(self._pylib_dir)

def is_installed(self):
libs = glob.glob(os.path.join(self._pylib_dir, self._libname, '*.so'))
return len(libs) > 0
"""Check if mpi4py is installed"""
python = sys.executable
p = Popen([python, '-c', 'import mpi4py'], stdout=PIPE, stderr=PIPE)
p.communicate()
return p.returncode == 0

def install(self, env):
sys.stderr.write(
Expand Down
9 changes: 6 additions & 3 deletions tests/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ test_reg_issue10() {
# https://github.com/keisukefukuda/mpienv/issues/10
assertSuccess mpienv autodiscover -q --add ${MPI_PREFIX}

mpienv use --mpi4py ${MPICH} # this command should install mpi4py to mpich-3.2
mpienv use ${MPICH} # this command should install mpi4py to mpich-3.2
mpienv rename ${MPICH} mpix # The mpi4py module should be taken over to 'mpix'

OUT=$(mpienv use mpix 2>&1) # this command should NOT intall mpi4py again
OUT=$(mpienv use mpix 2>&1) # this command should NOT install mpi4py again

# If the `use` command does not run `pip install mpi4py`,
# which is a correct behavior, E-S should be < 1 [s].
Expand All @@ -434,7 +434,10 @@ test_reg_issue_timeout() {
test_reg_issue_134_add_relpath() {
# Regression test for
pushd $HOME
OMPI_relpath=$(realpath --relative-to=$PWD $OMPI_ROOT)
echo realpath --version
realpath --version
# OMPI_relpath=$(realpath --relative-to $PWD $OMPI_ROOT)
OMPI_relpath=$(python -c "import os.path; print(os.path.relpath('${OMPI_ROOT}', '${PWD}'))")
mpienv add ${OMPI_relpath}
mpienv use ${OMPI}
popd
Expand Down