armci-mpi/ 0000755 0001750 0001750 00000000000 12663426407 012216 5 ustar mbanck mbanck armci-mpi/VERSION 0000644 0001750 0001750 00000001155 12663426407 013270 0 ustar mbanck mbanck # For libtool ABI versioning rules see:
# http://www.nondot.org/sabre/Mirrored/libtool-2.1a/libtool_6.html#SEC36
# 1. If the library source code has changed at all since the last
# update, then increment revision (`c:r:a' becomes `c:r+1:a').
#
# 2. If any interfaces have been added, removed, or changed since
# the last update, increment current, and set revision to 0.
#
# 3. If any interfaces have been added since the last public
# release, then increment age.
#
# 4. If any interfaces have been removed since the last public
# release, then set age to 0.
libarmci_abi_version=1:0:0
armci-mpi/travis/ 0000755 0001750 0001750 00000000000 12663426407 013526 5 ustar mbanck mbanck armci-mpi/travis/install-mpi.sh 0000755 0001750 0001750 00000006010 12663426407 016313 0 ustar mbanck mbanck #!/bin/sh
# This configuration file was taken originally from the mpi4py project
# , and then modified for Julia
set -e
set -x
os=`uname`
TRAVIS_ROOT="$1"
MPI_IMPL="$2"
# this is where updated Autotools will be for Linux
export PATH=$TRAVIS_ROOT/bin:$PATH
case "$os" in
Darwin)
echo "Mac"
brew update
case "$MPI_IMPL" in
mpich)
brew install mpich
;;
openmpi)
# Homebrew is still at 1.10.1, which is broken for STRIDED/IOV=DIRECT.
brew install openmpi
;;
*)
echo "Unknown MPI implementation: $MPI_IMPL"
exit 10
;;
esac
;;
Linux)
echo "Linux"
case "$MPI_IMPL" in
mpich)
if [ ! -d "$TRAVIS_ROOT/mpich" ]; then
wget -q --no-check-certificate http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
tar -xzf mpich-3.2.tar.gz
cd mpich-3.2
mkdir build && cd build
../configure CFLAGS="-w" --prefix=$TRAVIS_ROOT/mpich --disable-fortran --disable-static
make -j4
make install
else
echo "MPICH already installed"
fi
;;
openmpi)
if [ ! -d "$TRAVIS_ROOT/open-mpi" ]; then
wget -q --no-check-certificate http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.2rc3.tar.bz2
tar -xjf openmpi-1.10.2rc3.tar.bz2
cd openmpi-1.10.2rc3
mkdir build && cd build
../configure CFLAGS="-w" --prefix=$TRAVIS_ROOT/open-mpi \
--without-verbs --without-fca --without-mxm --without-ucx \
--without-portals4 --without-psm --without-psm2 \
--without-libfabric --without-usnic \
--without-udreg --without-ugni --without-xpmem \
--without-alps --without-munge \
--without-sge --without-loadleveler --without-tm \
--without-lsf --without-slurm \
--without-pvfs2 --without-plfs \
--without-cuda --disable-oshmem \
--disable-mpi-fortran --disable-oshmem-fortran \
--disable-libompitrace \
--disable-mpi-io --disable-io-romio \
--disable-static
make -j4
make install
else
echo "Open-MPI already installed"
fi
;;
*)
echo "Unknown MPI implementation: $MPI_IMPL"
exit 20
;;
esac
;;
esac
armci-mpi/travis/install-autotools.sh 0000755 0001750 0001750 00000007432 12663426407 017570 0 ustar mbanck mbanck #!/bin/sh
set -e
set -x
os=`uname`
TOP="$1"
case "$os" in
Darwin)
brew update
brew info autoconf automake libtool
#brew install autoconf automake libtool
brew upgrade autoconf automake libtool
which glibtool
which glibtoolize
glibtool --version
mkdir -p ${TOP}/bin
ln -s `which glibtool` ${TOP}/bin/libtool
ln -s `which glibtoolize` ${TOP}/bin/libtoolize
;;
Linux)
MAKE_JNUM=2
M4_VERSION=1.4.17
LIBTOOL_VERSION=2.4.4
AUTOCONF_VERSION=2.69
AUTOMAKE_VERSION=1.15
cd ${TOP}
TOOL=m4
TDIR=${TOOL}-${M4_VERSION}
FILE=${TDIR}.tar.gz
BIN=${TOP}/bin/${TOOL}
if [ -f ${FILE} ] ; then
echo ${FILE} already exists! Using existing copy.
else
wget http://ftp.gnu.org/gnu/${TOOL}/${FILE}
fi
if [ -d ${TDIR} ] ; then
echo ${TDIR} already exists! Using existing copy.
else
echo Unpacking ${FILE}
tar -xzf ${FILE}
fi
if [ -f ${BIN} ] ; then
echo ${BIN} already exists! Skipping build.
else
cd ${TOP}/${TDIR}
./configure --prefix=${TOP} && make -j ${MAKE_JNUM} && make install
if [ "x$?" != "x0" ] ; then
echo FAILURE 1
exit
fi
fi
cd ${TOP}
TOOL=libtool
TDIR=${TOOL}-${LIBTOOL_VERSION}
FILE=${TDIR}.tar.gz
BIN=${TOP}/bin/${TOOL}
if [ ! -f ${FILE} ] ; then
wget http://ftp.gnu.org/gnu/${TOOL}/${FILE}
else
echo ${FILE} already exists! Using existing copy.
fi
if [ ! -d ${TDIR} ] ; then
echo Unpacking ${FILE}
tar -xzf ${FILE}
else
echo ${TDIR} already exists! Using existing copy.
fi
if [ -f ${BIN} ] ; then
echo ${BIN} already exists! Skipping build.
else
cd ${TOP}/${TDIR}
./configure --prefix=${TOP} M4=${TOP}/bin/m4 && make -j ${MAKE_JNUM} && make install
if [ "x$?" != "x0" ] ; then
echo FAILURE 2
exit
fi
fi
cd ${TOP}
TOOL=autoconf
TDIR=${TOOL}-${AUTOCONF_VERSION}
FILE=${TDIR}.tar.gz
BIN=${TOP}/bin/${TOOL}
if [ ! -f ${FILE} ] ; then
wget http://ftp.gnu.org/gnu/${TOOL}/${FILE}
else
echo ${FILE} already exists! Using existing copy.
fi
if [ ! -d ${TDIR} ] ; then
echo Unpacking ${FILE}
tar -xzf ${FILE}
else
echo ${TDIR} already exists! Using existing copy.
fi
if [ -f ${BIN} ] ; then
echo ${BIN} already exists! Skipping build.
else
cd ${TOP}/${TDIR}
./configure --prefix=${TOP} M4=${TOP}/bin/m4 && make -j ${MAKE_JNUM} && make install
if [ "x$?" != "x0" ] ; then
echo FAILURE 3
exit
fi
fi
cd ${TOP}
TOOL=automake
TDIR=${TOOL}-${AUTOMAKE_VERSION}
FILE=${TDIR}.tar.gz
BIN=${TOP}/bin/${TOOL}
if [ ! -f ${FILE} ] ; then
wget http://ftp.gnu.org/gnu/${TOOL}/${FILE}
else
echo ${FILE} already exists! Using existing copy.
fi
if [ ! -d ${TDIR} ] ; then
echo Unpacking ${FILE}
tar -xzf ${FILE}
else
echo ${TDIR} already exists! Using existing copy.
fi
if [ -f ${BIN} ] ; then
echo ${BIN} already exists! Skipping build.
else
cd ${TOP}/${TDIR}
./configure --prefix=${TOP} M4=${TOP}/bin/m4 && make -j ${MAKE_JNUM} && make install
if [ "x$?" != "x0" ] ; then
echo FAILURE 4
exit
fi
fi
;;
esac
armci-mpi/travis/build-run.sh 0000755 0001750 0001750 00000001327 12663426407 015771 0 ustar mbanck mbanck #! /bin/sh
# Exit on error
set -ev
os=`uname`
TRAVIS_ROOT="$1"
MPI_IMPL="$2"
# Environment variables
export CFLAGS="-std=c99"
#export MPICH_CC=$CC
export MPICC=mpicc
case "$os" in
Darwin)
;;
Linux)
export PATH=$TRAVIS_ROOT/mpich/bin:$PATH
export PATH=$TRAVIS_ROOT/open-mpi/bin:$PATH
;;
esac
# Capture details of build
case "$MPI_IMPL" in
mpich)
mpichversion
mpicc -show
;;
openmpi)
# this is missing with Mac build it seems
#ompi_info --arch --config
mpicc --showme:command
;;
esac
# Configure and build
./autogen.sh
./configure --disable-static --enable-win-allocate
# Run unit tests
export ARMCI_VERBOSE=1
make check
armci-mpi/benchmarks/ 0000755 0001750 0001750 00000000000 12662706250 014327 5 ustar mbanck mbanck armci-mpi/benchmarks/bench_groups.c 0000644 0001750 0001750 00000004034 12662706250 017152 0 ustar mbanck mbanck /*
* Copyright (C) 2010. See COPYRIGHT in top-level directory.
*/
#include
#include
#include
#include
#define PART_SIZE 1
int main(int argc, char **argv) {
int me, nproc;
int i, *procs;
ARMCI_Group g_world, g_odd, g_even;
MPI_Init(&argc, &argv);
ARMCI_Init();
MPI_Comm_rank(MPI_COMM_WORLD, &me);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
procs = malloc(sizeof(int) * ( nproc/2 + (nproc % 2 ? 1 : 0 )));
if (me == 0) printf("ARMCI Group test starting on %d procs\n", nproc);
ARMCI_Group_get_world(&g_world);
if (me == 0) printf(" + Creating odd group\n");
for (i = 1; i < nproc; i += 2) {
procs[i/2] = i;
}
ARMCI_Group_create_child(i/2, procs, &g_odd, &g_world);
if (me == 0) printf(" + Creating even group\n");
for (i = 0; i < nproc; i += 2) {
procs[i/2] = i;
}
ARMCI_Group_create_child(i/2, procs, &g_even, &g_world);
/***********************************************************************/
{
int grp_me, grp_nproc;
double t_abs_to_grp, t_grp_to_abs;
const int iter = 1000000;
if (me == 0) {
ARMCI_Group_rank(&g_even, &grp_me);
ARMCI_Group_size(&g_even, &grp_nproc);
t_abs_to_grp = MPI_Wtime();
for (i = 0; i < iter; i++)
ARMCII_Translate_absolute_to_group(&g_even, (grp_me+1) % grp_nproc);
t_abs_to_grp = MPI_Wtime() - t_abs_to_grp;
t_grp_to_abs = MPI_Wtime();
for (i = 0; i < iter; i++)
ARMCI_Absolute_id(&g_even, (grp_me+1) % grp_nproc);
t_grp_to_abs = MPI_Wtime() - t_grp_to_abs;
printf("t_abs_to_grp = %f us, t_grp_to_abs = %f us\n", t_abs_to_grp/iter * 1.0e6, t_grp_to_abs/iter * 1.0e6);
}
ARMCI_Barrier();
}
/***********************************************************************/
if (me == 0) printf(" + Freeing groups\n");
if (me % 2 > 0)
ARMCI_Group_free(&g_odd);
else
ARMCI_Group_free(&g_even);
free(procs);
ARMCI_Finalize();
MPI_Finalize();
return 0;
}
armci-mpi/benchmarks/ring-flood.c 0000644 0001750 0001750 00000004125 12662706250 016535 0 ustar mbanck mbanck /*
* Copyright (C) 2010. See COPYRIGHT in top-level directory.
*/
#include
#include
#include
#include
#include
#include
#define MAX_XFER_SIZE 8192
#define NUM_XFERS 1024
int main(int argc, char **argv) {
int me, nproc;
int msg_length, i;
double t_start, t_stop;
armci_hdl_t *handles; // Non-blocking handles (NUM_XFERS)
uint8_t *snd_buf; // Send buffer (MAX_XFER_SIZE)
uint8_t **rcv_buf; // Receive buffer (MAX_XFER_SIZE * NUM_XFERS)
MPI_Init(&argc, &argv);
ARMCI_Init();
MPI_Comm_rank(MPI_COMM_WORLD, &me);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
if (nproc < 2)
ARMCI_Error("This benchmark should be run on at least two processes", 1);
if (me == 0)
printf("ARMCI flood bandwidth test, performing %d non-blocking xfers at each size.\n\n", NUM_XFERS);
handles = malloc(NUM_XFERS*sizeof(armci_hdl_t));
rcv_buf = malloc(nproc*sizeof(void*));
ARMCI_Malloc((void*)rcv_buf, MAX_XFER_SIZE*NUM_XFERS);
snd_buf = ARMCI_Malloc_local(MAX_XFER_SIZE);
for (i = 0; i < MAX_XFER_SIZE; i++) {
snd_buf[i] = (uint8_t) me;
}
for (msg_length = 1; msg_length <= MAX_XFER_SIZE; msg_length *= 2) {
int xfer;
for (xfer = 0; xfer < NUM_XFERS; xfer++)
ARMCI_INIT_HANDLE(&handles[xfer]);
ARMCI_Barrier();
t_start = MPI_Wtime();
// Initiate puts, perform NUM_XFERS NB puts to my right neighbor
for (xfer = 0; xfer < NUM_XFERS; xfer++) {
ARMCI_NbPut(snd_buf, ((uint8_t*)rcv_buf[(me+1)%nproc])+msg_length*xfer,
msg_length, (me+1)%nproc, &handles[xfer]);
}
// Wait for completion
for (xfer = 0; xfer < NUM_XFERS; xfer++)
ARMCI_Wait(&handles[xfer]);
ARMCI_Barrier();
t_stop = MPI_Wtime();
if (me == 0)
printf("%8d bytes \t %12.8f sec \t %12.8f GB/s\n",
msg_length*NUM_XFERS, (t_stop-t_start),
(msg_length*NUM_XFERS)/(t_stop-t_start)/1.0e9);
}
ARMCI_Free(rcv_buf[me]);
free(rcv_buf);
free(handles);
ARMCI_Free_local(snd_buf);
ARMCI_Finalize();
MPI_Finalize();
return 0;
}
armci-mpi/benchmarks/ping-pong.c 0000644 0001750 0001750 00000005765 12662706250 016406 0 ustar mbanck mbanck /*
* Copyright (C) 2010. See COPYRIGHT in top-level directory.
*/
#include
#include
#include
#include
#include
#include
#define MAX_SIZE 262144
#define NUM_ROUNDS 1000
int main(int argc, char **argv) {
int me, nproc, zero, target;
int msg_length, round, i;
double t_start, t_stop;
uint8_t *snd_buf; // Send buffer (byte array)
uint8_t **rcv_buf; // Receive buffer (byte array)
MPI_Init(&argc, &argv);
ARMCI_Init();
MPI_Comm_rank(MPI_COMM_WORLD, &me);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
if (nproc < 2)
ARMCI_Error("This benchmark should be run on at least two processes", 1);
if (me == 0)
printf("ARMCI ping-pong latency test, performing %d rounds at each xfer size.\n", NUM_ROUNDS);
rcv_buf = malloc(nproc*sizeof(void*));
ARMCI_Malloc((void*)rcv_buf, MAX_SIZE);
snd_buf = ARMCI_Malloc_local(MAX_SIZE);
zero = 0;
for (i = 0; i < MAX_SIZE; i++) {
snd_buf[i] = 1;
}
for (target = 1; target < nproc; target++) {
if (me == 0) printf("\n========== Process pair: %d and %d ==========\n\n", 0, target);
for (msg_length = 1; msg_length <= MAX_SIZE; msg_length *= 2) {
ARMCI_Barrier();
t_start = MPI_Wtime();
if (me == 0 || me == target) {
// Perform NUM_ROUNDS ping-pongs
for (round = 0; round < NUM_ROUNDS*2; round++) {
int my_target = me == 0 ? target : 0;
// I am the sender
if (round % 2 == me) {
if ((round % 2 == 0 && me == 0) || (round % 2 != 0 && me != 0)) {
// Clear start and end markers for next round
#ifdef DIRECT_ACCESS
((uint8_t*)rcv_buf[me])[0] = 0;
((uint8_t*)rcv_buf[me])[msg_length-1] = 0;
#else
ARMCI_Put(&zero, &(((uint8_t*)rcv_buf[me])[0]), 1, me);
ARMCI_Put(&zero, &(((uint8_t*)rcv_buf[me])[msg_length-1]), 1, me);
#endif
ARMCI_Put(snd_buf, rcv_buf[my_target], msg_length, my_target);
ARMCI_Fence(my_target); // This is optional, we don't need notification
}
// I am the receiver
else {
#ifdef DIRECT_ACCESS
while (((volatile uint8_t*)rcv_buf[me])[0] == 0) ;
while (((volatile uint8_t*)rcv_buf[me])[msg_length-1] == 0) ;
#else
uint8_t val;
do {
ARMCI_Get(&(((uint8_t*)rcv_buf[me])[0]), &val, 1, me);
} while (val == 0);
do {
ARMCI_Get(&(((uint8_t*)rcv_buf[me])[msg_length-1]), &val, 1, me);
} while (val == 0);
#endif
}
}
}
}
ARMCI_Barrier(); // FIXME: Time here increases with nproc :(
t_stop = MPI_Wtime();
if (me == 0)
printf("%8d bytes \t %12.8f us\n", msg_length, (t_stop-t_start)/NUM_ROUNDS*1.0e6);
}
ARMCI_Barrier();
}
ARMCI_Free(rcv_buf[me]);
free(rcv_buf);
ARMCI_Free_local(snd_buf);
ARMCI_Finalize();
MPI_Finalize();
return 0;
}
armci-mpi/benchmarks/Makefile.mk 0000644 0001750 0001750 00000001651 12662706250 016400 0 ustar mbanck mbanck #
# Copyright (C) 2010. See COPYRIGHT in top-level directory.
#
check_PROGRAMS += benchmarks/ping-pong \
benchmarks/ring-flood \
benchmarks/contiguous-bench \
benchmarks/strided-bench \
benchmarks/bench_groups \
benchmarks/rmw_perf \
# end
TESTS += benchmarks/ping-pong \
benchmarks/ring-flood \
benchmarks/contiguous-bench \
benchmarks/strided-bench \
benchmarks/rmw_perf \
# end
benchmarks_ping_pong_LDADD = libarmci.la
benchmarks_ring_flood_LDADD = libarmci.la
benchmarks_contiguous_bench_LDADD = libarmci.la -lm
benchmarks_strided_bench_LDADD = libarmci.la -lm
benchmarks_bench_groups_LDADD = libarmci.la -lm
benchmarks_rmw_perf_LDADD = libarmci.la
armci-mpi/benchmarks/rmw_perf.c 0000644 0001750 0001750 00000005425 12662706250 016322 0 ustar mbanck mbanck /*
* Copyright (C) 2010. See COPYRIGHT in top-level directory.
*/
#include
#include
#include
#include
#include
#include
#ifdef USE_ARMCI_LONG
# define INC_TYPE long
# define ARMCI_OP ARMCI_FETCH_AND_ADD_LONG
#else
# define INC_TYPE int
# define ARMCI_OP ARMCI_FETCH_AND_ADD
#endif
int main(int argc, char* argv[])
{
int provided;
#ifdef __bgp__
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
assert(provided==MPI_THREAD_MULTIPLE);
#else
MPI_Init_thread(&argc, &argv, MPI_THREAD_SINGLE, &provided);
#endif
int rank, nproc;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
if (nproc<2) {
printf("This benchmark requires >1 MPI processes\n");
MPI_Finalize();
return 1;
}
ARMCI_Init();
int count = ( argc > 1 ? atoi(argv[1]) : 1000000 );
char * cfair = getenv ("CHECK_FAIRNESS");
int check_fairness = (cfair!=NULL) ? 1 : 0;
int * complete = (int *) malloc(sizeof(int) * count);
for(int i=0; i0)
{
int target = 0;
INC_TYPE val = -1;
double t0 = MPI_Wtime();
while(val < count) {
ARMCI_Rmw(ARMCI_OP, &val, base_ptrs[target], 1, target);
if (val < count) {
complete[val] = rank;
nrecv++;
}
}
double t1 = MPI_Wtime();
tt = (t1-t0);
}
MPI_Allreduce(MPI_IN_PLACE, complete, count, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
double dt = 1.e6*(double)tt/(double)nrecv;
if(nrecv>0)
printf("process %d received %d counters in %lf seconds (%lf microseconds per call)\n",
rank, nrecv, tt, dt);
fflush(stdout);
MPI_Barrier(MPI_COMM_WORLD);
if (0==rank && check_fairness==1) {
printf("Checking for fairness...\n");
fflush(stdout);
for(int i=0; i