Skip to content

Commit 71e9f4f

Browse files
authored
Merge pull request #418 from sourceryinstitute/issue-378-mpi-names
Fixes #378 - mpi names
2 parents ca372db + 1c9c6ce commit 71e9f4f

File tree

20 files changed

+78
-84
lines changed

20 files changed

+78
-84
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
8181
"in a manner such as\n"
8282
" $ mkdir build-opencarrays\n"
8383
" $ cd build-opencoarrays\n"
84-
" $ CC=mpicc FC=mpif90 cmake <path-to-opencoarrays-source-directory> -DCMAKE_INSTALL_PREFIX=<path-to-install-directory>\n"
84+
" $ CC=gcc FC=gfortran cmake -DBUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/install/dir /path/to/opencoarrays/src/dir \n"
8585
"\nsubstituting the appropriate syntax for your shell (the above line assumes the bash shell)."
8686
)
8787
endif()
@@ -188,7 +188,7 @@ endif()
188188
# Find MPI and set some flags so that FC and CC can point to gfortran and gcc
189189
#----------------------------------------------------------------------------
190190

191-
# If the user passes FC=mpif90 etc. check and prefer that location
191+
# If the user passes FC=mpifort etc. check and prefer that location
192192
get_filename_component( FTN_COMPILER_NAME "${CMAKE_Fortran_COMPILER}"
193193
NAME )
194194
get_filename_component( C_COMPILER_NAME "${CMAKE_C_COMPILER}"

GETTING_STARTED.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ If the `caf` compiler wrapper cannot process the source code in question, invoke
107107
the underlying communication library directly:
108108

109109
```bash
110-
mpif90 -fcoarray=lib -L/opt/opencoarrays/ tally.f90 \ -lcaf_mpi -o htally -I<OpenCoarrays-install-path>/mod
110+
mpifort -fcoarray=lib -L/opt/opencoarrays/ tally.f90 \ -lcaf_mpi -o htally -I<OpenCoarrays-install-path>/mod
111111
```
112112

113113
and also run the program with the lower-level communication library:
114114

115115
```bash
116-
mpirun -np <number-of-images> ./tally
116+
mpiexec -np <number-of-images> ./tally
117117
```
118118

119119
---

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ OpenCoarrays provides a compiler wrapper (named `caf`), a runtime
4646
library (named `libcaf_mpi.a` by default), and an executable file
4747
launcher (named `cafrun`). With OpenCoarrays-aware compilers, the
4848
compiler wrapper passes the provided source code to the chosen
49-
compiler (`mpif90` by default). For non-OpenCoarrays-aware compilers,
49+
compiler (`mpifort` by default). For non-OpenCoarrays-aware compilers,
5050
the wrapper transforms CAF syntax into OpenCoarrays procedure calls
5151
before invoking the chosen compiler on the transformed code. The
5252
runtime library supports compiler communication and synchronization
5353
requests by invoking a lower-level communication library--the Message
5454
Passing Interface ([MPI]) by default. The launcher passes execution
5555
to the chosen communication library's parallel program launcher
56-
(`mpirun` by default).
56+
(`mpiexec` by default).
5757

5858
OpenCoarrays defines an application binary interface ([ABI]) that
5959
translates high-level communication and synchronization requests into

developer-scripts/hpclinux-install.sh

+43-42
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22

33
# BSD 3-Clause License
44
#
5-
# -- hpclinux-install.sh
6-
#
5+
# -- hpclinux-install.sh
6+
#
77
# Install OpenCoarrays inside the HPCLinux distribution from hpclinux.org.
88
#
99
# Usage: cd opencoarrays && ./prerequisites/hpclinux-install.sh"
1010
#
1111
# Motivation:
1212
#
13-
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14-
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15-
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16-
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
13+
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14+
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15+
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16+
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
1717
# omits the interrogation and invokes prerequisites/build.sh to build all prerequisites.
18-
#
18+
#
1919
# Copyright (c) 2016, Sourcery Institute
2020
# All rights reserved.
21-
#
21+
#
2222
# Redistribution and use in source and binary forms, with or without
2323
# modification, are permitted provided that the following conditions are met:
24-
#
24+
#
2525
# * Redistributions of source code must retain the above copyright notice, this
2626
# list of conditions and the following disclaimer.
27-
#
27+
#
2828
# * Redistributions in binary form must reproduce the above copyright notice,
2929
# this list of conditions and the following disclaimer in the documentation
3030
# and/or other materials provided with the distribution.
31-
#
31+
#
3232
# * Neither the name of the copyright holder nor the names of its
3333
# contributors may be used to endorse or promote products derived from
3434
# this software without specific prior written permission.
35-
#
35+
#
3636
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3737
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3838
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,57 +45,58 @@
4545
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646

4747
if [[ ! -d prerequisites ]]; then
48-
echo "Please execute this script with your present working directory"
49-
echo "set to the top level of the OpenCoarrays source tree."
50-
exit 1
48+
printf "Please execute this script with your present working directory"
49+
printf "set to the top level of the OpenCoarrays source tree."
50+
exit 1
5151
fi
5252

5353
pushd prerequisites
5454

55-
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56-
export cmake_install_path="${PWD}"/installations/cmake/cmake
57-
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58-
if [[ -z "${PATH}" ]]; then
59-
export PATH="${cmake_install_path}"/bin
60-
else
61-
export PATH="${cmake_install_path}"/bin:$PATH
62-
fi
55+
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56+
export cmake_install_path="${PWD}/installations/cmake/cmake"
57+
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58+
if [[ -z "${PATH}" ]]; then
59+
export PATH="${cmake_install_path}/bin"
60+
else
61+
export PATH="${cmake_install_path}/bin:${PATH}"
62+
fi
6363

64-
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65-
export gcc_version=6.3.0
66-
export gcc_install_path="${PWD}"/installations/gnu/$gcc_version
67-
./build.sh --package gcc --install-version $gcc_version --install-prefix "${gcc_install_path}"
68-
export PATH="${gcc_install_path}"/bin:$PATH
69-
export LD_LIBRARY_PATH="${gcc_install_path}"/lib64:"${gcc_install_path}"/lib:$LD_LIBRARY_PATH
64+
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65+
export gcc_version=6.3.0
66+
export gcc_install_path="${PWD}/installations/gnu/${gcc_version}"
67+
./build.sh --package gcc --install-version "${gcc_version}" --install-prefix "${gcc_install_path}"
68+
export PATH="${gcc_install_path}/bin:${PATH}"
69+
export LD_LIBRARY_PATH="${gcc_install_path}/lib64:${gcc_install_path}/lib:${LD_LIBRARY_PATH}"
7070

71-
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72-
export mpich_install_path="${PWD}"/installations/mpich
73-
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74-
export PATH="${mpich_install_path}"/bin:$PATH
71+
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72+
export mpich_install_path="${PWD}/installations/mpich"
73+
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74+
export PATH="${mpich_install_path}/bin:${PATH}"
7575

7676
popd # return to top level of OpenCoarrays source tree
7777

7878
# Build OpenCoarrays
7979
if [[ -d build ]]; then
80-
echo -e 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n) '
80+
printf 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n)'
8181
read -r delete_build
8282

