Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f29d430
use embeded fftw3 as a subpackage
rainwoodman Jul 7, 2015
d03c15e
Better omp support?
rainwoodman Sep 16, 2015
a04e487
Better omp support
rainwoodman Sep 16, 2015
7641c10
avoid backslash
rainwoodman Jun 5, 2016
8985ddd
update fftw3.
rainwoodman Jun 5, 2016
80f5f67
bump version
rainwoodman Jun 5, 2016
7438be0
bump version and embedded fftw
rainwoodman Dec 4, 2017
a889f7d
use fftw 3.3.7
rainwoodman Dec 4, 2017
b64ae80
add 2d on 2d test case.
rainwoodman Jan 13, 2018
bd0e8d3
update 2don2d
rainwoodman Jan 13, 2018
e56d072
add generic remap_nd interface.
rainwoodman Jan 17, 2018
9eb3054
Add some comments in the code.
rainwoodman Jan 17, 2018
309fc96
add a 2dto1d remapping that compiles.
rainwoodman Jan 18, 2018
0e13ca1
add interface of 2dto1d in remap.c
rainwoodman Jan 18, 2018
adb637e
At least now the test case runs.
rainwoodman Jan 18, 2018
00c0d35
fix the 2don2d test case on 1x1.
rainwoodman Jan 18, 2018
8f1f3d7
update tests.
rainwoodman Jan 18, 2018
ccda6c7
c2c is correct but c of r2c is wrong.
rainwoodman Jan 18, 2018
516f202
Actually c2c also doesn't work on 4x4 with 1x2.
rainwoodman Jan 18, 2018
e84ff0b
add gather and print helpers.
rainwoodman Jan 18, 2018
94f9ae3
rename members of fftwplan for better understanding.
rainwoodman Jan 18, 2018
2915350
commit c2c 2don2d test.
rainwoodman Jan 18, 2018
f8b62a6
remove noisy message from api.
rainwoodman Jan 18, 2018
36362fb
add the third transpose that breaks the roundtrip.
rainwoodman Jan 18, 2018
27b3b44
c2c_3don3d prints the array for easier consistency checks.
rainwoodman Jan 18, 2018
b01e24b
Minor: fix calculation of plain index (only used for generation of in…
Jan 29, 2018
71320e1
Minor: cleanup 2dto1d remap
Jan 29, 2018
5886b08
Minor: edit comment
Jan 29, 2018
16544ff
bugfix: fix order of in and out arrays
Jan 29, 2018
21e278f
protect critical remap_routines with needs_remap.
rainwoodman Feb 8, 2018
184045d
remove a few printfs
rainwoodman May 14, 2018
fe9732c
follow convention to write to input if DESTROY_INPUT is set.
rainwoodman May 14, 2018
15572f2
clean up the code.
rainwoodman May 15, 2018
bc0b03b
roughly follow the heuristics in remap_3dto2d.c
rainwoodman May 15, 2018
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "fftw3"]
path = fftw3
url = https://github.com/rainwoodman/fftw3
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
"LDFLAGS=@LDFLAGS@"

# Traverse these subdirectories, the current one first (for config.h).
SUBDIRS = kernel gcell util api .
SUBDIRS = fftw3 kernel gcell util api .

if ENABLE_TESTS
SUBDIRS += tests
Expand Down Expand Up @@ -46,7 +46,7 @@ lib@PFFT_PREFIX@pfft@PREC_SUFFIX@@OPENMP_SUFFIX@_la_LIBADD = \
gcell/libgcell.la

lib@PFFT_PREFIX@pfft@PREC_SUFFIX@@OPENMP_SUFFIX@_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
lib@PFFT_PREFIX@pfft@PREC_SUFFIX@@OPENMP_SUFFIX@_la_CFLAGS = $(OPENMP_CFLAGS)
lib@PFFT_PREFIX@pfft@PREC_SUFFIX@@OPENMP_SUFFIX@_la_CFLAGS = $(OPENMP_CFLAGS) -I $(top_srcdir)/mpi -I $(top_srcdir)/api

# Get Fortran compile rules that include preprocessing.
include $(top_srcdir)/build-aux/fortran-rules.am
Expand All @@ -58,6 +58,8 @@ pfft1@PREC_SUFFIX@@OPENMP_SUFFIX@.pc: pfft.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pfft.pc

DISTCHECK_CONFIGURE_FLAGS=--disable-shared --disable-doc --enable-mpi --enable-fortran

#################################################################
# Documentation
#################################################################
Expand Down
4 changes: 4 additions & 0 deletions api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/kernel

# Directory of util.h
AM_CPPFLAGS += -I$(top_srcdir)/util
#
# Directory of fftw3
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/api
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/mpi

# OpenMP support
AM_CFLAGS = $(OPENMP_CFLAGS)
Expand Down
28 changes: 5 additions & 23 deletions api/api-adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "ipfft.h"
#include "util.h"

