Skip to content

Commit cbcdbb5

Browse files
committed
Replace mpif90mpifort, mpirunmpiexec
Closes #378 (cherry picked from commit 19baa86b31dcfdea18afc7845668899694223c3c)
1 parent ca372db commit cbcdbb5

File tree

19 files changed

+35
-42
lines changed

19 files changed

+35
-42
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/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

src/tests/unit/extensions/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ function(generate_test_script base_name num_images)
2424
# automatically when the script wraps an OpenCoarrays-aware compiler
2525
file(APPEND
2626
"${harness}"
27-
"FC=mpif90 ${CMAKE_INSTALL_PREFIX}/bin/caf ${source} -o ${executable} -I${CMAKE_BINARY_DIR}/mod -DUSE_EXTENSIONS\n"
27+
"FC=mpifort ${CMAKE_INSTALL_PREFIX}/bin/caf ${source} -o ${executable} -I${CMAKE_BINARY_DIR}/mod -DUSE_EXTENSIONS\n"
2828
)
2929
else()
30-
file(APPEND "${harness}" "FC=mpif90 ${CMAKE_INSTALL_PREFIX}/bin/caf ${source} -o ${executable} -DUSE_EXTENSIONS\n")
30+
file(APPEND "${harness}" "FC=mpifort ${CMAKE_INSTALL_PREFIX}/bin/caf ${source} -o ${executable} -DUSE_EXTENSIONS\n")
3131
endif()
3232
file(APPEND "${harness}" "${CMAKE_INSTALL_PREFIX}/bin/cafrun -np ${num_images} ./${executable}\n")
3333
file( INSTALL "${harness}"

windows-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ else
240240
sudo apt-get install gfortran
241241
fi
242242

243-
if ! type mpif90 >& /dev/null; then
243+
if ! type mpifort >& /dev/null; then
244244
sudo apt-get install mpich
245245
fi
246246

0 commit comments

Comments
 (0)