Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTSCOTCH: Large refactor #16

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

jobs:
build:
working_directory: ~/test
machine: true
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./ci_support/fast_finish_ci_pr_build.sh
./ci_support/checkout_merge_commit.sh
- run:
command: docker pull condaforge/linux-anvil
- run:
# Run, test and (if we have a BINSTAR_TOKEN) upload the distributions.
command: ./ci_support/run_docker_build.sh

workflows:
version: 2
build_and_test:
jobs:
- build
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
* text=auto

*.patch binary
*.diff binary
meta.yaml text eol=lf
build.sh text eol=lf
bld.bat text eol=crlf
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ To manage the continuous integration and simplify feedstock maintenance
Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

For more information please check the [conda-forge documentation](https://conda-forge.org/docs/).

Terminology
===========
Expand Down Expand Up @@ -104,4 +105,4 @@ In order to produce a uniquely identifiable distribution:
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string).
* If the version of a package **is** being increased, please remember to return
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string)
back to 0.
back to 0.
20 changes: 17 additions & 3 deletions ci_support/run_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,30 @@ show_channel_urls: true
CONDARC
)

# In order for the conda-build process in the container to write to the mounted
# volumes, we need to run with the same id as the host machine, which is
# normally the owner of the mounted volumes, or at least has write permission
HOST_USER_ID=$(id -u)
# Check if docker-machine is being used (normally on OSX) and get the uid from
# the VM
if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then
HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u)
fi

rm -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done"

cat << EOF | docker run -i \
-v "${RECIPE_ROOT}":/recipe_root \
-v "${FEEDSTOCK_ROOT}":/feedstock_root \
-e HOST_USER_ID="${HOST_USER_ID}" \
-a stdin -a stdout -a stderr \
condaforge/linux-anvil \
bash || exit 1

set -e
set +x
export BINSTAR_TOKEN=${BINSTAR_TOKEN}
set -x
export PYTHONUNBUFFERED=1

echo "$config" > ~/.condarc
Expand All @@ -43,9 +57,9 @@ conda clean --lock
conda install --yes --quiet conda-forge-build-setup
source run_conda_forge_build_setup

# Embarking on 1 case(s).
conda build /recipe_root --quiet || exit 1
upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1
conda build /recipe_root --quiet || exit 1
upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1

touch /feedstock_root/build_artefacts/conda-forge-build-done
EOF

Expand Down
19 changes: 0 additions & 19 deletions circle.yml

This file was deleted.

63 changes: 63 additions & 0 deletions recipe/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# -*- mode: makefile-gmake -*-

EXE =
LIB = .a
OBJ = .o

AR = ar
ARFLAGS = -ruv
CAT = cat
CCS = ${CC}
CCP = ${CCS}
CCD = ${CCP}
CFLAGS := ${CFLAGS}
CLIBFLAGS = -fPIC
LDFLAGS := $(filter-out -lc++,${LDFLAGS})
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = ranlib
YACC = bison -pscotchyy -y -b y

ifeq (${PKG_NAME},ptscotch)
CCP = mpicc
endif

ifeq (${MAKELEVEL},0)

pthread ?= 1
UNAME_S ?= $(shell uname -s)

CFLAGS += -O3
CFLAGS += -I${PREFIX}/include
CFLAGS += -DIDXSIZE64
CFLAGS += -DSCOTCH_RENAME
CFLAGS += -Drestrict=__restrict
CFLAGS += -DCOMMON_FILE_COMPRESS_GZ
CFLAGS += -DCOMMON_RANDOM_FIXED_SEED
LDFLAGS += -L${PREFIX}/lib -lz -lm

ifeq (${pthread},1)
CFLAGS += -pthread
CFLAGS += -DCOMMON_PTHREAD
#CFLAGS += -DSCOTCH_PTHREAD
ifeq ($(UNAME_S),Darwin)
CFLAGS += -DCOMMON_PTHREAD_BARRIER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it would be easier to set CFLAGS, etc. in build.sh instead of Makefile, and just have CFLAGS = ${CFLAGS} here. Makefiles aren't very good at logic.

endif
LDFLAGS += -pthread
endif

ifeq ($(UNAME_S),Darwin)
CFLAGS += -DCOMMON_TIMING_OLD
endif

ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
endif

export CFLAGS
export LDFLAGS

endif #(${MAKELEVEL},0)
21 changes: 0 additions & 21 deletions recipe/Makefile.inc.i686_mac_darwin10

This file was deleted.

21 changes: 0 additions & 21 deletions recipe/Makefile.inc.x86-64_pc_linux2

This file was deleted.

49 changes: 38 additions & 11 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
#!/bin/sh

cd src/

if [ `uname` == "Darwin" ]; then
cp $RECIPE_DIR/Makefile.inc.i686_mac_darwin10 Makefile.inc
else
cp $RECIPE_DIR/Makefile.inc.x86-64_pc_linux2 Makefile.inc
sed -i 's#-l$(SCOTCHLIB)errexit#-l$(SCOTCHLIB)errexit -lm#g' esmumps/Makefile
fi
cp $RECIPE_DIR/Makefile.inc src/Makefile.inc

make ptesmumps | tee make.log 2>&1
# build
cd src/
make esmumps 2>&1 | tee -a make.log
make check
cd ..

