devinamatthews/tblis

error: no instance of constructor "tci::communicator::broadcast_from_internal

jeffhammond opened this issue · 6 comments

Intel 18 beta compilers...

$ ../configure CC=icc CXX=icpc --enable-thread-model=openmp --enable-config=skx && make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of icc... gcc3
checking for icc option to accept ISO C99... -std=gnu99
checking dependency style of icc -std=gnu99... gcc3
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for gawk... (cached) gawk
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether we are using the GNU C++ compiler... yes
checking whether icpc accepts -g... yes
checking dependency style of icpc... gcc3
checking whether icpc supports C++11 features by default... no
checking whether icpc supports C++11 features with -std=c++11... yes
checking for C/C++ restrict keyword... __restrict
checking for library containing clock_gettime... none required
checking how to run the C++ preprocessor... icpc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking hbwmalloc.h usability... yes
checking hbwmalloc.h presence... yes
checking for hbwmalloc.h... yes
checking memkind.h usability... yes
checking memkind.h presence... yes
checking for memkind.h... yes
checking for library containing hbw_malloc... -lmemkind
checking hwloc.h usability... no
checking hwloc.h presence... no
checking for hwloc.h... no
checking for library containing hwloc_topology_init... no
checking for lscpu... lscpu
checking for sysctl... yes
checking for sysctlbyname... no
checking for sysconf... yes
checking for _SC_NPROCESSORS_CONF defined in unistd.h... yes
checking for _SC_NPROCESSORS_ONLN defined in unistd.h... yes
checking for ptrdiff_t... yes
checking whether ptrdiff_t is signed... yes
checking for index length type... ptrdiff_t
checking for ptrdiff_t... (cached) yes
checking whether ptrdiff_t is signed... (cached) yes
checking for index stride type... ptrdiff_t
checking for char... yes
checking for index label type... char
checking compiler vendor... icc
checking compiler version... 18.0.0
checking whether inline FMA3 can be compiled... yes
checking whether inline AVX-512F can be compiled... yes
checking whether inline AVX-512DQ can be compiled... yes
checking enabled configurations... skx
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by icc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from icc -std=gnu99 object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if icc -std=gnu99 supports -fno-rtti -fno-exceptions... yes
checking for icc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if icc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if icc -std=gnu99 static flag -static works... no
checking if icc -std=gnu99 supports -c -o file.o... yes
checking if icc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the icc -std=gnu99 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... icpc -E
checking for ld used by icpc... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the icpc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for icpc option to produce PIC... -fPIC -DPIC
checking if icpc PIC flag -fPIC -DPIC works... yes
checking if icpc static flag -static works... no
checking if icpc supports -c -o file.o... yes
checking if icpc supports -c -o file.o... (cached) yes
checking whether the icpc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/configs/foreach_type.h
config.status: creating src/configs/foreach_config.h
config.status: creating src/configs/foreach_config_and_type.h
config.status: creating src/configs/include_configs.hpp
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing src/tblis_config.h commands
config.status: creating src/tblis_config.h - prefix TBLIS for config.h defines
config.status: src/tblis_config.h is unchanged
=== configuring in src/external/tci (/nfs_home/jrhammon/BLIS/tblis/build-skx/src/external/tci)
configure: running /bin/sh ../../../../src/external/tci/configure --disable-option-checking '--prefix=/usr/local'  'CC=icc' 'CXX=icpc' '--enable-thread-model=openmp' '--enable-config=skx' --cache-file=/dev/null --srcdir=../../../../src/external/tci
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ISO C89... none needed
checking whether icc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of icc... gcc3
checking for icc option to accept ISO C99... -std=gnu99
checking how to run the C preprocessor... icc -std=gnu99 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for library containing pthread_create... -lpthread
checking for pthread_spin_init... yes
checking for pthread_mutex_init... yes
checking for pthread_barrier_init... yes
checking for icc -std=gnu99 option to support OpenMP... -fopenmp
checking libkern/OSAtomic.h usability... no
checking libkern/OSAtomic.h presence... no
checking for libkern/OSAtomic.h... no
checking for OSSpinLockLock... no
checking for __atomic_load_n... yes
checking for __atomic_load... yes
checking for __atomic_store_n... yes
checking for __atomic_store... yes
checking for __atomic_exchange_n... yes
checking for __atomic_exchange... yes
checking for __atomic_compare_exchange_n... yes
checking for __atomic_compare_exchange... yes
checking for __atomic_add_fetch... yes
checking for __atomic_sub_fetch... yes
checking for __atomic_and_fetch... yes
checking for __atomic_xor_fetch... yes
checking for __atomic_or_fetch... yes
checking for __atomic_nand_fetch... yes
checking for __atomic_fetch_add... yes
checking for __atomic_fetch_sub... yes
checking for __atomic_fetch_and... yes
checking for __atomic_fetch_xor... yes
checking for __atomic_fetch_or... yes
checking for __atomic_fetch_nand... yes
checking for __atomic_test_and_set... yes
checking for __atomic_clear... yes
checking for __atomic_thread_fence... yes
checking for __atomic_signal_fence... yes
checking for __atomic_always_lock_free... yes
checking for __atomic_is_lock_free... yes
checking mutex type... atomic_spinlock
checking barrier type... spin_barrier
checking thread model... openmp
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by icc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from icc -std=gnu99 object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if icc -std=gnu99 supports -fno-rtti -fno-exceptions... yes
checking for icc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if icc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if icc -std=gnu99 static flag -static works... no
checking if icc -std=gnu99 supports -c -o file.o... yes
checking if icc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the icc -std=gnu99 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tci/tci_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make  all-recursive
make[1]: Entering directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx'
Making all in src/external/tci
make[2]: Entering directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx/src/external/tci'
  CC       tci/barrier.lo
  CC       tci/communicator.lo
  CC       tci/context.lo
  CC       tci/mutex.lo
  CC       tci/parallel.lo
  CC       tci/slot.lo
  CC       tci/work_item.lo
  CCLD     lib/libtci.la