83-
if [[ "$delete_build" == "n" || "$delete_build" == "no" ]]; then
83+
if [[ "${delete_build}" == "n" || "${delete_build}" == "no" ]]; then
8484
printf "n\n"
85-
echo -e "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
85+
printf "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
8686
exit 10
8787
else # permission granted to delete build subdirectory
8888
printf "Y\n"
89-
fi
89+
fi
9090
rm -rf build
9191
fi
9292
mkdir build
9393
pushd build
9494

95-
export opencoarrays_install_path="${PWD}"/prerequisites/installations/opencoarrays
96-
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="{opencoarrays_install_path}"
97-
make
98-
make install
99-
export PATH="${opencoarrays_install_path}"/bin:$PATH
95+
export opencoarrays_install_path="${PWD}/prerequisites/installations/opencoarrays"
96+
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="${opencoarrays_install_path}"
97+
make
98+
ctest --output-on-failure --schedule-random
99+
make install
100+
export PATH="${opencoarrays_install_path}/bin:${PATH}"
100101

101102
popd # return to top level of OpenCoarrays source tree

developer-scripts/patched-trunk-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ echo "Building MPICH with the patched compilers."
179179

180180
# Verify that MPICH installed where expected
181181
mpich_install_path=$(./install.sh -P mpich)
182-
if ! type "${mpich_install_path}"/bin/mpif90; then
182+
if ! type "${mpich_install_path}"/bin/mpifort; then
183183
echo "MPICH is not installed in the expected location ${mpich_install_path}."
184184
exit 1
185185
fi