# install.
# install
mkdir -p $PREFIX/lib/
cp lib/* $PREFIX/lib/
mkdir -p $PREFIX/bin/
cp bin/* $PREFIX/bin/
mkdir -p $PREFIX/include/
cp include/* $PREFIX/include/

if [ "$PKG_NAME" == "ptscotch" ]
then

export HYDRA_LAUNCHER=fork
export MPIEXEC=mpiexec
if [[ "$(uname)" == "Linux" ]]; then
# skip mpiexec tests on Linux due to conda-forge bug:
# https://github.com/conda-forge/conda-smithy/pull/337
export MPIEXEC="echo SKIPPING $MPIEXEC"
fi
if [[ "$(uname)" == "Darwin" ]]; then
# the following test fails with "write error"
# on Travis-CI during 'make ptcheck'
# $ mpiexec -n 4 ./test_scotch_dgraph_redist data/bump.grf
export MPIEXEC="echo SKIPPING $MPIEXEC"
fi

# build
cd src/
make ptesmumps 2>&1 | tee -a make.log
make ptcheck EXECP="$MPIEXEC -n 4"
cd ..
# install.
mkdir -p $PREFIX/lib/
cp lib/libpt* $PREFIX/lib/
mkdir -p $PREFIX/bin/
cp bin/dg* $PREFIX/bin/
mkdir -p $PREFIX/include/
cp include/ptscotch*.h $PREFIX/include/
cp include/parmetis.h $PREFIX/include/

fi
39 changes: 25 additions & 14 deletions recipe/meta.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ source:
fn: {{ name }}-{{ version }}.tar.gz
md5: {{ md5 }}
url: https://gforge.inria.fr/frs/download.php/latestfile/298/scotch_{{ version }}.tar.gz
patches:
- patch1.diff
- patch2.diff

build:
skip: true # [win]
number: 2
number: 3

requirements:
build:
Expand All @@ -27,30 +30,37 @@ requirements:
- mpich 3.2.*

test:
requires:
- toolchain
commands:
- test -f "${PREFIX}/lib/libscotch.a"
- test -f "${PREFIX}/lib/libscotcherr.a"
- test -f "${PREFIX}/lib/libscotcherrexit.a"
- test -f "${PREFIX}/lib/libscotchmetis.a"
- test -f "${PREFIX}/lib/libptesmumps.a"
- test -f "${PREFIX}/lib/libesmumps.a"
- test -f "${PREFIX}/include/scotch.h"
- test -f "${PREFIX}/include/scotchf.h"
- test -f "${PREFIX}/include/metis.h"
- test -f "${PREFIX}/include/esmumps.h"
- mord -V
- gmap -V
- gord -V
- gotst -V
- gpart -V
- gscat -V
- test -f "${PREFIX}/lib/libptscotch.a"
- test -f "${PREFIX}/lib/libptscotcherr.a"
- test -f "${PREFIX}/lib/libptscotcherrexit.a"
- test -f "${PREFIX}/lib/libptscotchparmetis.a"
- test -f "${PREFIX}/include/esmumps.h"
- test -f "${PREFIX}/include/metis.h"
- test -f "${PREFIX}/include/scotch.h"
- test -f "${PREFIX}/include/scotchf.h"
- test -f "${PREFIX}/include/parmetis.h"
- test -f "${PREFIX}/lib/libptesmumps.a"
- test -f "${PREFIX}/include/ptscotch.h"
- test -f "${PREFIX}/include/ptscotchf.h"
- mord -V
- gotst -V
- gord -V
- gpart -V
- gmap -V
- test -f "${PREFIX}/include/parmetis.h"
- test -f "${PREFIX}/include/esmumps.h"
- dggath -V
- dgmap -V
- dgord -V
- dgpart -V
- dgscat -V
- dgtst -V

about:
home: https://www.labri.fr/perso/pelegrin/scotch/
Expand All @@ -67,4 +77,5 @@ about:
extra:
recipe-maintainers:
- basnijholt
- dalcinl
- minrk
11 changes: 11 additions & 0 deletions recipe/patch1.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff -up a/src/libscotch/library.h b/src/libscotch/library.h
--- a/src/libscotch/library.h 2015-03-01 12:14:02.000000000 +0300
+++ b/src/libscotch/library.h 2017-10-08 14:39:38.439477780 +0300
@@ -268,6 +268,7 @@ SCOTCH_Ordering * SCOTCH_order

void SCOTCH_randomReset (void);
void SCOTCH_randomSeed (SCOTCH_Num);
+void SCOTCH_randomProc (int);

SCOTCH_Strat * SCOTCH_stratAlloc (void);
int SCOTCH_stratInit (SCOTCH_Strat * const);
29 changes: 29 additions & 0 deletions recipe/patch2.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 841877aa173c1bf79e8b667b862d1bce12fe1d6b Mon Sep 17 00:00:00 2001
From: Satish Balay <balay@mcs.anl.gov>
Date: Wed, 17 Aug 2016 10:06:14 -0500
Subject: [PATCH] compile fix - when -DCOMMON_PTHREAD is not used

https://bitbucket.org/petsc/petsc/issues/141/
http://gforge.inria.fr/tracker/index.php?func=detail&aid=19407&group_id=248&atid=1079
---
src/libscotch/common.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libscotch/common.h b/src/libscotch/common.h
index 7b50a59..ac8b79a 100644
--- a/src/libscotch/common.h
+++ b/src/libscotch/common.h
@@ -306,7 +306,9 @@ typedef struct ThreadGroupHeader_ {
ThreadLaunchStartFunc stafptr; /*+ Pointer to start routine +*/
ThreadLaunchJoinFunc joifptr; /*+ Pointer to join routine +*/
ThreadBarrier barrdat; /*+ Barrier data structure +*/
-#endif /* ((defined COMMON_PTHREAD) || (defined SCOTCH_PTHREAD)) */
+#else /* ((defined COMMON_PTHREAD) || (defined SCOTCH_PTHREAD)) */
+ int thrdnbr; /*+ Number of threads +*/
+#endif
} ThreadGroupHeader;

/** The thread header block. **/
--
2.7.4.1.g5468f9e