static void calculate_3dto2d_blocks(
const INT *n, MPI_Comm comm_cart_3d,
INT *iblk);


INT PX(local_size_many_dft)(
int rnk_n, const INT *n, const INT *ni, const INT *no,
INT howmany, const INT *iblock, const INT *oblock,
Expand Down Expand Up @@ -238,7 +233,7 @@ PX(gcplan) PX(plan_many_rgc)(
)
{
int rnk_pm;
INT blk_3dto2d[3];
INT blk_for_remap[3];
MPI_Comm *comms_pm;
PX(gcplan) ths;
MPI_Comm comm_cart = PX(assure_cart_comm)(comm);
Expand All @@ -256,13 +251,13 @@ PX(gcplan) PX(plan_many_rgc)(
comms_pm = (MPI_Comm*) malloc(sizeof(MPI_Comm) * (size_t) rnk_pm);
PX(split_cart_procmesh)(comm_cart, comms_pm);

if( PX(needs_3dto2d_remap)(rnk_n, comm_cart) ){
if( PX(needs_remap_nd)(rnk_n, comm_cart) ){
/* 3d to 2d remap results in complicated blocks.
* We ignore users input and use default block size. */
calculate_3dto2d_blocks(pn, comm_cart,
blk_3dto2d);
PX(remap_nd_calculate_blocks)(rnk_n, pn, comm_cart,
blk_for_remap);
ths = PX(plan_rgc_internal)(
rnk_n, pn, howmany, blk_3dto2d, gc_below, gc_above,
rnk_n, pn, howmany, blk_for_remap, gc_below, gc_above,
data, rnk_pm, comms_pm, comm_cart, gc_flags);
} else
ths = PX(plan_rgc_internal)(
Expand All @@ -279,19 +274,6 @@ PX(gcplan) PX(plan_many_rgc)(
return ths;
}

static void calculate_3dto2d_blocks(
const INT *n, MPI_Comm comm_cart_3d,
INT *iblk
)
{
int q0, q1, p0, p1;
INT mblk[3], oblk[3];

PX(get_procmesh_dims_2d)(comm_cart_3d, &p0, &p1, &q0, &q1);
PX(default_block_size_3dto2d)(n, p0, p1, q0, q1,
iblk, mblk, oblk);
}

PX(gcplan) PX(plan_many_cgc)(
int rnk_n, const INT *n,
INT howmany, const INT *block,
Expand Down
20 changes: 11 additions & 9 deletions api/api-basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ static R check_array(
case PFFTI_ARRAYTYPE_HERMITIAN_COMPLEX:
err = cabs( ((C*)data)[k] - 0.5 * (d1 + conj(d2))); break;
}

if( err > maxerr )
maxerr = err;
}
Expand Down Expand Up @@ -258,7 +257,7 @@ static INT plain_index(
INT k=0;

for(INT t=0; t<rnk; t++)
k += k*n[t] + kvec[t];
k = k*n[t] + kvec[t];

return k;
}
Expand Down Expand Up @@ -1076,19 +1075,22 @@ static void PX(execute_full)(
twiddle_input(ths, ths->in, ths->out, in, out);
PFFT_FINISH_TIMING(ths->timer->itwiddle);

PFFT_START_TIMING(ths->comm_cart, ths->timer->remap_3dto2d[0]);
PX(execute_remap_3dto2d)(ths->remap_3dto2d[0], ths->in, ths->out, in, out);
PFFT_FINISH_TIMING(ths->timer->remap_3dto2d[0]);
PFFT_START_TIMING(ths->comm_cart, ths->timer->remap_nd[0]);
PX(execute_remap_nd)(ths->remap_nd[0], ths->in, ths->out, in, out);
PFFT_FINISH_TIMING(ths->timer->remap_nd[0]);


execute_transposed(r, ths->serial_trafo, ths->global_remap,
ths->timer->trafo, ths->timer->remap, ths->in, ths->out, in, out, ths->comm_cart);

execute_transposed(r, &ths->serial_trafo[r+1], &ths->global_remap[r],
&ths->timer->trafo[r+1], &ths->timer->remap[r], ths->in, ths->out, in, out, ths->comm_cart);

PFFT_START_TIMING(ths->comm_cart, ths->timer->remap_3dto2d[1]);
PX(execute_remap_3dto2d)(ths->remap_3dto2d[1], ths->in, ths->out, in, out);
PFFT_FINISH_TIMING(ths->timer->remap_3dto2d[1]);

PFFT_START_TIMING(ths->comm_cart, ths->timer->remap_nd[1]);

PX(execute_remap_nd)(ths->remap_nd[1], ths->in, ths->out, in, out);

PFFT_FINISH_TIMING(ths->timer->remap_nd[1]);

/* twiddle outputs in order to get inputs shifted by n/2 */
PFFT_START_TIMING(ths->comm_cart, ths->timer->otwiddle);
Expand Down
15 changes: 13 additions & 2 deletions api/pfft.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,19 @@ BEGIN_C_DECLS
PFFT_EXTERN PX(gctimer) PX(convert_vec2gctimer)( \
const double *times); \
PFFT_EXTERN void PX(destroy_gctimer)( \
PX(gctimer) ths);

PX(gctimer) ths); \
\
PFFT_EXTERN R * PX(gather_array)(const int rnk_n, const int howmany, \
const R * local, \
const INT* local_start, \
const INT * local_n, \
const INT * global_n, \
MPI_Comm comm); \
void PX(print_array)(int rnk_n, \
int howmany, \
R * a, \
const INT * ni, \
MPI_Comm comm); \


#define PFFT_MANGLE_DOUBLE(name) PFFT_CONCAT(pfft_, name)
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
alias libtoolize=$(type -p glibtoolize libtoolize | head -1)

touch ChangeLog
touch fftw3/ChangeLog

echo "PLEASE IGNORE WARNINGS AND ERRORS"

rm -rf autom4te.cache
libtoolize
autoreconf --verbose --install --force
autoreconf --verbose --install --symlink --force

rm -f config.cache

Expand Down
36 changes: 4 additions & 32 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
AC_PREREQ(2.64)

# autoconf initialization
AC_INIT([PFFT],[1.0.8-alpha],[michael.pippig@mathematik.tu-chemnitz.de],[pfft],[http://www.tu-chemnitz.de/~mpip/software/])
AC_INIT([PFFT],[1.0.8-alpha3-fftw3],[michael.pippig@mathematik.tu-chemnitz.de],[pfft],[http://www.tu-chemnitz.de/~mpip/software/])
m4_ifndef([AC_PACKAGE_URL],
[AC_SUBST([PACKAGE_URL], [http://www.tu-chemnitz.de/~mpip/software/])])

Expand Down Expand Up @@ -263,6 +263,7 @@ SHARED_VERSION_INFO="0:0:0"
# substitute SHARED_VERSION_INFO in generated Makefiles
AC_SUBST(SHARED_VERSION_INFO)

AC_DISABLE_SHARED dnl to hell with shared libraries

################################################################################
# program checks
Expand All @@ -280,37 +281,6 @@ AC_SUBST(SHARED_VERSION_INFO)
# May need sincos from libm.
AC_CHECK_LIB([m], [sincos])

# Check for FFTW3, MPI FFTW and threaded FFTW.
if test "x$PRECISION" = "xs" ; then
AX_LIB_FFTW3F
elif test "x$PRECISION" = "xl" ; then
AX_LIB_FFTW3L
else
AX_LIB_FFTW3
fi

if test "x$ax_lib_fftw3" = "xno"; then
AC_MSG_ERROR([You do not seem to have the FFTW-3.3 library installed.]
[You can download it from http://www.fftw.org. If you have installed FFTW-3.3, ]
[make sure that this configure script can find it. See ./configure ]
[--help for more information.])
fi

if test "x$ax_lib_fftw3_mpi" = "xno"; then
AC_MSG_ERROR([You do not seem to have the MPI part of the FFTW-3.3 library installed.]
[You can download it from http://www.fftw.org. If you have installed FFTW-3.3, ]
[make sure that this configure script can find it. See ./configure --help]
[for more information.])
fi

if test "x$enable_openmp" = "xyes" -a "x$ax_lib_fftw3_openmp" = "xno"; then
AC_MSG_ERROR([You do not seem to have the OpenMP part of the FFTW-3.3 library installed.]
[You can download it from http://www.fftw.org. If you have installed FFTW-3.3, ]
[make sure that this configure script can find it. See ./configure --help]
[for more information.])
fi


################################################################################
# compiler options
################################################################################
Expand Down Expand Up @@ -482,4 +452,6 @@ AC_CONFIG_LINKS([tests/build_checks.sh:tests/build_checks.sh
tests/run_checks.sh:tests/run_checks.sh
tests/manual_c2c_3d.c:tests/manual_c2c_3d.c])

AC_CONFIG_SUBDIRS([fftw3])

AC_OUTPUT
1 change: 1 addition & 0 deletions fftw3
Submodule fftw3 added at 7a893f
4 changes: 4 additions & 0 deletions gcell/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/api

# Directory of util.h
AM_CPPFLAGS += -I$(top_srcdir)/util
#
# Directory of fftw3
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/api
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/mpi

noinst_LTLIBRARIES = libgcell.la

Expand Down
6 changes: 6 additions & 0 deletions kernel/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/api

# Directory of util.h
AM_CPPFLAGS += -I$(top_srcdir)/util
#
# Directory of fftw
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/api
AM_CPPFLAGS += -I$(top_srcdir)/fftw3/mpi

noinst_LTLIBRARIES = libkernel.la

Expand All @@ -21,6 +25,8 @@ libkernel_la_SOURCES = \
partrafo.c \
sertrafo.c \
procmesh.c \
remap.c \
remap_3dto2d.c \
remap_2dto1d.c \
timer.c \
transpose.c
Loading