prerequisites/install-functions/find_or_install.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ find_or_install()
88
package_executable_array=(
99
"gcc:gfortran"
1010
"cmake:cmake"
11-
"mpich:mpif90"
11+
"mpich:mpifort"
1212
"flex:flex"
1313
"bison:yacc"
1414
"m4:m4"
@@ -121,11 +121,11 @@ find_or_install()
121121
# MPIFC, MPICC, and MPICXX environment variables. Every branch must also manage the
122122
# dependency stack.
123123

124-
# If the user specified a Fortran compiler, verify that mpif90 wraps the specified compiler
124+
# If the user specified a Fortran compiler, verify that mpifort wraps the specified compiler
125125
if [[ ! -z "${arg_M:-}" ]]; then
126126

127127
echo -e "$this_script: Using the $package specified by -M or --with-mpi: ${arg_M}\n"
128-
export MPIFC="${arg_M}"/bin/mpif90
128+
export MPIFC="${arg_M}"/bin/mpifort
129129
export MPICC="${arg_M}"/bin/mpicc
130130
export MPICXX="${arg_M}"/bin/mpicxx
131131
# Halt the recursion
@@ -136,7 +136,7 @@ find_or_install()
136136
elif [[ "$script_installed_package" == true ]]; then
137137

138138
echo -e "$this_script: Using the $package installed by $this_script\n"
139-
export MPIFC=$package_install_path/bin/mpif90
139+
export MPIFC=$package_install_path/bin/mpifort
140140
export MPICC=$package_install_path/bin/mpicc
141141
export MPICXX=$package_install_path/bin/mpicxx
142142
# Halt the recursion
@@ -147,8 +147,8 @@ find_or_install()
147147
elif [[ "$package_in_path" == "true" ]]; then
148148

149149
echo -e "$this_script: Checking whether $executable in PATH wraps gfortran... "
150-
mpif90_version_header=$(mpif90 --version | head -1)
151-
first_three_characters=$(echo "$mpif90_version_header" | cut -c1-3)
150+
mpifort_version_header=$(mpifort --version | head -1)
151+
first_three_characters=$(echo "$mpifort_version_header" | cut -c1-3)
152152
if [[ "$first_three_characters" != "GNU" ]]; then
153153
printf "no.\n"
154154
# Trigger 'find_or_install gcc' and subsequent build of $package
@@ -162,7 +162,7 @@ find_or_install()
162162

163163
info "-f (or --with-fortran) argument detected with value ${arg_f}"
164164
printf "yes.\n %s: Using the specified %s.\n" "$this_script" "$executable"
165-
export MPIFC=mpif90
165+
export MPIFC=mpifort
166166
export MPICC=mpicc
167167
export MPICXX=mpicxx
168168

@@ -185,7 +185,7 @@ find_or_install()
185185
fi
186186
if [[ "$acceptable" == "${is_true:-}" ]]; then
187187
printf "yes.\n %s: Using the $executable found in the PATH.\n" "$this_script"
188-
export MPIFC=mpif90
188+
export MPIFC=mpifort
189189
export MPICC=mpicc
190190
export MPICXX=mpicxx
191191

@@ -637,8 +637,8 @@ find_or_install()
637637
export LD_LIBRARY_PATH="$gfortran_lib_paths:$LD_LIBRARY_PATH"
638638
fi
639639
elif [[ $package == "mpich" ]]; then
640-
echo "$this_script: export MPIFC=$package_install_path/bin/mpif90"
641-
export MPIFC="$package_install_path/bin/mpif90"
640+
echo "$this_script: export MPIFC=$package_install_path/bin/mpifort"
641+
export MPIFC="$package_install_path/bin/mpifort"
642642
echo "$this_script: export MPICC= $package_install_path/bin/mpicc"
643643
export MPICC="$package_install_path/bin/mpicc"
644644
echo "$this_script: export MPICXX=$package_install_path/bin/mpicxx"

src/extensions/caf-foot

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ usage()
2929
echo " * be the only Fortran source file in the argument list,"
3030
echo " * have a name of the form *.f90, *.F90, *.f, or *.F. "
3131
echo " c. The environment variable 'CAFC' must be empty or point to a Fortran compiler/linker. "
32-
echo " d. If 'CAFC' is empty, a default value of 'mpif90' is used. "
32+
echo " d. If 'CAFC' is empty, a default value of 'mpifort' is used. "
3333
echo ""
3434
echo " 2. With non-OCA CAF compilers (Intel or Cray),"
3535
echo " a. Observe restrictions 1a-d above."
@@ -60,8 +60,8 @@ if [ $# == 0 ]; then
6060
exit 1
6161
fi
6262

63-
# Default to "mpif90" Fortran compiler if environment variable CAFC is empty or unset:
64-
CAFC=${CAFC:-mpif90}
63+
# Default to "mpifort" Fortran compiler if environment variable CAFC is empty or unset:
64+
CAFC=${CAFC:-mpifort}
6565

6666
# TODO -- refactor this script to use the bash3boilerplate use case
6767
max_arguments=100

src/extensions/cafrun-head

-7
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,3 @@
2626
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2727
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2828
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29-
30-
# This script invokes the chosen Fortran compiler with the received command-line
31-
# arguments. Current assumptions:
32-
# 1. The only argument is either an informational flag or a CAF executable
33-
# file.
34-
# 2. The environment variable "FC" is used to determine the identity fo the Fortran compiler/linker.
35-
# 3. If "FC" is empty, a default value of "mpif90" is used.

src/make.inc

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ compiler=gnu
3838
ifeq ($(compiler),gnu)
3939
FC=gfortran
4040
CC=gcc
41-
MPFC = mpif90
41+
MPFC = mpifort
4242
MPICC = mpicc
4343
FFLAGS_EXTRA = -fcoarray=lib
4444
MPI_EXTRA_FLAGS = -Wall -Wextra -Wno-error=cpp -Wno-error=unused-parameter -DSTRIDED#-DNONBLOCKING_PUT -DCAF_MPI_LOCK_UNLOCK
45-
MPI_RUN = mpirun -np 2
45+
MPI_RUN = mpiexec -np 2
4646
else
4747
ifeq ($(compiler),cray)
4848
FC=ftn
@@ -71,4 +71,4 @@ GASNET_CFLAGS += # -DSTRIDED
7171
GASNET_PATH =
7272
GASNET_MAK = $(GASNET_PATH)/GASNet-1.22.4/smp-conduit/smp-par.mak
7373
GASNET_LDFLAGS +=$(GASNET_LIBS)
74-
GASNET_RUN = mpirun -np 2
74+
GASNET_RUN = mpiexec -np 2

src/make.inc.Cray-XE

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ GASNET_CFLAGS += -I/opt/chapel/1.8.0/cray-xk/third-party/gasnet/install/cray-xk-
3232
-Wno-all
3333
GASNET_MAK = /opt/chapel/1.8.0/cray-xk/third-party/gasnet/install/cray-xk-cray-prgenv-gnu/seg-fast/nodbg/include/gemini-conduit/gemini-par.mak
3434
GASNET_CC = cc
35-
GASNET_RUN = mpirun -np 2
35+
GASNET_RUN = mpiexec -np 2

src/tests/integration/coarrayHelloWorld/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
opencoarrays=/opt/opencoarrays
33
executable=hello_multiverse
44
opt=-L $(opencoarrays)/lib
5-
compile=mpif90 -fcoarray=lib
5+
compile=mpifort -fcoarray=lib
66
lib=-lcaf_mpi
77

88
$(executable): hello_multiverse.o Makefile

src/tests/integration/pde_solvers/coarrayBurgers/Makefile.inst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include_path=./include-files
1010

1111
ifeq ($(compiler),gnu)
1212
lib=-lcaf_mpi
13-
compile=mpif90 -fcoarray=lib
13+
compile=mpifort -fcoarray=lib
1414
ifeq ($(machine),virtual)
1515
libpath=-L /opt/opencoarrays/lib
1616
else

src/tests/integration/pde_solvers/coarrayBurgers/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export TAU_CALLPATH_DEPTH=100
1313
for i in 1 2 4
1414
do
1515
echo "Running the code:"
16-
mpirun -np ${i} ./burgers
16+
mpiexec -np ${i} ./burgers
1717
paraprof --pack ${i}p.ppk
1818
taudb_loadtrial -a fireworks -x experiment -n ${i} ${i}p.ppk
1919
done

src/tests/integration/pde_solvers/coarrayBurgers/scripts/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export TAU_CALLPATH_DEPTH=100
1111
#export TAU_SAMPLING=1
1212

1313
echo "Running the code:"
14-
mpirun -np 4 ./burgers
14+
mpiexec -np 4 ./burgers
1515

1616
echo "Running the pprof command:"
1717
pprof

src/tests/integration/pde_solvers/coarrayBurgers/scripts/run_troubleshooting.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ module load java
99
export PATH=/usr/local/packages/intel/14.0/mpirt/bin/intel64/:$PATH
1010
#export FOR_COARRAY_NUM_IMAGES=1
1111
echo "Using FOR_COARRAY_NUM_IMAGES = " $FOR_COARRAY_NUM_IMAGES
12-
mpirun --mca btl_tcp_if_include eth2 -np 16 ./burgers_caf
12+
mpiexec --mca btl_tcp_if_include eth2 -np 16 ./burgers_caf
1313
#./burgers_caf

src/tests/integration/pde_solvers/coarrayHeatSimplified/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ executable=co_heat
55
ifeq ($(compiler),gnu)
66
opencoarrays_dir=/opt/opencoarrays
77
opt=-L $(opencoarrays_dir)/lib
8-
compile=mpif90 -fcoarray=lib
8+
compile=mpifort -fcoarray=lib
99
lib=-lcaf_mpi
1010
else
1111
ifeq ($(compiler),intel)

src/tests/integration/pde_solvers/navier-stokes/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ opencoarrays_dir=/opt/opencoarrays/lib
66
ifeq ($(compiler),gnu)
77
opt=-L $(opencoarrays_dir) -fcoarray=lib -Ofast
88
libcaf_dir = $(opencoarrays_dir)
9-
compile=mpif90
9+
compile=mpifort
1010
lib=-lcaf_mpi
1111
else
1212
ifeq ($(compiler),intel)

src/tests/performance/BurgersMPI/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ executable=burgers_mpi
1515
#Cray compiler command
1616
cray=ftn -ew -h caf
1717
#GNU compiler command
18-
gnu=mpif90 -fcoarray=lib -ffree-form -ffree-line-length-none
18+
gnu=mpifort -fcoarray=lib -ffree-form -ffree-line-length-none
1919

2020
#Intel compiler command
2121
intel= tau_f90.sh -DTAU=1 -Bdynamic -standard-semantics -O3 -g -optCompInst

0 commit comments

Comments
 (0)