make[2]: Leaving directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx/src/external/tci'
make[2]: Entering directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx'
  CXX      src/iface/1v/add.lo
../src/external/tci/tci/communicator.h(226): error: no instance of constructor "tci::communicator::broadcast_from_internal<Func, Args...>::broadcast_from_internal [with Func=lambda [](tci::slot<-1> *&)->void, Args=<tci::slot<-1> *&>]" matches the argument list
            argument types are: (const tci::communicator, unsigned int, lambda [](tci::slot<-1> *&)->void, tci::slot<-1> *, tci::detail::index_sequence_for<tci::slot<-1> *&>)
              broadcast_from_internal<Func, Args...>
              ^
../src/external/tci/tci/communicator.h(150): note: this candidate was rejected because mismatch in count of arguments
          struct broadcast_from_internal
                 ^
../src/external/tci/tci/communicator.h(150): note: this candidate was rejected because mismatch in count of arguments
          struct broadcast_from_internal
                 ^
../src/external/tci/tci/communicator.h(153): note: this candidate was rejected because arguments do not match
              broadcast_from_internal(const communicator& comm, unsigned root,
              ^
          detected during:
            instantiation of "void tci::communicator::broadcast_from(unsigned int, Func &&, Args &&...) const [with Func=lambda [](tci::slot<-1> *&)->void, Args=<tci::slot<-1> *&>]" at line 248
            instantiation of "void tci::communicator::broadcast_value_from(unsigned int, Arg &) const [with Arg=tci::slot<-1> *]" at line 254
            instantiation of "void tci::communicator::broadcast_value(Arg &) const [with Arg=tci::slot<-1> *]" at line 92 of "../src/iface/1v/../../util/thread.h"

compilation aborted for ../src/iface/1v/add.cxx (code 2)
make[2]: *** [src/iface/1v/add.lo] Error 1
make[2]: Leaving directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/nfs_home/jrhammon/BLIS/tblis/build-skx'
make: *** [all] Error 2

I'm not quite sure how to work around this one, icpc 18 seems to think that the return value of std::forward<T*&>(T*&) is T*...

I came up with a minimal reproducer and possible workaround:

#include <vector>
#include <utility>

using namespace std;

//must be variadic
template <typename... Args>
struct foo1
{
    template <typename T>
    foo1(//actual arguments
         Args&&... args,
         //any template with deduced template paramataers
         std::vector<T>) {}
};

//must be variadic
template <typename... Args>
struct foo2
{
    template <typename T>
    foo2(//any template with deduced template paramataers
         std::vector<T>,
         //actual arguments
         Args&&... args) {}
};

template <typename... Args>
void bar(Args&&... args)
{
    //doesn't work
    foo1<Args...>{std::forward<Args>(args)..., std::vector<int>{}};
    //works
    foo2<Args...>{std::vector<int>{}, std::forward<Args>(args)...};
}

int main()
{
    int x;
    bar(x);
}

Ticket 03011774, which I'm recording here in case I somehow lose it.