diff --git a/packages/seacas/libraries/aprepro_lib/strings.cc b/packages/seacas/libraries/aprepro_lib/strings.cc index 737e032f5c..c9bafdfec4 100644 --- a/packages/seacas/libraries/aprepro_lib/strings.cc +++ b/packages/seacas/libraries/aprepro_lib/strings.cc @@ -62,8 +62,10 @@ std::vector build_strings() strings.emplace_back(R"({cd = tand(180/4)} {180-4*atand(cd)} $ tan(180/4))"); strings.emplace_back(R"()"); strings.emplace_back(R"(Test max, min, sign, dim, abs)"); - strings.emplace_back(R"({pmin = min(0.5, 1.0)} {nmin = min(-0.5, -1.0)} $ Should be 0.5, -1)"); - strings.emplace_back(R"({pmax = max(0.5, 1.0)} {nmax = max(-0.5, -1.0)} $ Should be 1.0, -0.5)"); + strings.emplace_back( + R"({pmin = min(0.5, 1.0)} {nmin = min(-0.5, -1.0)} $ Should be 0.5, -1)"); + strings.emplace_back( + R"({pmax = max(0.5, 1.0)} {nmax = max(-0.5, -1.0)} $ Should be 1.0, -0.5)"); strings.emplace_back(R"({zero = 0} {sign(0.5, zero) + sign(0.5, -zero)} $ Should be 0 1)"); strings.emplace_back( R"({nonzero = 1} {sign(0.5, nonzero) + sign(0.5, -nonzero)} $ Should be 1 0)"); diff --git a/packages/seacas/libraries/exodus/CMakeLists.txt b/packages/seacas/libraries/exodus/CMakeLists.txt index 4ece027a0e..697e022c57 100644 --- a/packages/seacas/libraries/exodus/CMakeLists.txt +++ b/packages/seacas/libraries/exodus/CMakeLists.txt @@ -7,8 +7,6 @@ endif() TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/include" ) -message("installing shared exodus to: ${CMAKE_INSTALL_LIBDIR}") - FILE(GLOB SOURCES src/ex_*.c) if (NOT ${PACKAGE_NAME}_HIDE_DEPRECATED_CODE) @@ -51,7 +49,6 @@ if (SEACASExodus_ENABLE_SHARED) # This keeps the library out of the `all_libs` targets... set_target_properties(exodus_shared PROPERTIES TRIBITS_TESTONLY_LIB TRUE) set_target_properties(exodus_shared PROPERTIES OUTPUT_NAME exodus) - message("installing shared exodus to: ${CMAKE_INSTALL_LIBDIR}") INSTALL(TARGETS exodus_shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() endif() @@ -76,7 +73,6 @@ if (SEACASExodus_ENABLE_STATIC) # Create a symbolic link from libexodus.a to libexoIIv2c.a -- do only for static lib InstallSymLink(libexodus.a ${CMAKE_INSTALL_PREFIX}/lib/libexoIIv2c.a) endif() -message("installing shared exodus to: ${CMAKE_INSTALL_LIBDIR}") if (${CMAKE_PROJECT_NAME} STREQUAL "Seacas") # add a target to generate API documentation with Doxygen @@ -91,7 +87,6 @@ if (${CMAKE_PROJECT_NAME} STREQUAL "Seacas") endif(DOXYGEN_FOUND) endif() endif() -message("installing shared exodus to: ${CMAKE_INSTALL_LIBDIR}") TRIBITS_ADD_TEST_DIRECTORIES(test) diff --git a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h index dbef70da81..54d65cc31f 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h @@ -289,7 +289,7 @@ namespace Ioss { /** \brief If a database type supports internal change sets, open the change set * specified [zero-based] index * - * \param[in] child_index The [zero-based] index of the internal change set to open. + * \param[in] set_index The [zero-based] index of the internal change set to open. * \returns True if successful. */ bool open_internal_change_set(int set_index) diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.h b/packages/seacas/libraries/ioss/src/Ioss_Utils.h index 3f0baeb87a..f6bf6f664b 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.h @@ -506,11 +506,11 @@ namespace Ioss { * \param[in] sb Compute the offset for element sides in this SideBlock * \returns The offset. */ + IOSS_NODISCARD static int64_t get_side_offset(const Ioss::SideBlock *sb); + IOSS_NODISCARD static int64_t get_side_offset(const Ioss::ElementTopology *parent_topo, const Ioss::ElementTopology *side_topo); - IOSS_NODISCARD static int64_t get_side_offset(const Ioss::SideBlock *sb); - IOSS_NODISCARD static unsigned int hash(const std::string &name); IOSS_NODISCARD static double timer(); diff --git a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C index 39bcc59b9c..7b8d15a55e 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C +++ b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022, 2024 National Technology & Engineering Solutions +// Copyright(C) 1999-2022, 2024, 2025 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -36,10 +36,12 @@ namespace Iohb { } } +#ifndef DOXYGEN_SKIP_THIS template void Layout::add(const std::string &name, const std::string &value); template void Layout::add(const std::string &name, const int &value); template void Layout::add(const std::string &name, const int64_t &value); template void Layout::add(const std::string &name, const size_t &value); +#endif // Ideally, this would be in the include file, but when building in Sierra, we // need to keep all `fmt` includes out of the include file due to some TPLs @@ -71,9 +73,11 @@ namespace Iohb { } } +#ifndef DOXYGEN_SKIP_THIS template void Layout::add(const std::string &name, const std::vector &value); template void Layout::add(const std::string &name, const std::vector &value); template void Layout::add(const std::string &name, const std::vector &value); +#endif template void Layout::add(const std::string &name, const std::vector &value) { diff --git a/packages/zoltan/CMakeLists.txt b/packages/zoltan/CMakeLists.txt index 94e6ba62ff..fb459a63a6 100644 --- a/packages/zoltan/CMakeLists.txt +++ b/packages/zoltan/CMakeLists.txt @@ -49,7 +49,7 @@ OPTION(${PACKAGE_NAME}_ENABLE_CPPDRIVER "Enable C++ driver for ${PACKAGE_NAME}." ${${PROJECT_NAME}_ENABLE_CXX} ) -IF (${PROJECT_NAME}_ENABLE_CXX) +IF (${PROJECT_NAME}_ENABLE_CXX) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_IGNORE_CXX_SEEK") ENDIF() diff --git a/packages/zoltan/COPYRIGHT b/packages/zoltan/COPYRIGHT new file mode 100644 index 0000000000..4e663b5cb7 --- /dev/null +++ b/packages/zoltan/COPYRIGHT @@ -0,0 +1,9 @@ + +Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring + Copyright (c) 2012 NTESS + +Copyright 2012 National Technology & Engineering Solutions of Sandia, +LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the +U.S. Government retains certain rights in this software. + +Copyright the Zoltan contributors. diff --git a/packages/zoltan/COPYRIGHT_AND_LICENSE b/packages/zoltan/COPYRIGHT_AND_LICENSE deleted file mode 100644 index 0af71a4318..0000000000 --- a/packages/zoltan/COPYRIGHT_AND_LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ diff --git a/packages/zoltan/LICENSE b/packages/zoltan/LICENSE new file mode 100644 index 0000000000..c1537e0839 --- /dev/null +++ b/packages/zoltan/LICENSE @@ -0,0 +1,31 @@ +SPDX-License-Identifier: BSD-3-Clause + +Copyright (c) 2012 NTESS and the Zoltan contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + 3. Neither the name of the copyright holder nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/zoltan/Makefile.am b/packages/zoltan/Makefile.am index 77d47b6e0e..0d03c27ec1 100644 --- a/packages/zoltan/Makefile.am +++ b/packages/zoltan/Makefile.am @@ -1,47 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER - ## ####################################################################### ## Options to automake (rarely used - don't worry about it) diff --git a/packages/zoltan/Makefile.export.zoltan.in b/packages/zoltan/Makefile.export.zoltan.in index 2c3071b91a..5217343f7d 100644 --- a/packages/zoltan/Makefile.export.zoltan.in +++ b/packages/zoltan/Makefile.export.zoltan.in @@ -10,7 +10,7 @@ ZOLTAN_INCLUDES = -I@abs_top_builddir@/src/include -I@abs_top_srcdir@/src/includ #@BUILD_FORTRAN90DRIVER_FALSE@ZFORLIBS = $(ZFLIBS) ZFORLIBS = $(ZFLIBS) -ZOLTAN_LIBS = @LDFLAGS@ -L@abs_top_builddir@/src -lzoltan @LIBS@ $(ZFORLIBS) $(SIMPI_LIBS) +ZOLTAN_LIBS = @LDFLAGS@ -L@abs_top_builddir@/src -lzoltan @LIBS@ $(ZFORLIBS) $(SIMPI_LIBS) ZOLTAN_LIBRARY_INCLUDES = -I@abs_top_builddir@/src/include -I@abs_top_srcdir@/src/include -I@abs_top_srcdir@/src/all -I@abs_top_srcdir@/src/coloring -I@abs_top_srcdir@/src/ha -I@abs_top_srcdir@/src/hier -I@abs_top_srcdir@/src/hsfc -I@abs_top_srcdir@/src/lb -I@abs_top_srcdir@/src/oct -I@abs_top_srcdir@/src/order -I@abs_top_srcdir@/src/par -I@abs_top_srcdir@/src/params -I@abs_top_srcdir@/src/tpls -I@abs_top_srcdir@/src/ccolamd -I@abs_top_srcdir@/src/phg -I@abs_top_srcdir@/src/rcb -I@abs_top_srcdir@/src/reftree -I@abs_top_srcdir@/src/timer -I@abs_top_srcdir@/src/Utilities/Communication -I@abs_top_srcdir@/src/Utilities/Timer -I@abs_top_srcdir@/src/Utilities/DDirectory -I@abs_top_srcdir@/src/Utilities/Memory -I@abs_top_srcdir@/src/Utilities/shared -I@abs_top_srcdir@/src/zz -I@abs_top_srcdir@/src/graph -I@abs_top_srcdir@/src/matrix -I@abs_top_srcdir@/src/simple $(SIMPI_INCDIR) @@ -59,7 +59,7 @@ ZOLTAN_DEFS = @DEFS@ # Fortran compilation flags @BUILD_FORTRAN90DRIVER_TRUE@ZOLTAN_FCFLAGS = @FCFLAGS@ @USE_FORTRAN_TRUE@ZOLTAN_FFLAGS = @FFLAGS@ - + # C compilation flags ZOLTAN_CFLAGS = @CFLAGS@ @@ -77,3 +77,4 @@ ZOLTAN_LDFLAGS = @LDFLAGS@ ############################################################################ ZOLTAN_RANLIB = @RANLIB@ + diff --git a/packages/zoltan/Makefile.in b/packages/zoltan/Makefile.in index 80c8a11fbc..8f74c72e00 100644 --- a/packages/zoltan/Makefile.in +++ b/packages/zoltan/Makefile.in @@ -15,49 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -300,7 +257,7 @@ ZOLTAN_TESTS = \ test/runtests \ test/ctest_zoltan.pl \ test/ch_simple \ - test/hg_simple + test/hg_simple ZOLTAN_DOCS = \ doc/Zoltan_html/Zoltan.html \ @@ -416,7 +373,7 @@ ZOLTAN_DOCS = \ doc/Zoltan_html/ug_html/ug_util.html \ doc/Zoltan_html/ug_html/ug_util_comm.html \ doc/Zoltan_html/ug_html/ug_util_dd.html \ - doc/Zoltan_html/ug_html/ug_util_mem.html + doc/Zoltan_html/ug_html/ug_util_mem.html ZOLTAN_SAMPLE = \ SampleConfigurationScripts/mac_osX_no_fortran \ @@ -446,11 +403,11 @@ EXTRA_DIST = config/generate-makeoptions.pl \ Disclaimer GNU_Lesser_GPL.txt Known_Problems VERSION \ $(ZOLTAN_DOCS) $(ZOLTAN_SAMPLE) $(ZOLTAN_TESTS) -AUX_DIST = config/install-sh config/missing config/mkinstalldirs +AUX_DIST = config/install-sh config/missing config/mkinstalldirs MAINTAINERCLEANFILES = Makefile.in aclocal.m4 autom4te.cache/* \ configure config.status config.log \ src/common/config-h.in src/common/stamp-h.in \ - $(AUX_DIST) + $(AUX_DIST) #We now build tests and examples through separate make targets, rather than @@ -460,11 +417,11 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 autom4te.cache/* \ #tarball. #Add this later -@SUB_TEST_TRUE@TEST_SUBDIR = +@SUB_TEST_TRUE@TEST_SUBDIR = @SUB_EXAMPLE_TRUE@EXAMPLE_SUBDIR = example @HAVE_MPI_FALSE@SIMPI_SUBDIR = siMPI -@HAVE_MPI_TRUE@SIMPI_SUBDIR = -SUBDIRS = $(SIMPI_SUBDIR) src $(EXAMPLE_SUBDIR) $(TEST_SUBDIR) +@HAVE_MPI_TRUE@SIMPI_SUBDIR = +SUBDIRS = $(SIMPI_SUBDIR) src $(EXAMPLE_SUBDIR) $(TEST_SUBDIR) TRILINOS_HOME_DIR = @abs_top_srcdir@/../.. TRILINOS_BUILD_DIR = @abs_top_builddir@/../.. TRILINOS_MPI_MAX_PROC = 4 @@ -514,7 +471,7 @@ src/include/Zoltan_config.h: src/include/stamp-h1 src/include/stamp-h1: $(top_srcdir)/src/include/Zoltan_config.h.in $(top_builddir)/config.status @rm -f src/include/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/Zoltan_config.h -$(top_srcdir)/src/include/Zoltan_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/src/include/Zoltan_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/include/stamp-h1 touch $@ @@ -1049,7 +1006,7 @@ runtests-mpi : --verbosity=1 \ --packages=zoltan -@USING_EXPORT_MAKEFILES_TRUE@install-exec-hook: +@USING_EXPORT_MAKEFILES_TRUE@install-exec-hook: @USING_EXPORT_MAKEFILES_TRUE@ mkdir -p $(DESTDIR)$(includedir) @USING_EXPORT_MAKEFILES_TRUE@ cp $(top_builddir)/Makefile.export.zoltan $(DESTDIR)$(includedir)/. @USING_EXPORT_MAKEFILES_TRUE@ $(PERL_EXE) $(top_srcdir)/config/replace-install-prefix.pl \ diff --git a/packages/zoltan/README b/packages/zoltan/README deleted file mode 100644 index 6eaf09490a..0000000000 --- a/packages/zoltan/README +++ /dev/null @@ -1,94 +0,0 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER -@HEADER - -********************************************************************** - - Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - Copyright 2012 Sandia Corporation - -Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -the U.S. Government retains certain rights in this software. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the Corporation nor the names of the -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Questions? Contact Karen Devine kddevin@sandia.gov - Erik Boman egboman@sandia.gov - -@HEADER - -############################################################################## - -INSTALLATION ------------- -Instructions for building and installing Zoltan using CMAKE or Autotools -are at the following web site: - - http://www.cs.sandia.gov/zoltan/ug_html/ug_usage.html - diff --git a/packages/zoltan/README.developer b/packages/zoltan/README.developer index bc2e5fb74d..05f35e194c 100644 --- a/packages/zoltan/README.developer +++ b/packages/zoltan/README.developer @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER lriesen@sandia.gov November 29, 2010 @@ -69,7 +26,7 @@ printf("GID: " ZOLTAN_ID_SPEC ", LID %d\n", my_gid, my_lid); To send a ZOLTAN_ID_TYPE in an MPI message, use ZOLTAN_ID_MPI_TYPE: -MPI_Bcast(&gid, 1, ZOLTAN_ID_MPI_TYPE, 0, MPI_COMM_WORLD); +MPI_Bcast(&gid, 1, ZOLTAN_ID_MPI_TYPE, 0, zoltan_get_global_comm()); To silence compiler warnings, you can properly specify a constant of type ZOLTAN_ID_TYPE using ZOLTAN_ID_CONSTANT: diff --git a/packages/zoltan/README.md b/packages/zoltan/README.md index 74cb91974c..4769d507ae 100644 --- a/packages/zoltan/README.md +++ b/packages/zoltan/README.md @@ -1,23 +1,53 @@ # Zoltan Zoltan Dynamic Load Balancing and Graph Algorithm Toolkit -- Distribution site -The most up-to-date version of Zoltan is in the Trilinos framework at https://github.com/trilinos/Trilinos. +The most up-to-date version of Zoltan is in the Trilinos framework +at https://github.com/trilinos/Trilinos. -This site provides stand-alone releases of Zoltan, separate from Trilinos: https://github.com/sandialabs/Zoltan/releases. Stand-alone releases of Zoltan may lag the Trilinos repo code. +This site provides stand-alone releases of Zoltan, separate from +Trilinos: https://github.com/sandialabs/Zoltan/releases. Stand-alone +releases of Zoltan may lag the Trilinos repo code. -You can download individual releases of Zoltan from this site, or clone the Trilinos repository -https://github.com/trilinos/Trilinos to get the most up-to-date version of Zoltan. Individual releases are tarballs that can be unzipped and built with autotools/make. +You can download individual releases of Zoltan from this site, or +clone the Trilinos repository https://github.com/trilinos/Trilinos +to get the most up-to-date version of Zoltan. Individual releases +are tarballs that can be unzipped and built with autotools/make. -Trilinos clones include Zoltan in directory Trilinos/packages/zoltan. In this directory, you can -build Zoltan separately from Trilinos using autotools/make. Or in the Trilinos repository, -you can build Zoltan using Trilinos' cmake system. +Trilinos clones include Zoltan in directory Trilinos/packages/zoltan. +In this directory, you can build Zoltan separately from Trilinos +using autotools/make. Or in the Trilinos repository, you can build +Zoltan using Trilinos' cmake system. -See https://htmlpreview.github.io/?https://github.com/sandialabs/zoltan/blob/master/doc/Zoltan_html/ug_html/ug_usage.html +See +https://htmlpreview.github.io/?https://github.com/sandialabs/zoltan/blob/master/doc/Zoltan_html/ug_html/ug_usage.html for details on building Zoltan. The main Zoltan page is http://cs.sandia.gov/Zoltan. -Release history: https://htmlpreview.github.io/?https://github.com/sandialabs/zoltan/blob/master/doc/Zoltan_html/ug_html/ug_release.html + +## INSTALLATION + +Instructions for building and installing Zoltan using CMAKE or Autotools +are at the following web site: + + http://www.cs.sandia.gov/zoltan/ug_html/ug_usage.html + + +## Copyright and License +See zoltan/COPYRIGHT, zoltan/LICENSE, https://trilinos.github.io/license.html and individual file headers for additional information. + + +## Questions? +Contact lead developers: + +* Zoltan team (GitHub handle: @trilinos/zoltan) +* Erik Boman (GitHub handle: [egboman](https://github.com/egboman) or egboman@sandia.gov) + + +## Release History + +https://htmlpreview.github.io/?https://github.com/sandialabs/zoltan/blob/master/doc/Zoltan_html/ug_html/ug_release.html + * Version 3.90 (4/08/21; as in Trilinos v13; d328e0e2a8a5c48a4e01d6541cd8c0eb7f364823) * Version 3.83 (1/28/16; as in Trilinos v12.6; aaf328db7e43001ee2d3148f72f12147e51c3293) * Version 3.82 (5/1/15; as in Trilinos v12) @@ -34,5 +64,3 @@ Release history: https://htmlpreview.github.io/?https://github.com/sandialabs/z * Version 1.5 (5/29/03) * Version 1.4 (6/18/02) * Version 1.3 (3/27/02) -- the Original - -Questions? Email zoltan-dev@software.sandia.gov diff --git a/packages/zoltan/ReleaseNotes.txt b/packages/zoltan/ReleaseNotes.txt index 2e91ce87eb..c78a26ab92 100644 --- a/packages/zoltan/ReleaseNotes.txt +++ b/packages/zoltan/ReleaseNotes.txt @@ -1,7 +1,7 @@ Zoltan release notes for Trilinos v12.8 Improved robustness of RCB partitioner for problems where many objects have -weight = 0 (e.g., PIC codes). Convergence is faster and the stopping +weight = 0 (e.g., PIC codes). Convergence is faster and the stopping criteria are more robust. Fixed bug that occurred when RETURN_LIST=PARTS and (Num_GID > 1 or Num_LID > 1); @@ -18,7 +18,7 @@ Minor code cleanup and bug fixes. New Zoltan_Get_Fn interface returning pointers to callback functions. See zoltan/src/include/zoltan.h for details. -Closest stand-alone Zoltan release is v3.83. +Closest stand-alone Zoltan release is v3.83. http://www.cs.sandia.gov/Zoltan ----------------------- @@ -35,7 +35,7 @@ Fixed bug in interface to Scotch when some processor has no vertices. Zoltan release notes for Trilinos v11. -Highlights are listed below; for more details, see +Highlights are listed below; for more details, see Trilinos/packages/zoltan/doc/Zoltan_html/ug_html/ug_release.html . - Zoltan is now released under Trilinos' BSD license. @@ -45,11 +45,11 @@ Trilinos/packages/zoltan/doc/Zoltan_html/ug_html/ug_release.html . + Partitioning method OCTPART: use partitioning method HSFC instead. -- Hierarchical partitioning received several performance, interface and - testing improvements. An easier-to-use interface has been +- Hierarchical partitioning received several performance, interface and + testing improvements. An easier-to-use interface has been added using simple parameters (HIER_ASSIST, PLATFORM_NAME, TOPOLOGY) instead of callback functions; the callback function interface is still - supported. + supported. - Memory usage in Zoltan Distributed Data Directories is improved, leading to faster execution times for data directories and hierarchical partitioning. @@ -57,4 +57,4 @@ Trilinos/packages/zoltan/doc/Zoltan_html/ug_html/ug_release.html . - Compilation with gcc 4.7 is now supported. - Zoltan supports PT-Scotch v5.1.12 and ParMETIS v4, as well as some older - versions of these TPLs. + versions of these TPLs. diff --git a/packages/zoltan/SampleCmakeScripts/linux_zoltan_gid_64_only b/packages/zoltan/SampleCmakeScripts/linux_zoltan_gid_64_only new file mode 100755 index 0000000000..c77faac4f0 --- /dev/null +++ b/packages/zoltan/SampleCmakeScripts/linux_zoltan_gid_64_only @@ -0,0 +1,31 @@ +#!/bin/csh +# Sample script for building using CMAKE on linux workstation octopi. +# 64-bit, Zoltan only. + +# Clean up the mess from previous configurations. +/bin/rm -r cmake* CMake* CPack* CTest* Dart* Trilinos* Testing packages Makefile OUT* + +cmake \ +-D CMAKE_INSTALL_PREFIX:FILEPATH="/home/lriesen/projects/Trilinos/build" \ +-D TPL_ENABLE_MPI:BOOL=ON \ +-D CMAKE_C_FLAGS:STRING="-m64 -g -DZOLTAN_ID_TYPE_LONG -std=c99" \ +-D CMAKE_CXX_FLAGS:STRING="-m64 -g" \ +-D CMAKE_Fortran_FLAGS:STRING="-m64 -g" \ +-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +-D MPIEXEC_MAX_NUMPROCS:STRING=11 \ +-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ +-D Trilinos_ENABLE_EXAMPLES:BOOL=ON \ +-D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=ON \ +-D Zoltan_ENABLE_EXAMPLES:BOOL=ON \ +-D Zoltan_ENABLE_TESTS:BOOL=ON \ +-D Zoltan_ENABLE_ParMETIS:BOOL=ON \ +-D ParMETIS_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/all/src/ParMETIS3_1" \ +-D ParMETIS_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/ParMETIS3_1" \ +-D Zoltan_ENABLE_Scotch:BOOL=OFF \ +-D Zoltan_ENABLE_PaToH:BOOL=OFF \ +.. |& tee OUTPUT.CMAKE + +make |& tee OUTPUT.MAKE +make install |& tee OUTPUT.INSTALL + diff --git a/packages/zoltan/SampleCmakeScripts/linux_zoltan_only b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only new file mode 100755 index 0000000000..e671d677eb --- /dev/null +++ b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only @@ -0,0 +1,36 @@ +#!/bin/csh +# Sample script for building using CMAKE on linux workstation octopi. +# 64-bit, Zoltan only. +# Run in Trilinos/Obj_cmake. + +# Clean up the mess from previous configurations. +/bin/rm -r cmake* CMake* CPack* CTest* Dart* Trilinos* Testing packages Makefile + +cmake \ +-D CMAKE_INSTALL_PREFIX:FILEPATH="/Net/local/homes/kddevin/code/trilinos/Obj_cmake" \ +-D TPL_ENABLE_MPI:BOOL=ON \ +-D CMAKE_C_FLAGS:STRING="-m64 -g" \ +-D CMAKE_CXX_FLAGS:STRING="-m64 -g" \ +-D CMAKE_Fortran_FLAGS:STRING="-m64 -g" \ +-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +-D MPI_EXEC_MAX_NUMPROCS:STRING=11 \ +-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ +-D Trilinos_ENABLE_EXAMPLES:BOOL=ON \ +-D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=ON \ +-D Zoltan_ENABLE_EXAMPLES:BOOL=ON \ +-D Zoltan_ENABLE_TESTS:BOOL=ON \ +-D Zoltan_ENABLE_ParMETIS:BOOL=ON \ +-D ParMETIS_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/all/src/ParMETIS3_1" \ +-D ParMETIS_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/ParMETIS3_1" \ +-D Zoltan_ENABLE_Scotch:BOOL=ON \ +-D Scotch_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/all/src/Scotch5" \ +-D Scotch_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/Scotch5" \ +-D Zoltan_ENABLE_PaToH:BOOL=ON \ +-D PaToH_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib" \ +-D PaToH_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/PaToH" \ +.. |& tee OUTPUT.CMAKE + +make |& tee OUTPUT.MAKE +make install |& tee OUTPUT.INSTALL + diff --git a/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_purify b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_purify new file mode 100755 index 0000000000..c7860a6b3a --- /dev/null +++ b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_purify @@ -0,0 +1,42 @@ +#!/bin/csh +# Sample script for building using CMAKE, LAM, and purify on octopi. +# 64-bit, Zoltan only. +# Run in Trilinos/Obj_pure. + +# Clean up the mess from previous configurations. +/bin/rm -r cmake* CMake* CPack* CTest* Dart* Trilinos* Testing packages Makefile OUTPUT* include lib install* +set MPICCEXTRACOMP="`/opt/lam714-gcc346-pure/bin/mpicc --showme:compile`" +set MPICXXEXTRACOMP="`/opt/lam714-gcc346-pure/bin/mpiCC --showme:compile`" +set MPIEXTRALINK="`/opt/lam714-gcc346-pure/bin/mpiCC --showme:link`" +set PURIFY="/usr/local/rational/releases/PurifyPlus.7.0/i386_linux2/bin/purify" +set GCC="/usr/bin/gcc346" +set GCXX="/usr/bin/g++346" + +/home/kddevin/cmake/bin/cmake \ +-D CMAKE_INSTALL_PREFIX:FILEPATH="/Net/local/homes/kddevin/code/Trilinos/Obj_pure" \ +-D TPL_ENABLE_MPI:BOOL=ON \ +-D MPI_USE_COMPILER_WRAPPERS:BOOL=OFF \ +-D MPI_BIN_DIR:STRING="/opt/lam714-gcc346-pure/bin" \ +-D CMAKE_C_COMPILER:STRING="$PURIFY" \ +-D CMAKE_C_FLAGS:STRING="-best-effort -follow-child-processes=yes -cache-dir=/tmp/purify -chain-length=20 $GCC -m64 -g $MPICCEXTRACOMP" \ +-D CMAKE_CXX_COMPILER:STRING="$PURIFY" \ +-D CMAKE_CXX_FLAGS:STRING="-best-effort -follow-child-processes=yes -cache-dir=/tmp/purify -chain-length=20 $GCXX -m64 -g $MPICXXEXTRACOMP" \ +-D Trilinos_EXTRA_LINK_FLAGS:STRING="$MPIEXTRALINK" \ +-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +-D MPI_EXEC_MAX_NUMPROCS:STRING=11 \ +-D Trilinos_ENABLE_Fortran:BOOL=OFF \ +-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ +-D Trilinos_ENABLE_EXAMPLES:BOOL=ON \ +-D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=ON \ +-D Zoltan_ENABLE_EXAMPLES:BOOL=OFF \ +-D Zoltan_ENABLE_TESTS:BOOL=ON \ +-D Zoltan_ENABLE_ParMETIS:BOOL=ON \ +-D ParMETIS_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib/lam/ParMETIS3" \ +-D ParMETIS_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/all/src/ParMETIS3" \ +-D Zoltan_ENABLE_Scotch:BOOL=ON \ +-D Scotch_LIBRARY_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/linux64/lib/lam/Scotch5" \ +-D Scotch_INCLUDE_DIRS:FILEPATH="/Net/local/proj/zoltan/arch/all/src/Scotch5" \ +.. |& tee OUTPUT.CMAKE + +make |& tee OUTPUT.MAKE diff --git a/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_serial b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_serial new file mode 100755 index 0000000000..8b7a43fc22 --- /dev/null +++ b/packages/zoltan/SampleCmakeScripts/linux_zoltan_only_serial @@ -0,0 +1,29 @@ +#!/bin/csh +# Sample script for building in serial mode using CMAKE on linux machine godel. +# 64-bit, Zoltan only. +# Run in Trilinos/Obj_cmake. + +# Clean up the mess from previous configurations. +/bin/rm -r cmake* CMake* CPack* CTest* Dart* Trilinos* Testing packages Makefile + +cmake \ +-D CMAKE_INSTALL_PREFIX:FILEPATH="/home/kddevin/code/Trilinos/Obj_cmake_serial" \ +-D TPL_ENABLE_MPI:BOOL=OFF \ +-D CMAKE_C_FLAGS:STRING="-m64 -g" \ +-D CMAKE_CXX_FLAGS:STRING="-m64 -g" \ +-D CMAKE_Fortran_FLAGS:STRING="-m64 -g" \ +-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ +-D Trilinos_ENABLE_EXAMPLES:BOOL=ON \ +-D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=ON \ +-D Trilinos_EXTRA_LINK_FLAGS:STRING="-lsimpi" \ +-D Zoltan_ENABLE_EXAMPLES:BOOL=ON \ +-D Zoltan_ENABLE_TESTS:BOOL=ON \ +-D Zoltan_ENABLE_ParMETIS:BOOL=ON \ +-D ParMETIS_INCLUDE_DIRS:FILEPATH="/home/kddevin/code/ParMETIS3_1_siMPI" \ +-D ParMETIS_LIBRARY_DIRS:FILEPATH="/home/kddevin/code/ParMETIS3_1_siMPI" \ +.. |& tee OUTPUT.CMAKE + +make |& tee OUTPUT.MAKE +make install |& tee OUTPUT.INSTALL diff --git a/packages/zoltan/SampleCmakeScripts/mac_osX_zoltan_only b/packages/zoltan/SampleCmakeScripts/mac_osX_zoltan_only new file mode 100755 index 0000000000..238deb72e8 --- /dev/null +++ b/packages/zoltan/SampleCmakeScripts/mac_osX_zoltan_only @@ -0,0 +1,57 @@ +#! +# Sample script for building using CMAKE on Karen's Mac OS X system. +# 64-bit, Zoltan only. +# TPLs = ParMETIS, Scotch and PaToH. +# Run in Trilinos/Obj_cmake. + +# Clean up the mess from previous configurations. +/bin/rm -r cmake* CMake* CPack* CTest* Dart* Trilinos* Testing packages Makefile + +setenv F77 /Users/kddevin/code/lib-m64/lam-7.1.4/bin/mpif77 + +cmake \ +-D CMAKE_INSTALL_PREFIX:FILEPATH="/Users/kddevin/code/trilinos/Obj_cmake" \ +-D TPL_ENABLE_MPI:BOOL=ON \ +-D CMAKE_C_FLAGS:STRING="-m64 -g" \ +-D CMAKE_CXX_FLAGS:STRING="-m64 -g" \ +-D CMAKE_Fortran_FLAGS:STRING="-m64 -g" \ +-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +-D MPI_EXEC_MAX_NUMPROCS:STRING=11 \ +-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ +-D Trilinos_ENABLE_EXAMPLES:BOOL=ON \ +-D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=ON \ +-D Trilinos_EXTRA_LINK_FLAGS:STRING="-framework vecLib" \ +-D Zoltan_ENABLE_EXAMPLES:BOOL=ON \ +-D Zoltan_ENABLE_TESTS:BOOL=ON \ +-D Zoltan_ENABLE_ParMETIS:BOOL=ON \ +-D ParMETIS_INCLUDE_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ +-D ParMETIS_LIBRARY_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ +-D Zoltan_ENABLE_Scotch:BOOL=ON \ +-D Scotch_INCLUDE_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/scotch_5.1/include" \ +-D Scotch_LIBRARY_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/scotch_5.1/lib" \ +-D Zoltan_ENABLE_PaToH:BOOL=ON \ +-D PaToH_INCLUDE_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/PaToH/dist" \ +-D PaToH_LIBRARY_DIRS:FILEPATH="/Users/kddevin/code/lib-m64/PaToH/dist" \ +.. |& tee OUTPUT.CMAKE + +make |& tee OUTPUT.MAKE +make install |& tee OUTPUT.INSTALL + +#Other useful flags. +#-D Trilinos_ENABLE_Epetra:BOOL=ON \ +#-D Trilinos_ENABLE_Tpetra:BOOL=ON \ +#-D Trilinos_ENABLE_Isorropia:BOOL=ON \ +#-D Trilinos_ENABLE_EpetraExt:BOOL=ON \ +#-D Trilinos_ENABLE_Fortran:BOOL=OFF \ +#-D MPI_EXTRA_LIBRARY:FILEPATH="" \ +#-D CMAKE_CXX_COMPILER:FILEPATH="mpic++" \ +#-D CMAKE_C_COMPILER:FILEPATH="mpicc" \ + +# NOTE: I hacked my version of CMAKE, as it had errors trying to find +# install_name_tool. I changed the following file to check for +# CMAKE_INSTALL_NAME_TOOL before running FIND_PROGRAM to find it. +# I don't know why it had problems only with install_name_tool, as the +# linker, ranlib, etc., were found with no difficulty. +# /Applications/CMake\ 2.6-2.app/Contents/share/cmake-2.6/Modules/CMakeFindBinUtils.cmake + diff --git a/packages/zoltan/SampleConfigurationScripts/linux_trilinos_runtests b/packages/zoltan/SampleConfigurationScripts/linux_trilinos_runtests new file mode 100755 index 0000000000..8f53659050 --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/linux_trilinos_runtests @@ -0,0 +1,5 @@ +#!/bin/tcsh +which lamboot +lamboot +make runtests-mpi TRILINOS_MPI_GO="'mpirun -np '" + diff --git a/packages/zoltan/SampleConfigurationScripts/linux_with_purify_zoltan_only b/packages/zoltan/SampleConfigurationScripts/linux_with_purify_zoltan_only new file mode 100755 index 0000000000..470207bf3d --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/linux_with_purify_zoltan_only @@ -0,0 +1,34 @@ +# Script for building Zoltan with purify on linux workstation octopi +# with openmpi. +# This is a 64-bit installation. + +/bin/rm -r Makefile Makefile.export.zoltan OUTPUT.C OUTPUT.I OUTPUT.M config.cache config.log config.status* example/ include/ lib/ siMPI/ src/ + +set path=(/usr/local/bin $path) +setenv PURE_CC "purify -best-effort -follow-child-processes=yes -cache-dir=/tmp/purify -chain-length=20" +setenv CC "$PURE_CC gcc34 -Wall -Werror-implicit-function-declaration" +setenv CXX "$PURE_CC g++34 -Wall -Werror-implicit-function-declaration" +setenv CFLAGS "-m64 -g" +setenv CXXFLAGS "-m64 -g" +setenv CPPFLAGS "-m64 -g" +setenv FCFLAGS "-m64 -g" +setenv MPIINC `mpicc --showme:compile` +setenv MPILIB `mpicc --showme:link` + +../configure -C \ + --prefix=/Net/local/homes/kddevin/code/zoltan_v3.2/Obj_pure \ + --enable-mpi \ + --with-mpi-compilers=no \ + --disable-fortran \ + --with-gnumake \ + --disable-zoltan-cppdriver \ + --with-libs="$MPILIB" \ + --with-incdirs="$MPIINC" \ + |& tee OUTPUT.C +make everything |& tee OUTPUT.M +make install |& tee OUTPUT.I + +# --with-parmetis \ +# --with-parmetis-incdir="/Net/local/proj/zoltan/arch/all/src/ParMETIS3" \ +# --with-parmetis-libdir="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/ParMETIS3_1" \ + diff --git a/packages/zoltan/SampleConfigurationScripts/linux_zoltan_dist b/packages/zoltan/SampleConfigurationScripts/linux_zoltan_dist new file mode 100755 index 0000000000..97085df788 --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/linux_zoltan_dist @@ -0,0 +1,15 @@ +#Script for building the Zoltan tarball on a 64-bit Linux workstation +#with OpenMPI. +#This script builds the Zoltan tarball from the Zoltan package directory. +#Assuming running script from +#/Net/local/homes/kddevin/code/zoltan_v3.1/Obj_DIST. +set path=(/usr/local/bin $path) +setenv CFLAGS -m64 +setenv CXXFLAGS -m64 +setenv CPPFLAGS -m64 +setenv FCFLAGS -m64 + +../configure -C \ + --prefix=/Net/local/homes/kddevin/code/zoltan_v3.1/OBJ_DIST \ + --with-gnumake |& tee OUTPUT.C +make dist |& tee OUTPUT.D diff --git a/packages/zoltan/SampleConfigurationScripts/linux_zoltan_only b/packages/zoltan/SampleConfigurationScripts/linux_zoltan_only new file mode 100755 index 0000000000..62c238b31d --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/linux_zoltan_only @@ -0,0 +1,22 @@ +#Script for building Zoltan only on a 64-bit Linux workstation +#with OpenMPI. +#This script builds only Zoltan from the Zoltan package directory. +#Assuming running script from +#/Net/local/homes/kddevin/code/zoltan_v3.1/Obj_linux64. +set path=(/usr/local/bin $path) +setenv CFLAGS -m64 +setenv CXXFLAGS -m64 +setenv CPPFLAGS -m64 +setenv FCFLAGS -m64 + +../configure -C \ + --prefix=/Net/local/homes/kddevin/code/zoltan_v3.1/Obj_linux64 \ + --with-parmetis \ + --with-parmetis-incdir="/Net/local/proj/zoltan/arch/all/src/ParMETIS3_1" \ + --with-parmetis-libdir="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/ParMETIS3_1" \ + --with-scotch \ + --with-scotch-incdir="/Net/local/proj/zoltan/arch/all/src/Scotch5" \ + --with-scotch-libdir="/Net/local/proj/zoltan/arch/linux64/lib/openmpi/Scotch5" \ + --with-gnumake |& tee OUTPUT.C +make everything |& tee OUTPUT.M +make install |& tee OUTPUT.I diff --git a/packages/zoltan/SampleConfigurationScripts/mac_osX_no_fortran b/packages/zoltan/SampleConfigurationScripts/mac_osX_no_fortran new file mode 100755 index 0000000000..8867304510 --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/mac_osX_no_fortran @@ -0,0 +1,25 @@ +#Script for building Zoltan and Isorropia on a 64-bit Mac OS X +#with LAM MPI on a machine with NO FORTRAN COMPILER. Note the option +#--disable-fortran. +#This script builds only Zoltan but builds it from the top-level Trilinos +#directory. +#Assuming running script from /Users/kddevin/code/trilinos_v9.0/Obj_mac64. +set path=(/Users/kddevin/code/lib-m64/lam-7.1.4/bin $path) +setenv CC /Users/kddevin/code/lib-m64/lam-7.1.4/bin/mpicc +setenv CXX /Users/kddevin/code/lib-m64/lam-7.1.4/bin/mpic++ +setenv FC /Users/kddevin/code/lib-m64/lam-7.1.4/bin/mpif77 +setenv CFLAGS -m64 +setenv CXXFLAGS -m64 +setenv CPPFLAGS -m64 +setenv FCFLAGS -m64 + +../configure -C \ + --prefix=/Users/kddevin/code/trilinos_v9.0/Obj_mac64 \ + --with-parmetis \ + --with-parmetis-incdir="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ + --with-parmetis-libdir="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ + --with-libs="-framework vecLib" \ + --with-gnumake \ + --with-cxxflags="-DLAM_BUILDING" |& tee OUTPUT.C +make everything |& tee OUTPUT.M +make install |& tee OUTPUT.I diff --git a/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_dist b/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_dist new file mode 100755 index 0000000000..2eb62edf58 --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_dist @@ -0,0 +1,4 @@ +# Since Mac OS X is case-insensitive, autoconf produces a bad Makefile.in +# Don't use Mac OS X until this bug is fixed. + +echo "Due to bug in autoconf Makefile.in, do not make dist on a case-insensitive system." diff --git a/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_only b/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_only new file mode 100755 index 0000000000..63e27a0dd4 --- /dev/null +++ b/packages/zoltan/SampleConfigurationScripts/mac_osX_zoltan_only @@ -0,0 +1,18 @@ +#Script for building Zoltan only on a 64-bit Mac OS X with LAM mpi +#Assuming running this script from /Users/kddevin/code/zoltan_v3.1/OBJ_MAC64. + +setenv CFLAGS -m64 +setenv CXXFLAGS -m64 +../configure \ + --prefix=/Users/kddevin/code/zoltan_v3.1/OBJ_MAC64 \ + --with-gnumake \ + --with-parmetis \ + --with-parmetis-incdir="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ + --with-parmetis-libdir="/Users/kddevin/code/lib-m64/ParMETIS3_1" \ + --with-patoh \ + --with-patoh-incdir="/Users/kddevin/code/lib-m64/PaToH/dist" \ + --with-patoh-libdir="/Users/kddevin/code/lib-m64/PaToH/dist" \ + |& tee OUTPUT.C +make everything |& tee OUTPUT.M +make install |& tee OUTPUT.I + diff --git a/packages/zoltan/cmake/Dependencies.cmake b/packages/zoltan/cmake/Dependencies.cmake index 5ffe0b4003..7460aab0b6 100644 --- a/packages/zoltan/cmake/Dependencies.cmake +++ b/packages/zoltan/cmake/Dependencies.cmake @@ -3,6 +3,6 @@ SET(LIB_OPTIONAL_DEP_PACKAGES) SET(TEST_REQUIRED_DEP_PACKAGES) SET(TEST_OPTIONAL_DEP_PACKAGES) SET(LIB_REQUIRED_DEP_TPLS) -SET(LIB_OPTIONAL_DEP_TPLS MPI METIS ParMETIS PaToH Scotch Zlib CCOLAMD OVIS) +SET(LIB_OPTIONAL_DEP_TPLS MPI METIS ParMETIS PaToH Scotch Zlib OVIS) SET(TEST_REQUIRED_DEP_TPLS) SET(TEST_OPTIONAL_DEP_TPLS) diff --git a/packages/zoltan/config/zac_arg_config_mpi.m4 b/packages/zoltan/config/zac_arg_config_mpi.m4 index 796d38bd6a..aa56a332b5 100644 --- a/packages/zoltan/config/zac_arg_config_mpi.m4 +++ b/packages/zoltan/config/zac_arg_config_mpi.m4 @@ -177,7 +177,7 @@ if test X${SEEK_MPI_COMPILERS} = Xyes; then # F77=${MPI_F77} # else # echo "-----" -# echo "Cannot find MPI Fortan 77 compiler." +# echo "Cannot find MPI Fortran 77 compiler." # echo "Specify a path to all mpi compilers with --with-mpi-compilers=PATH," # echo "or specify a path to top mpi directory (above bin) with --with-mpi=PATH," # echo "or specify a fortran 77 compiler using F77=" diff --git a/packages/zoltan/configure b/packages/zoltan/configure index c0f33f40ba..4d6a7db6f5 100755 --- a/packages/zoltan/configure +++ b/packages/zoltan/configure @@ -3333,7 +3333,7 @@ test -n "$MPI_CXX" || MPI_CXX="notFound" # F77=${MPI_F77} # else # echo "-----" -# echo "Cannot find MPI Fortan 77 compiler." +# echo "Cannot find MPI Fortran 77 compiler." # echo "Specify a path to all mpi compilers with --with-mpi-compilers=PATH," # echo "or specify a path to top mpi directory (above bin) with --with-mpi=PATH," # echo "or specify a fortran 77 compiler using F77=" diff --git a/packages/zoltan/configure.ac b/packages/zoltan/configure.ac index 37509602b9..1b62bda34e 100644 --- a/packages/zoltan/configure.ac +++ b/packages/zoltan/configure.ac @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER # ------------------------------------------------------------------------ # Process this file with autoconf to produce a configure script. # ------------------------------------------------------------------------ diff --git a/packages/zoltan/doc/NEA_docs/developer_html/dev_hybrid.html b/packages/zoltan/doc/NEA_docs/developer_html/dev_hybrid.html new file mode 100644 index 0000000000..ae480f2549 --- /dev/null +++ b/packages/zoltan/doc/NEA_docs/developer_html/dev_hybrid.html @@ -0,0 +1,471 @@ + + + + + + + + Zoltan Developer's Guide: Hybrid Partitioning + + + +

+Appendix: Hybrid Partitioning

+Hybrid partitioning is an amalgam of Zoltan's native parallel hypergraph +partitioner (PHG) and it Recursive Coordinate +Bisection algortihm (RCB). Hybrid partitioning can +be useful when a user is looking to strike a happy medium of both efficiency +and fidelity in their work. Traditional Zoltan-PHG is well suited to minimize +the number of cut hyperedges in the system, but it is comparatively slow due +to the multiple layers of coarsening it goes through and the standard matching +methods used to calculate new vertices for the coarser hypergraph. + + +

+Hypergraph partitioning is a useful partitioning and +load balancing method when connectivity data is available. It can be +viewed as a more sophisticated alternative to +the traditional graph partitioning. +

A hypergraph consists of vertices and hyperedges. A hyperedge +connects +one or more vertices. A graph is a special case of a hypergraph where +each edge has size two (two vertices). The hypergraph model is well +suited to parallel computing, where vertices correspond to data objects +and hyperedges represent the communication requirements. The basic +partitioning problem is to partition the vertices into k +approximately equal sets such that the number of cut hyperedges is +minimized. Most partitioners (including Zoltan-PHG) allows a more +general +model where both vertices and hyperedges can be assigned weights. +It has been +shown that the hypergraph model gives a more accurate representation +of communication cost (volume) than the graph model. In particular, +for sparse matrix-vector multiplication, the hypergraph model +exactly represents communication volume. Sparse +matrices can be partitioned either along rows or columns; +in the row-net model the columns are vertices and each row corresponds +to an hyperedge, while in the column-net model the roles of vertices +and hyperedges are reversed.

+

Zoltan contains a native parallel hypergraph partitioner, called PHG +(Parallel HyperGraph partitioner). In addition, Zoltan provides +access to PaToH, +a serial hypergraph partitioner. +Note that PaToH is not part of Zoltan and should be obtained +separately from the +PaToH web site. +Zoltan-PHG is a fully parallel multilevel hypergraph partitioner. For +further technical description, see [Devine et al, 2006].
+

+

Algorithm:

+The algorithm used is multilevel hypergraph partitioning. For +coarsening, several versions of inner product (heavy connectivity) +matching are available. +The refinement is based on Fiduccia-Mattheysis (FM) but in parallel it +is only an approximation. + +

Parallel implementation:

+A novel feature of our parallel implementation is that we use a 2D +distribution of the hypergraph. That is, each processor owns partial +data about some vertices and some hyperedges. The processors are +logically organized in a 2D grid as well. Most communication is limited +to either a processor row or column. This design should allow for +good scalability on large number of processors.
+ +

Data structures:

+The hypergraph is the most important data structure. This is stored as +a compressed sparse matrix. Note that in parallel, each processor owns +a local part of the global hypergraph +(a submatrix of the whole matrix). +The hypergraph data type is struct HGraph, and contains +information like number of vertices, hyperedges, pins, compressed +storage of all pins, optional vertex and edge weights, pointers +to relevant communicators, and more. One cryptic notation needs an +explanation: The arrays hindex, hvertex are used to +look up vertex info given a hyperedge, and vindex, vedge are +used to look up hyperedge info given a vertex. Essentially, +we store the hypergraph as a sparse matrix in both CSR and CSC formats. +This doubles the memory cost but gives better performance. +The data on each processor is stored using local indexing, starting at zero. +In order to get the global vertex or edge number, use the macros +VTX_LNO_TO_GNO and EDGE_LNO_TO_GNO. These macros will +look up the correct offsets (using the dist_x and dist_y arrays). +Note that phg->nVtx is always the local number of vertices, +which may be zero on some processors. + +

Parameters:

+In the User's Guide, only the most essential parameters have been +documented. There are several other parameters, intended for developers +and perhaps expert "power" users. We give a more complete list of all +parameters below. Note that these parameters may change in future versions!
+
+For a precise list of parameters in a particular version of Zoltan, look at the source code (phg.c). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method String:HYPERGRAPH
Parameters:
+
    HYPERGRAPH_PACKAGE
+
PHG (parallel) or PaToH (serial)
+
   CHECK_HYPERGRAPH
+
Check if input data is valid. +(Slows performance;intended for debugging.)
+
    +PHG_OUTPUT_LEVEL
+
Level of verbosity; 0 is silent.
+
    PHG_FINAL_OUTPUT
+
Print stats about final +partition? (0/1)
+
    PHG_NPROC_VERTEX
+
Desired number of processes in +the vertex direction (for 2D internal layout)
    PHG_NPROC_HEDGE
+
Desired number of processes in +the hyperedge direction (for 2D internal layout)
    PHG_COARSENING_METHODThe method to use in matching/coarsening; currently these are +available. 
+ agg - agglomerative inner product +matching (a.k.a. heavy connectivity matching)
+ ipm - inner product +matching (a.k.a. heavy connectivity matching)
+ c-ipm -  column +ipm;  faster method based on ipm within processor columns
+ a-ipm - alternate +between fast method (l-ipm ) and ipm
+ l-ipm -  local ipm +on each processor. Fastest option  but often gives poor quality.
+ h-ipm - hybrid ipm that  uses partial c-ipm followed +by ipm on each level
+
+
    PHG_COARSENING_LIMIT
+
Number of vertices at which to stop coarsening.
+
    PHG_VERTEX_VISIT_ORDER
+
Ordering of vertices in greedy +matching scheme:
+0 - random
+1 - natural order (as given by the query functions)
+2 - increasing vertex weights
+3 - increasing vertex degree
+4 - increasing vertex degree, weighted by pins
+
    PHG_EDGE_SCALING
+
Scale edge weights by some +function of size of the hyperedges:
+0 - no scaling
+1 - scale by 1/(size-1)     [absorption scaling]
+2 - scale by 2/((size*size-1)) [clique scaling]
+
    PHG_VERTEX_SCALING
+
Variations in "inner product" +similarity metric (for matching):
+0 - Euclidean inner product: <x,y>
+1 - cosine similarity: <x,y>/(|x|*|y|)
+2 - <x,y>/(|x|^2 * |y|^2)
+3 - scale by sqrt of vertex weights
+4 - scale by vertex weights
+
    PHG_COARSEPARTITION_METHODMethod to partition the coarsest (smallest) hypergraph; +typically done in serial:
+ random - random
+ linear - linear +(natural) order
+ greedy - greedy method +based on minimizing cuts
+ auto - automatically +select from the above methods (in parallel, the processes will do +different methods)
+
    PHG_REFINEMENT_METHOD
+
Refinement algorithm:
fm - two-way +approximate  FM
+ none - no refinement
+
    PHG_REFINEMENT_LOOP_LIMITLoop limit in FM refinement. Higher number means more +refinement.
+
    PHG_REFINEMENT_MAX_NEG_MOVE
+
Maximum number of negative moves allowed in FM.
+
   PHG_BAL_TOL_ADJUSTMENT
+
Controls how the balance tolerance is adjusted at +each level of bisection.
+
  PHG_RANDOMIZE_INPUT
+
Randomize layout of vertices and +hyperedges in internal parallel 2D layout? (0/1)
+
  PHG_EDGE_WEIGHT_OPERATION + Operation to be applied to edge +weights supplied by different processes for the same hyperedge:
+ add - the hyperedge weight will be the sum of the supplied +weights
+ max - the hyperedge weight will be the maximum of the +supplied weights
+ error - if the hyperedge weights are not equal, Zoltan +will flag an error, otherwise the hyperedge weight will be the value +returned by the processes
+
   EDGE_SIZE_THRESHOLD
+
Ignore hyperedges greater than this fraction times +number of vertices.
+
   PATOH_ALLOC_POOL0
+
Memory allocation for PaToH; see +the PaToH manual for details.
+
   PATOH_ALLOC_POOL1
+
Memory allocation for PaToH; see +the PaToH manual for details.
Default values:
+

+
HYPERGRAPH_PACKAGE = PHG
+

+
CHECK_HYPERGRAPH += 0
+

+
PHG_OUTPUT_LEVEL=0

+
PHG_FINAL_OUTPUT=0

+
PHG_REDUCTION_METHOD=ipm

+
PHG_REDUCTION_LIMIT=100

+
PHG_VERTEX_VISIT_ORDER=0

+
PHG_EDGE_SCALING=0

+
PHG_VERTEX_SCALING=0

+
PHG_COARSEPARTITION_METHOD=greedy

+
PHG_REFINEMENT_METHOD=fm

+
PHG_REFINEMENT_LOOP_LIMIT=10

+
PHG_REFINEMENT_MAX_NEG_MOVE=100

+
PHG_BAL_TOL_ADJUSTMENT=0.7

+
PHG_RANDOMIZE_INPUT=0

+
PHG_EDGE_WEIGHT_OPERATION=max

+
EDGE_SIZE_THRESHOLD=0.25

+
PATOH_ALLOC_POOL0=0

+
PATOH_ALLOC_POOL1=0
Required Query Functions:
+

+
ZOLTAN_NUM_OBJ_FN

+
ZOLTAN_OBJ_LIST_FN +or ZOLTAN_FIRST_OBJ_FN/ZOLTAN_NEXT_OBJ_FN +pair

+
ZOLTAN_HG_SIZE_CS_FN +
+ ZOLTAN_HG_CS_FN +
Optional Query Functions:
+

+
ZOLTAN_HG_SIZE_EDGE_WTS_FN

+
ZOLTAN_HG_EDGE_WTS_FN
+

+It is possible to provide the graph query functions instead of the +hypergraph queries, though this is not recommended. If only graph query +functions are registered, Zoltan will automatically create a hypergraph +from the graph, but some information (specifically, edge weights) will +be lost.

+
[Table of Contents  | Next:  +Refinement Tree Partitioning(NEANEA CHANGE ME)  |  Previous:  +ParMetis(NEANEA CHANGE ME)  |  Privacy and Security] + + diff --git a/packages/zoltan/doc/NEA_docs/writeup/128_breakdown_percent.pdf b/packages/zoltan/doc/NEA_docs/writeup/128_breakdown_percent.pdf new file mode 100644 index 0000000000..43e06ffb50 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/128_breakdown_percent.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/128_cutl.pdf b/packages/zoltan/doc/NEA_docs/writeup/128_cutl.pdf new file mode 100644 index 0000000000..6f315d3588 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/128_cutl.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/128_time.pdf b/packages/zoltan/doc/NEA_docs/writeup/128_time.pdf new file mode 100644 index 0000000000..ba14c5fa24 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/128_time.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/2_breakdown_percent.pdf b/packages/zoltan/doc/NEA_docs/writeup/2_breakdown_percent.pdf new file mode 100644 index 0000000000..163b12c6c7 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/2_breakdown_percent.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/2_cutl.pdf b/packages/zoltan/doc/NEA_docs/writeup/2_cutl.pdf new file mode 100644 index 0000000000..77a55467b7 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/2_cutl.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/2_time.pdf b/packages/zoltan/doc/NEA_docs/writeup/2_time.pdf new file mode 100644 index 0000000000..df6644c683 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/2_time.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.out b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.out new file mode 100644 index 0000000000..c8a1a16d77 --- /dev/null +++ b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.out @@ -0,0 +1,7 @@ +\BOOKMARK [1][-]{section.1}{Introduction}{} +\BOOKMARK [1][-]{section.2}{Parallel hypergraphs and geometric input}{} +\BOOKMARK [1][-]{section.3}{PHG, MPI and 2-dimensional representation}{} +\BOOKMARK [1][-]{section.4}{Matching}{} +\BOOKMARK [1][-]{section.5}{Reduction factor}{} +\BOOKMARK [1][-]{section.6}{Results}{} +\BOOKMARK [1][-]{section.7}{Conclusion and discussion}{} diff --git a/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.pdf b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.pdf new file mode 100644 index 0000000000..133e9c58dd Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.pdf differ diff --git a/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.tex b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.tex new file mode 100644 index 0000000000..ba5608923e --- /dev/null +++ b/packages/zoltan/doc/NEA_docs/writeup/hybrid_current.tex @@ -0,0 +1,296 @@ +\documentclass[12pt]{article} + +\usepackage{amsmath} % need for subequations +\usepackage{graphicx} % need for figures +\usepackage{verbatim} % useful for program listings +\usepackage{color} % use if color is used in text +\usepackage{subfigure} % use for side-by-side figures +\usepackage{hyperref} % use for hypertext links, including those to external documents and URLs + +\setlength{\baselineskip}{16.0pt} % 16 pt usual spacing between lines +\setlength{\parskip}{3pt plus 2pt} +\setlength{\parindent}{20pt} +\setlength{\oddsidemargin}{0.5cm} +\setlength{\evensidemargin}{0.5cm} +\setlength{\marginparsep}{0.75cm} +\setlength{\marginparwidth}{2.5cm} +\setlength{\marginparpush}{1.0cm} +\setlength{\textwidth}{150mm} + +\begin{comment} +\pagestyle{empty} +\end{comment} + + + +\begin{document} + +\begin{center} +{\large Hybrid Partitioning in Zoltan} \\ +Nick Aase, Karen Devine \\ +Summer, 2011 +\end{center} + + +\section{Introduction} +When used for partitioning, Zoltan has a wide range of algorithms +available to it. Traditionally they have fallen into two categories: +geometric-based partitioning, and topology-based partitioning. Each +method has its own strengths and weaknesses which ultimately come down +to the tradeoff between speed and quality, and the onus is placed +upon the user to determine which is more desirable for the project +at hand. + +In our project we strived to develop a hybrid partitioning algorithm; +one that attempts to take advantage of the efficiency of geometric +methods, as well as the precision of topological ones. The reasoning +behind this concept is that problem sets with large amounts of data may +be more easily digestible by topological methods if they are first +reduced into managable pieces based on their geometry. + +The two subjects chosen for this project were the Recursive +Coordinate Bisection (RCB) algorithm and Parallel Hypergraph +partitioning (PHG). RCB is an extremely fast method of partitioning, +but it can be clumsy at times when it ``cuts'' across a coordinate plane. +On the other hand, PHG has a good understanding of the relationships +between data, making its partitioning quite accurate, but it suffers +from having to spend a great deal of time finding those relationships. + +For further information on implementing hybrid partitioning, please see +the developer's guide at +http://www.cs.sandia.gov/Zoltan/dev\_html/dev\_hybrid.html + + +\section{Parallel hypergraphs and geometric input} +In order for Zoltan to support hybrid partitioning, it is necessary +to properly and frequently obtain, preserve, and communicate coordinate +data. The first step that needed to be taken was to modify PHG to +support coordinate information. Hypergraph objects carry a substantial +amount of data already, but we had to add an array of floating point +values to store the coordinates. Currently, when a hypergraph is built and +geometric information is available from the input, each vertex will have +a corresponding subset within the array defining its coordinates; +that is, \forall\, $v_x$\in\, $H:$\, \exists\, $C_x = \{c_0, c_1, ..., c_{n-1}\},$ +where $v_x$ is an arbitrary vertex in the hypergraph $H$, $C_x$ is its +corresponding coordinate subset, and $n$ is the number of dimensions in +the system. In this way, Zoltan can treat each coordinate subset as an +element of that vertex + + +\section{PHG, MPI and 2-dimensional representation} +PHG is interesting in that multiple processors can share partial data +that describes the properties of hyperedges and vertices. This sort of +system can be represented in a 2-dimensional distribution similar to +Table 1. A populated field represents that a processor on the y-axis has +data related to the vertex on the x-axis. In this example, you can see +that processor $P_0$ and $P_2$ share data describing vertices $v_0$ and +$v_2$. + +\begin{table}[h] +\begin{center} +\begin{tabular}{|r|l|l|l|} + \hline + Processor & $v_0$ & $v_1$ & $v_2$ \\ + \hline + $P_0$ & x & & x \\ + \hline + $P_1$ & & x & \\ + \hline + $P_2$ & x & & x \\ + \hline +\end{tabular} +\caption{\label{tab:0/tc} Before communication} +\end{center} +\end{table} + +Using Message Passing Interface (MPI) communicators, it is possible to +communicate with processors by column. We use an \texttt{MPI\_Allreduce} +call to collect data from each processor, which groups them into a usable +form. Consider Table 2. + +\begin{table}[h] +\begin{center} +\begin{tabular}{|r|l|l|l|} + \hline + Processor & $v_0$ & $v_1$ & $v_2$ \\ + \hline + $P_0$ & x & & \\ + \hline + $P_1$ & & x & \\ + \hline + $P_2$ & & & x \\ + \hline +\end{tabular} +\caption{\label{tab:1/tc} After communication} +\end{center} +\end{table} + +This same sort of operation is performed with weight data, so implementing +it on coordinate data was simply another step in setting up PHG to support +coordinate information from the input. Afterwards the entirity of a vertex's +data will be unique to a single processor, with the number of global +vertices == $\sum_{i=0}^{numProc-1} ($number of local vertices_i$)$. + + +\section{Matching} +There are several matching methods already native to Zoltan and specific to +PHG, but we needed to create a new method in order to use RCB on the +hypergraph data. Before the actual matching occurs several specialized +callbacks and parameters are registered. Doing this is crucial if RCB and PHG +are to interface properly with each other. + +The next task is to physically call RCB. It was easy enough to send PHG +data to RCB as we simply used the \texttt{Zoltan\_LB\_Partition} wrapper, +not unlike other standard load balancing partitioners. However, getting +matchings \emph{back} from RCB to PHG was another matter entirely. Thanks to +Dr. Devine's work, we were able to ostensibly comondeer one of RCB's unused +return values: since all matching algorithms conform syntactically to the +afforementioned load-balancing wrapper, there are some arguments and/or +values that are never used depending on what data that partitioner needs In +the case of RCB, the return value \texttt{*export\_global\_ids}, which is +defined in its prototype, was never actually computed. Dr. Devine was able +to rewire RCB so that, when using hybrid partitioning, it would return the +IDs of the matchings we need for each hypergraph (which are referred to in +the matching procedure as \emph{candidates}). + +This new matching procedure is similar to PHG's agglomerative matching, +whereby candidate vertices are selected to represent groups of similar +vertices. These candidates then make up the standard vertices in the +resultant coarse hypergraph. The major difference is that standard +agglomerative matching determines its candidates by the connectivity of +vertices to one another; the more heavily connected a subset of vertices +is, the more likely they will share the same candidate. Using RCB means +making the assumption that related vertices will be geometrically similar: +recursive geometric cuts will be more likely to naturally bisect less +connected parts of the hypergraph, and the vertices that are members of +the resulting subdomains will share the same candidates. Given RCB's +track record, this method should be significantly faster than the +agglomerative matching. + + +\section{Reduction factor} +When using hybrid partitioning, the user passes a parameter in the input +file called \texttt{HYBRID\_REDUCTION\_FACTOR}, which is a number $> 0$ +and $\leq 1$ that gets passed into RCB. This parameter defines the +aggressiveness of the overall procedure. This number simply determines +the amount by which the larger graph will be reduced (e.g. for the +original, fine hypergraph, $H_f$, where the number of vertices +$|V_f| == 1000$, and a reduction factor of $f == 0.1$, the coarse hypergraph, +$H_c$, will have $|V_c| == 100$ vertices). + +This gives the user more control over the balance between quality +and efficiency. + + +\section{Results} +We ran experiments primarily with 2 and 128 processors on the Odin cluster +at Sandia National Labs, though there were brief, undocumented forees with +16 and 32 processors as well. Odin has two AMD Opteron 2.2GHz processors +and 4GB of RAM on each node, which are connected with a Myrinet network +\cite{Catalyurek}. The partitioning methods used were RCB, PHG, and hybrid +partitioning with a reduction factor of 0.01, 0.05, and 0.1. Each run went +through 10 iterations of the scenario. The runs with 128 processors were +given 5 different meshes to run on, whereas the 2 processor runs only ran +on the 4 smaller meshes, as the cluster was undergoing diagnostics at the +time of the experiements. + +%NEED TIMES @ 128 PROCS +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=80mm]{128_time.pdf} + \caption{Runtimes on 128 processors}\label{fig:Times_np_128} +\end{figure} + + + +%NEED cutl @ 128 PROCS +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=70mm]{128_cutl.pdf} + \caption{Cuts on 128 processors}\label{fig:Cuts_np_128} +\end{figure} + +You can see from Figure 1 and 2 that at 128 processors the hybrid methods +are mainly slower than PHG and less accurate than RCB: both results are +the inverse of what we had hoped. There was better news looking at where +the processes were taking their time though: + +%timer breakdowns for 128 +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=70mm]{128_breakdown_percent.pdf} + \caption{Timing by percentage on 128 processors (UL, Shockstem 3D; UR, + Shockstem 3D -- 108; LL, RPI; LR, Slac1.5}\label{fig:Percent_np_128} +\end{figure} + +The dramatic decrease in the matching time meant that RCB was, indeed, +helping on that front. + +When we ran our simulations in serial, however, we saw some very different +results: + +%times, cutl +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=80mm]{2_time.pdf} + \caption{Runtimes in serial on 2 processors}\label{fig:Times_np_2} +\end{figure} + + + +%NEED cutl @ 128 PROCS +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=70mm]{2_cutl.pdf} + \caption{Cuts in serial on 2 processors}\label{fig:Cuts_np_2} +\end{figure} + +In general the hybrid times beat the PHG times, and the hybrid cuts beat +the RCB cuts. + +%time breakdowns for 2 +\begin{figure}[hgp] + \centering + \includegraphics[width=\textwidth, height=70mm]{2_breakdown_percent.pdf} + \caption{Timing by percentage on 2 processors (UL, Shockstem 3D; UR, + Shockstem 3D -- 108; LL, RPI; LR, Slac1.5}\label{fig:Percent_np_2} +\end{figure} + +Looking at individual timers in this serial run, we can see that RCB has +still drastically reduced the matching time. In addition, the slowdown in +the coarse partitioning has been greatly reduced. + +\section{Conclusion and discussion} +The parallel implementation of hybrid partitioning is obviously not +functioning as desired, but we believe that there is ultimately a great +deal of promise in this method. Seeing the results from our serial runs +is encouraging, and it would be worth the effort to continue forward. + +Perhaps it would be helpful to check for any communication issues arising +between processors. The whole system could potentially drag, was a +single processor waiting for a message. Additionally, Dr. Catalyurek had +suggested only using RCB-based coarsening on the largest, most complex +hypergraphs, and then revert to standard agglomerative matching for +coarser iterations. + +At this moment, there could be four different ways to use Dr. Catalyurek's +method: the first, and perhaps simplest of the three, would be to hardwire +in the number of coarsening levels to give to RCB. A second way would be +to define a new parameter to allow the user to select the number of +RCB-based coarsenings. A third would be to write a short algorithm to +determine and use the optimal number of layers based off of the input. +Finally, there could be an option of user input, with a default to +be either of the other ways. + +\begin{thebibliography}{5} + +\bibitem{Catalyurek}U.V. Catalyurek, E.G. Boman, K.D. Devine, D. Bozdag, + R.T. Heaphy, and L.A. Riesen. \emph{A Repartitioning Hypergraph Model + for Dynamic Load Balancing.} Sandia National Labs, 2009. + +\end{thebibliography} + +{\small \noindent August 2011.} +\end{document} + + diff --git a/packages/zoltan/doc/NEA_docs/writeup/odin-data.ods b/packages/zoltan/doc/NEA_docs/writeup/odin-data.ods new file mode 100644 index 0000000000..3d2b0e96e2 Binary files /dev/null and b/packages/zoltan/doc/NEA_docs/writeup/odin-data.ods differ diff --git a/packages/zoltan/doc/Tutorial/zoltan_tutorial_document.pdf b/packages/zoltan/doc/Tutorial/zoltan_tutorial_document.pdf new file mode 100644 index 0000000000..13dd418352 Binary files /dev/null and b/packages/zoltan/doc/Tutorial/zoltan_tutorial_document.pdf differ diff --git a/packages/zoltan/doc/Tutorial/zoltan_tutorial_presentation.pdf b/packages/zoltan/doc/Tutorial/zoltan_tutorial_presentation.pdf new file mode 100644 index 0000000000..665a9187d2 Binary files /dev/null and b/packages/zoltan/doc/Tutorial/zoltan_tutorial_presentation.pdf differ diff --git a/packages/zoltan/doc/Zoltan_pdf/ug.pdf b/packages/zoltan/doc/Zoltan_pdf/ug.pdf new file mode 100644 index 0000000000..95846d77c8 Binary files /dev/null and b/packages/zoltan/doc/Zoltan_pdf/ug.pdf differ diff --git a/packages/zoltan/docs/Zoltan.html b/packages/zoltan/docs/Zoltan.html index 154377ae65..9ed671e77e 100644 --- a/packages/zoltan/docs/Zoltan.html +++ b/packages/zoltan/docs/Zoltan.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_FAQ.html b/packages/zoltan/docs/Zoltan_FAQ.html index 45c332b834..066cc568a5 100644 --- a/packages/zoltan/docs/Zoltan_FAQ.html +++ b/packages/zoltan/docs/Zoltan_FAQ.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_bugreport.html b/packages/zoltan/docs/Zoltan_bugreport.html index 77ecab7b34..2fd089e208 100644 --- a/packages/zoltan/docs/Zoltan_bugreport.html +++ b/packages/zoltan/docs/Zoltan_bugreport.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_cite.html b/packages/zoltan/docs/Zoltan_cite.html index a47a1aa6cb..54dd416245 100644 --- a/packages/zoltan/docs/Zoltan_cite.html +++ b/packages/zoltan/docs/Zoltan_cite.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_download.html b/packages/zoltan/docs/Zoltan_download.html index 6c723c5352..c97ccf7d61 100644 --- a/packages/zoltan/docs/Zoltan_download.html +++ b/packages/zoltan/docs/Zoltan_download.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_phil.html b/packages/zoltan/docs/Zoltan_phil.html index 78e8dd7785..5f470f171a 100644 --- a/packages/zoltan/docs/Zoltan_phil.html +++ b/packages/zoltan/docs/Zoltan_phil.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/Zoltan_pubs.html b/packages/zoltan/docs/Zoltan_pubs.html index c4a051060e..7b4dd6bac0 100644 --- a/packages/zoltan/docs/Zoltan_pubs.html +++ b/packages/zoltan/docs/Zoltan_pubs.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev.html b/packages/zoltan/docs/dev_html/dev.html index 02137a4f65..4cee3454d9 100644 --- a/packages/zoltan/docs/dev_html/dev.html +++ b/packages/zoltan/docs/dev_html/dev.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add.html b/packages/zoltan/docs/dev_html/dev_add.html index da445d75ce..2b6740be8e 100644 --- a/packages/zoltan/docs/dev_html/dev_add.html +++ b/packages/zoltan/docs/dev_html/dev_add.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_interface.html b/packages/zoltan/docs/dev_html/dev_add_interface.html index 640943fe87..aa4905178c 100644 --- a/packages/zoltan/docs/dev_html/dev_add_interface.html +++ b/packages/zoltan/docs/dev_html/dev_add_interface.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_lb.html b/packages/zoltan/docs/dev_html/dev_add_lb.html index 73c016cc52..e85f742e0c 100644 --- a/packages/zoltan/docs/dev_html/dev_add_lb.html +++ b/packages/zoltan/docs/dev_html/dev_add_lb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_memory.html b/packages/zoltan/docs/dev_html/dev_add_memory.html index 2ce07f0bcd..a34b762d31 100644 --- a/packages/zoltan/docs/dev_html/dev_add_memory.html +++ b/packages/zoltan/docs/dev_html/dev_add_memory.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_params.html b/packages/zoltan/docs/dev_html/dev_add_params.html index af08d10a3e..aa3a568e0a 100644 --- a/packages/zoltan/docs/dev_html/dev_add_params.html +++ b/packages/zoltan/docs/dev_html/dev_add_params.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_remap.html b/packages/zoltan/docs/dev_html/dev_add_remap.html index 569bae7f59..3bfffb645a 100644 --- a/packages/zoltan/docs/dev_html/dev_add_remap.html +++ b/packages/zoltan/docs/dev_html/dev_add_remap.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_add_struct.html b/packages/zoltan/docs/dev_html/dev_add_struct.html index 7220a3b4b2..7359c18bf7 100644 --- a/packages/zoltan/docs/dev_html/dev_add_struct.html +++ b/packages/zoltan/docs/dev_html/dev_add_struct.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_cpp.html b/packages/zoltan/docs/dev_html/dev_cpp.html index 19efcb9aa8..90526bc22c 100644 --- a/packages/zoltan/docs/dev_html/dev_cpp.html +++ b/packages/zoltan/docs/dev_html/dev_cpp.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_degenerate.html b/packages/zoltan/docs/dev_html/dev_degenerate.html index bc55e39b02..950c8e65d0 100644 --- a/packages/zoltan/docs/dev_html/dev_degenerate.html +++ b/packages/zoltan/docs/dev_html/dev_degenerate.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_dist.html b/packages/zoltan/docs/dev_html/dev_dist.html index e077988f08..695c169c73 100644 --- a/packages/zoltan/docs/dev_html/dev_dist.html +++ b/packages/zoltan/docs/dev_html/dev_dist.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_dist_compile.html b/packages/zoltan/docs/dev_html/dev_dist_compile.html index e9fc2bc768..b64dfb3396 100644 --- a/packages/zoltan/docs/dev_html/dev_dist_compile.html +++ b/packages/zoltan/docs/dev_html/dev_dist_compile.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_dist_cvs.html b/packages/zoltan/docs/dev_html/dev_dist_cvs.html index c9d614959e..4cf0bbec53 100644 --- a/packages/zoltan/docs/dev_html/dev_dist_cvs.html +++ b/packages/zoltan/docs/dev_html/dev_dist_cvs.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_dist_dir.html b/packages/zoltan/docs/dev_html/dev_dist_dir.html index bb0ddff1a1..dc7d74d358 100644 --- a/packages/zoltan/docs/dev_html/dev_dist_dir.html +++ b/packages/zoltan/docs/dev_html/dev_dist_dir.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_driver.html b/packages/zoltan/docs/dev_html/dev_driver.html index 73162aa171..0a02518e1b 100644 --- a/packages/zoltan/docs/dev_html/dev_driver.html +++ b/packages/zoltan/docs/dev_html/dev_driver.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_fortran.html b/packages/zoltan/docs/dev_html/dev_fortran.html index c6ee6313eb..7a9a5e3d1e 100644 --- a/packages/zoltan/docs/dev_html/dev_fortran.html +++ b/packages/zoltan/docs/dev_html/dev_fortran.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_hier.html b/packages/zoltan/docs/dev_html/dev_hier.html index 64db15be00..b18086bd16 100644 --- a/packages/zoltan/docs/dev_html/dev_hier.html +++ b/packages/zoltan/docs/dev_html/dev_hier.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_hsfc.html b/packages/zoltan/docs/dev_html/dev_hsfc.html index b54d59f7c0..6776d5a279 100644 --- a/packages/zoltan/docs/dev_html/dev_hsfc.html +++ b/packages/zoltan/docs/dev_html/dev_hsfc.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_intro.html b/packages/zoltan/docs/dev_html/dev_intro.html index 8d96ac04e7..3578fb70a4 100644 --- a/packages/zoltan/docs/dev_html/dev_intro.html +++ b/packages/zoltan/docs/dev_html/dev_intro.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_intro_coding.html b/packages/zoltan/docs/dev_html/dev_intro_coding.html index 7f6b2c5e94..32ad42c261 100644 --- a/packages/zoltan/docs/dev_html/dev_intro_coding.html +++ b/packages/zoltan/docs/dev_html/dev_intro_coding.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_intro_philosophy.html b/packages/zoltan/docs/dev_html/dev_intro_philosophy.html index b73b2b24bb..c05d13b69f 100644 --- a/packages/zoltan/docs/dev_html/dev_intro_philosophy.html +++ b/packages/zoltan/docs/dev_html/dev_intro_philosophy.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_intro_sqe.html b/packages/zoltan/docs/dev_html/dev_intro_sqe.html index dca3acfb8b..62b456cdab 100644 --- a/packages/zoltan/docs/dev_html/dev_intro_sqe.html +++ b/packages/zoltan/docs/dev_html/dev_intro_sqe.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_lb.html b/packages/zoltan/docs/dev_html/dev_lb.html index 8e7d8f055b..0d2d019109 100644 --- a/packages/zoltan/docs/dev_html/dev_lb.html +++ b/packages/zoltan/docs/dev_html/dev_lb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_lb_interface.html b/packages/zoltan/docs/dev_html/dev_lb_interface.html index cb29cb6ba2..60cf874ee4 100644 --- a/packages/zoltan/docs/dev_html/dev_lb_interface.html +++ b/packages/zoltan/docs/dev_html/dev_lb_interface.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_lb_structs.html b/packages/zoltan/docs/dev_html/dev_lb_structs.html index f6c06f5dc5..c24006b528 100644 --- a/packages/zoltan/docs/dev_html/dev_lb_structs.html +++ b/packages/zoltan/docs/dev_html/dev_lb_structs.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_lb_types.html b/packages/zoltan/docs/dev_html/dev_lb_types.html index ade5ae6bf2..301182a925 100644 --- a/packages/zoltan/docs/dev_html/dev_lb_types.html +++ b/packages/zoltan/docs/dev_html/dev_lb_types.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_mig.html b/packages/zoltan/docs/dev_html/dev_mig.html index 971ada412d..5cfa72f2ce 100644 --- a/packages/zoltan/docs/dev_html/dev_mig.html +++ b/packages/zoltan/docs/dev_html/dev_mig.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_parmetis.html b/packages/zoltan/docs/dev_html/dev_parmetis.html index 6be236b67d..b400434cc0 100644 --- a/packages/zoltan/docs/dev_html/dev_parmetis.html +++ b/packages/zoltan/docs/dev_html/dev_parmetis.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_phg.html b/packages/zoltan/docs/dev_html/dev_phg.html index 9fb62145ce..bc11683620 100644 --- a/packages/zoltan/docs/dev_html/dev_phg.html +++ b/packages/zoltan/docs/dev_html/dev_phg.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_rcb.html b/packages/zoltan/docs/dev_html/dev_rcb.html index fbd04e0a19..0b988bb076 100644 --- a/packages/zoltan/docs/dev_html/dev_rcb.html +++ b/packages/zoltan/docs/dev_html/dev_rcb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_refs.html b/packages/zoltan/docs/dev_html/dev_refs.html index 654f0d4173..6b46cdba90 100644 --- a/packages/zoltan/docs/dev_html/dev_refs.html +++ b/packages/zoltan/docs/dev_html/dev_refs.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_reftree.html b/packages/zoltan/docs/dev_html/dev_reftree.html index 32cbc87306..ab2b57112b 100644 --- a/packages/zoltan/docs/dev_html/dev_reftree.html +++ b/packages/zoltan/docs/dev_html/dev_reftree.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_rib.html b/packages/zoltan/docs/dev_html/dev_rib.html index a68842aef8..15df6bec7e 100644 --- a/packages/zoltan/docs/dev_html/dev_rib.html +++ b/packages/zoltan/docs/dev_html/dev_rib.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services.html b/packages/zoltan/docs/dev_html/dev_services.html index 70d3166673..f3c137f6e2 100644 --- a/packages/zoltan/docs/dev_html/dev_services.html +++ b/packages/zoltan/docs/dev_html/dev_services.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_debug.html b/packages/zoltan/docs/dev_html/dev_services_debug.html index 81af948df0..5cd2714e8f 100644 --- a/packages/zoltan/docs/dev_html/dev_services_debug.html +++ b/packages/zoltan/docs/dev_html/dev_services_debug.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_hash.html b/packages/zoltan/docs/dev_html/dev_services_hash.html index 55638b3675..b95cfa50d9 100644 --- a/packages/zoltan/docs/dev_html/dev_services_hash.html +++ b/packages/zoltan/docs/dev_html/dev_services_hash.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_objlist.html b/packages/zoltan/docs/dev_html/dev_services_objlist.html index e2d9c327f8..b6ce66c7e3 100644 --- a/packages/zoltan/docs/dev_html/dev_services_objlist.html +++ b/packages/zoltan/docs/dev_html/dev_services_objlist.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_parallel.html b/packages/zoltan/docs/dev_html/dev_services_parallel.html index c524ba20f7..11d8f088cd 100644 --- a/packages/zoltan/docs/dev_html/dev_services_parallel.html +++ b/packages/zoltan/docs/dev_html/dev_services_parallel.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_params.html b/packages/zoltan/docs/dev_html/dev_services_params.html index 2712706e41..bc3cebfb5f 100644 --- a/packages/zoltan/docs/dev_html/dev_services_params.html +++ b/packages/zoltan/docs/dev_html/dev_services_params.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_time.html b/packages/zoltan/docs/dev_html/dev_services_time.html index e65bf983cd..864208be5e 100644 --- a/packages/zoltan/docs/dev_html/dev_services_time.html +++ b/packages/zoltan/docs/dev_html/dev_services_time.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_services_zoltantimer.html b/packages/zoltan/docs/dev_html/dev_services_zoltantimer.html index ca195864eb..a1cac198e7 100644 --- a/packages/zoltan/docs/dev_html/dev_services_zoltantimer.html +++ b/packages/zoltan/docs/dev_html/dev_services_zoltantimer.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_test_script.html b/packages/zoltan/docs/dev_html/dev_test_script.html index 17c2e48ca8..77a454b6a1 100644 --- a/packages/zoltan/docs/dev_html/dev_test_script.html +++ b/packages/zoltan/docs/dev_html/dev_test_script.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/dev_html/dev_view.html b/packages/zoltan/docs/dev_html/dev_view.html index f918fef862..275c2add72 100644 --- a/packages/zoltan/docs/dev_html/dev_view.html +++ b/packages/zoltan/docs/dev_html/dev_view.html @@ -1,47 +1,3 @@ - @@ -155,7 +111,7 @@

any value p. Note that since the window may be resized with the mouse, you may not need image height and image width unless you must have a very specific window size. Also note that if you -ran the Fortan test driver zfdrive, you will need to rename the +ran the Fortran test driver zfdrive, you will need to rename the output files from file_name.fout.p.n to file_name.out.p.n. diff --git a/packages/zoltan/docs/dev_html/zdrive.inp b/packages/zoltan/docs/dev_html/zdrive.inp index bd2bf40542..6eae2950af 100644 --- a/packages/zoltan/docs/dev_html/zdrive.inp +++ b/packages/zoltan/docs/dev_html/zdrive.inp @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ############################################################################## # # EXAMPLE OF zdrive.inp INPUT FILE FOR zdrive AND zfdrive. diff --git a/packages/zoltan/docs/tu_html/README b/packages/zoltan/docs/tu_html/README index f5a76909a8..8b94251bdb 100644 --- a/packages/zoltan/docs/tu_html/README +++ b/packages/zoltan/docs/tu_html/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER The Zoltan tutorial was written in LaTeX, but can be converted to html. The Makefile assumes latex2html is available. Just type 'make' and you should get diff --git a/packages/zoltan/docs/tu_html/tutorial.html b/packages/zoltan/docs/tu_html/tutorial.html index a9e59c4fe7..407daa88fe 100644 --- a/packages/zoltan/docs/tu_html/tutorial.html +++ b/packages/zoltan/docs/tu_html/tutorial.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug.html b/packages/zoltan/docs/ug_html/ug.html index 9f636d2208..7fa3a8b62e 100644 --- a/packages/zoltan/docs/ug_html/ug.html +++ b/packages/zoltan/docs/ug_html/ug.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg.html b/packages/zoltan/docs/ug_html/ug_alg.html index dc386de378..95eecc9976 100644 --- a/packages/zoltan/docs/ug_html/ug_alg.html +++ b/packages/zoltan/docs/ug_html/ug_alg.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_block.html b/packages/zoltan/docs/ug_html/ug_alg_block.html index 24bb64172f..fc2d43c80e 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_block.html +++ b/packages/zoltan/docs/ug_html/ug_alg_block.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_cyclic.html b/packages/zoltan/docs/ug_html/ug_alg_cyclic.html index c48f36523e..4cd3f49f41 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_cyclic.html +++ b/packages/zoltan/docs/ug_html/ug_alg_cyclic.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_geom.html b/packages/zoltan/docs/ug_html/ug_alg_geom.html index 73e27c5200..c9bfe01a9e 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_geom.html +++ b/packages/zoltan/docs/ug_html/ug_alg_geom.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_graph.html b/packages/zoltan/docs/ug_html/ug_alg_graph.html index 0331129aec..7e46728ca7 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_graph.html +++ b/packages/zoltan/docs/ug_html/ug_alg_graph.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_hier.html b/packages/zoltan/docs/ug_html/ug_alg_hier.html index 5c60996970..bd9b3a978a 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_hier.html +++ b/packages/zoltan/docs/ug_html/ug_alg_hier.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_hsfc.html b/packages/zoltan/docs/ug_html/ug_alg_hsfc.html index 2eae28e5d0..8ee32f898c 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_hsfc.html +++ b/packages/zoltan/docs/ug_html/ug_alg_hsfc.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_hypergraph.html b/packages/zoltan/docs/ug_html/ug_alg_hypergraph.html index ae2aa6c9c0..4ec3e7e120 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_hypergraph.html +++ b/packages/zoltan/docs/ug_html/ug_alg_hypergraph.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_jostle.html b/packages/zoltan/docs/ug_html/ug_alg_jostle.html index 77c8809e6f..5b3e6fc437 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_jostle.html +++ b/packages/zoltan/docs/ug_html/ug_alg_jostle.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_oct.html b/packages/zoltan/docs/ug_html/ug_alg_oct.html index 6d3b0b664f..8ebd2f4202 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_oct.html +++ b/packages/zoltan/docs/ug_html/ug_alg_oct.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_parkway.html b/packages/zoltan/docs/ug_html/ug_alg_parkway.html index 4d4f7e7e72..085106829a 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_parkway.html +++ b/packages/zoltan/docs/ug_html/ug_alg_parkway.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_parmetis.html b/packages/zoltan/docs/ug_html/ug_alg_parmetis.html index 3281aa450c..56dfc03207 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_parmetis.html +++ b/packages/zoltan/docs/ug_html/ug_alg_parmetis.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_patoh.html b/packages/zoltan/docs/ug_html/ug_alg_patoh.html index b7a4a9a080..e0a14d3d4f 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_patoh.html +++ b/packages/zoltan/docs/ug_html/ug_alg_patoh.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_phg.html b/packages/zoltan/docs/ug_html/ug_alg_phg.html index 441ffd5f43..f97d616662 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_phg.html +++ b/packages/zoltan/docs/ug_html/ug_alg_phg.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_ptscotch.html b/packages/zoltan/docs/ug_html/ug_alg_ptscotch.html index 715d29f5cf..e75401defb 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_ptscotch.html +++ b/packages/zoltan/docs/ug_html/ug_alg_ptscotch.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_random.html b/packages/zoltan/docs/ug_html/ug_alg_random.html index 1c96758da3..d941fb5a78 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_random.html +++ b/packages/zoltan/docs/ug_html/ug_alg_random.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_rcb.html b/packages/zoltan/docs/ug_html/ug_alg_rcb.html index f65bb4d573..a8cb119e16 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_rcb.html +++ b/packages/zoltan/docs/ug_html/ug_alg_rcb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_reftree.html b/packages/zoltan/docs/ug_html/ug_alg_reftree.html index 3dea63584a..e34a60f2f3 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_reftree.html +++ b/packages/zoltan/docs/ug_html/ug_alg_reftree.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_rib.html b/packages/zoltan/docs/ug_html/ug_alg_rib.html index a3cc8028b9..3cc396d2a8 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_rib.html +++ b/packages/zoltan/docs/ug_html/ug_alg_rib.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_alg_simple.html b/packages/zoltan/docs/ug_html/ug_alg_simple.html index e6c8d21f8b..a3c99b4fc8 100644 --- a/packages/zoltan/docs/ug_html/ug_alg_simple.html +++ b/packages/zoltan/docs/ug_html/ug_alg_simple.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_backward.html b/packages/zoltan/docs/ug_html/ug_backward.html index 97af92601c..f6f9fee2ab 100644 --- a/packages/zoltan/docs/ug_html/ug_backward.html +++ b/packages/zoltan/docs/ug_html/ug_backward.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_color.html b/packages/zoltan/docs/ug_html/ug_color.html index 0a66b59022..cc679d0f4c 100644 --- a/packages/zoltan/docs/ug_html/ug_color.html +++ b/packages/zoltan/docs/ug_html/ug_color.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_color_parallel.html b/packages/zoltan/docs/ug_html/ug_color_parallel.html index cdedb98b7a..f1b0a2fd44 100644 --- a/packages/zoltan/docs/ug_html/ug_color_parallel.html +++ b/packages/zoltan/docs/ug_html/ug_color_parallel.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_cpp.html b/packages/zoltan/docs/ug_html/ug_cpp.html index 7bb59d46e4..4505b67261 100644 --- a/packages/zoltan/docs/ug_html/ug_cpp.html +++ b/packages/zoltan/docs/ug_html/ug_cpp.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_examples.html b/packages/zoltan/docs/ug_html/ug_examples.html index 6e311e2b58..ea6526f1e5 100644 --- a/packages/zoltan/docs/ug_html/ug_examples.html +++ b/packages/zoltan/docs/ug_html/ug_examples.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_examples_init.html b/packages/zoltan/docs/ug_html/ug_examples_init.html index 130c427899..6c718f1ea0 100644 --- a/packages/zoltan/docs/ug_html/ug_examples_init.html +++ b/packages/zoltan/docs/ug_html/ug_examples_init.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_examples_lb.html b/packages/zoltan/docs/ug_html/ug_examples_lb.html index 9d2231da3d..bea47d5141 100644 --- a/packages/zoltan/docs/ug_html/ug_examples_lb.html +++ b/packages/zoltan/docs/ug_html/ug_examples_lb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_examples_mig.html b/packages/zoltan/docs/ug_html/ug_examples_mig.html index 1beeeacf53..b1b6effb19 100644 --- a/packages/zoltan/docs/ug_html/ug_examples_mig.html +++ b/packages/zoltan/docs/ug_html/ug_examples_mig.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_examples_query.html b/packages/zoltan/docs/ug_html/ug_examples_query.html index f3cdfa2df7..68c0bd3d1f 100644 --- a/packages/zoltan/docs/ug_html/ug_examples_query.html +++ b/packages/zoltan/docs/ug_html/ug_examples_query.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_fortran.html b/packages/zoltan/docs/ug_html/ug_fortran.html index 95416d3cc3..10d8e56feb 100644 --- a/packages/zoltan/docs/ug_html/ug_fortran.html +++ b/packages/zoltan/docs/ug_html/ug_fortran.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_graph_build.html b/packages/zoltan/docs/ug_html/ug_graph_build.html index 8a09ac552c..9a9283d6ce 100644 --- a/packages/zoltan/docs/ug_html/ug_graph_build.html +++ b/packages/zoltan/docs/ug_html/ug_graph_build.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_graph_vs_hg.html b/packages/zoltan/docs/ug_html/ug_graph_vs_hg.html index 62f52a573b..a41fcfca39 100644 --- a/packages/zoltan/docs/ug_html/ug_graph_vs_hg.html +++ b/packages/zoltan/docs/ug_html/ug_graph_vs_hg.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_index.html b/packages/zoltan/docs/ug_html/ug_index.html index 998b13bf01..ce7e054ebd 100644 --- a/packages/zoltan/docs/ug_html/ug_index.html +++ b/packages/zoltan/docs/ug_html/ug_index.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface.html b/packages/zoltan/docs/ug_html/ug_interface.html index 59af504806..75c03e1871 100644 --- a/packages/zoltan/docs/ug_html/ug_interface.html +++ b/packages/zoltan/docs/ug_html/ug_interface.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_augment.html b/packages/zoltan/docs/ug_html/ug_interface_augment.html index e4ba8bca17..b4ed2cb9aa 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_augment.html +++ b/packages/zoltan/docs/ug_html/ug_interface_augment.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_color.html b/packages/zoltan/docs/ug_html/ug_interface_color.html index 38e82874ed..e625d21237 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_color.html +++ b/packages/zoltan/docs/ug_html/ug_interface_color.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_init.html b/packages/zoltan/docs/ug_html/ug_interface_init.html index 68279c04fd..d77a5c8c37 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_init.html +++ b/packages/zoltan/docs/ug_html/ug_interface_init.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_lb.html b/packages/zoltan/docs/ug_html/ug_interface_lb.html index ac3f32a51c..436014a93b 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_lb.html +++ b/packages/zoltan/docs/ug_html/ug_interface_lb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_mig.html b/packages/zoltan/docs/ug_html/ug_interface_mig.html index 48d335091f..67381808a7 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_mig.html +++ b/packages/zoltan/docs/ug_html/ug_interface_mig.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_interface_order.html b/packages/zoltan/docs/ug_html/ug_interface_order.html index ab892ee45f..16e452bdc1 100644 --- a/packages/zoltan/docs/ug_html/ug_interface_order.html +++ b/packages/zoltan/docs/ug_html/ug_interface_order.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_intro.html b/packages/zoltan/docs/ug_html/ug_intro.html index 3dcc6b893d..636fd3f338 100644 --- a/packages/zoltan/docs/ug_html/ug_intro.html +++ b/packages/zoltan/docs/ug_html/ug_intro.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_order.html b/packages/zoltan/docs/ug_html/ug_order.html index 8f06ec7a93..f99526c6f1 100644 --- a/packages/zoltan/docs/ug_html/ug_order.html +++ b/packages/zoltan/docs/ug_html/ug_order.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_order_local_hsfc.html b/packages/zoltan/docs/ug_html/ug_order_local_hsfc.html index db1143b02a..7dc349b9b0 100644 --- a/packages/zoltan/docs/ug_html/ug_order_local_hsfc.html +++ b/packages/zoltan/docs/ug_html/ug_order_local_hsfc.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_order_parmetis.html b/packages/zoltan/docs/ug_html/ug_order_parmetis.html index 39d8855818..00c741715c 100644 --- a/packages/zoltan/docs/ug_html/ug_order_parmetis.html +++ b/packages/zoltan/docs/ug_html/ug_order_parmetis.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_order_ptscotch.html b/packages/zoltan/docs/ug_html/ug_order_ptscotch.html index 8d62d7a1b0..5f4c748952 100644 --- a/packages/zoltan/docs/ug_html/ug_order_ptscotch.html +++ b/packages/zoltan/docs/ug_html/ug_order_ptscotch.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_param.html b/packages/zoltan/docs/ug_html/ug_param.html index ff28749255..25e1fc436e 100644 --- a/packages/zoltan/docs/ug_html/ug_param.html +++ b/packages/zoltan/docs/ug_html/ug_param.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_query.html b/packages/zoltan/docs/ug_html/ug_query.html index 4f5f54eb66..c9fa08393d 100644 --- a/packages/zoltan/docs/ug_html/ug_query.html +++ b/packages/zoltan/docs/ug_html/ug_query.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_query_lb.html b/packages/zoltan/docs/ug_html/ug_query_lb.html index 61bfed1ac3..cbd4587d80 100644 --- a/packages/zoltan/docs/ug_html/ug_query_lb.html +++ b/packages/zoltan/docs/ug_html/ug_query_lb.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_query_mig.html b/packages/zoltan/docs/ug_html/ug_query_mig.html index c5dd925e93..56fcf9b73a 100644 --- a/packages/zoltan/docs/ug_html/ug_query_mig.html +++ b/packages/zoltan/docs/ug_html/ug_query_mig.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_refs.html b/packages/zoltan/docs/ug_html/ug_refs.html index 04b1de0d43..2a17ba3250 100644 --- a/packages/zoltan/docs/ug_html/ug_refs.html +++ b/packages/zoltan/docs/ug_html/ug_refs.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_release.html b/packages/zoltan/docs/ug_html/ug_release.html index d192375c45..e4319c847b 100644 --- a/packages/zoltan/docs/ug_html/ug_release.html +++ b/packages/zoltan/docs/ug_html/ug_release.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_usage.html b/packages/zoltan/docs/ug_html/ug_usage.html index 1df893a9a5..979e7eab83 100644 --- a/packages/zoltan/docs/ug_html/ug_usage.html +++ b/packages/zoltan/docs/ug_html/ug_usage.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_util.html b/packages/zoltan/docs/ug_html/ug_util.html index 085ba7da10..a4062876a1 100644 --- a/packages/zoltan/docs/ug_html/ug_util.html +++ b/packages/zoltan/docs/ug_html/ug_util.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_util_comm.html b/packages/zoltan/docs/ug_html/ug_util_comm.html index 10371913bc..c8a232b1d2 100644 --- a/packages/zoltan/docs/ug_html/ug_util_comm.html +++ b/packages/zoltan/docs/ug_html/ug_util_comm.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_util_dd.html b/packages/zoltan/docs/ug_html/ug_util_dd.html index 5d235e946e..6b74cc16c3 100644 --- a/packages/zoltan/docs/ug_html/ug_util_dd.html +++ b/packages/zoltan/docs/ug_html/ug_util_dd.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/docs/ug_html/ug_util_mem.html b/packages/zoltan/docs/ug_html/ug_util_mem.html index 22810ffe28..1e84c9d435 100644 --- a/packages/zoltan/docs/ug_html/ug_util_mem.html +++ b/packages/zoltan/docs/ug_html/ug_util_mem.html @@ -1,47 +1,3 @@ - diff --git a/packages/zoltan/example/C/CMakeLists.txt b/packages/zoltan/example/C/CMakeLists.txt index 63870eb4b3..91fed654c9 100644 --- a/packages/zoltan/example/C/CMakeLists.txt +++ b/packages/zoltan/example/C/CMakeLists.txt @@ -10,7 +10,7 @@ TRIBITS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${PACKAGE_SOURC TRIBITS_ADD_EXECUTABLE_AND_TEST( simpleHIER SOURCES simpleHIER.c - ARGS + ARGS COMM mpi NUM_MPI_PROCS 1-4 ) @@ -18,7 +18,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( simpleBLOCK SOURCES simpleBLOCK.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) @@ -26,7 +26,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( simpleRCB SOURCES simpleRCB.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) @@ -34,7 +34,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( simpleGRAPH SOURCES simpleGRAPH.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) @@ -42,7 +42,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( simplePHG SOURCES simplePHG.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) @@ -50,7 +50,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( migrateGRAPH SOURCES migrateGRAPH.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) @@ -58,7 +58,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TRIBITS_ADD_EXECUTABLE_AND_TEST( problemGRAPH SOURCES problemGRAPH.c - ARGS + ARGS COMM serial mpi NUM_MPI_PROCS 1-4 ) diff --git a/packages/zoltan/example/C/Makefile.am b/packages/zoltan/example/C/Makefile.am index 7df6eef47b..172b495786 100644 --- a/packages/zoltan/example/C/Makefile.am +++ b/packages/zoltan/example/C/Makefile.am @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER # The following line helps the test harness recover from build errors. diff --git a/packages/zoltan/example/C/Makefile.in b/packages/zoltan/example/C/Makefile.in index d32228039d..c5e55bdad2 100644 --- a/packages/zoltan/example/C/Makefile.in +++ b/packages/zoltan/example/C/Makefile.in @@ -15,49 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER # The following line helps the test harness recover from build errors. @@ -331,19 +288,19 @@ $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -problemGRAPH$(EXEEXT): $(problemGRAPH_OBJECTS) $(problemGRAPH_DEPENDENCIES) $(EXTRA_problemGRAPH_DEPENDENCIES) +problemGRAPH$(EXEEXT): $(problemGRAPH_OBJECTS) $(problemGRAPH_DEPENDENCIES) $(EXTRA_problemGRAPH_DEPENDENCIES) @rm -f problemGRAPH$(EXEEXT) $(problemGRAPH_LINK) $(problemGRAPH_OBJECTS) $(problemGRAPH_LDADD) $(LIBS) -simpleBLOCK$(EXEEXT): $(simpleBLOCK_OBJECTS) $(simpleBLOCK_DEPENDENCIES) $(EXTRA_simpleBLOCK_DEPENDENCIES) +simpleBLOCK$(EXEEXT): $(simpleBLOCK_OBJECTS) $(simpleBLOCK_DEPENDENCIES) $(EXTRA_simpleBLOCK_DEPENDENCIES) @rm -f simpleBLOCK$(EXEEXT) $(simpleBLOCK_LINK) $(simpleBLOCK_OBJECTS) $(simpleBLOCK_LDADD) $(LIBS) -simpleGRAPH$(EXEEXT): $(simpleGRAPH_OBJECTS) $(simpleGRAPH_DEPENDENCIES) $(EXTRA_simpleGRAPH_DEPENDENCIES) +simpleGRAPH$(EXEEXT): $(simpleGRAPH_OBJECTS) $(simpleGRAPH_DEPENDENCIES) $(EXTRA_simpleGRAPH_DEPENDENCIES) @rm -f simpleGRAPH$(EXEEXT) $(simpleGRAPH_LINK) $(simpleGRAPH_OBJECTS) $(simpleGRAPH_LDADD) $(LIBS) -simplePHG$(EXEEXT): $(simplePHG_OBJECTS) $(simplePHG_DEPENDENCIES) $(EXTRA_simplePHG_DEPENDENCIES) +simplePHG$(EXEEXT): $(simplePHG_OBJECTS) $(simplePHG_DEPENDENCIES) $(EXTRA_simplePHG_DEPENDENCIES) @rm -f simplePHG$(EXEEXT) $(simplePHG_LINK) $(simplePHG_OBJECTS) $(simplePHG_LDADD) $(LIBS) -simpleRCB$(EXEEXT): $(simpleRCB_OBJECTS) $(simpleRCB_DEPENDENCIES) $(EXTRA_simpleRCB_DEPENDENCIES) +simpleRCB$(EXEEXT): $(simpleRCB_OBJECTS) $(simpleRCB_DEPENDENCIES) $(EXTRA_simpleRCB_DEPENDENCIES) @rm -f simpleRCB$(EXEEXT) $(simpleRCB_LINK) $(simpleRCB_OBJECTS) $(simpleRCB_LDADD) $(LIBS) diff --git a/packages/zoltan/example/C/coloring/makefile.old b/packages/zoltan/example/C/coloring/makefile.old index 934db66e06..0f9bf8ec84 100644 --- a/packages/zoltan/example/C/coloring/makefile.old +++ b/packages/zoltan/example/C/coloring/makefile.old @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER CC = mpicc CFLAGS = -Wall -Wstrict-prototypes -O3 -m64 # CFLAGS = -Wall -Wstrict-prototypes -g -m64 -DZOLTANV31 diff --git a/packages/zoltan/example/C/coloring/zcol.c b/packages/zoltan/example/C/coloring/zcol.c index 3213fc7c42..d7ba0fb86e 100644 --- a/packages/zoltan/example/C/coloring/zcol.c +++ b/packages/zoltan/example/C/coloring/zcol.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /*************************************************************** File : zcoldrive.c Date : @@ -91,7 +54,7 @@ struct edge neig[8] = { }; typedef struct { - int stencil; /* for 5, 7 and 9-point, 4, 6 and 8 edges will be created, respectively, + int stencil; /* for 5, 7 and 9-point, 4, 6 and 8 edges will be created, respectively, hence stencil value will be 4, 6 or 8 */ int procR, procC; /* proc mesh is R x C */ @@ -103,7 +66,7 @@ typedef struct { int numredge; int *redgeto; /* if beta>0; contains end point of my random edges; redgeto[lID(i,j)] = -1 means no random edge, - >= 0 points to end point */ + >= 0 points to end point */ } UZData; extern unsigned int Zoltan_Rand_InRange(unsigned int *, unsigned int); @@ -113,7 +76,7 @@ double u_wseconds(void) struct timeval tp; gettimeofday(&tp, NULL); - + return (double) tp.tv_sec + (double) tp.tv_usec / 1000000.0; } @@ -121,9 +84,9 @@ double u_wseconds(void) static int get_number_of_objects(void *data, int *ierr) { UZData *uz = (UZData *) data; - + *ierr = ZOLTAN_OK; - + return (uz->_er-uz->_sr) * (uz->_ec-uz->_sc); } @@ -134,7 +97,7 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, UZData *uz = (UZData *) data; int i, j, next=0; - /* By setting parameters, I previously gave the Zoltan library + /* By setting parameters, I previously gave the Zoltan library * the length of my global IDs, local IDs, and object weights. */ @@ -153,8 +116,8 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, fprintf(stderr, "umit something is wrong lID(%d, %d) is %d but next is %d\n", i, j, lID(i, j), next); exit(1); } - -#if 0 + +#if 0 if (wgt_dim>0) obj_wgts[next] = uz->stencil; /* weight */ #endif @@ -167,7 +130,7 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, /* let's keep this in the code for now; may be we'll use it later */ #if 0 -/* +/* ************************************************************** * Prototype: ZOLTAN_NUM_GEOM_FN * Return the dimension of a vertex, for geometric methods @@ -179,7 +142,7 @@ static int get_num_geometry(void *data, int *ierr) return 2; } -/* +/* ************************************************************** * Prototype: ZOLTAN_GEOM_MULTI_FN * Return the coordinates of my objects (vertices), for @@ -193,7 +156,7 @@ static void get_geometry_list(void *data, int sizeGID, int sizeLID, { UZData *uz = (UZData *) data; int i, j, next=0; - + if ( (sizeGID != 1) || (sizeLID != 1) || (num_dim != 2)){ *ierr = ZOLTAN_FATAL; return; @@ -221,7 +184,7 @@ static int filledges(int lid, int *adjID, int *adjProc, UZData *uz) for (e=0; estencil; ++e) { r2 = r+neig[e].r; c2 = c+neig[e].c; - + if (r2>=0 && r2meshR && c2>=0 && c2meshC) { *nextID++ = gID(r2, c2); @@ -229,14 +192,14 @@ static int filledges(int lid, int *adjID, int *adjProc, UZData *uz) *nextProc++ = pID(r2/(uz->meshR/uz->procR), c2/(uz->meshC/uz->procC)); /* printf(" %d (%d, %d) [%d] ", *(nextID-1), r2, c2, *(nextProc-1)); */ } - + } if (uz->redgeto && (uz->redgeto[lid]>=0)) { for (ptr=adjID; ptrredgeto[lid]; ++ptr); if (ptr>=nextID) { r2 = getR(uz->redgeto[lid]); c2 = getC(uz->redgeto[lid]); - + *nextID++ = uz->redgeto[lid]; if (adjProc) *nextProc++ = pID(r2/(uz->meshR/uz->procR), c2/(uz->meshC/uz->procC)); @@ -258,7 +221,7 @@ static int filledges(int lid, int *adjID, int *adjProc, UZData *uz) /* printf("\n"); */ return nextID-adjID; } - + static void get_num_edges_list(void *data, int sizeGID, int sizeLID, int num_obj, @@ -267,29 +230,29 @@ static void get_num_edges_list(void *data, int sizeGID, int sizeLID, { UZData *uz = (UZData *) data; int i, lid; - + if ( (sizeGID != 1) || (sizeLID != 1)){ *ierr = ZOLTAN_FATAL; return; } - + for (i=0; i < num_obj ; ++i){ lid = lIDfGID(globalID[i]); numEdges[i] = filledges(lid, adjTemp, NULL, uz); } - + *ierr = ZOLTAN_OK; } static void get_edge_list(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, - int *num_edges, + int *num_edges, ZOLTAN_ID_PTR nborGID, int *nborProc, int wgt_dim, float *ewgts, int *ierr) { UZData *uz = (UZData *) data; int i; - ZOLTAN_ID_PTR nextID; + ZOLTAN_ID_PTR nextID; int *nextProc; if ( (sizeGID != 1) || (sizeLID != 1) || @@ -297,7 +260,7 @@ static void get_edge_list(void *data, int sizeGID, int sizeLID, *ierr = ZOLTAN_FATAL; return; } - + nextID = nborGID; nextProc = nborProc; @@ -357,10 +320,10 @@ void saveColor(char *exename, UZData *uz, int *gid_list, int *color, int ngids) if (!uz->myRank) printf("Saving the colors in file '%s'\n", fname); fp = fopen(fname, "w"); - for (i=0; i= 100\n"); + fprintf(stderr, "\tSUPERSTEP_SIZE : suggested >= 100\n"); fprintf(stderr, "\tCOMM_PATTERN : S or A\n"); fprintf(stderr, "\tCOLOR_ORDER : I, B, U\n"); fprintf(stderr, "\tCOLORING_METHOD : F (for now)\n"); @@ -436,7 +399,7 @@ int main(int argc, char *argv[]) uz->procC = atoi(argv[5]); if (uz->procR <= 0 || uz->procC <= 0) computeProcMesh(uz); - + if (uz->procR*uz->procC!=uz->numProcs) { fprintf(stderr, "#Procs=%d but requested %dx%d Proc Mesh Partitioning...\n", uz->numProcs, uz->procR, uz->procC); goto End; @@ -446,7 +409,7 @@ int main(int argc, char *argv[]) uz->beta = atof(argv[6]); else uz->beta = 0.0; - + /* compute which part of mesh I will compute */ uz->myR = uz->myRank / uz->procC; uz->myC = uz->myRank % uz->procC; @@ -470,7 +433,7 @@ int main(int argc, char *argv[]) if (uz->myRank==0) printf("Running %s on %d x %d processor mesh, generating %d-point %d x %d mesh with beta=%.3lf\n", argv[0], uz->procR, uz->procC, uz->stencil+1, uz->meshR, uz->meshC, uz->beta); - times[1] = u_wseconds(); + times[1] = u_wseconds(); uz->numredge = 0; uz->redgeto = NULL; if (uz->beta>0) { /* create random edges for WS graph */ @@ -478,14 +441,14 @@ int main(int argc, char *argv[]) int ierr=0; int *edges=NULL, *redges=NULL, *proclist=NULL, nedge; ZOLTAN_COMM_OBJ *plan; - + uz->redgeto = (int *) malloc(nlvtx*sizeof(int)); for (i=0; iredgeto[i] = Zoltan_Rand_InRange(NULL, ngvtx))==gIDfLID(i)) /* is it a self edge */ uz->redgeto[i] = -1; - else + else ++uz->numredge; } else uz->redgeto[i] = -1; @@ -504,16 +467,16 @@ int main(int argc, char *argv[]) ierr = Zoltan_Comm_Create(&plan, uz->numredge, proclist, MPI_COMM_WORLD, msg_tag, &nedge); - + redges = (int *) malloc(sizeof(int)*2*nedge); - + --msg_tag; ierr |= Zoltan_Comm_Do(plan, msg_tag, (char *) edges, 2*sizeof(int), (char *) redges); ierr |= Zoltan_Comm_Destroy(&plan); free(proclist); free(edges); - + if (ierr) { printf("error while communicating edges!\n"); exit(1); @@ -524,7 +487,7 @@ int main(int argc, char *argv[]) if (redges[2*i] < gID(uz->_sr, uz->_sc) || redges[2*i] >= gID(uz->_er, uz->_ec)) { printf("[%d/%d] received gid=%d doesn't blong to processor range [%d, %d) should go to proc %d\n", uz->myRank, uz->numProcs, redges[2*i], gID(uz->_sr, uz->_sc), gID(uz->_er, uz->_ec), pIDfGID(redges[2*i])); } - + ++xadj[lIDfGID(redges[2*i])]; } xadj[nlvtx] = nedge; @@ -533,25 +496,25 @@ int main(int argc, char *argv[]) maxdeg = xadj[i]>maxdeg ? xadj[i] : maxdeg; xadj[i] += xadj[i-1]; } - + for (i=0; istencil+1; adjTemp = (int *) malloc(sizeof(int)*2*maxdeg); times[2] = u_wseconds(); - + /* printf("My rank %d/%d at proc-mesh loc (%d, %d) generating [%d, %d) x [%d, %d) + %d random edges TotEdge=%d\n", uz->myRank, uz->numProcs, uz->myR, uz->myC, uz->_sr, uz->_er, uz->_sc, uz->_ec, uz->numredge, xadj[nlvtx]); */ printStats("Number of Vertices ", nlvtx, uz->myRank, uz->numProcs); if (xadj) printStats("Number of Rand Edges", xadj[nlvtx], uz->myRank, uz->numProcs); - + /* General parameters */ #ifndef ZOLTANV31 Zoltan_Set_Param(zz, "GRAPH_BUILD_TYPE", "FAST_NO_DUP"); @@ -559,7 +522,7 @@ int main(int argc, char *argv[]) /* General parameters */ Zoltan_Set_Param(zz, "DEBUG_LEVEL", "3"); - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz, "OBJ_WEIGHT_DIM", "0"); @@ -582,7 +545,7 @@ int main(int argc, char *argv[]) } -#if 0 +#if 0 /* Graph parameters */ Zoltan_Set_Param(zz, "CHECK_GRAPH", "2"); #endif @@ -593,13 +556,13 @@ int main(int argc, char *argv[]) Zoltan_Set_Num_Edges_Multi_Fn(zz, get_num_edges_list, uz); Zoltan_Set_Edge_List_Multi_Fn(zz, get_edge_list, uz); -#if 0 +#if 0 #ifndef ZOLTANV31 Zoltan_LB_Eval_Graph(zz, 0, &graph); if (!uz->myRank) { printf("EdgeCut Min=%8.0f Max=%8.0f Sum=%8.0f\n", graph.cuts[EVAL_GLOBAL_MIN], graph.cuts[EVAL_GLOBAL_MAX], graph.cuts[EVAL_GLOBAL_SUM]); - printf("#Vertices Min=%8.0f Max=%8.0f Sum=%8.0f imbal=%.2f\n", graph.nobj[EVAL_GLOBAL_MIN], graph.nobj[EVAL_GLOBAL_MAX], graph.nobj[EVAL_GLOBAL_SUM], graph.obj_imbalance); + printf("#Vertices Min=%8.0f Max=%8.0f Sum=%8.0f imbal=%.2f\n", graph.nobj[EVAL_GLOBAL_MIN], graph.nobj[EVAL_GLOBAL_MAX], graph.nobj[EVAL_GLOBAL_SUM], graph.obj_imbalance); } #endif #endif @@ -615,12 +578,12 @@ int main(int argc, char *argv[]) for (j=uz->_sc; j_ec; ++j) { gid_list[next++] = i*uz->meshC + j; } - } + } #endif - color = (int *) malloc(sizeof(int) * ngids); + color = (int *) malloc(sizeof(int) * ngids); MPI_Barrier(MPI_COMM_WORLD); - times[3] = u_wseconds(); + times[3] = u_wseconds(); #ifdef ZOLTANV31 rc = Zoltan_Color(zz, /* input (all remaining fields are output) */ &numGidEntries, /* Number of integers used for a global ID */ @@ -628,8 +591,8 @@ int main(int argc, char *argv[]) ngids, /* #objects to color in this proc */ gid_list, /* global ids of colored vertices */ NULL, /* we ignore local ids */ - color); /* result color */ -#else + color); /* result color */ +#else rc = Zoltan_Color(zz, /* input (all remaining fields are output) */ 1, /* Number of integers used for a global ID */ ngids, /* #objects to color in this proc */ @@ -641,7 +604,7 @@ int main(int argc, char *argv[]) MPI_Reduce(times, gtimes, 5, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); - if (rc != ZOLTAN_OK) + if (rc != ZOLTAN_OK) fprintf(stderr, "Zoltan_Color failed with return code %d...\n", rc); for (maxcol=i=0; imyRank==0) { struct rusage usage; - + printf("%s setup Proc-0: %8.2lf Max: %8.2lf\n", argv[0], times[1]-times[0], gtimes[1]-gtimes[0]); printf("%s gen rand edges Proc-0: %8.2lf Max: %8.2lf\n", argv[0], times[2]-times[1], gtimes[2]-gtimes[1]); printf("%s set gids Proc-0: %8.2lf Max: %8.2lf\n", argv[0], times[3]-times[2], gtimes[3]-gtimes[2]); printf("%s Zoltan_Color call Proc-0: %8.2lf Max: %8.2lf\n", argv[0], times[4]-times[3], gtimes[4]-gtimes[3]); printf("%s Coloring Time : %.2lf # Colors used : %d\n", argv[0], gtimes[4]-gtimes[0], ncolors); getrusage(RUSAGE_SELF, &usage); - printf("%s maxrss=%ld minflt=%ld majflt=%ld nswap=%ld\n", argv[0], usage.ru_maxrss, usage.ru_minflt, usage.ru_majflt, usage.ru_nswap); + printf("%s maxrss=%ld minflt=%ld majflt=%ld nswap=%ld\n", argv[0], usage.ru_maxrss, usage.ru_minflt, usage.ru_majflt, usage.ru_nswap); } - + #ifdef _DEBUG saveColor(argv[0], uz, (int *) gid_list, color, ngids); #endif @@ -681,7 +644,7 @@ int main(int argc, char *argv[]) if (uz->redgeto) free(uz->redgeto); -End: +End: Zoltan_Destroy(&zz); MPI_Finalize(); diff --git a/packages/zoltan/example/C/coloring/zcoldriver.c b/packages/zoltan/example/C/coloring/zcoldriver.c index 78796619bb..99f95c0f25 100644 --- a/packages/zoltan/example/C/coloring/zcoldriver.c +++ b/packages/zoltan/example/C/coloring/zcoldriver.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /*************************************************************** File : zcoldrive.c Date : @@ -84,7 +47,7 @@ struct edge neig[8] = { }; typedef struct { - int stencil; /* for 5, 7 and 9-point, 4, 6 and 8 edges will be created, respectively, + int stencil; /* for 5, 7 and 9-point, 4, 6 and 8 edges will be created, respectively, hence stencil value will be 4, 6 or 8 */ int procR, procC; /* proc mesh is R x C */ @@ -96,7 +59,7 @@ typedef struct { int numredge; int *redgeto; /* if beta>0; contains end point of my random edges; redgeto[lID(i,j)] = -1 means no random edge, - >= 0 points to end point */ + >= 0 points to end point */ } UZData; extern unsigned int Zoltan_Rand_InRange(unsigned int *, unsigned int); @@ -106,7 +69,7 @@ double u_wseconds(void) struct timeval tp; gettimeofday(&tp, NULL); - + return (double) tp.tv_sec + (double) tp.tv_usec / 1000000.0; } @@ -114,9 +77,9 @@ double u_wseconds(void) static int get_number_of_objects(void *data, int *ierr) { UZData *uz = (UZData *) data; - + *ierr = ZOLTAN_OK; - + return (uz->_er-uz->_sr) * (uz->_ec-uz->_sc); } @@ -127,7 +90,7 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, UZData *uz = (UZData *) data; int i, j, next=0; - /* By setting parameters, I previously gave the Zoltan library + /* By setting parameters, I previously gave the Zoltan library * the length of my global IDs, local IDs, and object weights. */ @@ -146,8 +109,8 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, fprintf(stderr, "umit something is wrong lID(%d, %d) is %d but next is %d\n", i, j, lID(i, j), next); exit(1); } - -#if 0 + +#if 0 if (wgt_dim>0) obj_wgts[next] = uz->stencil; /* weight */ #endif @@ -160,7 +123,7 @@ static void get_object_list(void *data, int sizeGID, int sizeLID, /* let's keep this in the code for now; may be we'll use it later */ #if 0 -/* +/* ************************************************************** * Prototype: ZOLTAN_NUM_GEOM_FN * Return the dimension of a vertex, for geometric methods @@ -172,7 +135,7 @@ static int get_num_geometry(void *data, int *ierr) return 2; } -/* +/* ************************************************************** * Prototype: ZOLTAN_GEOM_MULTI_FN * Return the coordinates of my objects (vertices), for @@ -186,7 +149,7 @@ static void get_geometry_list(void *data, int sizeGID, int sizeLID, { UZData *uz = (UZData *) data; int i, j, next=0; - + if ( (sizeGID != 1) || (sizeLID != 1) || (num_dim != 2)){ *ierr = ZOLTAN_FATAL; return; @@ -202,7 +165,7 @@ static void get_geometry_list(void *data, int sizeGID, int sizeLID, } #endif -/* +/* ************************************************************** * Prototype: ZOLTAN_NUM_EDGES_MULTI_FN * Return the number of edges for each vertex in the ID lists. @@ -216,12 +179,12 @@ static void get_num_edges_list(void *data, int sizeGID, int sizeLID, { UZData *uz = (UZData *) data; int i, id, r, c, r2, c2, edgecnt, e; - + if ( (sizeGID != 1) || (sizeLID != 1)){ *ierr = ZOLTAN_FATAL; return; } - + for (i=0; i < num_obj ; ++i){ id = globalID[i]; r = getR(id); @@ -236,7 +199,7 @@ static void get_num_edges_list(void *data, int sizeGID, int sizeLID, for (e=0; estencil; ++e) { r2 = r+neig[e].r; c2 = c+neig[e].c; - + if (r2>=0 && r2meshR && c2>=0 && c2meshC) ++edgecnt; @@ -245,30 +208,30 @@ static void get_num_edges_list(void *data, int sizeGID, int sizeLID, } else /* internal vertices always have all the edges */ numEdges[i] = uz->stencil; if (uz->redgeto && (uz->redgeto[i]>=0)) - ++numEdges[i]; + ++numEdges[i]; } - + *ierr = ZOLTAN_OK; } -/* +/* ************************************************************** * Prototype: ZOLTAN_EDGE_LIST_MULTI_FN * For every vertex in the ID list, return a list of all its * adjacent vertices, and the processes on which they reside. * Also include the edge weights if any. - * For graph methods. + * For graph methods. ************************************************************** */ static void get_edge_list(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, - int *num_edges, + int *num_edges, ZOLTAN_ID_PTR nborGID, int *nborProc, int wgt_dim, float *ewgts, int *ierr) { UZData *uz = (UZData *) data; int i, id, r, c, r2, c2, e; - ZOLTAN_ID_PTR nextID; + ZOLTAN_ID_PTR nextID; int *nextProc; if ( (sizeGID != 1) || (sizeLID != 1) || @@ -276,7 +239,7 @@ static void get_edge_list(void *data, int sizeGID, int sizeLID, *ierr = ZOLTAN_FATAL; return; } - + nextID = nborGID; nextProc = nborProc; @@ -290,26 +253,26 @@ static void get_edge_list(void *data, int sizeGID, int sizeLID, for (e=0; estencil; ++e) { r2 = r+neig[e].r; c2 = c+neig[e].c; - + if (r2>=0 && r2meshR && c2>=0 && c2meshC) { *nextID++ = gID(r2, c2); *nextProc++ = pID(r2/(uz->meshR/uz->procR), c2/(uz->meshC/uz->procC)); /* printf(" %d (%d, %d) [%d] ", *(nextID-1), r2, c2, *(nextProc-1)); */ } - + } if (uz->redgeto && (uz->redgeto[i]>=0)) { r2 = getR(uz->redgeto[i]); c2 = getC(uz->redgeto[i]); - + *nextID++ = gID(r2, c2); *nextProc++ = pID(r2/(uz->meshR/uz->procR), c2/(uz->meshC/uz->procC)); /* printf(" %d (%d, %d) [%d] ", *(nextID-1), r2, c2, *(nextProc-1)); */ } /* printf("\n"); */ - - *ierr = ZOLTAN_OK; + + *ierr = ZOLTAN_OK; } } @@ -336,10 +299,10 @@ void saveColor(char *exename, UZData *uz, int *gid_list, int *color, int ngids) if (!uz->myRank) printf("Saving the colors in file '%s'\n", fname); fp = fopen(fname, "w"); - for (i=0; i=] ...\n\n", argv[0]); fprintf(stderr, "ws-beta: is the probablity of adding an edge to a vertex to generate Watts-Strogatz graphs\n"); fprintf(stderr, "Valid values for Stencil are 5, 7 and 9\n"); fprintf(stderr, "Zoltan Coloring Parameters and values are\n"); fprintf(stderr, "\tDISTANCE : 1 or 2\n"); - fprintf(stderr, "\tSUPERSTEP_SIZE : suggested >= 100\n"); + fprintf(stderr, "\tSUPERSTEP_SIZE : suggested >= 100\n"); fprintf(stderr, "\tCOMM_PATTERN : S or A\n"); fprintf(stderr, "\tCOLOR_ORDER : I, B, U\n"); fprintf(stderr, "\tCOLORING_METHOD : F (for now)\n"); @@ -416,7 +379,7 @@ int main(int argc, char *argv[]) uz.procC = atoi(argv[5]); if (uz.procR <= 0 || uz.procC <= 0) computeProcMesh(&uz); - + if (uz.procR*uz.procC!=uz.numProcs) { fprintf(stderr, "#Procs=%d but requested %dx%d Proc Mesh Partitioning...\n", uz.numProcs, uz.procR, uz.procC); goto End; @@ -426,7 +389,7 @@ int main(int argc, char *argv[]) uz.beta = atof(argv[6]); else uz.beta = 0.0; - + /* compute which part of mesh I will compute */ uz.myR = uz.myRank / uz.procC; uz.myC = uz.myRank % uz.procC; @@ -450,7 +413,7 @@ int main(int argc, char *argv[]) uz.redgeto = NULL; if (uz.beta>0) { /* create random edges for WS graph */ int nlvtx= (uz._er-uz._sr) * (uz._ec-uz._sc), ngvtx=uz.meshC*uz.meshR, trsh=(int) (uz.beta*100.0); - + uz.redgeto = (int *) malloc(nlvtx*sizeof(int)); for (i=0; i 0){ MPI_Recv(graph->nborGID,send_count[1], ZOLTAN_ID_MPI_TYPE, 0, id_tag + 2, MPI_COMM_WORLD, &status); - MPI_Recv(graph->nborPart,send_count[1], MPI_INT, 0, + MPI_Recv(graph->nborPart,send_count[1], MPI_INT, 0, id_tag + 3, MPI_COMM_WORLD, &status); } } diff --git a/packages/zoltan/example/C/problemGRAPH.c b/packages/zoltan/example/C/problemGRAPH.c index 25f4610549..ec644167d5 100644 --- a/packages/zoltan/example/C/problemGRAPH.c +++ b/packages/zoltan/example/C/problemGRAPH.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /************************************************************** * Basic example of using Zoltan to partition a graph. ***************************************************************/ @@ -123,7 +86,7 @@ int main(int argc, char *argv[]) } /****************************************************************** - ** Read graph from input file and distribute it + ** Read graph from input file and distribute it ******************************************************************/ fp = fopen(global_fname, "r"); @@ -150,13 +113,13 @@ int main(int argc, char *argv[]) /* Zoltan_Set_Param(zz, "DEBUG_LEVEL", "0"); Zoltan_Set_Param(zz, "LB_METHOD", "GRAPH"); - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz, "OBJ_WEIGHT_DIM", "0"); Zoltan_Set_Param(zz, "RETURN_LISTS", "ALL"); */ - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz,"LB_METHOD","GRAPH"); #ifdef HAVE_PARMETIS @@ -173,7 +136,7 @@ int main(int argc, char *argv[]) /* Graph parameters */ - Zoltan_Set_Param(zz, "CHECK_GRAPH", "2"); + Zoltan_Set_Param(zz, "CHECK_GRAPH", "2"); Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", ".35"); /* 0-remove all, 1-remove none */ /* Query functions - defined in simpleQueries.h */ @@ -191,7 +154,7 @@ int main(int argc, char *argv[]) ******************************************************************/ rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of vertices to be sent to me */ @@ -245,9 +208,9 @@ int main(int argc, char *argv[]) ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -335,7 +298,7 @@ float *nextWgt; GRAPH_DATA *graph = (GRAPH_DATA *)data; *ierr = ZOLTAN_OK; - if ( (sizeGID != 1) || (sizeLID != 1) || + if ( (sizeGID != 1) || (sizeLID != 1) || (num_obj != graph->numMyVertices)) { *ierr = ZOLTAN_FATAL; return; @@ -344,7 +307,7 @@ float *nextWgt; nextNbor = nborGID; nextProc = nborProc; nextWgt = ewgts; - + for (i=0; i < num_obj; i++){ @@ -368,7 +331,7 @@ float *nextWgt; } /* Function to find next line of information in input file */ - + static int get_next_line(FILE *fp, char *buf, int bufsize) { int i, cval, len; @@ -384,7 +347,7 @@ char *c; len = strlen(c); for (i=0, c=buf; i < len; i++, c++){ - cval = (int)*c; + cval = (int)*c; if (isspace(cval) == 0) break; } if (i == len) continue; /* blank line */ @@ -411,16 +374,16 @@ int count=0; if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; - + vals[count++] = atoi(c); - + while (isdigit(*c)){ if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; } @@ -607,7 +570,7 @@ GRAPH_DATA *send_graph; for (i=0; i nborGID[i]; graph->nborProc[i] = simple_hash(&id, numProcs); - } + } /* Create a sub graph for each process */ @@ -662,10 +625,10 @@ GRAPH_DATA *send_graph; if (nnbors > 0){ memcpy(send_graph[procID].nborGID + j, graph->nborGID + graph->nborIndex[i], nnbors * sizeof(ZOLTAN_ID_TYPE)); - + memcpy(send_graph[procID].nborProc + j, graph->nborProc + graph->nborIndex[i], nnbors * sizeof(int)); - + idx[procID] = j + nnbors; } } @@ -791,3 +754,5 @@ unsigned int simple_hash(unsigned int *key, unsigned int n) /* Return h mod n */ return (h%n); } + + diff --git a/packages/zoltan/example/C/simpleBLOCK.c b/packages/zoltan/example/C/simpleBLOCK.c index a94edf8de9..c59a0027e1 100644 --- a/packages/zoltan/example/C/simpleBLOCK.c +++ b/packages/zoltan/example/C/simpleBLOCK.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Basic example of using Zoltan to compute a quick partitioning ** of a set of objects. ***************************************************************/ @@ -70,7 +33,7 @@ static int get_number_of_objects(void *data, int *ierr); static void get_object_list(void *data, int sizeGID, int sizeLID, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int wgt_dim, float *obj_wgts, int *ierr); - + static int get_next_line(FILE *fp, char *buf, int bufsize); static void input_file_error(int numProcs, int tag, int startProc); @@ -87,7 +50,7 @@ int main(int argc, char *argv[]) struct Zoltan_Struct *zz; int changes, numGidEntries, numLidEntries, numImport, numExport; ZOLTAN_ID_PTR importGlobalGids, importLocalGids; - ZOLTAN_ID_PTR exportGlobalGids, exportLocalGids; + ZOLTAN_ID_PTR exportGlobalGids, exportLocalGids; int *importProcs, *importToPart, *exportProcs, *exportToPart; int *parts = NULL; @@ -148,7 +111,7 @@ int main(int argc, char *argv[]) ******************************************************************/ rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of objects to be sent to me */ @@ -202,9 +165,9 @@ int main(int argc, char *argv[]) ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -245,7 +208,7 @@ int i; } /* Function to find next line of information in input file */ - + static int get_next_line(FILE *fp, char *buf, int bufsize) { int i, cval, len; @@ -261,7 +224,7 @@ char *c; len = strlen(c); for (i=0, c=buf; i < len; i++, c++){ - cval = (int)*c; + cval = (int)*c; if (isspace(cval) == 0) break; } if (i == len) continue; /* blank line */ @@ -372,13 +335,13 @@ int obj_ack_tag = 5, obj_count_tag = 10, obj_id_tag = 15; if (num == 0) input_file_error(numProcs, obj_count_tag, 1); num = sscanf(buf, ZOLTAN_ID_SPEC , myData->myGlobalIDs + i); if (num != 1) input_file_error(numProcs, obj_count_tag, 1); - + } gids = (ZOLTAN_ID_TYPE *)malloc(sizeof(ZOLTAN_ID_TYPE) * (nobj + 1)); for (i=1; i < numProcs; i++){ - + if (remainingObj > 1){ nobj = remainingObj / 2; remainingObj -= nobj; @@ -408,7 +371,7 @@ int obj_ack_tag = 5, obj_count_tag = 10, obj_id_tag = 15; if (nobj > 0) MPI_Send(gids, nobj, ZOLTAN_ID_MPI_TYPE, i, obj_id_tag, MPI_COMM_WORLD); - + } free(gids); @@ -428,7 +391,7 @@ int obj_ack_tag = 5, obj_count_tag = 10, obj_id_tag = 15; if (myData->numMyObjects > 0){ myData->myGlobalIDs = (ZOLTAN_ID_TYPE *)malloc(sizeof(ZOLTAN_ID_TYPE) * myData->numMyObjects); MPI_Send(&ack, 1, MPI_INT, 0, obj_ack_tag, MPI_COMM_WORLD); - MPI_Recv(myData->myGlobalIDs, myData->numMyObjects, ZOLTAN_ID_MPI_TYPE, 0, + MPI_Recv(myData->myGlobalIDs, myData->numMyObjects, ZOLTAN_ID_MPI_TYPE, 0, obj_id_tag, MPI_COMM_WORLD, &status); } else if (myData->numMyObjects == 0){ diff --git a/packages/zoltan/example/C/simpleGRAPH.c b/packages/zoltan/example/C/simpleGRAPH.c index d393133582..7c8c4b3700 100644 --- a/packages/zoltan/example/C/simpleGRAPH.c +++ b/packages/zoltan/example/C/simpleGRAPH.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /************************************************************** * Basic example of using Zoltan to partition a graph. ***************************************************************/ @@ -57,7 +20,7 @@ static char *global_fname="graph.txt"; -/* Structure to hold graph data +/* Structure to hold graph data ZOLTAN_ID_TYPE is defined when Zoltan is compiled. It's size can be obtained at runtime by a library call. (See zoltan_types.h). */ @@ -127,7 +90,7 @@ int main(int argc, char *argv[]) } /****************************************************************** - ** Read graph from input file and distribute it + ** Read graph from input file and distribute it ******************************************************************/ fp = fopen(global_fname, "r"); @@ -154,13 +117,13 @@ int main(int argc, char *argv[]) Zoltan_Set_Param(zz, "DEBUG_LEVEL", "0"); Zoltan_Set_Param(zz, "LB_METHOD", "GRAPH"); Zoltan_Set_Param(zz, "LB_APPROACH", "PARTITION"); - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz, "RETURN_LISTS", "ALL"); /* Graph parameters */ - Zoltan_Set_Param(zz, "CHECK_GRAPH", "2"); + Zoltan_Set_Param(zz, "CHECK_GRAPH", "2"); Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", ".35"); /* 0-remove all, 1-remove none */ /* Query functions - defined in simpleQueries.h */ @@ -178,7 +141,7 @@ int main(int argc, char *argv[]) ******************************************************************/ rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of vertices to be sent to me */ @@ -232,9 +195,9 @@ int main(int argc, char *argv[]) ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -321,7 +284,7 @@ ZOLTAN_ID_TYPE *nextNbor; GRAPH_DATA *graph = (GRAPH_DATA *)data; *ierr = ZOLTAN_OK; - if ( (sizeGID != 1) || (sizeLID != 1) || + if ( (sizeGID != 1) || (sizeLID != 1) || (num_obj != graph->numMyVertices)|| (wgt_dim != 0)){ *ierr = ZOLTAN_FATAL; @@ -355,7 +318,7 @@ ZOLTAN_ID_TYPE *nextNbor; } /* Function to find next line of information in input file */ - + static int get_next_line(FILE *fp, char *buf, int bufsize) { int i, cval, len; @@ -371,7 +334,7 @@ char *c; len = strlen(c); for (i=0, c=buf; i < len; i++, c++){ - cval = (int)*c; + cval = (int)*c; if (isspace(cval) == 0) break; } if (i == len) continue; /* blank line */ @@ -400,16 +363,16 @@ int count=0; if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; - + vals[count++] = atoi(c); - + while (isdigit(*c)){ if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; } @@ -595,7 +558,7 @@ GRAPH_DATA *send_graph; for (i=0; i nborGID[i]; graph->nborProc[i] = simple_hash(&id, numProcs); - } + } /* Create a sub graph for each process */ @@ -650,10 +613,10 @@ GRAPH_DATA *send_graph; if (nnbors > 0){ memcpy(send_graph[procID].nborGID + j, graph->nborGID + graph->nborIndex[i], nnbors * sizeof(ZOLTAN_ID_TYPE)); - + memcpy(send_graph[procID].nborProc + j, graph->nborProc + graph->nborIndex[i], nnbors * sizeof(int)); - + idx[procID] = j + nnbors; } } @@ -779,3 +742,4 @@ unsigned int simple_hash(unsigned int *key, unsigned int n) /* Return h mod n */ return (h%n); } + diff --git a/packages/zoltan/example/C/simpleHIER.c b/packages/zoltan/example/C/simpleHIER.c index bc568778b1..2b24013634 100644 --- a/packages/zoltan/example/C/simpleHIER.c +++ b/packages/zoltan/example/C/simpleHIER.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /************************************************************** * Basic example of using Zoltan to partition a graph. ***************************************************************/ @@ -131,7 +94,7 @@ int main(int argc, char *argv[]) } /****************************************************************** - ** Read graph from input file and distribute it + ** Read graph from input file and distribute it ******************************************************************/ fp = fopen(global_fname, "r"); @@ -161,7 +124,7 @@ int main(int argc, char *argv[]) Zoltan_Set_Param(zz, "HIER_ASSIST", "1"); Zoltan_Set_Param(zz, "TOPOLOGY", "2,2"); Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", ".8"); - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz, "RETURN_LISTS", "ALL"); @@ -180,11 +143,11 @@ int main(int argc, char *argv[]) ******************************************************************/ MPI_Barrier(MPI_COMM_WORLD); -if (myRank==0) fprintf(stderr,"GO Zoltan_LB_Partition\n"); +if (myRank==0) fprintf(stderr,"GO Zoltan_LB_Partition\n"); MPI_Barrier(MPI_COMM_WORLD); rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of vertices to be sent to me */ @@ -206,7 +169,7 @@ MPI_Barrier(MPI_COMM_WORLD); } MPI_Barrier(MPI_COMM_WORLD); -if (myRank==0) fprintf(stderr,"DONE Zoltan_LB_Partition\n"); +if (myRank==0) fprintf(stderr,"DONE Zoltan_LB_Partition\n"); MPI_Barrier(MPI_COMM_WORLD); /****************************************************************** ** Visualize the graph partitioning before and after calling Zoltan. @@ -239,9 +202,9 @@ MPI_Barrier(MPI_COMM_WORLD); ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -329,7 +292,7 @@ int *nextProc; GRAPH_DATA *graph = (GRAPH_DATA *)data; *ierr = ZOLTAN_OK; - if ( (sizeGID != 1) || (sizeLID != 1) || + if ( (sizeGID != 1) || (sizeLID != 1) || (num_obj != graph->numMyVertices)|| (wgt_dim != 0)){ *ierr = ZOLTAN_FATAL; @@ -363,7 +326,7 @@ int *nextProc; } /* Function to find next line of information in input file */ - + static int get_next_line(FILE *fp, char *buf, int bufsize) { int i, cval, len; @@ -379,7 +342,7 @@ char *c; len = strlen(c); for (i=0, c=buf; i < len; i++, c++){ - cval = (int)*c; + cval = (int)*c; if (isspace(cval) == 0) break; } if (i == len) continue; /* blank line */ @@ -406,16 +369,16 @@ int count=0; if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; - + vals[count++] = atoi(c); - + while (isdigit(*c)){ if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; } @@ -601,7 +564,7 @@ GRAPH_DATA *send_graph; for (i=0; i nborGID[i]; graph->nborProc[i] = simple_hash(&id, numProcs); - } + } /* Create a sub graph for each process */ @@ -656,10 +619,10 @@ GRAPH_DATA *send_graph; if (nnbors > 0){ memcpy(send_graph[procID].nborGID + j, graph->nborGID + graph->nborIndex[i], nnbors * sizeof(int)); - + memcpy(send_graph[procID].nborProc + j, graph->nborProc + graph->nborIndex[i], nnbors * sizeof(int)); - + idx[procID] = j + nnbors; } } @@ -785,3 +748,4 @@ unsigned int simple_hash(unsigned int *key, unsigned int n) /* Return h mod n */ return (h%n); } + diff --git a/packages/zoltan/example/C/simplePHG.c b/packages/zoltan/example/C/simplePHG.c index 5cef4584b9..a5bf28d258 100644 --- a/packages/zoltan/example/C/simplePHG.c +++ b/packages/zoltan/example/C/simplePHG.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /************************************************************** * Basic example of using Zoltan to partition a hypergraph. * @@ -50,7 +13,7 @@ * the rows, and the vertices are the columns. If (i,j) is * non-zero, this indicates that vertex j is in hyperedge i. * -* In some Zoltan documentation, the non-zeroes in hypergraph +* In some Zoltan documentation, the non-zeroes in hypergraph * matrices are called "pins". * ***************************************************************/ @@ -105,7 +68,7 @@ static void input_file_error(int numProcs, int tag, int startProc); static void showHypergraph(int myProc, int numProc, int numIDs, ZOLTAN_ID_TYPE *GIDs, int *parts); static void read_input_file(int myRank, int numProcs, char *fname, HGRAPH_DATA *data); -static HGRAPH_DATA global_hg; +static HGRAPH_DATA global_hg; int main(int argc, char *argv[]) { @@ -137,7 +100,7 @@ int main(int argc, char *argv[]) } /****************************************************************** - ** Read hypergraph from input file and distribute it + ** Read hypergraph from input file and distribute it ******************************************************************/ fp = fopen(global_fname, "r"); @@ -172,7 +135,7 @@ int main(int argc, char *argv[]) /* PHG parameters - see the Zoltan User's Guide for many more * (The "REPARTITION" approach asks Zoltan to create a partitioning that is - * better but is not too far from the current partitioning, rather than partitioning + * better but is not too far from the current partitioning, rather than partitioning * from scratch. It may be faster but of lower quality that LB_APPROACH=PARTITION.) */ @@ -193,7 +156,7 @@ int main(int argc, char *argv[]) ******************************************************************/ rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of vertices to be sent to me */ @@ -245,9 +208,9 @@ int main(int argc, char *argv[]) ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -348,7 +311,7 @@ int i; /* Function to find next line of information in input file */ - + static int get_next_line(FILE *fp, char *buf, int bufsize) { int i, cval, len; @@ -364,7 +327,7 @@ char *c; len = strlen(c); for (i=0, c=buf; i < len; i++, c++){ - cval = (int)*c; + cval = (int)*c; if (isspace(cval) == 0) break; } if (i == len) continue; /* blank line */ @@ -391,16 +354,16 @@ int count=0; if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; - + vals[count++] = atoi(c); - + while (isdigit(*c)){ if ((c - buf) >= bufsize) break; c++; } - + if ( (c-buf) >= bufsize) break; } @@ -697,7 +660,7 @@ HGRAPH_DATA *send_hg; send_hg = (HGRAPH_DATA *)calloc(sizeof(HGRAPH_DATA) , numProcs); - /* + /* * Divide the vertices across the processes */ @@ -741,13 +704,13 @@ HGRAPH_DATA *send_hg; send_hg[i].numAllNbors = 0; if (count > 0){ - + to = from + count; - + nnbors = global_hg.nborIndex[to] - global_hg.nborIndex[from]; send_hg[i].numAllNbors = nnbors; - + send_hg[i].edgeGID = (ZOLTAN_ID_TYPE *)malloc(sizeof(ZOLTAN_ID_TYPE) * count); memcpy(send_hg[i].edgeGID, global_hg.edgeGID + from, sizeof(ZOLTAN_ID_TYPE) * count); @@ -761,10 +724,10 @@ HGRAPH_DATA *send_hg; for (j=1; j <= count; j++){ send_hg[i].nborIndex[j] = global_hg.nborIndex[from+j] - num; } - + send_hg[i].nborGID = (ZOLTAN_ID_TYPE *)malloc(sizeof(ZOLTAN_ID_TYPE) * nnbors); - memcpy(send_hg[i].nborGID, - global_hg.nborGID + global_hg.nborIndex[from], + memcpy(send_hg[i].nborGID, + global_hg.nborGID + global_hg.nborIndex[from], sizeof(ZOLTAN_ID_TYPE) * nnbors); } } diff --git a/packages/zoltan/example/C/simpleRCB.c b/packages/zoltan/example/C/simpleRCB.c index c2a9ff81e4..01c3511001 100644 --- a/packages/zoltan/example/C/simpleRCB.c +++ b/packages/zoltan/example/C/simpleRCB.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /*************************************************************** ** Basic example of using Zoltan to compute an RCB partitioning ** of a very simple mesh or graph. @@ -93,7 +56,7 @@ int main(int argc, char *argv[]) float ver; struct Zoltan_Struct *zz; int changes, numGidEntries, numLidEntries, numImport, numExport; - ZOLTAN_ID_PTR importGlobalGids, importLocalGids, exportGlobalGids, exportLocalGids; + ZOLTAN_ID_PTR importGlobalGids, importLocalGids, exportGlobalGids, exportLocalGids; int *importProcs, *importToPart, *exportProcs, *exportToPart; int *parts; FILE *fp; @@ -142,7 +105,7 @@ int main(int argc, char *argv[]) Zoltan_Set_Param(zz, "DEBUG_LEVEL", "1"); Zoltan_Set_Param(zz, "LB_METHOD", "RCB"); - Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); + Zoltan_Set_Param(zz, "NUM_GID_ENTRIES", "1"); Zoltan_Set_Param(zz, "NUM_LID_ENTRIES", "1"); Zoltan_Set_Param(zz, "OBJ_WEIGHT_DIM", "0"); Zoltan_Set_Param(zz, "RETURN_LISTS", "ALL"); @@ -150,7 +113,7 @@ int main(int argc, char *argv[]) /* RCB parameters */ Zoltan_Set_Param(zz, "RCB_OUTPUT_LEVEL", "0"); - Zoltan_Set_Param(zz, "RCB_RECTILINEAR_BLOCKS", "1"); + Zoltan_Set_Param(zz, "RCB_RECTILINEAR_BLOCKS", "1"); /*Zoltan_Set_Param(zz, "RCB_RECTILINEAR_BLOCKS", "0"); */ /* Query functions, to provide geometry to Zoltan */ @@ -167,7 +130,7 @@ int main(int argc, char *argv[]) ** partition 0, process rank 1 will own partition 1, and so on. ******************************************************************/ rc = Zoltan_LB_Partition(zz, /* input (all remaining fields are output) */ - &changes, /* 1 if partitioning was changed, 0 otherwise */ + &changes, /* 1 if partitioning was changed, 0 otherwise */ &numGidEntries, /* Number of integers used for a global ID */ &numLidEntries, /* Number of integers used for a local ID */ &numImport, /* Number of vertices to be sent to me */ @@ -221,9 +184,9 @@ int main(int argc, char *argv[]) ** the storage allocated for the Zoltan structure. ******************************************************************/ - Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, + Zoltan_LB_Free_Part(&importGlobalGids, &importLocalGids, &importProcs, &importToPart); - Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, + Zoltan_LB_Free_Part(&exportGlobalGids, &exportLocalGids, &exportProcs, &exportToPart); Zoltan_Destroy(&zz); @@ -518,3 +481,4 @@ int i, j, part; printf("\n"); } } + diff --git a/packages/zoltan/example/CPP/CMakeLists.txt b/packages/zoltan/example/CPP/CMakeLists.txt new file mode 100644 index 0000000000..8fe39de0fa --- /dev/null +++ b/packages/zoltan/example/CPP/CMakeLists.txt @@ -0,0 +1,12 @@ + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + exampleBLOCK + SOURCES exampleBLOCK.cpp + ARGS + COMM serial mpi + NUM_MPI_PROCS 1-4 + ) + +TRIBITS_COPY_FILES_TO_BINARY_DIR(CPPExamplesCopyFile + SOURCE_FILES objects.txt + ) diff --git a/packages/zoltan/example/CPP/Makefile.am b/packages/zoltan/example/CPP/Makefile.am new file mode 100644 index 0000000000..cd2d14132d --- /dev/null +++ b/packages/zoltan/example/CPP/Makefile.am @@ -0,0 +1,17 @@ + +# The following line helps the test harness recover from build errors. + +all-local: + +include $(top_builddir)/Makefile.export.zoltan + +EXEEXT = .exe + +noinst_PROGRAMS = exampleBLOCK + +exampleBLOCK_SOURCES = exampleBLOCK.cpp +exampleBLOCK_DEPENDENCIES = $(ZOLTAN_DEPS) +exampleBLOCK_CXXFLAGS = $(ZOLTAN_INCLUDES) +exampleBLOCK_LDADD = $(ZOLTAN_LIBS) + +EXTRA_DIST = classicMakefile objects.txt diff --git a/packages/zoltan/example/CPP/Makefile.in b/packages/zoltan/example/CPP/Makefile.in new file mode 100644 index 0000000000..8fa33bfd12 --- /dev/null +++ b/packages/zoltan/example/CPP/Makefile.in @@ -0,0 +1,500 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# The following line helps the test harness recover from build errors. + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = exampleBLOCK$(EXEEXT) +subdir = example/CPP +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ax_f90_module_case.m4 \ + $(top_srcdir)/config/ax_f90_module_flag.m4 \ + $(top_srcdir)/config/tac_arg_check_mpi.m4 \ + $(top_srcdir)/config/tac_arg_enable_export-makefiles.m4 \ + $(top_srcdir)/config/tac_arg_enable_feature.m4 \ + $(top_srcdir)/config/tac_arg_enable_feature_sub.m4 \ + $(top_srcdir)/config/tac_arg_enable_feature_sub_check.m4 \ + $(top_srcdir)/config/tac_arg_enable_option.m4 \ + $(top_srcdir)/config/tac_arg_with_3pl_sub.m4 \ + $(top_srcdir)/config/tac_arg_with_ar.m4 \ + $(top_srcdir)/config/tac_arg_with_flags.m4 \ + $(top_srcdir)/config/tac_arg_with_incdirs.m4 \ + $(top_srcdir)/config/tac_arg_with_libdirs.m4 \ + $(top_srcdir)/config/tac_arg_with_libs.m4 \ + $(top_srcdir)/config/tac_arg_with_package.m4 \ + $(top_srcdir)/config/tac_arg_with_perl.m4 \ + $(top_srcdir)/config/wk_fc_get_vendor.m4 \ + $(top_srcdir)/config/zac_arg_config_mpi.m4 \ + $(top_srcdir)/config/zac_arg_with_id.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/include/Zoltan_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_exampleBLOCK_OBJECTS = exampleBLOCK-exampleBLOCK.$(OBJEXT) +exampleBLOCK_OBJECTS = $(am_exampleBLOCK_OBJECTS) +exampleBLOCK_LINK = $(CXXLD) $(exampleBLOCK_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(exampleBLOCK_SOURCES) +DIST_SOURCES = $(exampleBLOCK_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALTERNATE_AR = @ALTERNATE_AR@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = .exe +FC = @FC@ +FCFLAGS = @FCFLAGS@ +FCFLAGS_f = @FCFLAGS_f@ +FCFLAGS_f90 = @FCFLAGS_f90@ +FCLIBS = @FCLIBS@ +FC_MAJOR_VERSION = @FC_MAJOR_VERSION@ +FC_MODNAME = @FC_MODNAME@ +FC_MODNAME_Q = @FC_MODNAME_Q@ +FC_VENDOR = @FC_VENDOR@ +FC_VERSION = @FC_VERSION@ +FC_VERSION_STRING = @FC_VERSION_STRING@ +HAVE_PERL = @HAVE_PERL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MPI_CC = @MPI_CC@ +MPI_CXX = @MPI_CXX@ +MPI_FC = @MPI_FC@ +MPI_RECV_LIMIT_FLAG = @MPI_RECV_LIMIT_FLAG@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL_EXE = @PERL_EXE@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_FC = @ac_ct_FC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +exampleBLOCK_SOURCES = exampleBLOCK.cpp +exampleBLOCK_DEPENDENCIES = $(ZOLTAN_DEPS) +exampleBLOCK_CXXFLAGS = $(ZOLTAN_INCLUDES) +exampleBLOCK_LDADD = $(ZOLTAN_LIBS) +EXTRA_DIST = classicMakefile objects.txt +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu example/CPP/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu example/CPP/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +exampleBLOCK$(EXEEXT): $(exampleBLOCK_OBJECTS) $(exampleBLOCK_DEPENDENCIES) $(EXTRA_exampleBLOCK_DEPENDENCIES) + @rm -f exampleBLOCK$(EXEEXT) + $(exampleBLOCK_LINK) $(exampleBLOCK_OBJECTS) $(exampleBLOCK_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exampleBLOCK-exampleBLOCK.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +exampleBLOCK-exampleBLOCK.o: exampleBLOCK.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(exampleBLOCK_CXXFLAGS) $(CXXFLAGS) -MT exampleBLOCK-exampleBLOCK.o -MD -MP -MF $(DEPDIR)/exampleBLOCK-exampleBLOCK.Tpo -c -o exampleBLOCK-exampleBLOCK.o `test -f 'exampleBLOCK.cpp' || echo '$(srcdir)/'`exampleBLOCK.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/exampleBLOCK-exampleBLOCK.Tpo $(DEPDIR)/exampleBLOCK-exampleBLOCK.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='exampleBLOCK.cpp' object='exampleBLOCK-exampleBLOCK.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(exampleBLOCK_CXXFLAGS) $(CXXFLAGS) -c -o exampleBLOCK-exampleBLOCK.o `test -f 'exampleBLOCK.cpp' || echo '$(srcdir)/'`exampleBLOCK.cpp + +exampleBLOCK-exampleBLOCK.obj: exampleBLOCK.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(exampleBLOCK_CXXFLAGS) $(CXXFLAGS) -MT exampleBLOCK-exampleBLOCK.obj -MD -MP -MF $(DEPDIR)/exampleBLOCK-exampleBLOCK.Tpo -c -o exampleBLOCK-exampleBLOCK.obj `if test -f 'exampleBLOCK.cpp'; then $(CYGPATH_W) 'exampleBLOCK.cpp'; else $(CYGPATH_W) '$(srcdir)/exampleBLOCK.cpp'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/exampleBLOCK-exampleBLOCK.Tpo $(DEPDIR)/exampleBLOCK-exampleBLOCK.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='exampleBLOCK.cpp' object='exampleBLOCK-exampleBLOCK.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(exampleBLOCK_CXXFLAGS) $(CXXFLAGS) -c -o exampleBLOCK-exampleBLOCK.obj `if test -f 'exampleBLOCK.cpp'; then $(CYGPATH_W) 'exampleBLOCK.cpp'; else $(CYGPATH_W) '$(srcdir)/exampleBLOCK.cpp'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) all-local +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ + clean-generic clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +all-local: + +include $(top_builddir)/Makefile.export.zoltan + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/packages/zoltan/example/CPP/classicMakefile b/packages/zoltan/example/CPP/classicMakefile new file mode 100644 index 0000000000..d48b4ef924 --- /dev/null +++ b/packages/zoltan/example/CPP/classicMakefile @@ -0,0 +1,77 @@ +## +## a basic makefile to build examples +## + +## +## The default type for a Zoltan global ID is "int". This can be changed +## with compile-time flags like: +## +## -DZOLTAN_ID_TYPE_LONG_LONG +## +## See src/include/zoltan_types.h for the valid id type macros. If Zoltan was compiled +## with one of these flags, then these examples need to be compiled with the same flag. +## +ID_TYPE_FLAG=-DZOLTAN_ID_TYPE_LONG_LONG +## + + +## Location of zoltan library, also location of Zoltan_config.h if +## using the autoconf build + +BLD=../../build_both/src + +## +## Location of zoltan "src" directory (for header files) +## + +SRC=../../src + +# Location of zoltan header files + +ZOLTAN_INCLUDE=-I$(SRC)/include + +## +## For an autoconf build, the location of Zoltan_config.h +## +ZOLTAN_CONFIG_INCLUDE=-I$(BLD)/include + +## +## Headers for zoltan utilities, not often used by applications +## Needed for use of Zoltan_Hash in simpleGRAPH.c +## + +ZOLTAN_UTIL_INCLUDE=-I$(SRC)/zz \ + -I$(SRC)/par \ + -I$(SRC)/order \ + -I$(SRC)/tpls \ + -I$(SRC)/lb \ + -I$(SRC)/params \ + -I$(SRC)/Utilities/shared + +## +## If Zoltan was built with a third party library, provide the information required +## to link with that library. +## + +SCOTCH=/home/lriesen/system/scotch_5.1.10a-32 +PARMETIS=/home/lafisk/system/parmetis/ParMetis-3.1 + +TPL_LIB_DIR=-L$(PARMETIS) -L$(SCOTCH)/lib +TPL_INCLUDE=-I$(PARMETIS) -I$(SCOTCH)/include +TPL_LIBS=-lparmetis -lmetis -lptscotch -lscotch -lptscotcherr -lscotcherr + +CXX=mpicxx + +CXXFLAGS =$(ID_TYPE_FLAG) + +EXAMPLE_NAMES = exampleBLOCK graphHier.cpp + +all: $(EXAMPLE_NAMES) + +%: %.cpp + $(CXX) $(CXXFLAGS) $(TPL_LIB_DIR) \ + -I$(BLD)/include $(TPL_INCLUDE) $(ZOLTAN_INCLUDE) $(ZOLTAN_UTIL_INCLUDE) \ + -o $@ $< $(BLD)/libzoltan.a $(TPL_LIBS) -lm + +clean: + @rm -rf $(EXAMPLE_NAMES) diff --git a/packages/zoltan/example/CPP/exampleBLOCK.cpp b/packages/zoltan/example/CPP/exampleBLOCK.cpp new file mode 100644 index 0000000000..4a2095648b --- /dev/null +++ b/packages/zoltan/example/CPP/exampleBLOCK.cpp @@ -0,0 +1,505 @@ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER +// +// Basic C++ example of using Zoltan to compute a quick partitioning +// of a set of objects. +// + +#ifdef MPICPP +#undef MPICPP +#endif /* MPICPP */ + +//#define MPICPP // Uncomment to use C++ interface for MPI. + +#include +#include +#include + +// Class representing collection of objects to be partitioned. + +class objectCollection { + +private: + + int numGlobalObjects; + int numMyObjects; + int *myGlobalIDs; + +public: + + // constructor + + objectCollection():numGlobalObjects(0), numMyObjects(0), myGlobalIDs(NULL){} + + // destructor + + ~objectCollection(){ if (myGlobalIDs) delete [] myGlobalIDs;} + + void set_num_global_objects(int n) {numGlobalObjects = n;} + int get_num_global_objects() {return numGlobalObjects;} + + void set_num_my_objects(int n) {numMyObjects = n;} + int get_num_my_objects() {return numMyObjects;} + + void set_my_global_ids(int *p) {myGlobalIDs = p;} + int *get_my_global_ids() {return myGlobalIDs;} + + // query functions that respond to requests from Zoltan + + static int get_number_of_objects(void *data, int *ierr){ + + objectCollection *objs = (objectCollection *)data; + *ierr = ZOLTAN_OK; + + return objs->numMyObjects; + } + + static void get_object_list(void *data, int sizeGID, int sizeLID, + ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, + int wgt_dim, float *obj_wgts, int *ierr){ + + objectCollection *objs = (objectCollection *)data; + *ierr = ZOLTAN_OK; + + // In this example, return the IDs of our objects, but no weights. + // Zoltan will assume equally weighted objects. + + for (int i=0; iget_num_my_objects(); i++){ + globalID[i] = objs->get_my_global_ids()[i]; + localID[i] = i; + } + return; + } + +}; + +static const char *global_fname="objects.txt"; // File containing objects to be partitioned. + +static int get_next_line(FILE *fp, char *buf, int bufsize); +static void input_file_error(int numProcs, int tag, int startProc); +static void showSimpleMeshPartitions(int myProc, int numIDs, int *GIDs, int *parts); +static void read_input_objects(int myRank, int numProcs, const char *fname, objectCollection &myData); + +static void MPIExit() +{ +#ifdef MPICPP + MPI::Finalize(); +#else + MPI_Finalize(); +#endif +} + +int main(int argc, char *argv[]) +{ + ///////////////////////////////// + // Initialize MPI and Zoltan + ///////////////////////////////// + + int rank, size; + float version; + +#ifdef MPICPP + MPI::Init(argc, argv); + rank = MPI::COMM_WORLD.Get_rank(); + size = MPI::COMM_WORLD.Get_size(); +#else + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &size); +#endif + + Zoltan_Initialize(argc, argv, &version); + + ///////////////////////////////// + // Create a Zoltan object + ///////////////////////////////// + +#ifdef MPICPP + Zoltan *zz = new Zoltan(MPI::COMM_WORLD); +#else + Zoltan *zz = new Zoltan(MPI_COMM_WORLD); +#endif + + if (zz == NULL){ + MPIExit(); + exit(0); + } + + ////////////////////////////////////////////////////////////////// + // Read objects from input file and distribute them unevenly + ////////////////////////////////////////////////////////////////// + + FILE *fp = fopen(global_fname, "r"); + if (!fp){ + if (rank == 0) fprintf(stderr,"ERROR: Can not open %s\n",global_fname); + MPIExit(); + exit(1); + } + fclose(fp); + + objectCollection objects; + + read_input_objects(rank, size, global_fname, objects); + + /////////////////////////////////////////////////////////////////// + // Set the Zoltan parameters, and the names of the query functions + /////////////////////////////////////////////////////////////////// + + // General parameters + + zz->Set_Param( "LB_METHOD", "BLOCK"); /* Zoltan method: "BLOCK" */ + zz->Set_Param( "NUM_GID_ENTRIES", "1"); /* global ID is 1 integer */ + zz->Set_Param( "NUM_LID_ENTRIES", "1"); /* local ID is 1 integer */ + zz->Set_Param( "OBJ_WEIGHT_DIM", "0"); /* we omit object weights */ + + // Query functions + + zz->Set_Num_Obj_Fn(objectCollection::get_number_of_objects, &objects); + zz->Set_Obj_List_Fn(objectCollection::get_object_list, &objects); + + //////////////////////////////////////////////////////////////// + // Zoltan can now partition the objects in this collection. + // In this simple example, we assume the number of partitions is + // equal to the number of processes. Process rank 0 will own + // partition 0, process rank 1 will own partition 1, and so on. + //////////////////////////////////////////////////////////////// + + int changes; + int numGidEntries; + int numLidEntries; + int numImport; + ZOLTAN_ID_PTR importGlobalIds; + ZOLTAN_ID_PTR importLocalIds; + int *importProcs; + int *importToPart; + int numExport; + ZOLTAN_ID_PTR exportGlobalIds; + ZOLTAN_ID_PTR exportLocalIds; + int *exportProcs; + int *exportToPart; + + int rc = zz->LB_Partition(changes, numGidEntries, numLidEntries, + numImport, importGlobalIds, importLocalIds, importProcs, importToPart, + numExport, exportGlobalIds, exportLocalIds, exportProcs, exportToPart); + + if (rc != ZOLTAN_OK){ + printf("Partitioning failed on process %d\n",rank); + MPIExit(); + delete zz; + exit(0); + } + + ///////////////////////////////////////////////////////////////// + // Visualize the partitioning before and after calling Zoltan. + // + // In this example, partition number equals process rank. + ///////////////////////////////////////////////////////////////// + + int *parts = new int [objects.get_num_my_objects()]; + + for (int i=0; i < objects.get_num_my_objects(); i++){ + parts[i] = rank; + } + + if (rank == 0){ + printf("\nObject partition assignments before calling Zoltan\n"); + } + + showSimpleMeshPartitions(rank, objects.get_num_my_objects(), + objects.get_my_global_ids(), parts); + + for (int i=0; i < numExport; i++){ + parts[exportLocalIds[i]] = exportToPart[i]; + } + + if (rank == 0){ + printf("Object partition assignments after calling Zoltan\n"); + } + + showSimpleMeshPartitions(rank, objects.get_num_my_objects(), + objects.get_my_global_ids(), parts); + + delete [] parts; + + //////////////////////////////////////////////////////////////// + // Free the arrays allocated by LB_Partition, and free + // the storage allocated for the Zoltan structure and the mesh. + //////////////////////////////////////////////////////////////// + + Zoltan::LB_Free_Part(&importGlobalIds, &importLocalIds, &importProcs, + &importToPart); + Zoltan::LB_Free_Part(&exportGlobalIds, &exportLocalIds, &exportProcs, + &exportToPart); + + delete zz; + + //////////////////////////////////////////////////////////////// + // all done //////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// + + MPIExit(); + + return 0; +} + +/* Function to find next line of information in input file */ + +static int get_next_line(FILE *fp, char *buf, int bufsize) +{ +int i, cval, len; +char *c; + + while (1){ + + c = fgets(buf, bufsize, fp); + + if (c == NULL) + return 0; /* end of file */ + + len = strlen(c); + + for (i=0, c=buf; i < len; i++, c++){ + cval = (int)*c; + if (isspace(cval) == 0) break; + } + if (i == len) continue; /* blank line */ + if (*c == '#') continue; /* comment */ + + if (c != buf){ + strcpy(buf, c); + } + break; + } + + return strlen(buf); /* number of characters */ +} + +// Proc 0 notifies others of error and exits + +static void input_file_error(int numProcs, int tag, int startProc) +{ +int i, val; + + val = -1; + + fprintf(stderr,"ERROR in input file.\n"); + + for (i=startProc; i < numProcs; i++){ + // these procs have posted receive for "tag" +#ifdef MPICPP + MPI::COMM_WORLD.Send(&val, 1, MPI::INT, i, tag); +#else + MPI_Send(&val, 1, MPI_INT, i, tag, MPI_COMM_WORLD); +#endif + + } + for (i=1; i < startProc; i++){ + // these procs are done +#ifdef MPICPP + MPI::COMM_WORLD.Send(&val, 1, MPI::INT, i, 0); +#else + MPI_Send(&val, 1, MPI_INT, i, 0, MPI_COMM_WORLD); +#endif + } + + MPIExit(); + exit(0); +} + +/* Draw the partition assignments of the objects */ + +void showSimpleMeshPartitions(int myProc, int numIDs, int *GIDs, int *parts) +{ +int partAssign[25], allPartAssign[25]; +int i, j, part; + + memset(partAssign, 0, sizeof(int) * 25); + + for (i=0; i < numIDs; i++){ + partAssign[GIDs[i]-1] = parts[i]; + } + +#ifdef MPICPP + MPI::COMM_WORLD.Reduce(partAssign, allPartAssign, 25, MPI::INT, MPI::MAX, 0); +#else + MPI_Reduce(partAssign, allPartAssign, 25, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); +#endif + + if (myProc == 0){ + + for (i=20; i >= 0; i-=5){ + for (j=0; j < 5; j++){ + part = allPartAssign[i + j]; + if (j < 4) + printf("%d-----",part); + else + printf("%d\n",part); + } + if (i > 0) + printf("| | | | |\n"); + } + printf("\n"); + } +} + +// +// Proc 0 reads the objects in the input file and divides them across processes +// + +void read_input_objects(int myRank, int numProcs, const char *fname, objectCollection &myData) +{ +int val, nobj, remainingObj; +int obj_ack_tag = 5, obj_count_tag = 10, obj_id_tag = 15; +#ifdef MPICPP +MPI::Status status; +#else +MPI_Status status; +#endif + + if (myRank == 0){ + + char *buf = new char [512]; + FILE *fp = fopen(fname, "r"); + + int num = get_next_line(fp, buf, 512); + if (num == 0) input_file_error(numProcs, obj_count_tag, 1); + num = sscanf(buf, "%d", &val); + myData.set_num_global_objects(val); + if (num != 1) input_file_error(numProcs, obj_count_tag, 1); + + if (numProcs > 1){ + nobj = myData.get_num_global_objects() / 2; + remainingObj = myData.get_num_global_objects() - nobj; + } + else{ + nobj = myData.get_num_global_objects(); + remainingObj = 0; + } + + int *mygids = new int [nobj]; + myData.set_num_my_objects(nobj); + myData.set_my_global_ids(mygids); + + for (int i=0; i < nobj; i++){ + + num = get_next_line(fp, buf, 512); + if (num == 0) input_file_error(numProcs, obj_count_tag, 1); + num = sscanf(buf, "%d", &val); + if (num != 1) input_file_error(numProcs, obj_count_tag, 1); + mygids[i] = val; + + } + + int *gids = new int [nobj + 1]; + int ack = 0; + + for (int i=1; i < numProcs; i++){ + + if (remainingObj > 1){ + nobj = remainingObj / 2; + remainingObj -= nobj; + } + else if (remainingObj == 1){ + nobj = 1; + remainingObj = 0; + } + else{ + nobj = 0; + } + + if ((i == numProcs - 1) && (remainingObj > 0)) + nobj += remainingObj; + + if (nobj > 0){ + for (int j=0; j < nobj; j++){ + num = get_next_line(fp, buf, 512); + if (num == 0) input_file_error(numProcs, obj_count_tag, i); + num = sscanf(buf, "%d", &val); + if (num != 1) input_file_error(numProcs, obj_count_tag, i); + gids[j] = val;; + } + } + +#ifdef MPICPP + MPI::COMM_WORLD.Send(&nobj, 1, MPI::INT, i, obj_count_tag); + MPI::COMM_WORLD.Recv(&ack, 1, MPI::INT, i, obj_ack_tag, status); +#else + MPI_Send(&nobj, 1, MPI_INT, i, obj_count_tag, MPI_COMM_WORLD); + MPI_Recv(&ack, 1, MPI_INT, i, obj_ack_tag, MPI_COMM_WORLD, &status); +#endif + + if (nobj > 0) + MPI_Send(gids, nobj, MPI_INT, i, obj_id_tag, MPI_COMM_WORLD); + + } + + delete [] gids; + delete [] buf; + + fclose(fp); + + /* signal all procs it is OK to go on */ + ack = 0; + for (int i=1; i < numProcs; i++){ +#ifdef MPICPP + MPI::COMM_WORLD.Send(&ack, 1, MPI::INT, i, 0); +#else + MPI_Send(&ack, 1, MPI_INT, i, 0, MPI_COMM_WORLD); +#endif + } + } + else{ + +#ifdef MPICPP + MPI::COMM_WORLD.Recv(&val, 1, MPI::INT, 0, obj_count_tag, status); +#else + MPI_Recv(&val, 1, MPI_INT, 0, obj_count_tag, MPI_COMM_WORLD, &status); +#endif + + myData.set_num_my_objects(val); + + int ack = 0; + + if (myData.get_num_my_objects() > 0){ + int *mygids = new int [myData.get_num_my_objects()]; +#ifdef MPICPP + MPI::COMM_WORLD.Send(&ack, 1, MPI::INT, 0, obj_ack_tag); + MPI::COMM_WORLD.Recv(mygids, myData.get_num_my_objects(), MPI::INT, 0, + obj_id_tag, status); +#else + MPI_Send(&ack, 1, MPI_INT, 0, obj_ack_tag, MPI_COMM_WORLD); + MPI_Recv(mygids, myData.get_num_my_objects(), MPI_INT, 0, + obj_id_tag, MPI_COMM_WORLD, &status); +#endif + + myData.set_my_global_ids(mygids); + } + else if (myData.get_num_my_objects() == 0){ +#ifdef MPICPP + MPI::COMM_WORLD.Send(&ack, 1, MPI::INT, 0, obj_ack_tag); +#else + MPI_Send(&ack, 1, MPI_INT, 0, obj_ack_tag, MPI_COMM_WORLD); +#endif + } + else{ + MPIExit(); + exit(1); + } + +#ifdef MPICPP + MPI::COMM_WORLD.Recv(&ack, 1, MPI::INT, 0, 0, status); +#else + MPI_Recv(&ack, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); +#endif + if (ack < 0){ + MPIExit(); + exit(1); + } + } +} diff --git a/packages/zoltan/example/CPP/objects.txt b/packages/zoltan/example/CPP/objects.txt new file mode 100644 index 0000000000..20e59dec56 --- /dev/null +++ b/packages/zoltan/example/CPP/objects.txt @@ -0,0 +1,48 @@ +## +## This simple structure is used by many of the nightly Zoltan tests. +## It can be interpreted as a mesh, a graph, a hypergraph, or simply +## as 25 objects to be partitioned. +## +## 21----22----23----24---25 +## | | | | | +## 16----17----18----19---20 +## | | | | | +## 11----12----13----14---15 +## | | | | | +## 6-----7-----8-----9----10 +## | | | | | +## 1-----2-----3-----4----5 +## +## Regarded as a collection of objects, we have objects 1 through 25. +## + +## Number of objects: +25 + +## Global ID for each object + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 diff --git a/packages/zoltan/example/Fortran/CMakeLists.txt b/packages/zoltan/example/Fortran/CMakeLists.txt index 0f8640172a..4b5438a592 100644 --- a/packages/zoltan/example/Fortran/CMakeLists.txt +++ b/packages/zoltan/example/Fortran/CMakeLists.txt @@ -3,11 +3,11 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( simpleRCB_f90 SOURCES simpleRCB.f90 zoltanRCBmod.f90 mpi_h.f - ARGS + ARGS COMM mpi NUM_MPI_PROCS 1-4 ) TRIBITS_COPY_FILES_TO_BINARY_DIR(FortranExamplesCopyFiles - SOURCE_FILES mesh.txt + SOURCE_FILES mesh.txt ) diff --git a/packages/zoltan/example/Fortran/mpi_h.f b/packages/zoltan/example/Fortran/mpi_h.f index a28c261993..71556826ca 100644 --- a/packages/zoltan/example/Fortran/mpi_h.f +++ b/packages/zoltan/example/Fortran/mpi_h.f @@ -1,57 +1,22 @@ -!! +!! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------------- -! Purpose: Provide the MPI include file as a module. +! Purpose: Provide the MPI include file as a module. !-------------------------------------------------------------------------- -! Author(s): William F. Mitchell +! Author(s): William F. Mitchell !-------------------------------------------------------------------------- !-------------------------------------------------------------------------- -! Revision History: -! 2 September 1999: Date of creation. +! Revision History: +! 2 September 1999: Date of creation. !-------------------------------------------------------------------------- module mpi_h diff --git a/packages/zoltan/example/Fortran/simpleRCB.f90 b/packages/zoltan/example/Fortran/simpleRCB.f90 index e53e8da0d0..775028eb13 100644 --- a/packages/zoltan/example/Fortran/simpleRCB.f90 +++ b/packages/zoltan/example/Fortran/simpleRCB.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! // !! File: driver.cc // diff --git a/packages/zoltan/example/Fortran/zoltanRCBmod.f90 b/packages/zoltan/example/Fortran/zoltanRCBmod.f90 index fda0efd352..581f6ae0ed 100644 --- a/packages/zoltan/example/Fortran/zoltanRCBmod.f90 +++ b/packages/zoltan/example/Fortran/zoltanRCBmod.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! // !! File: driver.cc // diff --git a/packages/zoltan/example/Makefile.am b/packages/zoltan/example/Makefile.am index 49f69bbf70..c129b1b0be 100644 --- a/packages/zoltan/example/Makefile.am +++ b/packages/zoltan/example/Makefile.am @@ -1,47 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER - # The following line helps the test harness recover from build errors. all-local: diff --git a/packages/zoltan/example/Makefile.in b/packages/zoltan/example/Makefile.in index 65388bacb1..269fafa34b 100644 --- a/packages/zoltan/example/Makefile.in +++ b/packages/zoltan/example/Makefile.in @@ -15,50 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER - # The following line helps the test harness recover from build errors. VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ diff --git a/packages/zoltan/example/README b/packages/zoltan/example/README index 14690cd8cf..9a68198b80 100644 --- a/packages/zoltan/example/README +++ b/packages/zoltan/example/README @@ -1,47 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER -$Id$ Some simple C examples may be found in the "C" directory, and C++ examples in the "CPP" directory. Edit the classicMakefile found diff --git a/packages/zoltan/siMPI/Makefile.in b/packages/zoltan/siMPI/Makefile.in index 3bf94c0b81..638a1a3676 100644 --- a/packages/zoltan/siMPI/Makefile.in +++ b/packages/zoltan/siMPI/Makefile.in @@ -230,7 +230,7 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = pyMPI +SUBDIRS = pyMPI all: all-recursive .SUFFIXES: diff --git a/packages/zoltan/siMPI/pyMPI/Makefile.in b/packages/zoltan/siMPI/pyMPI/Makefile.in index e808468baf..cb1abf39a3 100644 --- a/packages/zoltan/siMPI/pyMPI/Makefile.in +++ b/packages/zoltan/siMPI/pyMPI/Makefile.in @@ -230,7 +230,7 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = siMPI +SUBDIRS = siMPI all: all-recursive .SUFFIXES: diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/CMakeLists.txt b/packages/zoltan/siMPI/pyMPI/siMPI/CMakeLists.txt index 99535f66fd..37d8f0caa4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/CMakeLists.txt +++ b/packages/zoltan/siMPI/pyMPI/siMPI/CMakeLists.txt @@ -466,7 +466,6 @@ SET(SOURCES ${SOURCES} TRIBITS_ADD_LIBRARY( simpi - HEADERS_INSTALL_SUBDIR simpi HEADERS ${HEADERS} SOURCES ${SOURCES} ) diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Test.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Test.c index 632df1c2ad..e64f9ee9bd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Test.c @@ -18,5 +18,6 @@ int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status) { _MPI_COVERAGE(); - return PMPIO_Test(request, flag, status); + return PMPIO_Test(request, flag, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Wait.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Wait.c index 7cb870a8f1..5b3ff64458 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Wait.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPIO_Wait.c @@ -18,5 +18,6 @@ int MPIO_Wait(MPIO_Request *request, MPI_Status *status) { _MPI_COVERAGE(); - return PMPIO_Wait(request, status); + return PMPIO_Wait(request, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Address.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Address.c index 38b0674ed7..63b084e7ea 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Address.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Address.c @@ -18,5 +18,6 @@ int MPI_Address( void *location, MPI_Aint *address) { _MPI_COVERAGE(); - return PMPI_Address(location, address); + return PMPI_Address(location, address); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgather.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgather.c index 84bbb79e87..23e318c3e6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgather.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgather.c @@ -16,9 +16,10 @@ /* STUB */ int MPI_Allgather ( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); - return PMPI_Allgather (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); + return PMPI_Allgather (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgatherv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgatherv.c index ddc6e80eb3..3a2b57c62a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgatherv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allgatherv.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int MPI_Allgatherv ( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int MPI_Allgatherv ( void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); - return PMPI_Allgatherv ( sendbuf, sendcount, sendtype, - recvbuf, recvcounts, displs, + return PMPI_Allgatherv ( sendbuf, sendcount, sendtype, + recvbuf, recvcounts, displs, recvtype, comm ); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allreduce.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allreduce.c index 8cdd7cef8c..e82739c799 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allreduce.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Allreduce.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_Allreduce ( void *sendbuf, void *recvbuf, int count, +int MPI_Allreduce ( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoall.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoall.c index 7116cbb556..27168800ac 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoall.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int MPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcnt, MPI_Datatype recvtype, +int MPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Alltoall (sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoallv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoallv.c index de181b1e38..211339d8a4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoallv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Alltoallv.c @@ -15,17 +15,18 @@ #include "mpi.h" /* STUB */ -int MPI_Alltoallv ( - void *sendbuf, - int *sendcnts, - int *sdispls, - MPI_Datatype sendtype, - void *recvbuf, - int *recvcnts, - int *rdispls, - MPI_Datatype recvtype, +int MPI_Alltoallv ( + void *sendbuf, + int *sendcnts, + int *sdispls, + MPI_Datatype sendtype, + void *recvbuf, + int *recvcnts, + int *rdispls, + MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); - return PMPI_Alltoallv( sendbuf, sendcnts, sdispls, sendtype, recvbuf, recvcnts, rdispls, recvtype, comm); + return PMPI_Alltoallv( sendbuf, sendcnts, sdispls, sendtype, recvbuf, recvcnts, rdispls, recvtype, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_delete.c index e12f559b1c..f0ce3a350f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_delete.c @@ -18,5 +18,6 @@ int MPI_Attr_delete ( MPI_Comm comm, int keyval ) { _MPI_COVERAGE(); - return PMPI_Attr_delete (comm, keyval); + return PMPI_Attr_delete (comm, keyval); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_get.c index f4f682b8f0..767d383f87 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_get.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int MPI_Attr_get ( - MPI_Comm comm, - int keyval, - void *attr_value, +int MPI_Attr_get ( + MPI_Comm comm, + int keyval, + void *attr_value, int *flag ) { _MPI_COVERAGE(); - return PMPI_Attr_get(comm, keyval, attr_value, flag); + return PMPI_Attr_get(comm, keyval, attr_value, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_put.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_put.c index 024a26b768..f552ea2694 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_put.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Attr_put.c @@ -18,5 +18,6 @@ int MPI_Attr_put ( MPI_Comm comm, int keyval, void *attr_value ) { _MPI_COVERAGE(); - return PMPI_Attr_put (comm, keyval, attr_value); + return PMPI_Attr_put (comm, keyval, attr_value); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Barrier.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Barrier.c index 77b5ab0d13..8ad9ca233a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Barrier.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Barrier.c @@ -18,5 +18,6 @@ int MPI_Barrier ( MPI_Comm comm) { _MPI_COVERAGE(); - return PMPI_Barrier (comm); + return PMPI_Barrier (comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bcast.1.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bcast.1.c index a71aff52c7..ba74795d60 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bcast.1.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bcast.1.c @@ -17,9 +17,10 @@ #include "mpi.h" /*==========================================================================*/ -int MPI_Bcast ( void* buffer, int count, MPI_Datatype datatype, int root, +int MPI_Bcast ( void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Bcast(buffer, count, datatype, root, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend.c index 50bf49328f..d73f8275be 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend.c @@ -17,6 +17,7 @@ /*=============================================================================================*/ int MPI_Bsend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { _MPI_COVERAGE(); - return PMPI_Bsend(message, count, datatype, dest, tag, comm); + return PMPI_Bsend(message, count, datatype, dest, tag, comm); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend_init.c index a87db8d92c..49cca48470 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Bsend_init.c @@ -19,5 +19,6 @@ int MPI_Bsend_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { _MPI_COVERAGE(); - return PMPI_Bsend_init (buf, count, datatype, dest, tag, comm, request); + return PMPI_Bsend_init (buf, count, datatype, dest, tag, comm, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_attach.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_attach.c index 07329d1ca6..0130961497 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_attach.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_attach.c @@ -18,5 +18,6 @@ int MPI_Buffer_attach( void *buffer, int size ) { _MPI_COVERAGE(); - return PMPI_Buffer_attach (buffer, size); + return PMPI_Buffer_attach (buffer, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_detach.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_detach.c index 6d7f321cc2..fa6e29960a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_detach.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Buffer_detach.c @@ -18,5 +18,6 @@ int MPI_Buffer_detach( void *bufferptr, int *size) { _MPI_COVERAGE(); - return PMPI_Buffer_detach (bufferptr, size); + return PMPI_Buffer_detach (bufferptr, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cancel.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cancel.c index 718b23432d..430b793d8e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cancel.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cancel.c @@ -18,5 +18,6 @@ int MPI_Cancel( MPI_Request *request ) { _MPI_COVERAGE(); - return PMPI_Cancel(request); + return PMPI_Cancel(request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_coords.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_coords.c index e1190756ef..56b664c420 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_coords.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_coords.c @@ -18,5 +18,6 @@ int MPI_Cart_coords ( MPI_Comm comm, int rank, int maxdims, int *coords ) { _MPI_COVERAGE(); - return PMPI_Cart_coords (comm, rank, maxdims, coords); + return PMPI_Cart_coords (comm, rank, maxdims, coords); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_create.c index 56fc31860f..469c07e386 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_create.c @@ -19,5 +19,6 @@ int MPI_Cart_create ( MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart ) { _MPI_COVERAGE(); - return PMPI_Cart_create (comm_old, ndims, dims, periods, reorder, comm_cart); + return PMPI_Cart_create (comm_old, ndims, dims, periods, reorder, comm_cart); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_get.c index 05ab62133b..03408838d8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_get.c @@ -23,5 +23,6 @@ int MPI_Cart_get ( int *coords ) { _MPI_COVERAGE(); - return PMPI_Cart_get(comm, maxdims, dims, periods, coords); + return PMPI_Cart_get(comm, maxdims, dims, periods, coords); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_map.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_map.c index 92f38d7420..f0336d3240 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_map.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_map.c @@ -23,5 +23,6 @@ int MPI_Cart_map ( int *newrank) { _MPI_COVERAGE(); - return PMPI_Cart_map(comm_old, ndims, dims, periods, newrank); + return PMPI_Cart_map(comm_old, ndims, dims, periods, newrank); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_rank.c index 574babe2cb..4612c32c2f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_rank.c @@ -21,5 +21,6 @@ int MPI_Cart_rank ( int *rank ) { _MPI_COVERAGE(); - return PMPI_Cart_rank(comm, coords, rank); + return PMPI_Cart_rank(comm, coords, rank); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_shift.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_shift.c index ba901b2d1f..6de3680d88 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_shift.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_shift.c @@ -19,5 +19,6 @@ int MPI_Cart_shift ( MPI_Comm comm, int direction, int displ, int *source, int *dest ) { _MPI_COVERAGE(); - return PMPI_Cart_shift (comm, direction, displ, source, dest); + return PMPI_Cart_shift (comm, direction, displ, source, dest); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_sub.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_sub.c index 582300a1d7..fa33707e1d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_sub.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cart_sub.c @@ -18,5 +18,6 @@ int MPI_Cart_sub ( MPI_Comm comm, int *remain_dims, MPI_Comm *comm_new ) { _MPI_COVERAGE(); - return PMPI_Cart_sub (comm, remain_dims, comm_new); + return PMPI_Cart_sub (comm, remain_dims, comm_new); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cartdim_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cartdim_get.c index b0abeefd8c..6232b790ec 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cartdim_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Cartdim_get.c @@ -18,5 +18,6 @@ int MPI_Cartdim_get ( MPI_Comm comm, int *ndims ) { _MPI_COVERAGE(); - return PMPI_Cartdim_get (comm, ndims); + return PMPI_Cartdim_get (comm, ndims); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_compare.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_compare.c index 79e4dcad07..06b15da9ea 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_compare.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_compare.c @@ -15,11 +15,12 @@ #include "mpi.h" /* STUB */ -int MPI_Comm_compare ( +int MPI_Comm_compare ( MPI_Comm comm1, MPI_Comm comm2, int *result) { _MPI_COVERAGE(); - return PMPI_Comm_compare (comm1, comm2, result); + return PMPI_Comm_compare (comm1, comm2, result); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_create.c index f0206d7d94..6970da0823 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_create.c @@ -20,3 +20,4 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group new_group, MPI_Comm* new_comm) _MPI_COVERAGE(); return PMPI_Comm_create(comm, new_group, new_comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_dup.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_dup.c index cb7c0cc6d3..921ecef175 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_dup.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_dup.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int MPI_Comm_dup ( - MPI_Comm comm, +int MPI_Comm_dup ( + MPI_Comm comm, MPI_Comm *comm_out ) { _MPI_COVERAGE(); - return PMPI_Comm_dup (comm, comm_out); + return PMPI_Comm_dup (comm, comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_free.c index 8ad5bea2a5..f2203eca9a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_free.c @@ -20,3 +20,4 @@ int MPI_Comm_free(MPI_Comm* comm) _MPI_COVERAGE(); return PMPI_Comm_free(comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_get_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_get_name.c index 8360a4dbc7..7eb17595df 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_get_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_get_name.c @@ -18,5 +18,6 @@ int MPI_Comm_get_name( MPI_Comm comm, char *namep, int *reslen ) { _MPI_COVERAGE(); - return PMPI_Comm_get_name (comm, namep, reslen); + return PMPI_Comm_get_name (comm, namep, reslen); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_group.c index 90993b64d1..118c22adeb 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_group.c @@ -26,3 +26,4 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group* group) } /*============================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_rank.c index 01557a8722..244db07c94 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_rank.c @@ -20,3 +20,4 @@ int MPI_Comm_rank(MPI_Comm comm, int* rank) _MPI_COVERAGE(); return PMPI_Comm_rank(comm, rank); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_group.c index aca5edb852..ecc410077b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_group.c @@ -18,5 +18,6 @@ int MPI_Comm_remote_group ( MPI_Comm comm, MPI_Group *group ) { _MPI_COVERAGE(); - return PMPI_Comm_remote_group (comm, group); + return PMPI_Comm_remote_group (comm, group); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_size.c index 6fb44f8f6c..557dcd62ca 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_remote_size.c @@ -20,3 +20,4 @@ int MPI_Comm_remote_size ( MPI_Comm comm, int *size ) _MPI_COVERAGE(); return PMPI_Comm_remote_size (comm, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_set_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_set_name.c index cdb87dabdd..39e1585b0b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_set_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_set_name.c @@ -18,5 +18,6 @@ int MPI_Comm_set_name( MPI_Comm com, char *name ) { _MPI_COVERAGE(); - return PMPI_Comm_set_name (com, name); + return PMPI_Comm_set_name (com, name); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_size.c index de77bdcf1e..736c538719 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_size.c @@ -22,3 +22,4 @@ int MPI_Comm_size(MPI_Comm comm, int* size) _MPI_COVERAGE(); return PMPI_Comm_size(comm, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_split.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_split.c index 8fc097fdc6..f9a14fe5e9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_split.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_split.c @@ -18,5 +18,6 @@ int MPI_Comm_split ( MPI_Comm comm, int color, int key, MPI_Comm *comm_out ) { _MPI_COVERAGE(); - return PMPI_Comm_split (comm, color, key, comm_out); + return PMPI_Comm_split (comm, color, key, comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_test_inter.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_test_inter.c index acb2e66be6..d3ca9c7859 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_test_inter.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Comm_test_inter.c @@ -18,5 +18,6 @@ int MPI_Comm_test_inter ( MPI_Comm comm, int *flag ) { _MPI_COVERAGE(); - return PMPI_Comm_test_inter (comm, flag); + return PMPI_Comm_test_inter (comm, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Dims_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Dims_create.c index f04f8db2dc..6bd73528b2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Dims_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Dims_create.c @@ -16,10 +16,11 @@ /* STUB */ int MPI_Dims_create( - int nnodes, - int ndims, + int nnodes, + int ndims, int *dims) { _MPI_COVERAGE(); - return PMPI_Dims_create ( nnodes, ndims, dims); + return PMPI_Dims_create ( nnodes, ndims, dims); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_ARE_FATAL.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_ARE_FATAL.c index 4fccf82faf..828ac25115 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_ARE_FATAL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_ARE_FATAL.c @@ -22,3 +22,4 @@ void MPI_ERRORS_ARE_FATAL (MPI_Comm* comm, int* error_code, ...) if (comm == (MPI_Comm)0) MPI_Abort(0, *error_code); MPI_Abort(*comm, *error_code); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_RETURN.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_RETURN.c index d480605e47..42edf8f336 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_RETURN.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_ERRORS_RETURN.c @@ -19,83 +19,83 @@ void MPI_ERRORS_RETURN (MPI_Comm* comm, int* error_code, ...) _MPI_COVERAGE(); switch(*error_code) { - case MPI_ERR_BUFFER: + case MPI_ERR_BUFFER: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_BUFFER, "Error with Buffer."); break; - case MPI_ERR_COUNT: + case MPI_ERR_COUNT: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_COUNT, "Error with count value."); break; - case MPI_ERR_TYPE: + case MPI_ERR_TYPE: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_TYPE, "Error with datatype."); break; - case MPI_ERR_TAG: + case MPI_ERR_TAG: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_TAG, "Error with tag."); break; - case MPI_ERR_COMM: + case MPI_ERR_COMM: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_COMM, "Error with communicator."); break; - case MPI_ERR_RANK: + case MPI_ERR_RANK: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_RANK, "Error with rank."); break; - case MPI_ERR_ROOT: + case MPI_ERR_ROOT: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_ROOT, "Error with root."); break; - case MPI_ERR_GROUP: + case MPI_ERR_GROUP: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_GROUP, "Error with group."); break; - case MPI_ERR_OP: + case MPI_ERR_OP: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_OP, "Error with Op"); break; - case MPI_ERR_TOPOLOGY: + case MPI_ERR_TOPOLOGY: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_TOPOLOGY, "Error with topology."); break; - case MPI_ERR_DIMS: + case MPI_ERR_DIMS: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_DIMS, "Error with Dims."); break; - case MPI_ERR_ARG: + case MPI_ERR_ARG: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_ARG, "Error with argument."); break; - case MPI_ERR_UNKNOWN: + case MPI_ERR_UNKNOWN: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_UNKNOWN, "Error unknown."); break; - case MPI_ERR_TRUNCATE: + case MPI_ERR_TRUNCATE: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_TRUNCATE, "Error with truncate."); break; - case MPI_ERR_OTHER: + case MPI_ERR_OTHER: _MPI_COVERAGE(); - _MPI_ERR_ROUTINE(MPI_ERR_OTHER, "Error with other."); + _MPI_ERR_ROUTINE(MPI_ERR_OTHER, "Error with other."); break; - case MPI_ERR_IN_STATUS: + case MPI_ERR_IN_STATUS: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "Error with Init status."); break; - case MPI_ERR_PENDING: + case MPI_ERR_PENDING: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_PENDING, "Error pending."); break; - case MPI_ERR_REQUEST: + case MPI_ERR_REQUEST: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_REQUEST, "Error with request."); break; - case MPI_ERR_LASTCODE: + case MPI_ERR_LASTCODE: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_LASTCODE, "Error with Last code."); break; - case MPI_ERR_INTERN: + case MPI_ERR_INTERN: _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_INTERN, "Error with Internal."); break; @@ -106,3 +106,4 @@ void MPI_ERRORS_RETURN (MPI_Comm* comm, int* error_code, ...) } return; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_create.c index 3cf8de08dc..30afce6b91 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_create.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Errhandler_create( +int MPI_Errhandler_create( MPI_Handler_function *function, MPI_Errhandler *errhandler) { _MPI_COVERAGE(); return PMPI_Errhandler_create (function, errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_free.c index 1325e9788f..2a89993a18 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_free.c @@ -19,3 +19,4 @@ int MPI_Errhandler_free( MPI_Errhandler *errhandler ) _MPI_COVERAGE(); return PMPI_Errhandler_free (errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_get.c index a95b3e72ee..6a39cc1277 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_get.c @@ -19,3 +19,4 @@ int MPI_Errhandler_get( MPI_Comm comm, MPI_Errhandler *errhandler ) _MPI_COVERAGE(); return PMPI_Errhandler_get (comm, errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_set.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_set.c index ee2a023c44..a9946f9055 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_set.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Errhandler_set.c @@ -19,3 +19,4 @@ int MPI_Errhandler_set( MPI_Comm comm, MPI_Errhandler errhandler ) _MPI_COVERAGE(); return PMPI_Errhandler_set (comm, errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_class.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_class.c index 9734809662..1b98e11643 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_class.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_class.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Error_class( - int errorcode, +int MPI_Error_class( + int errorcode, int *errorclass) { _MPI_COVERAGE(); return PMPI_Error_class (errorcode, errorclass); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_string.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_string.c index 60451e4483..7f1b8cf682 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_string.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Error_string.c @@ -19,3 +19,4 @@ int MPI_Error_string( int errorcode, char *string, int *resultlen ) _MPI_COVERAGE(); return PMPI_Error_string (errorcode, string, resultlen); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_c2f.c index 5b6760c644..fe27a9b580 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_c2f.c @@ -18,5 +18,6 @@ MPI_Fint MPI_File_c2f(MPI_File fh) { _MPI_COVERAGE(); - return PMPI_File_c2f(fh); + return PMPI_File_c2f(fh); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_close.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_close.c index f09628fc65..d5dbf53b63 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_close.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_close.c @@ -18,5 +18,6 @@ int MPI_File_close(MPI_File *fh) { _MPI_COVERAGE(); - return PMPI_File_close(fh); + return PMPI_File_close(fh); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_delete.c index e89fa2e3e0..2a13b59a3e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_delete.c @@ -18,5 +18,6 @@ int MPI_File_delete(char *filename, MPI_Info info) { _MPI_COVERAGE(); - return PMPI_File_delete(filename, info); + return PMPI_File_delete(filename, info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_f2c.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_f2c.c index 4a16ee9d1f..998cab3339 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_f2c.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_f2c.c @@ -18,5 +18,6 @@ MPI_File MPI_File_f2c(MPI_Fint fh) { _MPI_COVERAGE(); - return PMPI_File_f2c(fh); + return PMPI_File_f2c(fh); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_amode.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_amode.c index cd8e6cc64e..ae6b328909 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_amode.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_amode.c @@ -18,5 +18,6 @@ int MPI_File_get_amode(MPI_File fh, int *amode) { _MPI_COVERAGE(); - return PMPI_File_get_amode(fh, amode); + return PMPI_File_get_amode(fh, amode); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_atomicity.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_atomicity.c index 4e982e9488..7818071b2f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_atomicity.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_atomicity.c @@ -18,5 +18,6 @@ int MPI_File_get_atomicity(MPI_File fh, int *flag) { _MPI_COVERAGE(); - return PMPI_File_get_atomicity(fh, flag); + return PMPI_File_get_atomicity(fh, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_byte_offset.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_byte_offset.c index 70b4a47aaf..d06c0a4a20 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_byte_offset.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_byte_offset.c @@ -18,5 +18,6 @@ int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) { _MPI_COVERAGE(); - return PMPI_File_get_byte_offset(fh, offset, disp); + return PMPI_File_get_byte_offset(fh, offset, disp); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_errhandler.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_errhandler.c index f2e1d0f925..34ddfdfb92 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_errhandler.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_errhandler.c @@ -18,5 +18,6 @@ int MPI_File_get_errhandler(MPI_File fh, MPI_Errhandler *errhandler) { _MPI_COVERAGE(); - return PMPI_File_get_errhandler(fh, errhandler); + return PMPI_File_get_errhandler(fh, errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_group.c index 5d673e04e2..f8214560bd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_group.c @@ -18,5 +18,6 @@ int MPI_File_get_group(MPI_File fh, MPI_Group *group) { _MPI_COVERAGE(); - return PMPI_File_get_group(fh, group); + return PMPI_File_get_group(fh, group); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_info.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_info.c index f26331310d..07bdab0933 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_info.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_info.c @@ -18,5 +18,6 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) { _MPI_COVERAGE(); - return PMPI_File_get_info(fh, info_used); + return PMPI_File_get_info(fh, info_used); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position.c index d50ff998e2..4c2ba0ea41 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position.c @@ -18,5 +18,6 @@ int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) { _MPI_COVERAGE(); - return PMPI_File_get_position(fh, offset); + return PMPI_File_get_position(fh, offset); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position_shared.c index 2fe23608fc..41eecc5c04 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_position_shared.c @@ -18,5 +18,6 @@ int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) { _MPI_COVERAGE(); - return PMPI_File_get_position_shared(fh, offset); + return PMPI_File_get_position_shared(fh, offset); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_size.c index 67f81f41fb..8670d64b4a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_size.c @@ -18,5 +18,6 @@ int MPI_File_get_size(MPI_File fh, MPI_Offset *size) { _MPI_COVERAGE(); - return PMPI_File_get_size(fh, size); + return PMPI_File_get_size(fh, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_type_extent.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_type_extent.c index e7f33dce27..fc55b0fd43 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_type_extent.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_type_extent.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, +int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) { _MPI_COVERAGE(); - return PMPI_File_get_type_extent (fh, datatype, extent); + return PMPI_File_get_type_extent (fh, datatype, extent); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_view.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_view.c index de332a64ac..46721adaea 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_view.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_get_view.c @@ -19,5 +19,6 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep) { _MPI_COVERAGE(); - return PMPI_File_get_view(fh, disp, etype, filetype, datarep); + return PMPI_File_get_view(fh, disp, etype, filetype, datarep); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread.c index 73306fe55c..72469b66da 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_iread(MPI_File fh, void *buf, int count, +int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iread(fh, buf, count, datatype, request); + return PMPI_File_iread(fh, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_at.c index c3616a74d5..a280414f13 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_at.c @@ -16,9 +16,10 @@ /* STUB */ int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iread_at(fh, offset, buf, count, datatype, request); + return PMPI_File_iread_at(fh, offset, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_shared.c index fa7d849a02..d8659e1d03 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iread_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_iread_shared(MPI_File fh, void *buf, int count, +int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iread_shared(fh, buf, count, datatype, request); + return PMPI_File_iread_shared(fh, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite.c index 01a0d7f36a..40d5a0f396 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_iwrite(MPI_File fh, void *buf, int count, +int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iwrite(fh, buf, count, datatype, request); + return PMPI_File_iwrite(fh, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_at.c index 4a9424fba3..96389ca940 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_at.c @@ -16,9 +16,10 @@ /* STUB */ int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iwrite_at(fh, offset, buf, count, datatype, request); + return PMPI_File_iwrite_at(fh, offset, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_shared.c index 56fb7e7142..a89cf0f83d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_iwrite_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, +int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { _MPI_COVERAGE(); - return PMPI_File_iwrite_shared(fh, buf, count, datatype, request); + return PMPI_File_iwrite_shared(fh, buf, count, datatype, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_open.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_open.c index fedda217b3..9ad8a339d6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_open.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_open.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_open(MPI_Comm comm, char *filename, int amode, +int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh) { _MPI_COVERAGE(); - return PMPI_File_open (comm, filename, amode, info, fh); + return PMPI_File_open (comm, filename, amode, info, fh); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_preallocate.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_preallocate.c index a7e680be57..d22a0777fe 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_preallocate.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_preallocate.c @@ -18,5 +18,6 @@ int MPI_File_preallocate(MPI_File fh, MPI_Offset size) { _MPI_COVERAGE(); - return PMPI_File_preallocate(fh, size); + return PMPI_File_preallocate(fh, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read.c index 5deeff2f9b..e65a4d3fa9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_read(MPI_File fh, void *buf, int count, +int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read(fh, buf, count, datatype, status); + return PMPI_File_read(fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all.c index 0b5cd5173d..3c769c4de5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int MPI_File_read_all(MPI_File fh, void *buf, int count, +int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_all(fh, buf, count, datatype, status); + return PMPI_File_read_all(fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_begin.c index d551624d3e..bfb7a7e849 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_begin.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, +int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); - return PMPI_File_read_all_begin(fh, buf, count, datatype); + return PMPI_File_read_all_begin(fh, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_end.c index 527f29aa09..a8b96d6b64 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_all_end.c @@ -17,5 +17,6 @@ int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_all_end (fh, buf, status); + return PMPI_File_read_all_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at.c index 8c443a1a31..c99815f151 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at.c @@ -18,5 +18,6 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_at (fh, offset, buf, count, datatype, status); + return PMPI_File_read_at (fh, offset, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all.c index 9a8800930d..9d78fefde5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all.c @@ -15,9 +15,10 @@ #include "mpi.h" int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_at_all (fh, offset, buf, count, datatype, status); + return PMPI_File_read_at_all (fh, offset, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_begin.c index b5af4cb37b..eed99b362d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_begin.c @@ -18,5 +18,6 @@ int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); - return PMPI_File_read_at_all_begin (fh, offset, buf, count, datatype); + return PMPI_File_read_at_all_begin (fh, offset, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_end.c index 776d8429d9..68b7c739a3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_at_all_end.c @@ -17,5 +17,6 @@ int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_at_all_end (fh, buf, status); + return PMPI_File_read_at_all_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered.c index 311adfe56e..4597f9cdb3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_read_ordered(MPI_File fh, void *buf, int count, +int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_ordered (fh, buf, count, datatype, status); + return PMPI_File_read_ordered (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_begin.c index 4fbb2a6996..112b8febf6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_begin.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, +int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); - return PMPI_File_read_ordered_begin (fh, buf, count, datatype); + return PMPI_File_read_ordered_begin (fh, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_end.c index 4bb5e9ec71..31415baa23 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_ordered_end.c @@ -17,5 +17,6 @@ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_read_ordered_end (fh, buf, status); + return PMPI_File_read_ordered_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_shared.c index c7e97bb963..139d874675 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_read_shared.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_read_shared(MPI_File fh, void *buf, int count, +int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); return PMPI_File_read_shared (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek.c index 7bd49ab5f2..c98651fa66 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek.c @@ -17,5 +17,6 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) { _MPI_COVERAGE(); - return PMPI_File_seek (fh, offset, whence); + return PMPI_File_seek (fh, offset, whence); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek_shared.c index 09daaf0266..1da233b2b3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_seek_shared.c @@ -17,5 +17,6 @@ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) { _MPI_COVERAGE(); - return PMPI_File_seek_shared (fh, offset, whence); + return PMPI_File_seek_shared (fh, offset, whence); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_atomicity.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_atomicity.c index 0fd36c2654..671bf0543d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_atomicity.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_atomicity.c @@ -17,5 +17,6 @@ int MPI_File_set_atomicity(MPI_File fh, int flag) { _MPI_COVERAGE(); - return PMPI_File_set_atomicity (fh, flag); + return PMPI_File_set_atomicity (fh, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_errhandler.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_errhandler.c index 5bb1146981..c72b0e9f54 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_errhandler.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_errhandler.c @@ -17,5 +17,6 @@ int MPI_File_set_errhandler(MPI_File fh, MPI_Errhandler errhandler) { _MPI_COVERAGE(); - return PMPI_File_set_errhandler(fh, errhandler); + return PMPI_File_set_errhandler(fh, errhandler); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_info.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_info.c index 2b92bf33fc..8fa9261ac5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_info.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_info.c @@ -17,5 +17,6 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info) { _MPI_COVERAGE(); - return PMPI_File_set_info (fh, info); + return PMPI_File_set_info (fh, info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_size.c index e143abed40..9f2eb70268 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_size.c @@ -17,5 +17,6 @@ int MPI_File_set_size(MPI_File fh, MPI_Offset size) { _MPI_COVERAGE(); - return PMPI_File_set_size (fh, size); + return PMPI_File_set_size (fh, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_view.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_view.c index 1886b2649a..616fc615f4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_view.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_set_view.c @@ -18,5 +18,6 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info) { _MPI_COVERAGE(); - return PMPI_File_set_view (fh, disp, etype, filetype, datarep, info); + return PMPI_File_set_view (fh, disp, etype, filetype, datarep, info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_sync.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_sync.c index daec12928a..0a8ea64a3e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_sync.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_sync.c @@ -17,5 +17,6 @@ int MPI_File_sync(MPI_File fh) { _MPI_COVERAGE(); - return PMPI_File_sync (fh); + return PMPI_File_sync (fh); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write.c index 9fec75752e..ba839ddecd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write(MPI_File fh, void *buf, int count, +int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_write (fh, buf, count, datatype, status); + return PMPI_File_write (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all.c index 6df0857077..75899e53b3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write_all(MPI_File fh, void *buf, int count, +int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_write_all (fh, buf, count, datatype, status); + return PMPI_File_write_all (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_begin.c index d5ae475699..76797ba24f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_begin.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, +int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); - return PMPI_File_write_all_begin (fh, buf, count, datatype); + return PMPI_File_write_all_begin (fh, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_end.c index 1578db9108..41ece11c12 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_all_end.c @@ -19,3 +19,4 @@ int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status) _MPI_COVERAGE(); return PMPI_File_write_all_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at.c index d975cc0e3b..653fa229ee 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at.c @@ -15,9 +15,10 @@ #include "mpi.h" int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_write_at (fh, offset, buf, count, datatype, status); + return PMPI_File_write_at (fh, offset, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all.c index ca27eeba48..7ef87ed9b9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all.c @@ -15,9 +15,10 @@ #include "mpi.h" int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_write_at_all (fh, offset, buf, count, datatype, status); + return PMPI_File_write_at_all (fh, offset, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_begin.c index bb48b6f253..755228401c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_begin.c @@ -18,5 +18,6 @@ int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); - return PMPI_File_write_at_all_begin (fh, offset, buf, count, datatype); + return PMPI_File_write_at_all_begin (fh, offset, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_end.c index 822679c8d5..3f23467f35 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_at_all_end.c @@ -17,5 +17,6 @@ int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { _MPI_COVERAGE(); - return PMPI_File_write_at_all_end (fh, buf, status); + return PMPI_File_write_at_all_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered.c index 706b602d62..0de875597d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write_ordered(MPI_File fh, void *buf, int count, +int MPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); return PMPI_File_write_ordered (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_begin.c index 1bc9a12447..e443a9ad66 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_begin.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, +int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { _MPI_COVERAGE(); return PMPI_File_write_ordered_begin (fh, buf, count, datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_end.c index dffebb3f55..2f1a47a8a2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_ordered_end.c @@ -19,3 +19,4 @@ int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status) _MPI_COVERAGE(); return PMPI_File_write_ordered_end (fh, buf, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_shared.c index 34e8a81748..945bb52d03 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_File_write_shared.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_File_write_shared(MPI_File fh, void *buf, int count, +int MPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { _MPI_COVERAGE(); return PMPI_File_write_shared (fh, buf, count, datatype, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalize.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalize.c index 2966d72f86..6b555cd00b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalize.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalize.c @@ -17,10 +17,10 @@ #include "mpi.h" int MPI_Finalize (void) -{ +{ _MPI_COVERAGE(); return PMPI_Finalize(); - /* + /* #ifdef _MPI_DEBUG if (x == _MPI_NOT_OK) printf ("\n>>>>ERROR MPI_Finalize\n"); @@ -29,3 +29,5 @@ int MPI_Finalize (void) #endif */ } + + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalized.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalized.c index 06bc592f45..e929f0143c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalized.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Finalized.c @@ -19,3 +19,4 @@ int MPI_Finalized( int *flag ) _MPI_COVERAGE(); return PMPI_Finalized (flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Gatherv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Gatherv.c index cd390d107c..dd1ecd455e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Gatherv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Gatherv.c @@ -14,11 +14,12 @@ #include "mpi.h" -int MPI_Gatherv ( void *sendbuf, int sendcnt, MPI_Datatype sendtype, - void *recvbuf, int *recvcnts, int *displs, - MPI_Datatype recvtype, +int MPI_Gatherv ( void *sendbuf, int sendcnt, MPI_Datatype sendtype, + void *recvbuf, int *recvcnts, int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Gatherv (sendbuf, sendcnt, sendtype, recvbuf, recvcnts, displs, recvtype, root, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_count.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_count.c index ee87028aba..23c6a76c71 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_count.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_count.c @@ -14,11 +14,12 @@ #include "mpi.h" -int MPI_Get_count( - MPI_Status *status, - MPI_Datatype datatype, +int MPI_Get_count( + MPI_Status *status, + MPI_Datatype datatype, int *count ) { _MPI_COVERAGE(); return PMPI_Get_count (status, datatype, count); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_elements.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_elements.c index 777c13d945..518bfb461c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_elements.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_elements.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Get_elements ( MPI_Status *status, MPI_Datatype datatype, +int MPI_Get_elements ( MPI_Status *status, MPI_Datatype datatype, int *elements ) { _MPI_COVERAGE(); return PMPI_Get_elements (status, datatype, elements); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_processor_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_processor_name.c index a396d8a6d3..5e096ce7af 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_processor_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_processor_name.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Get_processor_name( +int MPI_Get_processor_name( char *name, int *resultlen) { _MPI_COVERAGE(); return PMPI_Get_processor_name (name, resultlen); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_version.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_version.c index 2eb777c19b..ddb2d56720 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_version.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Get_version.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Get_version( - int *version, +int MPI_Get_version( + int *version, int *subversion ) { _MPI_COVERAGE(); return PMPI_Get_version (version, subversion); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_create.c index f93eaa1b2f..28e2421b3b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_create.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Graph_create ( MPI_Comm comm_old, int nnodes, int *index, int *edges, +int MPI_Graph_create ( MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph ) { _MPI_COVERAGE(); return PMPI_Graph_create (comm_old, nnodes, index, edges, reorder, comm_graph); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_get.c index 98f619a92c..4a4ad9f4f7 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_get.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Graph_get ( MPI_Comm comm, int maxindex, int maxedges, +int MPI_Graph_get ( MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges ) { _MPI_COVERAGE(); return PMPI_Graph_get (comm, maxindex, maxedges, index, edges); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_map.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_map.c index bf0cf05663..9ab6c64878 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_map.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_map.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Graph_map ( MPI_Comm comm_old, int nnodes, int *index, int *edges, +int MPI_Graph_map ( MPI_Comm comm_old, int nnodes, int *index, int *edges, int *newrank ) { _MPI_COVERAGE(); return PMPI_Graph_map (comm_old, nnodes, index, edges, newrank); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors.c index fe7f2b6102..1a358f810e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Graph_neighbors ( MPI_Comm comm, int rank, int maxneighbors, +int MPI_Graph_neighbors ( MPI_Comm comm, int rank, int maxneighbors, int *neighbors ) { _MPI_COVERAGE(); return PMPI_Graph_neighbors (comm, rank, maxneighbors, neighbors); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors_count.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors_count.c index 6685e1748e..57b68c5195 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors_count.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graph_neighbors_count.c @@ -19,3 +19,4 @@ int MPI_Graph_neighbors_count ( MPI_Comm comm, int rank, int *nneighbors ) _MPI_COVERAGE(); return PMPI_Graph_neighbors_count (comm, rank, nneighbors); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graphdims_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graphdims_get.c index c403e7ea1f..08e50164bb 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graphdims_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Graphdims_get.c @@ -19,3 +19,4 @@ int MPI_Graphdims_get ( MPI_Comm comm, int *nnodes, int *nedges ) _MPI_COVERAGE(); return PMPI_Graphdims_get (comm, nnodes, nedges); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_compare.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_compare.c index bc5b907778..8b85411f7f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_compare.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_compare.c @@ -19,3 +19,4 @@ int MPI_Group_compare ( MPI_Group group1, MPI_Group group2, int *result ) _MPI_COVERAGE(); return PMPI_Group_compare (group1, group2, result); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_difference.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_difference.c index f022bd9457..4bc1192281 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_difference.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_difference.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Group_difference ( MPI_Group group1, MPI_Group group2, +int MPI_Group_difference ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { _MPI_COVERAGE(); return PMPI_Group_difference (group1, group2, group_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_excl.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_excl.c index 2730552d7d..e493c08b45 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_excl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_excl.c @@ -19,3 +19,4 @@ int MPI_Group_excl ( MPI_Group group, int n, int *ranks, MPI_Group *newgroup ) _MPI_COVERAGE(); return PMPI_Group_excl (group, n, ranks, newgroup); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_free.c index 3abf05f466..771a8b05a4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_free.c @@ -19,3 +19,4 @@ int MPI_Group_free ( MPI_Group *group ) _MPI_COVERAGE(); return PMPI_Group_free (group); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_incl.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_incl.c index af75294426..451b90fc81 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_incl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_incl.c @@ -18,3 +18,4 @@ int MPI_Group_incl ( MPI_Group group, int n, int *ranks, MPI_Group *group_out ) { return PMPI_Group_incl (group, n, ranks, group_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_intersection.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_intersection.c index 035651d0ae..92dd0ab3ae 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_intersection.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_intersection.c @@ -14,8 +14,9 @@ #include "mpi.h" -int MPI_Group_intersection ( MPI_Group group1, MPI_Group group2, +int MPI_Group_intersection ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { return PMPI_Group_intersection (group1, group2, group_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_excl.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_excl.c index 4aef5356f4..d5b983da70 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_excl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_excl.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Group_range_excl ( MPI_Group group, int n, int ranges[][3], +int MPI_Group_range_excl ( MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup ) { _MPI_COVERAGE(); return PMPI_Group_range_excl (group, n, ranges, newgroup); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_incl.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_incl.c index a4002b5110..d4ee22be13 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_incl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_range_incl.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Group_range_incl ( MPI_Group group, int n, int ranges[][3], +int MPI_Group_range_incl ( MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup ) { _MPI_COVERAGE(); return PMPI_Group_range_incl (group, n, ranges, newgroup); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_rank.c index 5fbddf98b9..708d573d54 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_rank.c @@ -19,3 +19,4 @@ int MPI_Group_rank ( MPI_Group group, int *rank ) _MPI_COVERAGE(); return PMPI_Group_rank (group, rank); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_size.c index a033521207..69a7a5dfb1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_size.c @@ -19,3 +19,4 @@ int MPI_Group_size ( MPI_Group group, int *size ) _MPI_COVERAGE(); return PMPI_Group_size (group, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_translate_ranks.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_translate_ranks.c index b1c1bea133..4ab3f7a647 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_translate_ranks.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_translate_ranks.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Group_translate_ranks ( MPI_Group group_a, int n, int *ranks_a, +int MPI_Group_translate_ranks ( MPI_Group group_a, int n, int *ranks_a, MPI_Group group_b, int *ranks_b ) { _MPI_COVERAGE(); return PMPI_Group_translate_ranks (group_a, n, ranks_a, group_b, ranks_b); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_union.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_union.c index a11f51e4f4..8737af48a0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_union.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Group_union.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Group_union ( MPI_Group group1, MPI_Group group2, +int MPI_Group_union ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { _MPI_COVERAGE(); return PMPI_Group_union (group1, group2, group_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ibsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ibsend.c index f118183c16..71a6e67b73 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ibsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ibsend.c @@ -22,3 +22,4 @@ int MPI_Ibsend (void* message, int count, MPI_Datatype datatype, int dest, return PMPI_Ibsend(message, count, datatype, dest, tag, comm, request); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_c2f.c index 62c72cd715..984add98db 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_c2f.c @@ -19,3 +19,4 @@ MPI_Fint MPI_Info_c2f(MPI_Info info) _MPI_COVERAGE(); return PMPI_Info_c2f (info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_create.c index c41dada46b..e62ed51576 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_create.c @@ -19,3 +19,4 @@ int MPI_Info_create(MPI_Info *info) _MPI_COVERAGE(); return PMPI_Info_create (info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_delete.c index 26661529ba..d265741c97 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_delete.c @@ -19,3 +19,4 @@ int MPI_Info_delete(MPI_Info info, char *key) _MPI_COVERAGE(); return PMPI_Info_delete(info, key); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_dup.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_dup.c index b4cb02d192..32dcfd67e1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_dup.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_dup.c @@ -19,3 +19,4 @@ int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) _MPI_COVERAGE(); return PMPI_Info_dup (info, newinfo); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_f2c.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_f2c.c index 6ac3ff6c25..47402ff6ca 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_f2c.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_f2c.c @@ -19,3 +19,4 @@ MPI_Info MPI_Info_f2c(MPI_Fint info) _MPI_COVERAGE(); return PMPI_Info_f2c (info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_free.c index e37deaad65..f8f5f0e961 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_free.c @@ -19,3 +19,4 @@ int MPI_Info_free(MPI_Info *info) _MPI_COVERAGE(); return PMPI_Info_free (info); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get.c index 5348fb603c..d410c7f738 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get.c @@ -19,3 +19,4 @@ int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag) _MPI_COVERAGE(); return PMPI_Info_get (info, key, valuelen, value, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nkeys.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nkeys.c index 43fd2ec4eb..49824a5e0c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nkeys.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nkeys.c @@ -19,3 +19,4 @@ int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) _MPI_COVERAGE(); return PMPI_Info_get_nkeys (info, nkeys); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nthkey.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nthkey.c index acc8a766e4..d26f8264dd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nthkey.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_nthkey.c @@ -19,3 +19,4 @@ int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) _MPI_COVERAGE(); return PMPI_Info_get_nthkey (info, n, key); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_valuelen.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_valuelen.c index 807f20b40d..367f079fb8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_valuelen.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_get_valuelen.c @@ -19,3 +19,4 @@ int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag) _MPI_COVERAGE(); return PMPI_Info_get_valuelen (info, key, valuelen, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_set.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_set.c index cb30bffbae..2490016c4b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_set.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Info_set.c @@ -19,3 +19,4 @@ int MPI_Info_set(MPI_Info info, char *key, char *value) _MPI_COVERAGE(); return PMPI_Info_set (info, key, value); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init.c index aec4b60db1..8fdc0c487c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init.c @@ -20,3 +20,4 @@ int MPI_Init( int *argc, char **argv[]) _MPI_COVERAGE(); return PMPI_Init(argc, argv); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init_thread.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init_thread.c index 1d7d742d99..d9d89dc8f0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init_thread.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Init_thread.c @@ -19,3 +19,4 @@ int MPI_Init_thread(int *argc, char ***argv, int required, int *provided ) _MPI_COVERAGE(); return PMPI_Init_thread (argc, argv, required, provided); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Initialized.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Initialized.c index b025ab7c2e..9dbf357b33 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Initialized.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Initialized.c @@ -19,3 +19,4 @@ int MPI_Initialized( int *flag ) _MPI_COVERAGE(); return PMPI_Initialized (flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Int2handle.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Int2handle.c index b30aa5dc01..4e9bb56161 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Int2handle.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Int2handle.c @@ -19,3 +19,4 @@ MPI_Handle_type MPI_Int2handle( MPI_Fint f_handle, MPI_Handle_enum handle_kind ) _MPI_COVERAGE(); return PMPI_Int2handle (f_handle, handle_kind); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_create.c index 0dc00e703d..495378417f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_create.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Intercomm_create ( MPI_Comm local_comm, int local_leader, - MPI_Comm peer_comm, int remote_leader, int tag, +int MPI_Intercomm_create ( MPI_Comm local_comm, int local_leader, + MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm *comm_out ) { _MPI_COVERAGE(); return PMPI_Intercomm_create (local_comm, local_leader, peer_comm, remote_leader, tag, comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_merge.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_merge.c index 6365b494ee..48ec351831 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_merge.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Intercomm_merge.c @@ -19,3 +19,4 @@ int MPI_Intercomm_merge ( MPI_Comm comm, int high, MPI_Comm *comm_out ) _MPI_COVERAGE(); return PMPI_Intercomm_merge (comm, high, comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Iprobe.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Iprobe.c index 675fb19774..5d1c81b12f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Iprobe.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Iprobe.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Iprobe( int source, int tag, MPI_Comm comm, int *flag, +int MPI_Iprobe( int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status ) { _MPI_COVERAGE(); return PMPI_Iprobe (source, tag, comm, flag, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irecv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irecv.c index 4f3a3dae3b..0fe44fd4b1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irecv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irecv.c @@ -14,7 +14,7 @@ #include "mpi.h" -int MPI_Irecv (void* message, int count, MPI_Datatype datatype, int source, +int MPI_Irecv (void* message, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request* request) { _MPI_COVERAGE(); diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irsend.c index 0e7abfeea9..40901dfc14 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Irsend.c @@ -22,3 +22,4 @@ int MPI_Irsend (void* message, int count, MPI_Datatype datatype, int dest, return PMPI_Irsend(message, count, datatype, dest, tag, comm, request); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Isend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Isend.c index fc09e95dc6..7380de1838 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Isend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Isend.c @@ -19,6 +19,7 @@ int MPI_Isend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { _MPI_COVERAGE(); - return PMPI_Isend(message, count, datatype, dest, tag, comm, request); + return PMPI_Isend(message, count, datatype, dest, tag, comm, request); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Issend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Issend.c index f1739b58eb..67c6fee3e3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Issend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Issend.c @@ -22,3 +22,4 @@ int MPI_Issend (void* message, int count, MPI_Datatype datatype, int dest, return PMPI_Issend(message, count, datatype, dest, tag, comm, request); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_create.c index 60f32b1496..78d2cc985f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_create.c @@ -14,12 +14,13 @@ #include "mpi.h" -int MPI_Keyval_create ( - MPI_Copy_function *copy_fn, - MPI_Delete_function *delete_fn, - int *keyval, +int MPI_Keyval_create ( + MPI_Copy_function *copy_fn, + MPI_Delete_function *delete_fn, + int *keyval, void *extra_state ) { _MPI_COVERAGE(); return PMPI_Keyval_create (copy_fn, delete_fn, keyval, extra_state); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_free.c index b9f06837b9..d5b9f4b3ca 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Keyval_free.c @@ -19,3 +19,4 @@ int MPI_Keyval_free ( int *keyval ) _MPI_COVERAGE(); return PMPI_Keyval_free (keyval); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack.c index d06501f811..7436ce3b82 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Pack ( void *inbuf, int incount, MPI_Datatype datatype, +int MPI_Pack ( void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outcount, int *position, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Pack (inbuf, incount, datatype, outbuf, outcount, position, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack_size.c index c265b392aa..62c400eb94 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pack_size.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Pack_size ( int incount, MPI_Datatype datatype, MPI_Comm comm, +int MPI_Pack_size ( int incount, MPI_Datatype datatype, MPI_Comm comm, int *size ) { _MPI_COVERAGE(); return PMPI_Pack_size (incount, datatype, comm, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pcontrol.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pcontrol.c index 971ad7ef36..432cf14648 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pcontrol.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Pcontrol.c @@ -19,3 +19,4 @@ int MPI_Pcontrol( int level ) _MPI_COVERAGE(); return PMPI_Pcontrol (level); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Probe.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Probe.c index 82d37ef231..4444bb3466 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Probe.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Probe.c @@ -19,3 +19,4 @@ int MPI_Probe( int source, int tag, MPI_Comm comm, MPI_Status *status ) _MPI_COVERAGE(); return PMPI_Probe (source, tag, comm, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Recv_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Recv_init.c index 831ce20598..a99074376f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Recv_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Recv_init.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Recv_init( void *buf, int count, MPI_Datatype datatype, int source, +int MPI_Recv_init( void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request ) { _MPI_COVERAGE(); return PMPI_Recv_init (buf, count, datatype, source, tag, comm, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Reduce_scatter.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Reduce_scatter.c index d46a607b90..c87f208687 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Reduce_scatter.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Reduce_scatter.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Reduce_scatter ( void *sendbuf, void *recvbuf, int *recvcnts, +int MPI_Reduce_scatter ( void *sendbuf, void *recvbuf, int *recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Reduce_scatter (sendbuf, recvbuf, recvcnts, datatype, op, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_c2f.c index 3c8cdb30d7..f92caea01f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_c2f.c @@ -19,3 +19,4 @@ MPI_Fint MPI_Request_c2f( MPI_Request c_request ) _MPI_COVERAGE(); return PMPI_Request_c2f (c_request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_free.c index 85e8c9947a..1770d24dab 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Request_free.c @@ -20,3 +20,4 @@ int MPI_Request_free( MPI_Request *request ) _MPI_COVERAGE(); return PMPI_Request_free (request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend.c index 6453151fee..b3dfe5a47b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend.c @@ -18,6 +18,7 @@ int MPI_Rsend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { _MPI_COVERAGE(); - return PMPI_Rsend(message, count, datatype, dest, tag, comm); + return PMPI_Rsend(message, count, datatype, dest, tag, comm); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend_init.c index 9e46419b7c..b6de9f72c4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Rsend_init.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Rsend_init( void *buf, int count, MPI_Datatype datatype, int dest, +int MPI_Rsend_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { _MPI_COVERAGE(); return PMPI_Rsend_init (buf, count, datatype, dest, tag, comm, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scan.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scan.c index 015226d847..72e7454d6f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scan.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scan.c @@ -20,3 +20,4 @@ int MPI_Scan ( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, _MPI_COVERAGE(); return PMPI_Scan(sendbuf, recvbuf, count, datatype, op, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scatterv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scatterv.c index 09ad9a4ca5..7efc08a6b3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scatterv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Scatterv.c @@ -14,17 +14,18 @@ #include "mpi.h" -int MPI_Scatterv ( - void *sendbuf, - int *sendcnts, - int *displs, - MPI_Datatype sendtype, - void *recvbuf, - int recvcnt, - MPI_Datatype recvtype, - int root, +int MPI_Scatterv ( + void *sendbuf, + int *sendcnts, + int *displs, + MPI_Datatype sendtype, + void *recvbuf, + int recvcnt, + MPI_Datatype recvtype, + int root, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Scatterv (sendbuf, sendcnts, displs, sendtype, recvbuf, recvcnt, recvtype, root, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Send_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Send_init.c index 341b22371b..404a19c0f3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Send_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Send_init.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Send_init( void *buf, int count, MPI_Datatype datatype, int dest, +int MPI_Send_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { _MPI_COVERAGE(); return PMPI_Send_init (buf, count, datatype, dest, tag, comm, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv.c index 45bfcde7c6..ae3f2fcc85 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv.c @@ -18,12 +18,12 @@ #include "mpi.h" /*==========================================================================*/ -int MPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, - int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, +int MPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status ) { _MPI_COVERAGE(); - return PMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, + return PMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, source, recvtag, comm, status); } /*==========================================================================*/ diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv_replace.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv_replace.c index c1d5294e21..7dc894ec6e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv_replace.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Sendrecv_replace.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Sendrecv_replace( void *buf, int count, MPI_Datatype datatype, - int dest, int sendtag, int source, int recvtag, +int MPI_Sendrecv_replace( void *buf, int count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status ) { _MPI_COVERAGE(); return PMPI_Sendrecv_replace (buf, count, datatype, dest, sendtag, source, recvtag, comm, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend.c index f9b8a9d639..ce4ed24c84 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend.c @@ -18,6 +18,7 @@ int MPI_Ssend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { _MPI_COVERAGE(); - return PMPI_Ssend(message, count, datatype, dest, tag, comm); + return PMPI_Ssend(message, count, datatype, dest, tag, comm); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend_init.c index fbcca96068..e4b6fc75ad 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Ssend_init.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Ssend_init( void *buf, int count, MPI_Datatype datatype, int dest, +int MPI_Ssend_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { _MPI_COVERAGE(); return PMPI_Ssend_init (buf, count, datatype, dest, tag, comm, request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Start.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Start.c index 1264ebe79d..88fa822107 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Start.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Start.c @@ -14,9 +14,10 @@ #include "mpi.h" -int MPI_Start( +int MPI_Start( MPI_Request *request) { _MPI_COVERAGE(); return PMPI_Start (request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Startall.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Startall.c index 91e70accdd..bd6ca32138 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Startall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Startall.c @@ -19,3 +19,4 @@ int MPI_Startall( int count, MPI_Request array_of_requests[] ) _MPI_COVERAGE(); return PMPI_Startall (count, array_of_requests); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_c2f.c index dac411ca1b..f186a2c193 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_c2f.c @@ -19,3 +19,4 @@ int MPI_Status_c2f( MPI_Status *c_status, MPI_Fint *f_status ) _MPI_COVERAGE(); return PMPI_Status_c2f (c_status, f_status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_cancelled.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_cancelled.c index 136ce18a02..a45ccbca71 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_cancelled.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_cancelled.c @@ -19,3 +19,4 @@ int MPI_Status_set_cancelled( MPI_Status *status, int flag ) _MPI_COVERAGE(); return PMPI_Status_set_cancelled (status, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_elements.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_elements.c index 02236ccb91..7a04c319c2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_elements.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Status_set_elements.c @@ -20,3 +20,4 @@ int MPI_Status_set_elements( MPI_Status *status, MPI_Datatype datatype, _MPI_COVERAGE(); return PMPI_Status_set_elements (status, datatype, count); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test.c index f67db60c29..1f7c53f909 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test.c @@ -14,7 +14,7 @@ #include "mpi.h" -int MPI_Test ( +int MPI_Test ( MPI_Request *request, int *flag, MPI_Status *status) @@ -22,3 +22,4 @@ int MPI_Test ( _MPI_COVERAGE(); return PMPI_Test (request, flag, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test_cancelled.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test_cancelled.c index b2d528ef99..b0ab2a4824 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test_cancelled.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Test_cancelled.c @@ -18,3 +18,4 @@ int MPI_Test_cancelled(MPI_Status *status, int *flag) { _MPI_COVERAGE(); return PMPI_Test_cancelled(status, flag); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testall.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testall.c index f39df21af2..3a7216aadb 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testall.c @@ -14,12 +14,13 @@ #include "mpi.h" -int MPI_Testall( - int count, - MPI_Request array_of_requests[], - int *flag, +int MPI_Testall( + int count, + MPI_Request array_of_requests[], + int *flag, MPI_Status array_of_statuses[] ) { _MPI_COVERAGE(); return PMPI_Testall (count, array_of_requests, flag, array_of_statuses); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testany.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testany.c index d19a13b29b..3ee8d57238 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testany.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testany.c @@ -14,12 +14,13 @@ #include "mpi.h" -int MPI_Testany( - int count, - MPI_Request array_of_requests[], - int *index, int *flag, +int MPI_Testany( + int count, + MPI_Request array_of_requests[], + int *index, int *flag, MPI_Status *status ) { _MPI_COVERAGE(); return PMPI_Testany (count, array_of_requests, index, flag, status); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testsome.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testsome.c index 4d05475fa7..693c5e6e8e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testsome.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Testsome.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Testsome( - int incount, - MPI_Request array_of_requests[], - int *outcount, - int array_of_indices[], +int MPI_Testsome( + int incount, + MPI_Request array_of_requests[], + int *outcount, + int array_of_indices[], MPI_Status array_of_statuses[] ) { _MPI_COVERAGE(); return PMPI_Testsome (incount, array_of_requests, outcount, array_of_indices, array_of_statuses); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Topo_test.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Topo_test.c index 3d6c19bb1a..f2cf3d5ec5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Topo_test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Topo_test.c @@ -19,3 +19,4 @@ int MPI_Topo_test ( MPI_Comm comm, int *top_type ) _MPI_COVERAGE(); return PMPI_Topo_test (comm, top_type); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_commit.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_commit.c index 1ba6eb84f1..0e2d84bfa3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_commit.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_commit.c @@ -19,3 +19,4 @@ int MPI_Type_commit ( MPI_Datatype *datatype ) _MPI_COVERAGE(); return PMPI_Type_commit (datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_contiguous.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_contiguous.c index b922169bf9..3123e6f96b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_contiguous.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_contiguous.c @@ -14,7 +14,7 @@ #include "mpi.h" -int MPI_Type_contiguous( +int MPI_Type_contiguous( int count, MPI_Datatype old_type, MPI_Datatype *newtype) @@ -22,3 +22,4 @@ int MPI_Type_contiguous( _MPI_COVERAGE(); return PMPI_Type_contiguous (count, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_darray.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_darray.c index d82713db34..00366c7f7c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_darray.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_darray.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) +int MPI_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype) { _MPI_COVERAGE(); - return PMPI_Type_create_darray (size, rank, ndims, array_of_gsizes, array_of_distribs, + return PMPI_Type_create_darray (size, rank, ndims, array_of_gsizes, array_of_distribs, array_of_dargs, array_of_psizes, order, oldtype, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_indexed_block.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_indexed_block.c index 1c25f76bc9..c874aa4093 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_indexed_block.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_indexed_block.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_create_indexed_block( - int count, - int blocklength, - int array_of_displacements[], - MPI_Datatype old_type, +int MPI_Type_create_indexed_block( + int count, + int blocklength, + int array_of_displacements[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_create_indexed_block (count, blocklength, array_of_displacements, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_subarray.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_subarray.c index c5a0dc7c59..865945588e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_subarray.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_create_subarray.c @@ -15,15 +15,16 @@ #include "mpi.h" int MPI_Type_create_subarray( - int ndims, - int *array_of_sizes, - int *array_of_subsizes, - int *array_of_starts, - int order, - MPI_Datatype oldtype, + int ndims, + int *array_of_sizes, + int *array_of_subsizes, + int *array_of_starts, + int order, + MPI_Datatype oldtype, MPI_Datatype *newtype) { _MPI_COVERAGE(); - return PMPI_Type_create_subarray (ndims, array_of_sizes, array_of_subsizes, array_of_starts, + return PMPI_Type_create_subarray (ndims, array_of_sizes, array_of_subsizes, array_of_starts, order, oldtype, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_extent.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_extent.c index 2452550524..cb42be2023 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_extent.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_extent.c @@ -19,3 +19,4 @@ int MPI_Type_extent( MPI_Datatype datatype, MPI_Aint *extent ) _MPI_COVERAGE(); return PMPI_Type_extent (datatype, extent); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_free.c index 97de0de825..302827414e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_free.c @@ -19,3 +19,4 @@ int MPI_Type_free ( MPI_Datatype *datatype ) _MPI_COVERAGE(); return PMPI_Type_free (datatype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_contents.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_contents.c index b9773ee697..faaab2ab8d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_contents.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_contents.c @@ -15,15 +15,16 @@ #include "mpi.h" int MPI_Type_get_contents( - MPI_Datatype datatype, - int max_integers, - int max_addresses, - int max_datatypes, - int *array_of_integers, - MPI_Aint *array_of_addresses, + MPI_Datatype datatype, + int max_integers, + int max_addresses, + int max_datatypes, + int *array_of_integers, + MPI_Aint *array_of_addresses, MPI_Datatype *array_of_datatypes) { _MPI_COVERAGE(); - return PMPI_Type_get_contents (datatype, max_integers, max_addresses, max_datatypes, + return PMPI_Type_get_contents (datatype, max_integers, max_addresses, max_datatypes, array_of_integers, array_of_addresses, array_of_datatypes); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_envelope.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_envelope.c index 0f454bfb9d..afbc330d4d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_envelope.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_get_envelope.c @@ -15,12 +15,13 @@ #include "mpi.h" int MPI_Type_get_envelope( - MPI_Datatype datatype, - int *num_integers, - int *num_addresses, - int *num_datatypes, + MPI_Datatype datatype, + int *num_integers, + int *num_addresses, + int *num_datatypes, int *combiner) { _MPI_COVERAGE(); return PMPI_Type_get_envelope (datatype, num_integers, num_addresses, num_datatypes, combiner); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hindexed.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hindexed.c index 0d056aa541..9effca9a7e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hindexed.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hindexed.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_hindexed( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_type, +int MPI_Type_hindexed( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_hindexed (count, blocklens, indices, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hvector.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hvector.c index e33b323d66..43ec3f8cd5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hvector.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_hvector.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_hvector( - int count, - int blocklen, - MPI_Aint stride, - MPI_Datatype old_type, +int MPI_Type_hvector( + int count, + int blocklen, + MPI_Aint stride, + MPI_Datatype old_type, MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_hvector (count, blocklen, stride, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_indexed.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_indexed.c index d60f2e8f27..195874e85e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_indexed.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_indexed.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_indexed( - int count, - int blocklens[], - int indices[], - MPI_Datatype old_type, +int MPI_Type_indexed( + int count, + int blocklens[], + int indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_indexed (count, blocklens, indices, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_lb.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_lb.c index cd6d7d2bd7..c8461d3686 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_lb.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_lb.c @@ -19,3 +19,4 @@ int MPI_Type_lb ( MPI_Datatype datatype, MPI_Aint *displacement ) _MPI_COVERAGE(); return PMPI_Type_lb (datatype, displacement); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_size.c index 06aa195956..1da85117cd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_size.c @@ -19,3 +19,4 @@ int MPI_Type_size ( MPI_Datatype datatype, int *size ) _MPI_COVERAGE(); return PMPI_Type_size (datatype, size); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_struct.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_struct.c index 2c0131b2c5..f2ead358c2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_struct.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_struct.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_struct( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_types[], +int MPI_Type_struct( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_types[], MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_struct (count, blocklens, indices, old_types, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_ub.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_ub.c index 7c700584e1..a9a8ef913b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_ub.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_ub.c @@ -19,3 +19,4 @@ int MPI_Type_ub ( MPI_Datatype datatype, MPI_Aint *displacement ) _MPI_COVERAGE(); return PMPI_Type_ub (datatype, displacement); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_vector.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_vector.c index d0dca2f702..6fdc71efe7 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_vector.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Type_vector.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Type_vector( - int count, - int blocklen, - int stride, - MPI_Datatype old_type, +int MPI_Type_vector( + int count, + int blocklen, + int stride, + MPI_Datatype old_type, MPI_Datatype *newtype ) { _MPI_COVERAGE(); return PMPI_Type_vector (count, blocklen, stride, old_type, newtype); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Unpack.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Unpack.c index 245b1ad136..14ed79621f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Unpack.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Unpack.c @@ -14,10 +14,11 @@ #include "mpi.h" -int MPI_Unpack ( void *inbuf, int insize, int *position, - void *outbuf, int outcount, MPI_Datatype datatype, +int MPI_Unpack ( void *inbuf, int insize, int *position, + void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Unpack (inbuf, insize, position, outbuf, outcount, datatype, comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wait.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wait.c index 35f0d89e36..79cf604cd8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wait.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wait.c @@ -24,3 +24,4 @@ int MPI_Wait ( MPI_Request* request, MPI_Status* status) return PMPI_Wait(request, status); } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitall.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitall.c index 8c7868f9f7..5c61472623 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitall.c @@ -27,3 +27,4 @@ int MPI_Waitall( return PMPI_Waitall(count, array_of_requests, array_of_statuses); } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitany.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitany.c index 64f09eacdb..9046ac31d6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitany.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitany.c @@ -24,3 +24,4 @@ int MPI_Waitany( int count, MPI_Request array_of_requests[], int* index, MPI_Sta return PMPI_Waitany(count, array_of_requests, index, status); } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitsome.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitsome.c index 0b47eb48d6..fd9061c98b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitsome.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Waitsome.c @@ -14,13 +14,14 @@ #include "mpi.h" -int MPI_Waitsome( - int incount, - MPI_Request array_of_requests[], - int *outcount, - int array_of_indices[], +int MPI_Waitsome( + int incount, + MPI_Request array_of_requests[], + int *outcount, + int array_of_indices[], MPI_Status array_of_statuses[] ) { _MPI_COVERAGE(); return PMPI_Waitsome (incount, array_of_requests, outcount, array_of_indices, array_of_statuses); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wtick.c b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wtick.c index 65f87ddedc..c97de605b9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wtick.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/MPI_Wtick.c @@ -19,3 +19,4 @@ double MPI_Wtick(void) _MPI_COVERAGE(); return PMPI_Wtick(); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/Makefile.in b/packages/zoltan/siMPI/pyMPI/siMPI/Makefile.in index 1f211e4cc1..c5afcaba4e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/Makefile.in +++ b/packages/zoltan/siMPI/pyMPI/siMPI/Makefile.in @@ -1036,7 +1036,7 @@ uninstall-libLIBRARIES: clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) -libsimpi.a: $(libsimpi_a_OBJECTS) $(libsimpi_a_DEPENDENCIES) $(EXTRA_libsimpi_a_DEPENDENCIES) +libsimpi.a: $(libsimpi_a_OBJECTS) $(libsimpi_a_DEPENDENCIES) $(EXTRA_libsimpi_a_DEPENDENCIES) -rm -f libsimpi.a $(libsimpi_a_AR) libsimpi.a $(libsimpi_a_OBJECTS) $(libsimpi_a_LIBADD) $(RANLIB) libsimpi.a @@ -1077,7 +1077,7 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -mpirun$(EXEEXT): $(mpirun_OBJECTS) $(mpirun_DEPENDENCIES) $(EXTRA_mpirun_DEPENDENCIES) +mpirun$(EXEEXT): $(mpirun_OBJECTS) $(mpirun_DEPENDENCIES) $(EXTRA_mpirun_DEPENDENCIES) @rm -f mpirun$(EXEEXT) $(LINK) $(mpirun_OBJECTS) $(mpirun_LDADD) $(LIBS) diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Test.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Test.c index 974d1620fa..dda5b52021 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Test.c @@ -18,5 +18,6 @@ int PMPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Wait.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Wait.c index 6561d92cb1..59f7f92f85 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Wait.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPIO_Wait.c @@ -18,5 +18,6 @@ int PMPIO_Wait(MPIO_Request *request, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Abort.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Abort.c index 2d0b6f2670..b2d0194432 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Abort.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Abort.c @@ -24,4 +24,5 @@ int PMPI_Abort( MPI_Comm comm, int errorcode ) #endif _MPI_ERR_ROUTINE(errorcode, "MPI aborting..."); abort(); + return -1; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Address.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Address.c index 677ba19c98..b1bdd72cc5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Address.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Address.c @@ -21,3 +21,4 @@ int PMPI_Address( void *location, MPI_Aint *address) if ( address ) (*address) = (MPI_Aint)(location); return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgather.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgather.c index 76e395c712..97dcffbc28 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgather.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgather.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_Allgather ( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Gather(sendbuf,sendcount,sendtype,recvbuf,recvcount,recvtype,0,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgatherv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgatherv.c index 1a5497fa2f..f78a6f1af5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgatherv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allgatherv.c @@ -15,11 +15,12 @@ #include "mpi.h" /* STUB */ -int PMPI_Allgatherv ( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int PMPI_Allgatherv ( void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); if ( recvcounts == 0 ) return MPI_ERR_ARG; return PMPI_Gather(sendbuf,sendcount,sendtype,recvbuf,*recvcounts,recvtype,0,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allreduce.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allreduce.c index 454938d6ed..014d1addbd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allreduce.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Allreduce.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Allreduce ( void *sendbuf, void *recvbuf, int count, +int PMPI_Allreduce ( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Reduce( sendbuf,recvbuf,count,datatype,op,0,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoall.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoall.c index 6dd0ecf43b..2618f15863 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoall.c @@ -16,8 +16,8 @@ #include /* STUB */ -int PMPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int PMPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm ) { int send_size; @@ -40,8 +40,8 @@ int PMPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, switch( _MPI_checkSendType(recvtype) ) { case _MPI_DEFAULT: _MPI_COVERAGE(); - send_size = _MPI_calculateSize(sendcount, sendtype); - recv_size = _MPI_calculateSize(recvcount, recvtype); + send_size = _MPI_calculateSize(sendcount, sendtype); + recv_size = _MPI_calculateSize(recvcount, recvtype); if ( send_size < recv_size ) { _MPI_COVERAGE(); memcpy(recvbuf,sendbuf,send_size); @@ -51,9 +51,10 @@ int PMPI_Alltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, } return MPI_SUCCESS; default: - return MPI_Abort(comm, MPI_UNDEFINED); + return MPI_Abort(comm, MPI_UNDEFINED); } default: - return MPI_Abort(comm, MPI_UNDEFINED); + return MPI_Abort(comm, MPI_UNDEFINED); } } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoallv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoallv.c index 89a9885079..6491965cc2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoallv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Alltoallv.c @@ -14,15 +14,15 @@ #include "mpi.h" -int PMPI_Alltoallv ( - void *sendbuf, - int *sendcnts, - int *sdispls, - MPI_Datatype sendtype, - void *recvbuf, - int *recvcnts, - int *rdispls, - MPI_Datatype recvtype, +int PMPI_Alltoallv ( + void *sendbuf, + int *sendcnts, + int *sdispls, + MPI_Datatype sendtype, + void *recvbuf, + int *recvcnts, + int *rdispls, + MPI_Datatype recvtype, MPI_Comm comm ) { _MPI_COVERAGE(); diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_delete.c index 856908866c..d6a4b80bba 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_delete.c @@ -19,5 +19,6 @@ int PMPI_Attr_delete ( MPI_Comm comm, int keyval ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_get.c index 73b28d5062..5ad6285f0a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_get.c @@ -15,13 +15,14 @@ #include "mpi.h" /* STUB */ -int PMPI_Attr_get ( - MPI_Comm comm, - int keyval, - void *attr_value, +int PMPI_Attr_get ( + MPI_Comm comm, + int keyval, + void *attr_value, int *flag ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_put.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_put.c index 5bc0496d29..2bb5b9c499 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_put.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Attr_put.c @@ -19,5 +19,6 @@ int PMPI_Attr_put ( MPI_Comm comm, int keyval, void *attr_value ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Barrier.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Barrier.c index 272f9e2dd2..5077b30a0e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Barrier.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Barrier.c @@ -27,3 +27,4 @@ int PMPI_Barrier ( MPI_Comm comm) } return retval; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bcast.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bcast.c index fffdfb0238..dcc08846fc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bcast.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bcast.c @@ -18,7 +18,7 @@ #include "mpi.h" /*==========================================================================*/ -int PMPI_Bcast ( void *buffer, int count, MPI_Datatype datatype, int root, +int PMPI_Bcast ( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm ) { int retval; @@ -30,8 +30,9 @@ int PMPI_Bcast ( void *buffer, int count, MPI_Datatype datatype, int root, { _MPI_COVERAGE(); _MPI_ERR_ROUTINE(retval, "MPI_BCAST: Argument error."); - MPI_Abort (comm, retval); + MPI_Abort (comm, retval); } return retval; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend.c index e39aba2196..48127c8130 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend.c @@ -22,3 +22,4 @@ int PMPI_Bsend(void* message, int count, MPI_Datatype datatype, int dest, int ta return PMPI_Send(message,count,datatype,dest,tag,comm); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend_init.c index d726edf53e..9455760274 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Bsend_init.c @@ -20,5 +20,6 @@ int PMPI_Bsend_init( void *buf, int count, MPI_Datatype datatype, int dest, { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_attach.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_attach.c index ad24de2b80..dc9ae8359c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_attach.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_attach.c @@ -19,5 +19,6 @@ int PMPI_Buffer_attach( void *buffer, int size ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_detach.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_detach.c index 2fda82aff5..51c431f2a4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_detach.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Buffer_detach.c @@ -19,5 +19,6 @@ int PMPI_Buffer_detach( void *bufferptr, int *size) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cancel.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cancel.c index 609c90036b..250dcf64b7 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cancel.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cancel.c @@ -19,7 +19,7 @@ int PMPI_Cancel( MPI_Request *request ) _MPI_COVERAGE(); if ( !request ) return MPI_ERR_REQUEST; - + (*request)->cancel = 1; /* true */ return MPI_SUCCESS; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_coords.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_coords.c index 662b2ff6b0..6ef50929d5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_coords.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_coords.c @@ -19,5 +19,6 @@ int PMPI_Cart_coords ( MPI_Comm comm, int rank, int maxdims, int *coords ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_create.c index 8cc2722440..a5f277b6c5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_create.c @@ -20,5 +20,6 @@ int PMPI_Cart_create ( MPI_Comm comm_old, int ndims, int *dims, int *periods, { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_get.c index e6f6f762ef..7446715794 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_get.c @@ -24,5 +24,6 @@ int PMPI_Cart_get ( { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_map.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_map.c index a684182f91..cc6eaa1253 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_map.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_map.c @@ -24,5 +24,6 @@ int PMPI_Cart_map ( { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_rank.c index d9dc8a0719..83907c2661 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_rank.c @@ -22,5 +22,6 @@ int PMPI_Cart_rank ( { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_shift.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_shift.c index e4b9622b07..dc9ed18c6d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_shift.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_shift.c @@ -20,5 +20,6 @@ int PMPI_Cart_shift ( MPI_Comm comm, int direction, int displ, { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_sub.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_sub.c index 3f7fb8c7c1..26ab2c3227 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_sub.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cart_sub.c @@ -19,5 +19,6 @@ int PMPI_Cart_sub ( MPI_Comm comm, int *remain_dims, MPI_Comm *comm_new ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cartdim_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cartdim_get.c index b7085e85b3..9e78ba28da 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cartdim_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Cartdim_get.c @@ -19,5 +19,6 @@ int PMPI_Cartdim_get ( MPI_Comm comm, int *ndims ) { _MPI_COVERAGE(); fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_compare.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_compare.c index 4c19275ca5..513bf00255 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_compare.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_compare.c @@ -14,7 +14,7 @@ #include "mpi.h" -int PMPI_Comm_compare ( +int PMPI_Comm_compare ( MPI_Comm comm1, MPI_Comm comm2, int *result) @@ -34,7 +34,7 @@ int PMPI_Comm_compare ( _MPI_COVERAGE(); if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) return MPI_ERR_COMM; - + if ( index1 == index2 ) { _MPI_COVERAGE(); *result = MPI_IDENT; @@ -44,19 +44,20 @@ int PMPI_Comm_compare ( _MPI_COVERAGE(); group1 = _MPI_COMM_LIST[index1].group; group2 = _MPI_COMM_LIST[index2].group; - + if ( PMPI_Group_compare( group1, group2, &gcmp ) != MPI_SUCCESS ) return MPI_ERR_GROUP; - + if ( gcmp == MPI_IDENT ) *result = MPI_CONGRUENT; - + if ( gcmp == MPI_SIMILAR ) *result = MPI_SIMILAR; } - + return MPI_SUCCESS; } } return MPI_ERR_COMM; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_create.c index 054bccfe04..3c4413d647 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_create.c @@ -42,7 +42,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group new_group, MPI_Comm* new_comm) { } _MPI_COMM_ARRAY_SIZE+=_MPI_PREALLOCATION_SIZE; } - _MPI_Comm_Insert(i); + _MPI_Comm_Insert(i); *new_comm = _MPI_COMM_LIST[i].comm; return MPI_SUCCESS; } else { @@ -55,3 +55,4 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group new_group, MPI_Comm* new_comm) { return MPI_ERR_INTERN; } /*============================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_dup.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_dup.c index 7322def0f0..024131e150 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_dup.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_dup.c @@ -15,8 +15,8 @@ #include "mpi.h" /* STUB */ -int PMPI_Comm_dup ( - MPI_Comm comm, +int PMPI_Comm_dup ( + MPI_Comm comm, MPI_Comm *comm_out ) { _MPI_COVERAGE(); @@ -27,3 +27,4 @@ int PMPI_Comm_dup ( } return PMPI_Comm_create(comm,_MPI_COMM_WORLD_GROUP,comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_get_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_get_name.c index e1cc62c9bd..0ff3ba655f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_get_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_get_name.c @@ -18,5 +18,6 @@ int PMPI_Comm_get_name( MPI_Comm comm, char *namep, int *reslen ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_group.c index afc15a21a6..264a342b00 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_group.c @@ -34,3 +34,4 @@ int index; } /*============================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_rank.c index 6ac35b8daa..0e004c196a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_rank.c @@ -28,13 +28,14 @@ int index; return MPI_SUCCESS; } _MPI_ERR_ROUTINE(MPI_ERR_COMM, "MPI_COMM_RANK: Null communicator."); - MPI_Abort (comm, MPI_ERR_COMM); + MPI_Abort (comm, MPI_ERR_COMM); return MPI_ERR_COMM; } else { _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI_COMM_RANK: MPI initialization error."); - MPI_Abort (comm, MPI_ERR_IN_STATUS); + MPI_Abort (comm, MPI_ERR_IN_STATUS); return MPI_ERR_ARG; } } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_group.c index c5168fc0b7..032c663a20 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_group.c @@ -18,5 +18,6 @@ int PMPI_Comm_remote_group ( MPI_Comm comm, MPI_Group *group ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_size.c index f3720d9252..92a86ac7a3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_remote_size.c @@ -18,5 +18,6 @@ int PMPI_Comm_remote_size ( MPI_Comm comm, int *size ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_set_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_set_name.c index 6da81a5ce9..bfd5720fdc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_set_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_set_name.c @@ -18,5 +18,6 @@ int PMPI_Comm_set_name( MPI_Comm com, char *name ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_size.c index fbe7583d03..ddccac6ae9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_size.c @@ -35,3 +35,4 @@ int index; MPI_Abort (comm, MPI_ERR_IN_STATUS); return MPI_ERR_ARG; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_split.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_split.c index 3f324e498d..d3c331c2b9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_split.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_split.c @@ -22,3 +22,4 @@ int PMPI_Comm_split ( MPI_Comm comm, int color, int key, MPI_Comm *comm_out ) /* it just returns a new communicator */ return PMPI_Comm_create(comm,_MPI_COMM_WORLD_GROUP,comm_out); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_test_inter.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_test_inter.c index 91529c65f4..d09de5250f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_test_inter.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Comm_test_inter.c @@ -18,5 +18,6 @@ int PMPI_Comm_test_inter ( MPI_Comm comm, int *flag ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Dims_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Dims_create.c index 21d991156a..ae1fe0be3a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Dims_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Dims_create.c @@ -16,10 +16,11 @@ /* STUB */ int PMPI_Dims_create( - int nnodes, - int ndims, + int nnodes, + int ndims, int *dims) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_create.c index 9c30d57fb2..5f64d5b173 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_create.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Errhandler_create( +int PMPI_Errhandler_create( MPI_Handler_function *function, MPI_Errhandler *errhandler) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_free.c index 892a0d3503..2339f8c8dd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_free.c @@ -18,5 +18,6 @@ int PMPI_Errhandler_free( MPI_Errhandler *errhandler ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_get.c index b87ff411d7..6b1ce91920 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_get.c @@ -18,5 +18,6 @@ int PMPI_Errhandler_get( MPI_Comm comm, MPI_Errhandler *errhandler ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_set.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_set.c index d1de108c9b..cd82a01589 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_set.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Errhandler_set.c @@ -18,5 +18,6 @@ int PMPI_Errhandler_set( MPI_Comm comm, MPI_Errhandler errhandler ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_class.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_class.c index 3e7e40906d..0290f44bf0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_class.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_class.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Error_class( - int errorcode, +int PMPI_Error_class( + int errorcode, int *errorclass) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_string.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_string.c index 88951317af..e1a9566d63 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_string.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Error_string.c @@ -61,3 +61,4 @@ int PMPI_Error_string( int errorcode, char *string, int *resultlen ) *resultlen = 0; return MPI_ERR_ARG; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_c2f.c index 0b6b98e4fc..5bc9c45562 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_c2f.c @@ -18,5 +18,6 @@ MPI_Fint PMPI_File_c2f(MPI_File fh) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_close.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_close.c index 2977e5fd10..61063b52aa 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_close.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_close.c @@ -18,5 +18,6 @@ int PMPI_File_close(MPI_File *fh) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_delete.c index bdf1b0f644..b512d13cf2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_delete.c @@ -18,5 +18,6 @@ int PMPI_File_delete(char *filename, MPI_Info info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_f2c.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_f2c.c index 2bf2ef96c2..09705f80db 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_f2c.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_f2c.c @@ -18,5 +18,6 @@ MPI_File PMPI_File_f2c(MPI_Fint fh) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_amode.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_amode.c index e4090b60bf..ad953494bc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_amode.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_amode.c @@ -18,5 +18,6 @@ int PMPI_File_get_amode(MPI_File fh, int *amode) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_atomicity.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_atomicity.c index 3198598800..ed96a37c75 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_atomicity.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_atomicity.c @@ -18,5 +18,6 @@ int PMPI_File_get_atomicity(MPI_File fh, int *flag) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_byte_offset.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_byte_offset.c index 381d95b4dd..8e800b016f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_byte_offset.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_byte_offset.c @@ -18,5 +18,6 @@ int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_errhandler.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_errhandler.c index 9872a68aef..dfd6af3f33 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_errhandler.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_errhandler.c @@ -18,5 +18,6 @@ int PMPI_File_get_errhandler(MPI_File fh, MPI_Errhandler *errhandler) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_group.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_group.c index 5609c0d795..5f6b6c70c6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_group.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_group.c @@ -18,5 +18,6 @@ int PMPI_File_get_group(MPI_File fh, MPI_Group *group) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_info.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_info.c index 3d2f60699b..156073677a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_info.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_info.c @@ -18,5 +18,6 @@ int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position.c index ad33ca1ef1..bfbd140308 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position.c @@ -18,5 +18,6 @@ int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position_shared.c index b43eb0098e..beaa1859f8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_position_shared.c @@ -18,5 +18,6 @@ int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_size.c index 401221c46f..ab5cd5722d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_size.c @@ -18,5 +18,6 @@ int PMPI_File_get_size(MPI_File fh, MPI_Offset *size) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_type_extent.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_type_extent.c index a724728ea5..38b360efe9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_type_extent.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_type_extent.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, +int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_view.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_view.c index 1bf4ff5136..c83e11880d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_view.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_get_view.c @@ -19,5 +19,6 @@ int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread.c index 40004518aa..d3eeb787fc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_iread(MPI_File fh, void *buf, int count, +int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_at.c index cf332698d7..b620fbaea8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_at.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_shared.c index ed76f47742..151dc3aae9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iread_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, +int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite.c index 9f07bd8acf..feb9360a35 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_iwrite(MPI_File fh, void *buf, int count, +int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_at.c index f70d956fb1..5e33057bd7 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_at.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_shared.c index 1b74773db9..71b45dd1e1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_iwrite_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, +int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_open.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_open.c index c2af9e55a1..c73580126c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_open.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_open.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_open(MPI_Comm comm, char *filename, int amode, +int PMPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_preallocate.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_preallocate.c index fea5a64c8c..210286c442 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_preallocate.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_preallocate.c @@ -18,5 +18,6 @@ int PMPI_File_preallocate(MPI_File fh, MPI_Offset size) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read.c index 18280226b9..fd75a40cf0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read(MPI_File fh, void *buf, int count, +int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all.c index 923e9e79d2..7805316dfe 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read_all(MPI_File fh, void *buf, int count, +int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_begin.c index c592dc1127..41a28f1be3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_begin.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, +int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_end.c index 912c707389..d43954ddcf 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_all_end.c @@ -18,5 +18,6 @@ int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at.c index d00011c0e3..2bcea2f6aa 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at.c @@ -19,5 +19,6 @@ int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all.c index b786becf08..b55b70635f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_begin.c index 78bd6c9000..af2d9ae471 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_begin.c @@ -19,5 +19,6 @@ int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_end.c index faff9d8800..81c8e9c4b8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_at_all_end.c @@ -18,5 +18,6 @@ int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered.c index 48f8cda998..fda38f82ce 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, +int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_begin.c index 57456249ab..b5938b10f1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_begin.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, +int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_end.c index 33a3afaf1f..53a99ba277 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_ordered_end.c @@ -18,5 +18,6 @@ int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_shared.c index d6bcd22781..f55ed342b6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_read_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_read_shared(MPI_File fh, void *buf, int count, +int PMPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek.c index 9a791388b9..9d243a599f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek.c @@ -18,5 +18,6 @@ int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek_shared.c index 8148981eb2..05e5e9ceef 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_seek_shared.c @@ -18,5 +18,6 @@ int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_atomicity.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_atomicity.c index 9b3f915292..3ce8171d75 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_atomicity.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_atomicity.c @@ -18,5 +18,6 @@ int PMPI_File_set_atomicity(MPI_File fh, int flag) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_errhandler.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_errhandler.c index f680d4d95f..121cca08b4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_errhandler.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_errhandler.c @@ -18,5 +18,6 @@ int PMPI_File_set_errhandler(MPI_File fh, MPI_Errhandler errhandler) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_info.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_info.c index 761f8a3e69..8ea5fd5479 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_info.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_info.c @@ -18,5 +18,6 @@ int PMPI_File_set_info(MPI_File fh, MPI_Info info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_size.c index 4dc07861a9..4a80c554cf 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_size.c @@ -18,5 +18,6 @@ int PMPI_File_set_size(MPI_File fh, MPI_Offset size) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_view.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_view.c index 6a60f7dfa6..98731b9585 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_view.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_set_view.c @@ -19,5 +19,6 @@ int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_sync.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_sync.c index 8887753cf3..061d39981d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_sync.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_sync.c @@ -18,5 +18,6 @@ int PMPI_File_sync(MPI_File fh) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write.c index e66515965c..b4d37fbeae 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write(MPI_File fh, void *buf, int count, +int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all.c index 4417c00537..0d45c36210 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write_all(MPI_File fh, void *buf, int count, +int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_begin.c index 7d10f61734..6e4d2c8647 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_begin.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, +int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_end.c index fe50c08850..b8d9780881 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_all_end.c @@ -18,5 +18,6 @@ int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at.c index 483535532b..a221aab2c0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all.c index 399beba792..971b2a23bd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all.c @@ -16,9 +16,10 @@ /* STUB */ int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, + int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_begin.c index 9892430fc0..3c290bb426 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_begin.c @@ -19,5 +19,6 @@ int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_end.c index 56e22433ba..9aeb6647a5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_at_all_end.c @@ -18,5 +18,6 @@ int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered.c index 656bc8e270..d20e5dd168 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, +int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_begin.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_begin.c index 92a72187b1..39ad0ab17e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_begin.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_begin.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, +int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_end.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_end.c index 75c863a1e8..aa32ced292 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_end.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_ordered_end.c @@ -18,5 +18,6 @@ int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_shared.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_shared.c index 014aa54fb8..78ccdac1dd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_shared.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_File_write_shared.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_File_write_shared(MPI_File fh, void *buf, int count, +int PMPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalize.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalize.c index 83ba9a89f8..8a8436cae6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalize.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalize.c @@ -17,15 +17,15 @@ #include "mpi.h" int PMPI_Finalize (void) { - int i; - _MPI_FINALIZED_FLAG = _MPI_TRUE; - + int i; + _MPI_FINALIZED_FLAG = _MPI_TRUE; + if ( (_MPI_INIT_STATUS)!=(_MPI_STARTED) ) { - _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI_FINALIZE: MPI has not been initialized."); + _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI_FINALIZE: MPI has not been initialized."); MPI_Abort (MPI_COMM_NULL, MPI_ERR_IN_STATUS); - return _MPI_NOT_OK; + return _MPI_NOT_OK; } else { - _MPI_INIT_STATUS = _MPI_ENDED; + _MPI_INIT_STATUS = _MPI_ENDED; for (i = 1; i < _MPI_PREALLOCATION_SIZE; i++) { _MPI_Comm_Invalid(i); _MPI_Data_Invalid(i); @@ -42,5 +42,5 @@ int PMPI_Finalize (void) { free(_MPI_REQ_LIST_OF_LISTS);_MPI_REQ_LIST_OF_LISTS = 0; free(_MPI_REQNULL);_MPI_REQNULL = 0; return MPI_SUCCESS; - } + } } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalized.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalized.c index 890b50285e..a4f396532a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalized.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Finalized.c @@ -20,13 +20,14 @@ int PMPI_Finalized( int *flag ) retval = _MPI_checkIntP (flag); if (retval!=MPI_SUCCESS) { - _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI_FINALIZED: Invalid pointer."); + _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI_FINALIZED: Invalid pointer."); MPI_Abort((MPI_Comm)0, MPI_ERR_OTHER); return retval; } if ( (_MPI_INIT_STATUS == _MPI_ENDED) && (_MPI_FINALIZED_FLAG) ) *flag = _MPI_TRUE; - else + else *flag = _MPI_FALSE; - return MPI_SUCCESS; + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gather.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gather.c index 0100805289..ce19327845 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gather.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gather.c @@ -18,8 +18,8 @@ #include "mpi.h" /*==========================================================================*/ -int PMPI_Gather ( void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int PMPI_Gather ( void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm ) { int sendsize, recvsize, retval; @@ -50,3 +50,4 @@ int PMPI_Gather ( void *sendbuf, int sendcount, MPI_Datatype sendtype, return _MPI_NOT_OK; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gatherv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gatherv.c index a054d1cf51..5e64470438 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gatherv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Gatherv.c @@ -15,11 +15,12 @@ #include "mpi.h" /* STUB */ -int PMPI_Gatherv ( void *sendbuf, int sendcnt, MPI_Datatype sendtype, - void *recvbuf, int *recvcnts, int *displs, - MPI_Datatype recvtype, +int PMPI_Gatherv ( void *sendbuf, int sendcnt, MPI_Datatype sendtype, + void *recvbuf, int *recvcnts, int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm ) { _MPI_COVERAGE(); return PMPI_Gather(sendbuf,sendcnt,sendtype,recvbuf,*recvcnts,recvtype,root,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_count.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_count.c index 95cb9385d9..80fbe717af 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_count.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_count.c @@ -14,9 +14,9 @@ #include "mpi.h" -int PMPI_Get_count( - MPI_Status *status, - MPI_Datatype datatype, +int PMPI_Get_count( + MPI_Status *status, + MPI_Datatype datatype, int *count ) { int size_of_one; @@ -35,3 +35,4 @@ int PMPI_Get_count( } return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_elements.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_elements.c index 0c997e8d1a..10344c1b03 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_elements.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_elements.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Get_elements ( MPI_Status *status, MPI_Datatype datatype, +int PMPI_Get_elements ( MPI_Status *status, MPI_Datatype datatype, int *elements ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_processor_name.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_processor_name.c index c52304d5eb..10e2947908 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_processor_name.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_processor_name.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Get_processor_name( +int PMPI_Get_processor_name( char *name, int *resultlen) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_version.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_version.c index 1530ca8614..f0c06d5212 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_version.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Get_version.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Get_version( - int *version, +int PMPI_Get_version( + int *version, int *subversion ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_create.c index af2e00cb15..0b49d64258 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_create.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Graph_create ( MPI_Comm comm_old, int nnodes, int *index, int *edges, +int PMPI_Graph_create ( MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_get.c index b5625c3efb..6dc687958e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_get.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Graph_get ( MPI_Comm comm, int maxindex, int maxedges, +int PMPI_Graph_get ( MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_map.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_map.c index 8b00aac951..445fde3ae0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_map.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_map.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Graph_map ( MPI_Comm comm_old, int nnodes, int *index, int *edges, +int PMPI_Graph_map ( MPI_Comm comm_old, int nnodes, int *index, int *edges, int *newrank ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors.c index adb3108dc3..ece5c4efdc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Graph_neighbors ( MPI_Comm comm, int rank, int maxneighbors, +int PMPI_Graph_neighbors ( MPI_Comm comm, int rank, int maxneighbors, int *neighbors ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors_count.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors_count.c index 0a938a99ba..9690c4b3a8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors_count.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graph_neighbors_count.c @@ -18,5 +18,6 @@ int PMPI_Graph_neighbors_count ( MPI_Comm comm, int rank, int *nneighbors ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graphdims_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graphdims_get.c index c4bc9a151f..77728cb269 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graphdims_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Graphdims_get.c @@ -18,5 +18,6 @@ int PMPI_Graphdims_get ( MPI_Comm comm, int *nnodes, int *nedges ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_compare.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_compare.c index d3a3178ed0..b6a8bc0fa0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_compare.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_compare.c @@ -28,3 +28,4 @@ int PMPI_Group_compare ( MPI_Group group1, MPI_Group group2, int *result ) } return MPI_ERR_GROUP; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_difference.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_difference.c index 9badc11acc..5419ca623a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_difference.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_difference.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_difference ( MPI_Group group1, MPI_Group group2, +int PMPI_Group_difference ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_free.c index 1df06b62be..650771d737 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_free.c @@ -20,3 +20,4 @@ int PMPI_Group_free ( MPI_Group *group ) *group = MPI_GROUP_NULL; return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_intersection.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_intersection.c index 24ef492d09..1abf08c44a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_intersection.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_intersection.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_intersection ( MPI_Group group1, MPI_Group group2, +int PMPI_Group_intersection ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_excl.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_excl.c index d5717b38d7..0b646f8e43 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_excl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_excl.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_range_excl ( MPI_Group group, int n, int ranges[][3], +int PMPI_Group_range_excl ( MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_incl.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_incl.c index e215f6fb47..2a0778a87b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_incl.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_range_incl.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_range_incl ( MPI_Group group, int n, int ranges[][3], +int PMPI_Group_range_incl ( MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_rank.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_rank.c index 43e1863cd3..58627299e9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_rank.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_rank.c @@ -25,3 +25,4 @@ int PMPI_Group_rank ( MPI_Group group, int *rank ) *rank = _MPI_RANK; return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_size.c index 0e6b478c70..f58343f94f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_size.c @@ -23,3 +23,4 @@ int PMPI_Group_size ( MPI_Group group, int *size ) *size = _MPI_SIZE; return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_translate_ranks.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_translate_ranks.c index 5651abae26..2023e88096 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_translate_ranks.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_translate_ranks.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_translate_ranks ( MPI_Group group_a, int n, int *ranks_a, +int PMPI_Group_translate_ranks ( MPI_Group group_a, int n, int *ranks_a, MPI_Group group_b, int *ranks_b ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_union.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_union.c index ed13817472..f5b74351ca 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_union.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Group_union.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Group_union ( MPI_Group group1, MPI_Group group2, +int PMPI_Group_union ( MPI_Group group1, MPI_Group group2, MPI_Group *group_out ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ibsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ibsend.c index 8a287bef1a..d62b2b20c2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ibsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ibsend.c @@ -18,3 +18,4 @@ int PMPI_Ibsend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { return PMPI_Isend(message,count,datatype,dest,tag,comm,request); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_c2f.c index d38e36ecf3..d2317f8730 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_c2f.c @@ -18,5 +18,6 @@ MPI_Fint PMPI_Info_c2f(MPI_Info info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_create.c index 3ecbd3db9d..683c7c81ce 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_create.c @@ -18,5 +18,6 @@ int PMPI_Info_create(MPI_Info *info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_delete.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_delete.c index cea7f28ce8..6afd78b715 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_delete.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_delete.c @@ -18,5 +18,6 @@ int PMPI_Info_delete(MPI_Info info, char *key) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_dup.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_dup.c index 1b9448bcbf..f058108078 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_dup.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_dup.c @@ -18,5 +18,6 @@ int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_f2c.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_f2c.c index 4e60be7815..21ff7c1dc0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_f2c.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_f2c.c @@ -18,5 +18,6 @@ MPI_Info PMPI_Info_f2c(MPI_Fint info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_free.c index 68308e37cb..e8da9a8fcf 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_free.c @@ -18,5 +18,6 @@ int PMPI_Info_free(MPI_Info *info) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get.c index 220c48c203..6308319a0b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get.c @@ -18,5 +18,6 @@ int PMPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nkeys.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nkeys.c index 3ab2793703..0f7a27b866 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nkeys.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nkeys.c @@ -18,5 +18,6 @@ int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nthkey.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nthkey.c index 2a7a79ae62..d2f85e7c63 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nthkey.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_nthkey.c @@ -18,5 +18,6 @@ int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_valuelen.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_valuelen.c index 1b28612b07..a1a0f1d952 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_valuelen.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_get_valuelen.c @@ -18,5 +18,6 @@ int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_set.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_set.c index 787bcea8cf..848a15b6b4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_set.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Info_set.c @@ -18,5 +18,6 @@ int PMPI_Info_set(MPI_Info info, char *key, char *value) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init.c index 43ff32685f..41fb21a980 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init.c @@ -22,30 +22,30 @@ int PMPI_Init ( int *argc, char **argv[]) { int retval = MPI_ERR_IN_STATUS; _MPI_COVERAGE(); _MPI_INITIALIZED_FLAG = _MPI_TRUE; - + /* ----------------------------------------------- */ /* Check for the current status of MPI */ /* ----------------------------------------------- */ - if ( (_MPI_INIT_STATUS == _MPI_ENDED) || (_MPI_INIT_STATUS == _MPI_STARTED) ) { + if ( (_MPI_INIT_STATUS == _MPI_ENDED) || (_MPI_INIT_STATUS == _MPI_STARTED) ) { if (_MPI_INIT_STATUS == _MPI_ENDED) { _MPI_COVERAGE(); _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI was already finalized"); } else { _MPI_COVERAGE(); - _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI was already initialized"); + _MPI_ERR_ROUTINE(MPI_ERR_IN_STATUS, "MPI was already initialized"); } MPI_ERRORS_ARE_FATAL((MPI_Comm*)0, &retval); return MPI_ERR_OTHER; - } + } /* ----------------------------------------------- */ /* If the status is fine, initialize the internal */ - /* data structures */ + /* data structures */ /* ----------------------------------------------- */ _MPI_COVERAGE(); - _MPI_INIT_STATUS = _MPI_STARTED; + _MPI_INIT_STATUS = _MPI_STARTED; - /* ---------- */ + /* ---------- */ /* Allocation */ _MPI_COMM_ARRAY_SIZE = _MPI_PREALLOCATION_SIZE; _MPI_DATA_ARRAY_SIZE = _MPI_PREALLOCATION_SIZE; @@ -84,9 +84,9 @@ int PMPI_Init ( int *argc, char **argv[]) { _MPI_TYPE_COUNT = 0; _MPI_OP_COUNT = 0; _MPI_REQ_COUNT = 0; - + /* ------------------------- */ - /* Set entries all to "null" */ + /* Set entries all to "null" */ for (i=0; i<_MPI_PREALLOCATION_SIZE; i++) { _MPI_COVERAGE(); _MPI_Data_Invalid(i); diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init_thread.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init_thread.c index f324120e23..e477591a24 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init_thread.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Init_thread.c @@ -18,5 +18,6 @@ int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Initialized.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Initialized.c index ec9a3646da..8b223d78ef 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Initialized.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Initialized.c @@ -24,5 +24,6 @@ int PMPI_Initialized( int *flag ) return retval; } *flag = _MPI_INITIALIZED_FLAG; - return MPI_SUCCESS; + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Int2handle.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Int2handle.c index 4caa53d77e..5df04f92ca 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Int2handle.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Int2handle.c @@ -18,5 +18,6 @@ MPI_Handle_type PMPI_Int2handle( MPI_Fint f_handle, MPI_Handle_enum handle_kind ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_create.c index 4663eda644..348b645029 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_create.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Intercomm_create ( MPI_Comm local_comm, int local_leader, - MPI_Comm peer_comm, int remote_leader, int tag, +int PMPI_Intercomm_create ( MPI_Comm local_comm, int local_leader, + MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm *comm_out ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_merge.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_merge.c index 83c20a6bd2..4e48b034a1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_merge.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Intercomm_merge.c @@ -18,5 +18,6 @@ int PMPI_Intercomm_merge ( MPI_Comm comm, int high, MPI_Comm *comm_out ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Iprobe.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Iprobe.c index bff3fcb787..a9bb8a4819 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Iprobe.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Iprobe.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Iprobe( int source, int tag, MPI_Comm comm, int *flag, +int PMPI_Iprobe( int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irecv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irecv.c index 015e6edb7c..96f406fa16 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irecv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irecv.c @@ -37,3 +37,5 @@ int PMPI_Irecv (void* message, int count, MPI_Datatype datatype, int source, return retval; } /*==========================================================================*/ + + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irsend.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irsend.c index abc0131dbb..2783663a3a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irsend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Irsend.c @@ -22,3 +22,4 @@ int PMPI_Irsend (void* message, int count, MPI_Datatype datatype, int dest, return PMPI_Issend(message, count, datatype, dest, tag, comm, request); } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Isend.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Isend.c index d6392292b4..f72eb3900b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Isend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Isend.c @@ -18,7 +18,7 @@ int PMPI_Isend (void* message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { int retval; - retval = PMPI_Send(message, count, datatype, dest, tag, comm); + retval = PMPI_Send(message, count, datatype, dest, tag, comm); /* Fill in the request object so that we can query it later */ if (retval == MPI_SUCCESS && request != 0) { @@ -28,3 +28,4 @@ int PMPI_Isend (void* message, int count, MPI_Datatype datatype, int dest, return retval; } /*=============================================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_create.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_create.c index b2d95fb038..97623602cf 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_create.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_create.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int PMPI_Keyval_create ( - MPI_Copy_function *copy_fn, - MPI_Delete_function *delete_fn, - int *keyval, +int PMPI_Keyval_create ( + MPI_Copy_function *copy_fn, + MPI_Delete_function *delete_fn, + int *keyval, void *extra_state ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_free.c index 8524994b72..69b934aca8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Keyval_free.c @@ -18,5 +18,6 @@ int PMPI_Keyval_free ( int *keyval ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Msend.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Msend.c index 8ef9339de0..322a097df5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Msend.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Msend.c @@ -26,18 +26,18 @@ int PMPI_Msend (void* message, int count, MPI_Datatype datatype, int dest, int t /* option 1: Assert( _MPI_IS_INITIALIZED() ); */ _MPI_COVERAGE(); - + _MPI_CHECK_STATUS(&comm); retval = _MPI_checks(message, count, datatype, dest, tag, comm); /* option 2: STANDARD_MPI_CHECK(comm); */ if (retval == MPI_SUCCESS) { - size = _MPI_calculateSize(count, datatype); - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + size = _MPI_calculateSize(count, datatype); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); p = memcpy(p, message, size); retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); return retval; - } else { + } else { _MPI_ERR_ROUTINE (retval, "MPI_SEND / MPI_ISEND: argument error"); MPI_Abort (comm, retval); } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack.c index b69bbdb79d..5a27aa3e7d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Pack ( void *inbuf, int incount, MPI_Datatype datatype, +int PMPI_Pack ( void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outcount, int *position, MPI_Comm comm ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack_size.c index 7410cacb6c..6cca68052a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pack_size.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Pack_size ( int incount, MPI_Datatype datatype, MPI_Comm comm, +int PMPI_Pack_size ( int incount, MPI_Datatype datatype, MPI_Comm comm, int *size ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pcontrol.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pcontrol.c index d9807dad8e..7c9cc673e0 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pcontrol.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Pcontrol.c @@ -18,5 +18,6 @@ int PMPI_Pcontrol( int level ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Probe.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Probe.c index a3ac676b46..05526bdfe2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Probe.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Probe.c @@ -18,5 +18,6 @@ int PMPI_Probe( int source, int tag, MPI_Comm comm, MPI_Status *status ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv.c index e72600df1c..3a382a236e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv.c @@ -34,7 +34,7 @@ int PMPI_Recv (void* message, int count, MPI_Datatype datatype, int source, if (index == _MPI_NOT_OK) { return MPI_ERR_TAG; /* this return value is relied upon by some */ } /* internal calls to indicate no matching send */ - + message_size = _MPI_calculateSize(_MPI_DATA_BUFF[index].count, _MPI_DATA_BUFF[index].type); @@ -57,7 +57,7 @@ int PMPI_Recv (void* message, int count, MPI_Datatype datatype, int source, return MPI_SUCCESS; } - return retval; + return retval; } /*==========================================================================*/ diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv_init.c index 2b7ecd8633..a8246e217c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Recv_init.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Recv_init( void *buf, int count, MPI_Datatype datatype, int source, +int PMPI_Recv_init( void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce.c index 05fc374674..9d9317560c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce.c @@ -18,7 +18,7 @@ #include "mpi.h" /*==========================================================================*/ -int PMPI_Reduce ( void *sendbuf, void *recvbuf, int count, +int PMPI_Reduce ( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm ) { int size; @@ -42,13 +42,13 @@ int PMPI_Reduce ( void *sendbuf, void *recvbuf, int count, MPI_Abort(comm, retval); return _MPI_NOT_OK; } - + if ( _MPI_checkBuffer(recvbuf) != MPI_SUCCESS ) { _MPI_ERR_ROUTINE (MPI_ERR_BUFFER, "MPI_REDUCE : Invalid buffer pointer"); MPI_Abort(comm, MPI_ERR_BUFFER); return _MPI_NOT_OK; } - + if ( _MPI_checkOp(op) != MPI_SUCCESS ) { _MPI_ERR_ROUTINE(MPI_ERR_OP, "MPI_REDUCE : Invalid MPI_Op"); MPI_Abort(comm, MPI_ERR_OP); @@ -73,3 +73,4 @@ int PMPI_Reduce ( void *sendbuf, void *recvbuf, int count, return MPI_SUCCESS; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce_scatter.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce_scatter.c index ce4804d1ac..db497af450 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce_scatter.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Reduce_scatter.c @@ -24,3 +24,4 @@ int PMPI_Reduce_scatter ( void *sendbuf, void *recvbuf, int *recvcnts, MPI_Datat return PMPI_Reduce(sendbuf,recvbuf,*recvcnts,datatype,op,0,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_c2f.c index 9bec13054e..5f52f53723 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_c2f.c @@ -18,5 +18,6 @@ MPI_Fint PMPI_Request_c2f( MPI_Request c_request ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_free.c index 09ef7ebd5e..86373abd3b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Request_free.c @@ -25,3 +25,4 @@ int PMPI_Request_free( MPI_Request *request ) { *request = MPI_REQUEST_NULL; return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Rsend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Rsend_init.c index 23c2a16ced..21cb116590 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Rsend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Rsend_init.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Rsend_init( void *buf, int count, MPI_Datatype datatype, int dest, +int PMPI_Rsend_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort(comm, MPI_UNDEFINED); + return MPI_Abort(comm, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scan.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scan.c index 82901ac69f..67435b5b99 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scan.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scan.c @@ -20,3 +20,4 @@ int PMPI_Scan ( void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, { return PMPI_Allreduce(sendbuf,recvbuf,count,datatype,op,comm); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatter.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatter.c index f85bbdf4f9..ffc8d5f971 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatter.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatter.c @@ -18,8 +18,8 @@ #include "mpi.h" /*==========================================================================*/ -int PMPI_Scatter (void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, - int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) +int PMPI_Scatter (void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, + int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) { int sendsize, recvsize, retval; _MPI_COVERAGE(); @@ -47,3 +47,4 @@ int PMPI_Scatter (void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvb return _MPI_NOT_OK; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatterv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatterv.c index 21b2ca3e7e..68ae3a150f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatterv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Scatterv.c @@ -15,17 +15,18 @@ #include "mpi.h" /* STUB */ -int PMPI_Scatterv ( - void *sendbuf, - int *sendcnts, - int *displs, - MPI_Datatype sendtype, - void *recvbuf, - int recvcnt, - MPI_Datatype recvtype, - int root, +int PMPI_Scatterv ( + void *sendbuf, + int *sendcnts, + int *displs, + MPI_Datatype sendtype, + void *recvbuf, + int recvcnt, + MPI_Datatype recvtype, + int root, MPI_Comm comm ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send.c index 5f8227118d..6999a2f404 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send.c @@ -33,8 +33,8 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta switch (sendType) { case _MPI_DEFAULT: { - size = _MPI_calculateSize(count, datatype); - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + size = _MPI_calculateSize(count, datatype); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); p = memcpy(p, message, size); retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); return retval; @@ -43,7 +43,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta { sendType = _MPI_FindType(datatype); size = _MPI_TYPE_LIST[sendType].extent; - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); p = memcpy(p, message, size); retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); return retval; @@ -52,7 +52,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta { sendType = _MPI_FindType(datatype); size = _MPI_TYPE_LIST[sendType].extent; - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); /* ================================================== */ /* Determine the correct parts to save to the buffers */ @@ -62,7 +62,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta for (index = 0; index < info->count; index++) { position = info->stride[index]*sizeof(info->types[0]); - p = memcpy(p+copiedPointer, ((char*)message)+position, info->blocklen[index]*sizeof(info->types[0])); + p = memcpy(p+copiedPointer, ((char*)message)+position, info->blocklen[index]*sizeof(info->types[0])); copiedPointer += info->blocklen[index]*sizeof(info->types[0]); } retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); @@ -72,7 +72,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta { sendType = _MPI_FindType(datatype); size = _MPI_TYPE_LIST[sendType].extent; - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); /* =================================== */ /* Figure out the correct ones to pass */ retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); @@ -82,7 +82,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta { sendType = _MPI_FindType(datatype); size = _MPI_TYPE_LIST[sendType].extent; - p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); + p = (char *)_MPI_safeMalloc(size, "Error with malloc for send buffer."); /* =================================== */ /* Figure out the correct ones to pass */ retval =_MPI_Buff_Insert(p, count, datatype, tag, comm); @@ -94,7 +94,7 @@ int PMPI_Send (void* message, int count, MPI_Datatype datatype, int dest, int ta MPI_Abort (comm, _MPI_NOT_OK); } } - } else { + } else { _MPI_ERR_ROUTINE (retval, "MPI_SEND / MPI_ISEND: argument error"); MPI_Abort (comm, retval); } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send_init.c index 1e32941d7a..49c525d9fb 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Send_init.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Send_init( void *buf, int count, MPI_Datatype datatype, int dest, +int PMPI_Send_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv.c index 5649ad3bc7..b366a9644e 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv.c @@ -18,8 +18,8 @@ #include "mpi.h" /*==========================================================================*/ -int PMPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, - int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, +int PMPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status ) { int retval; diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv_replace.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv_replace.c index 8a6ed564e3..c8214cf4b3 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv_replace.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Sendrecv_replace.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Sendrecv_replace( void *buf, int count, MPI_Datatype datatype, - int dest, int sendtag, int source, int recvtag, +int PMPI_Sendrecv_replace( void *buf, int count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ssend_init.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ssend_init.c index 41579bd36d..34ab0dca92 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ssend_init.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Ssend_init.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Ssend_init( void *buf, int count, MPI_Datatype datatype, int dest, +int PMPI_Ssend_init( void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Start.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Start.c index b64df78d4f..feedc05761 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Start.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Start.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Start( +int PMPI_Start( MPI_Request *request) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Startall.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Startall.c index dabc4886c6..23896259f9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Startall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Startall.c @@ -18,5 +18,6 @@ int PMPI_Startall( int count, MPI_Request array_of_requests[] ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_c2f.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_c2f.c index 50ae0bffc7..6411de3a00 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_c2f.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_c2f.c @@ -18,5 +18,6 @@ int PMPI_Status_c2f( MPI_Status *c_status, MPI_Fint *f_status ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_cancelled.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_cancelled.c index 501eb95d4d..0c773472c9 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_cancelled.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_cancelled.c @@ -18,5 +18,6 @@ int PMPI_Status_set_cancelled( MPI_Status *status, int flag ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_elements.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_elements.c index e9e114242c..e91e05bd83 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_elements.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Status_set_elements.c @@ -19,5 +19,6 @@ int PMPI_Status_set_elements( MPI_Status *status, MPI_Datatype datatype, int count ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test.c index 6ce04add47..6150cece83 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test.c @@ -14,25 +14,25 @@ #include "mpi.h" -int PMPI_Test ( +int PMPI_Test ( MPI_Request *request, int *flag, MPI_Status *status) { int err; - + /* defer to the code in Wait() */ err = PMPI_Wait(request,status); - + if ( err == MPI_ERR_TAG ) { /* could not match the request up, so assume not done */ *flag = 0; return MPI_SUCCESS; } - + /* Flag indicates message was sent */ if ( flag ) *flag = 1; - + return err; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test_cancelled.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test_cancelled.c index 7e3db9d784..1954ab9af6 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test_cancelled.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Test_cancelled.c @@ -15,10 +15,11 @@ #include "mpi.h" /* STUB */ -int PMPI_Test_cancelled( +int PMPI_Test_cancelled( MPI_Status *status, int *flag) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testall.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testall.c index e5b2234f42..4b338271f2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testall.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int PMPI_Testall( - int count, - MPI_Request array_of_requests[], - int *flag, +int PMPI_Testall( + int count, + MPI_Request array_of_requests[], + int *flag, MPI_Status array_of_statuses[] ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testany.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testany.c index 3d1d9c5b0b..8a39f95789 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testany.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testany.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int PMPI_Testany( - int count, - MPI_Request array_of_requests[], - int *index, int *flag, +int PMPI_Testany( + int count, + MPI_Request array_of_requests[], + int *index, int *flag, MPI_Status *status ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testsome.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testsome.c index 87bb83838c..7b578d4a2d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testsome.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Testsome.c @@ -14,11 +14,11 @@ #include "mpi.h" -int PMPI_Testsome( - int incount, - MPI_Request array_of_requests[], - int *outcount, - int array_of_indices[], +int PMPI_Testsome( + int incount, + MPI_Request array_of_requests[], + int *outcount, + int array_of_indices[], MPI_Status array_of_statuses[] ) { int i, j, num_active, flag, t; @@ -36,7 +36,7 @@ int PMPI_Testsome( t = PMPI_Test( array_of_requests+i, &flag, array_of_statuses+j ); if ( t != MPI_SUCCESS ) return t; - + if ( flag ) { array_of_indices[j] = i; @@ -45,9 +45,10 @@ int PMPI_Testsome( } } } - + if ( num_active == 0 ) *outcount = MPI_UNDEFINED; - + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Topo_test.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Topo_test.c index db1e6d0d27..1358037743 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Topo_test.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Topo_test.c @@ -18,5 +18,6 @@ int PMPI_Topo_test ( MPI_Comm comm, int *top_type ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_commit.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_commit.c index 03038ac48d..5ddd3933b5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_commit.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_commit.c @@ -17,5 +17,6 @@ /* Does not do anything */ int PMPI_Type_commit ( MPI_Datatype *datatype ) { - return MPI_SUCCESS; + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_contiguous.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_contiguous.c index 9117c0e1ef..e613a96181 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_contiguous.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_contiguous.c @@ -14,7 +14,7 @@ #include "mpi.h" -int PMPI_Type_contiguous( +int PMPI_Type_contiguous( int count, MPI_Datatype old_type, MPI_Datatype *newtype) @@ -48,6 +48,7 @@ int PMPI_Type_contiguous( currType->next = 0; prevType = currType; } - + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_darray.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_darray.c index 8943baae1d..e48aae09c1 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_darray.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_darray.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int PMPI_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, - MPI_Datatype *newtype) +int PMPI_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_indexed_block.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_indexed_block.c index 410836f04b..b1bd9e33ad 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_indexed_block.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_indexed_block.c @@ -15,13 +15,14 @@ #include "mpi.h" /* STUB */ -int PMPI_Type_create_indexed_block( - int count, - int blocklength, - int array_of_displacements[], - MPI_Datatype old_type, +int PMPI_Type_create_indexed_block( + int count, + int blocklength, + int array_of_displacements[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_subarray.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_subarray.c index b1b03fd800..bfe2aec27f 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_subarray.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_create_subarray.c @@ -16,14 +16,15 @@ /* STUB */ int PMPI_Type_create_subarray( - int ndims, - int *array_of_sizes, - int *array_of_subsizes, - int *array_of_starts, - int order, - MPI_Datatype oldtype, + int ndims, + int *array_of_sizes, + int *array_of_subsizes, + int *array_of_starts, + int order, + MPI_Datatype oldtype, MPI_Datatype *newtype) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_extent.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_extent.c index f8a3013bbc..446b543b26 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_extent.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_extent.c @@ -23,7 +23,7 @@ int PMPI_Type_extent( MPI_Datatype datatype, MPI_Aint *extent ) { index = _MPI_FindType (datatype); if (index == _MPI_NOT_OK) - { + { _MPI_ERR_ROUTINE (MPI_ERR_TYPE, "MPI_TYPE_SIZE: datatype error"); MPI_Abort (MPI_COMM_NULL, MPI_ERR_TYPE); } @@ -31,3 +31,4 @@ int PMPI_Type_extent( MPI_Datatype datatype, MPI_Aint *extent ) } } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_free.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_free.c index 8bc71e5262..0261a9556c 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_free.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_free.c @@ -21,3 +21,4 @@ int PMPI_Type_free ( MPI_Datatype *datatype ) { if ( datatype ) *datatype = _MPI_NOT_VALID; return retval; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_contents.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_contents.c index b484aaff4e..40b25a0321 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_contents.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_contents.c @@ -15,12 +15,12 @@ #include "mpi.h" int PMPI_Type_get_contents( - MPI_Datatype datatype, - int max_integers, - int max_addresses, - int max_datatypes, - int *array_of_integers, - MPI_Aint *array_of_addresses, + MPI_Datatype datatype, + int max_integers, + int max_addresses, + int max_datatypes, + int *array_of_integers, + MPI_Aint *array_of_addresses, MPI_Datatype *array_of_datatypes) { int index, position; @@ -43,7 +43,7 @@ int PMPI_Type_get_contents( (_MPI_TYPE_LIST[position].info->count < max_datatypes) ) { _MPI_ERR_ROUTINE (MPI_ERR_TYPE, "MPI_TYPE_GET_CONTENTS: invalid max_* error"); - MPI_Abort (MPI_COMM_NULL, MPI_ERR_TYPE); + MPI_Abort (MPI_COMM_NULL, MPI_ERR_TYPE); } if (_MPI_TYPE_LIST[position].sendType == _MPI_STRUCT) { @@ -65,3 +65,4 @@ int PMPI_Type_get_contents( } return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_envelope.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_envelope.c index 5623d9ef34..03b70b403d 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_envelope.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_get_envelope.c @@ -16,12 +16,13 @@ /* STUB */ int PMPI_Type_get_envelope( - MPI_Datatype datatype, - int *num_integers, - int *num_addresses, - int *num_datatypes, + MPI_Datatype datatype, + int *num_integers, + int *num_addresses, + int *num_datatypes, int *combiner) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hindexed.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hindexed.c index f364af006c..6d3a650152 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hindexed.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hindexed.c @@ -15,13 +15,14 @@ #include "mpi.h" /* STUB */ -int PMPI_Type_hindexed( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_type, +int PMPI_Type_hindexed( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hvector.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hvector.c index 52e19b6f46..bfb35148f2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hvector.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_hvector.c @@ -15,13 +15,14 @@ #include "mpi.h" /* STUB */ -int PMPI_Type_hvector( - int count, - int blocklen, - MPI_Aint stride, - MPI_Datatype old_type, +int PMPI_Type_hvector( + int count, + int blocklen, + MPI_Aint stride, + MPI_Datatype old_type, MPI_Datatype *newtype ) { fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_indexed.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_indexed.c index e528c61ed1..4cbd0cbaa2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_indexed.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_indexed.c @@ -15,11 +15,11 @@ #include "mpi.h" #include -int PMPI_Type_indexed( - int count, - int blocklens[], - int indices[], - MPI_Datatype old_type, +int PMPI_Type_indexed( + int count, + int blocklens[], + int indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ) { int index, i; @@ -53,11 +53,11 @@ int PMPI_Type_indexed( info = _MPI_TYPE_LIST[index].info; info->count = count; info->blocklen = (int *) _MPI_safeMalloc(sizeof(int)*count, "MPI_TYPE_INDEXED: Error with malloc");; - info->blocklen = memcpy(info->blocklen, blocklens, sizeof(int)*count); + info->blocklen = memcpy(info->blocklen, blocklens, sizeof(int)*count); info->stride = (int *) _MPI_safeMalloc(sizeof(int)*count, "MPI_TYPE_INDEXED: Error with malloc");; - info->stride = memcpy(info->stride, indices, sizeof(int)*count); + info->stride = memcpy(info->stride, indices, sizeof(int)*count); info->types = (int *) _MPI_safeMalloc(sizeof(MPI_Datatype), "MPI_TYPE_INDEXED: Error with malloc");; - info->types[0] = old_type; + info->types[0] = old_type; /* ================================ */ /* Create linked list of structures */ @@ -76,3 +76,4 @@ int PMPI_Type_indexed( return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_lb.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_lb.c index 37b48b90d8..323ecc024b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_lb.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_lb.c @@ -19,3 +19,4 @@ int PMPI_Type_lb ( MPI_Datatype datatype, MPI_Aint *displacement ) fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_size.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_size.c index 288a916fd5..b3b7aa37fd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_size.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_size.c @@ -27,9 +27,10 @@ int PMPI_Type_size ( MPI_Datatype datatype, int *size ) if (index == _MPI_NOT_OK) { _MPI_ERR_ROUTINE (MPI_ERR_TYPE, "MPI_TYPE_SIZE: datatype error"); - MPI_Abort (MPI_COMM_NULL, MPI_ERR_TYPE); + MPI_Abort (MPI_COMM_NULL, MPI_ERR_TYPE); } *size = _MPI_TYPE_LIST[index].extent; } return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_struct.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_struct.c index ca92cb9427..46b8f54292 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_struct.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_struct.c @@ -15,11 +15,11 @@ #include "mpi.h" #include -int PMPI_Type_struct( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_types[], +int PMPI_Type_struct( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_types[], MPI_Datatype *newtype ) { int index, i; @@ -29,11 +29,11 @@ int PMPI_Type_struct( _MPI_TYPE_DES* prevType; _MPI_TYPE_INFO* info; - /* KDD 6/2/16 Last entry of old_types must be MPI_UB to + /* KDD 6/2/16 Last entry of old_types must be MPI_UB to get the padding correct. */ nfields = count - 1; if (old_types[nfields] != MPI_UB) { - _MPI_ERR_ROUTINE (MPI_ERR_TYPE, + _MPI_ERR_ROUTINE (MPI_ERR_TYPE, "MPI_Type_struct: Must terminate type list with MPI_UB"); MPI_Abort(MPI_COMM_WORLD, MPI_ERR_TYPE); return _MPI_NOT_OK; @@ -42,7 +42,7 @@ int PMPI_Type_struct( index = _MPI_Find_free(); /* ===================================== */ /* Calculate total size of parts to copy */ - /* KDD 6/2/16 This size calc doesn't account for padding in the struct. + /* KDD 6/2/16 This size calc doesn't account for padding in the struct. KDD 6/2/16 Instead, we'll compute size based on the indices. KDD 6/2/16 We assume that the indices are terminated with MPI_UB, KDD 6/2/16 as recommended in MPI-1 documentation, so that indices @@ -61,8 +61,8 @@ int PMPI_Type_struct( /* ====================== */ /* Save Query information */ - /* KDD 6/2/16 To account for padding in the structure, the - * KDD 6/2/16 extent and ub should be related to the calculated size + /* KDD 6/2/16 To account for padding in the structure, the + * KDD 6/2/16 extent and ub should be related to the calculated size _MPI_TYPE_LIST[index].extent = indices[count-1]+(blocklens[count-1]*_MPI_getSize(old_types[count-1])); _MPI_TYPE_LIST[index].ub = indices[count-1]+(blocklens[count-1]*_MPI_getSize(old_types[count-1])); _MPI_TYPE_LIST[index].lb = indices[0]; @@ -91,7 +91,7 @@ int PMPI_Type_struct( currType = (_MPI_TYPE_DES *) _MPI_safeMalloc(sizeof(_MPI_TYPE_DES), "MPI_TYPE_STRUCT: Error with malloc"); prevType->next = currType; currType->id = old_types[i]; - /* KDD 6/2/16 use the actual extent provided by the indices + /* KDD 6/2/16 use the actual extent provided by the indices currType->extent = indices[i]+currType->size; */ currType->extent = indices[i+1]-indices[i]; @@ -110,5 +110,6 @@ int PMPI_Type_struct( currType->extent = 0; currType->next = 0; - return MPI_SUCCESS; + return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_ub.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_ub.c index 5496a01adf..5ea89b8c84 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_ub.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_ub.c @@ -19,3 +19,4 @@ int PMPI_Type_ub ( MPI_Datatype datatype, MPI_Aint *displacement ) fprintf(stderr,"%s:%d: NOT IMPLEMENTED\n",__FILE__,__LINE__); return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_vector.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_vector.c index 0321fe36b9..8e9a773a60 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_vector.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Type_vector.c @@ -14,11 +14,11 @@ #include "mpi.h" -int PMPI_Type_vector( - int count, - int blocklen, - int stride, - MPI_Datatype old_type, +int PMPI_Type_vector( + int count, + int blocklen, + int stride, + MPI_Datatype old_type, MPI_Datatype *newtype ) { int index; @@ -60,3 +60,4 @@ int PMPI_Type_vector( return MPI_SUCCESS; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Unpack.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Unpack.c index 5b6459246d..33e39f5f28 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Unpack.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Unpack.c @@ -15,9 +15,10 @@ #include "mpi.h" /* STUB */ -int PMPI_Unpack ( void *inbuf, int insize, int *position, - void *outbuf, int outcount, MPI_Datatype datatype, +int PMPI_Unpack ( void *inbuf, int insize, int *position, + void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm ) { - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wait.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wait.c index 087a84e3b9..c4ea8fc348 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wait.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wait.c @@ -41,10 +41,10 @@ int PMPI_Wait(MPI_Request* request, MPI_Status* status) { retval = PMPI_Recv((*request)->buffer, (*request)->count, (*request)->type, - _MPI_RANK, + _MPI_RANK, (*request)->tag, (*request)->comm, - &recv_status); + &recv_status); if ( retval == MPI_ERR_TAG && (*request)->cancel ) { /* no matching send and the recv request has been cancelled */ @@ -56,10 +56,10 @@ int PMPI_Wait(MPI_Request* request, MPI_Status* status) { return retval; } } - + /* Copy in the status */ if ( status && status != MPI_STATUS_IGNORE) { - status->MPI_SOURCE = _MPI_RANK; + status->MPI_SOURCE = _MPI_RANK; status->MPI_TAG = (*request)->tag; status->MPI_ERROR = MPI_SUCCESS; if ((*request)->send) { @@ -68,7 +68,7 @@ int PMPI_Wait(MPI_Request* request, MPI_Status* status) { status->__count = recv_status.__count; } } - + /* ----------------------------------------------- */ /* Mark the request available in the pool and then */ /* write REQUEST_NULL back into the original req */ @@ -80,3 +80,4 @@ int PMPI_Wait(MPI_Request* request, MPI_Status* status) { return MPI_SUCCESS; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitall.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitall.c index 06d2129728..827cf034fc 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitall.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitall.c @@ -25,7 +25,7 @@ int PMPI_Waitall( { int retval, i; - retval = _MPI_Check_Request_Array(count, array_of_requests); + retval = _MPI_Check_Request_Array(count, array_of_requests); if ( retval != MPI_SUCCESS ) return MPI_UNDEFINED; /* POLL THROUGH REQUESTS */ @@ -34,8 +34,9 @@ int PMPI_Waitall( retval = PMPI_Wait(array_of_requests+i,array_of_statuses+i); if (array_of_requests[i] != MPI_REQUEST_NULL) return retval; } - } + } return MPI_SUCCESS; - + } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitany.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitany.c index 803c449fd0..368f8d021b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitany.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitany.c @@ -21,7 +21,7 @@ int PMPI_Waitany( int count, MPI_Request array_of_requests[], int* index, MPI_Status* status) { int retval, i; - retval = _MPI_Check_Request_Array(count, array_of_requests); + retval = _MPI_Check_Request_Array(count, array_of_requests); if ( retval != MPI_SUCCESS ) return MPI_UNDEFINED; /* POLL THROUGH REQUESTS */ @@ -33,8 +33,9 @@ int PMPI_Waitany( int count, MPI_Request array_of_requests[], int* index, MPI_St return MPI_SUCCESS; } } - } + } return MPI_ERR_OTHER; - + } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitsome.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitsome.c index 9e7fed75df..ea91cfab48 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitsome.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Waitsome.c @@ -15,12 +15,13 @@ #include "mpi.h" /* STUB */ -int PMPI_Waitsome( - int incount, - MPI_Request array_of_requests[], - int *outcount, - int array_of_indices[], +int PMPI_Waitsome( + int incount, + MPI_Request array_of_requests[], + int *outcount, + int array_of_indices[], MPI_Status array_of_statuses[] ) { - return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); + return MPI_Abort((MPI_Comm)0, MPI_UNDEFINED); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wtick.c b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wtick.c index 9364264cd2..2fdbc65f7a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wtick.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/PMPI_Wtick.c @@ -23,3 +23,4 @@ double PMPI_Wtick(void) { return 1.0/(_SC_CLK_TCK); } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_BCAST.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_BCAST.c index 65fab05132..dff11ee96b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_BCAST.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_BCAST.c @@ -22,3 +22,4 @@ int MPI_Bcast ( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Co return PMPI_Bcast(buffer, count, datatype, root, comm); } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_COMM_UTIL.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_COMM_UTIL.c index d832ac03a4..a186a68c64 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_COMM_UTIL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_COMM_UTIL.c @@ -62,7 +62,7 @@ int _MPI_Comm_Invalid (int index) int _MPI_Comm_check (int index) { _MPI_COVERAGE(); -/* KDDKDDKDD WHY DO WE CHANGE THE VALIDITY HERE? +/* KDDKDDKDD WHY DO WE CHANGE THE VALIDITY HERE? _MPI_COMM_LIST[index].valid = _MPI_NOT_VALID; */ if ( (index == MPI_COMM_NULL)||(index==0) ) { @@ -126,3 +126,4 @@ int _MPI_Comm_check_legal (MPI_Comm comm, int *index) return MPI_ERR_COMM; } /*============================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_ERR_ROUTINE.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_ERR_ROUTINE.c index 22bdc18f57..b8867de5bb 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_ERR_ROUTINE.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_ERR_ROUTINE.c @@ -24,7 +24,7 @@ int _MPI_ERR_ROUTINE(MPI_Error_Class error, char* message) _MPI_COVERAGE(); #ifdef _MPI_DEBUG printf("ERROR: %d %s\n",error, message); -#endif +#endif return 0; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_OP_UTIL.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_OP_UTIL.c index 878a65e6ac..ae0fae4cd8 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_OP_UTIL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_OP_UTIL.c @@ -21,12 +21,12 @@ void _MPI_Default_Op ( void* a, void* b, int* len, MPI_Datatype* type ) { int size; _MPI_COVERAGE(); - size = _MPI_calculateSize(*len, *type); + size = _MPI_calculateSize(*len, *type); memcpy(b, a, size); } /*==========================================================================*/ -static void _MPI_Ops_init(int i) +void _MPI_Ops_init(int i) { _MPI_COVERAGE(); _MPI_OP_LIST[i].valid = _MPI_NOT_VALID; @@ -65,7 +65,7 @@ int _MPI_Op_insert (MPI_User_function* function, int commute, MPI_Op* id) { _MPI_OP_LIST = (_MPI_OP_TYPE*) _MPI_safeRealloc (_MPI_OP_LIST, (_MPI_OP_ARRAY_SIZE+_MPI_PREALLOCATION_SIZE)*sizeof(_MPI_OP_TYPE), - "Error in _MPI_Op_Insert for reallocation"); + "Error in _MPI_Op_Insert for reallocation"); for(j=0;j<_MPI_PREALLOCATION_SIZE;j++) { _MPI_COVERAGE(); @@ -78,11 +78,11 @@ int _MPI_Op_insert (MPI_User_function* function, int commute, MPI_Op* id) { _MPI_OP_LIST[i].function = function; _MPI_OP_LIST[i].commute = commute; - *id = i+_MPI_OP_OFFSET; + *id = i+_MPI_OP_OFFSET; _MPI_OP_COUNT++; _MPI_COVERAGE(); return MPI_SUCCESS; -} +} /*==========================================================================*/ int _MPI_checkOp(MPI_Op op) { @@ -138,7 +138,7 @@ int _MPI_Op_invalid(int index) int _MPI_check_overlap(void* sendbuf, void* recvbuf, int size) { _MPI_COVERAGE(); - if(sendbuf == recvbuf) { + if(sendbuf == recvbuf) { _MPI_COVERAGE(); return _MPI_NOT_OK; } @@ -154,3 +154,4 @@ int _MPI_check_overlap(void* sendbuf, void* recvbuf, int size) return MPI_SUCCESS; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_REQ_UTIL.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_REQ_UTIL.c index 3258206bcc..1b0c8ffa57 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_REQ_UTIL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_REQ_UTIL.c @@ -99,3 +99,4 @@ int _MPI_Check_Request_Array(int count, MPI_Request array[]) { } return _MPI_NOT_OK; } + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_SENDREC_UTIL.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_SENDREC_UTIL.c index 073aabd87d..090dab8016 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_SENDREC_UTIL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_SENDREC_UTIL.c @@ -170,7 +170,7 @@ int _MPI_calculateStructureSize (MPI_Datatype type) } datatype = &_MPI_TYPE_LIST[index]; - /* KDD 6/2/16 Comment below says this return value should be extent, + /* KDD 6/2/16 Comment below says this return value should be extent, KDD 6/2/16 not size. I agree. size = datatype->size; */ @@ -245,7 +245,7 @@ int _MPI_Buff_Insert(void *message,int count,MPI_Datatype datatype,int tag,MPI_C _MPI_DATA_BUFF = (_MPI_DATA_ENTRY*) _MPI_safeRealloc (_MPI_DATA_BUFF, - (_MPI_DATA_ARRAY_SIZE+_MPI_PREALLOCATION_SIZE)*sizeof(_MPI_DATA_ENTRY), + (_MPI_DATA_ARRAY_SIZE+_MPI_PREALLOCATION_SIZE)*sizeof(_MPI_DATA_ENTRY), "Error in _MPI_Buff_Insert for reallocation"); _MPI_DATA_ARRAY_SIZE+=_MPI_PREALLOCATION_SIZE; _MPI_DATA_BUFF[index].valid = _MPI_VALID; @@ -265,7 +265,7 @@ int _MPI_Data_Invalid(int index) { if(_MPI_DATA_BUFF[index].user==_MPI_TRUE) { ; } else { - _MPI_safeFree(_MPI_DATA_BUFF[index].buffer,"BUFF buffer"); + _MPI_safeFree(_MPI_DATA_BUFF[index].buffer,"BUFF buffer"); _MPI_DATA_BUFF[index].buffer = 0; } @@ -332,3 +332,4 @@ int _MPI_Buff_Find(int tag, MPI_Comm comm) { return _MPI_NOT_OK; } /*==========================================================================*/ + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_TYPE_UTIL.c b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_TYPE_UTIL.c index 83bd7c3cc0..0bd9a8931a 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_TYPE_UTIL.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/_MPI_TYPE_UTIL.c @@ -31,8 +31,8 @@ int _MPI_FindType (MPI_Datatype datatype) int index; _MPI_COVERAGE(); /* KDDKDD 11/4/14: changed loop max from _MPI_TYPE_COUNT to - * _MPI_TYPE_ARRAY_SIZE; _MPI_TYPE_LIST entries are freed and - * reused, so _MPI_TYPE_ARRAY_SIZE accurately gives the max + * _MPI_TYPE_ARRAY_SIZE; _MPI_TYPE_LIST entries are freed and + * reused, so _MPI_TYPE_ARRAY_SIZE accurately gives the max * entries to search */ for (index = 0; index < _MPI_TYPE_ARRAY_SIZE; index++) { @@ -42,7 +42,7 @@ int _MPI_FindType (MPI_Datatype datatype) _MPI_COVERAGE(); return index; } - } + } return _MPI_NOT_OK; } /*==========================================================================*/ @@ -62,7 +62,7 @@ int _MPI_Free_datatype (MPI_Datatype datatype) child = _MPI_TYPE_LIST[index].next; if ( child ) _MPI_deleteAll(child); _MPI_safeFree(_MPI_TYPE_LIST[index].info,"type info"); - /* + /* _MPI_safeFree(_MPI_TYPE_LIST[index].next,"type next"); */ @@ -90,8 +90,8 @@ int _MPI_Find_free (void) { int ret; _MPI_COVERAGE(); /* KDDKDD 11/4/14: changed loop max from _MPI_TYPE_COUNT to - * _MPI_TYPE_ARRAY_SIZE; _MPI_TYPE_LIST entries are freed and - * reused, so _MPI_TYPE_ARRAY_SIZE accurately gives the max + * _MPI_TYPE_ARRAY_SIZE; _MPI_TYPE_LIST entries are freed and + * reused, so _MPI_TYPE_ARRAY_SIZE accurately gives the max * entries to search */ for (i=0; i<_MPI_TYPE_ARRAY_SIZE; i++) { _MPI_COVERAGE(); @@ -122,3 +122,6 @@ int _MPI_checkSendType (MPI_Datatype type) { return _MPI_TYPE_LIST[index].sendType; } /*==========================================================================*/ + + + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/fortran_grinder.c b/packages/zoltan/siMPI/pyMPI/siMPI/fortran_grinder.c index 1f316b419c..1025ea97d5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/fortran_grinder.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/fortran_grinder.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "mpi_config.h" @@ -200,7 +201,7 @@ int main(int argc, char** argv) { puts("#include \"mpi.h\""); puts("#include \"mpi_config.h\""); puts("#include \"mpi_implementation.h\""); - + if ( body ) { mangle(ident,mangled); printf("void %s%s\n",mangled,body); @@ -210,7 +211,7 @@ int main(int argc, char** argv) { return 0; } } + - - return 0; + return 0; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/fortran_parameterize.c b/packages/zoltan/siMPI/pyMPI/siMPI/fortran_parameterize.c index 6d13da2fcf..e73439c5d5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/fortran_parameterize.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/fortran_parameterize.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include "mpi_config.h" @@ -91,7 +91,7 @@ int main(int argc, char** argv) { printf(" %s\n",args); } } + - - return 0; + return 0; } diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/kdd_mpi_config.h b/packages/zoltan/siMPI/pyMPI/siMPI/kdd_mpi_config.h index bd578bbc13..b5231a512b 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/kdd_mpi_config.h +++ b/packages/zoltan/siMPI/pyMPI/siMPI/kdd_mpi_config.h @@ -6,7 +6,7 @@ * Revision: 1.2 $ ****************************************************************************/ /* mpi_config.h generated by Karen Devine 1 March 2005 */ -/* For now, just manually define the values. We may do +/* For now, just manually define the values. We may do * something more intelligent later (particularly wrt fortran mangling) * based on Mitchell's F90 interface for Zoltan. * diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_config.h b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_config.h index e722469883..16a130cb89 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_config.h +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_config.h @@ -6,7 +6,7 @@ * Revision: 1.2 $ ****************************************************************************/ /* mpi_config.h generated by Karen Devine 1 March 2005 */ -/* For now, just manually define the values. We may do +/* For now, just manually define the values. We may do * something more intelligent later (particularly wrt fortran mangling) * based on Mitchell's F90 interface for Zoltan. * diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_implementation.h b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_implementation.h index 157093cbd7..0290dea0a5 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_implementation.h +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_implementation.h @@ -9,14 +9,13 @@ /* FILE *********** mpi_implementation.h ********************/ /******************************************************************/ /* Author : Lisa Alano June 18 2002 */ -/* Copyright (c) 2002, 2023 University of California Regents */ +/* Copyright (c) 2002 University of California Regents */ /******************************************************************/ #ifndef _MPI_IMPL_H #define _MPI_IMPL_H #ifdef __cplusplus - // NOLINTBEGIN extern "C" { #endif @@ -47,7 +46,7 @@ extern "C" { #define _MPI_NOT_VALID (-500) #define _MPI_NULL (-1) -#define _MPI_OP_START (MPI_MAX) +#define _MPI_OP_START (MPI_MAX) #define _MPI_OP_END (MPI_MAXLOC) #define _MPI_OP_OFFSET (_MPI_OP_END+1) #define _MPI_TYPE_START (MPI_CHAR) @@ -134,7 +133,7 @@ typedef struct _MPI_COMM_IMPL { int valid; MPI_Handler_function_pointer handler; /*MPI_Handler_function handler;*/ - MPI_Group group; + MPI_Group group; } _MPI_COMM_IMPL; typedef struct _MPI_TYPE_DES { @@ -158,13 +157,13 @@ typedef struct _MPI_DATA_ENTRY { int count; MPI_Datatype type; int tag; - MPI_Comm comm; + MPI_Comm comm; int user; /*Lets you know if you should free the buffer. No, if it is the user's buffer*/ } _MPI_DATA_ENTRY; typedef struct _MPI_OP_TYPE { int valid; - void (*function) ( void * a, void * b, int * len, MPI_Datatype * ); + void (*function) ( void * a, void * b, int * len, MPI_Datatype * ); int commute; } _MPI_OP_TYPE; @@ -258,7 +257,6 @@ int _MPI_Find_free (void); #ifdef __cplusplus } - // NOLINTEND #endif #endif diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_profile.h b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_profile.h index 2cd7c781b0..c1283c9bf2 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_profile.h +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_profile.h @@ -45,8 +45,8 @@ int PMPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, int PMPI_Wait ( MPI_Request* request, MPI_Status* status); int PMPI_Waitany( int count, MPI_Request array_of_requests[], int* index, MPI_Status* status); int PMPI_Waitall( - int count, - MPI_Request array_of_requests[], + int count, + MPI_Request array_of_requests[], MPI_Status array_of_statuses[] ); @@ -377,86 +377,86 @@ int PMPI_Testsome( MPI_Status array_of_statuses[] ); int PMPI_Topo_test ( MPI_Comm comm, int *top_type ); int PMPI_Type_commit ( MPI_Datatype *datatype ); -int PMPI_Type_contiguous( +int PMPI_Type_contiguous( int count, MPI_Datatype old_type, MPI_Datatype *newtype); -int PMPI_Type_create_darray(int size, int rank, int ndims, - int *array_of_gsizes, int *array_of_distribs, - int *array_of_dargs, int *array_of_psizes, - int order, MPI_Datatype oldtype, +int PMPI_Type_create_darray(int size, int rank, int ndims, + int *array_of_gsizes, int *array_of_distribs, + int *array_of_dargs, int *array_of_psizes, + int order, MPI_Datatype oldtype, MPI_Datatype *newtype); -int PMPI_Type_create_indexed_block( - int count, - int blocklength, - int array_of_displacements[], - MPI_Datatype old_type, +int PMPI_Type_create_indexed_block( + int count, + int blocklength, + int array_of_displacements[], + MPI_Datatype old_type, MPI_Datatype *newtype ); int PMPI_Type_create_subarray( - int ndims, - int *array_of_sizes, - int *array_of_subsizes, - int *array_of_starts, - int order, - MPI_Datatype oldtype, + int ndims, + int *array_of_sizes, + int *array_of_subsizes, + int *array_of_starts, + int order, + MPI_Datatype oldtype, MPI_Datatype *newtype); int PMPI_Type_extent( MPI_Datatype datatype, MPI_Aint *extent ); int PMPI_Type_free ( MPI_Datatype *datatype ); int PMPI_Type_get_contents( - MPI_Datatype datatype, - int max_integers, - int max_addresses, - int max_datatypes, - int *array_of_integers, - MPI_Aint *array_of_addresses, + MPI_Datatype datatype, + int max_integers, + int max_addresses, + int max_datatypes, + int *array_of_integers, + MPI_Aint *array_of_addresses, MPI_Datatype *array_of_datatypes); int PMPI_Type_get_envelope( - MPI_Datatype datatype, - int *num_integers, - int *num_addresses, - int *num_datatypes, + MPI_Datatype datatype, + int *num_integers, + int *num_addresses, + int *num_datatypes, int *combiner); -int PMPI_Type_hindexed( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_type, +int PMPI_Type_hindexed( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ); -int PMPI_Type_hvector( - int count, - int blocklen, - MPI_Aint stride, - MPI_Datatype old_type, +int PMPI_Type_hvector( + int count, + int blocklen, + MPI_Aint stride, + MPI_Datatype old_type, MPI_Datatype *newtype ); -int PMPI_Type_indexed( - int count, - int blocklens[], - int indices[], - MPI_Datatype old_type, +int PMPI_Type_indexed( + int count, + int blocklens[], + int indices[], + MPI_Datatype old_type, MPI_Datatype *newtype ); int PMPI_Type_lb ( MPI_Datatype datatype, MPI_Aint *displacement ); int PMPI_Type_size ( MPI_Datatype datatype, int *size ); -int PMPI_Type_struct( - int count, - int blocklens[], - MPI_Aint indices[], - MPI_Datatype old_types[], +int PMPI_Type_struct( + int count, + int blocklens[], + MPI_Aint indices[], + MPI_Datatype old_types[], MPI_Datatype *newtype ); int PMPI_Type_ub ( MPI_Datatype datatype, MPI_Aint *displacement ); -int PMPI_Type_vector( - int count, - int blocklen, - int stride, - MPI_Datatype old_type, +int PMPI_Type_vector( + int count, + int blocklen, + int stride, + MPI_Datatype old_type, MPI_Datatype *newtype ); -int PMPI_Unpack ( void *inbuf, int insize, int *position, - void *outbuf, int outcount, MPI_Datatype datatype, +int PMPI_Unpack ( void *inbuf, int insize, int *position, + void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm ); -int PMPI_Waitsome( - int incount, - MPI_Request array_of_requests[], - int *outcount, - int array_of_indices[], +int PMPI_Waitsome( + int incount, + MPI_Request array_of_requests[], + int *outcount, + int array_of_indices[], MPI_Status array_of_statuses[] ); double PMPI_Wtick(void); double PMPI_Wtime(void); diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_prototypes.h b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_prototypes.h index 8d8c9e46ac..51844d62b4 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpi_prototypes.h +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpi_prototypes.h @@ -45,8 +45,8 @@ int MPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPI_Wait ( MPI_Request* request, MPI_Status* status); int MPI_Waitany( int count, MPI_Request array_of_requests[], int* index, MPI_Status* status); int MPI_Waitall( - int count, - MPI_Request array_of_requests[], + int count, + MPI_Request array_of_requests[], MPI_Status array_of_statuses[] ); diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpicc.c b/packages/zoltan/siMPI/pyMPI/siMPI/mpicc.c index 424ce31ccf..37a23d14cd 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpicc.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpicc.c @@ -70,7 +70,7 @@ int main(int argc, char** argv) { arguments[argc++] = lib_library; } arguments[argc] = 0; - + /* ----------------------------------------------- */ /* In verbose mode, echo the command */ diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/mpif77.c b/packages/zoltan/siMPI/pyMPI/siMPI/mpif77.c index 2083f0b819..5205546540 100644 --- a/packages/zoltan/siMPI/pyMPI/siMPI/mpif77.c +++ b/packages/zoltan/siMPI/pyMPI/siMPI/mpif77.c @@ -7,3 +7,5 @@ ****************************************************************************/ #define COMPILER_PATH F77PATH #include "mpicc.c" + + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/aaa.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/aaa.c new file mode 100644 index 0000000000..858e4da31c --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/aaa.c @@ -0,0 +1,17 @@ +/*TEST +CCFLAGS="" +OUTPUT="""siMPI running on rank 0 +""" +STATUS=0 +TEST*/ + +#include "mpi.h" + +int main(int argc, char** argv) { + int rank; + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD,&rank); + printf("siMPI running on rank %d\n",rank); + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/monteCarloPi.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/monteCarloPi.c new file mode 100644 index 0000000000..18f243daa6 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/monteCarloPi.c @@ -0,0 +1,112 @@ + +/*TEST +SKIP=1 +PATH='tests/monteCarloPi.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/* compute pi using Monte Carlo method */ +#include +#include "mpi.h" +/* #include "mpe.h" */ +#define CHUNKSIZE 1000 +/* message tags */ +#define REQUEST 1 +#define REPLY 2 +#define INT_MAX 4 + +int main( int argc, char* argv[] ) +{ + int iter; + int in, out, i, iters, max, ix, iy, ranks[1], done, temp; + double x, y, Pi, error, epsilon; + int numprocs, myid, server, totalin, totalout, workerid; + int rands[CHUNKSIZE], request=0; + MPI_Comm world, workers; + MPI_Group world_group, worker_group; + MPI_Status status; + + MPI_Init(&argc,&argv); + world = MPI_COMM_WORLD; + MPI_Comm_size(world,&numprocs); + MPI_Comm_rank(world,&myid); + server = numprocs-1; /*last proc is server*/ + if (myid == 0) + sscanf( argv[1], "%lf", &epsilon ); + MPI_Bcast( &epsilon, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD ); + MPI_Comm_group( world, &world_group ); + ranks[0] - server; + MPI_Group_excl( world_group, 1, ranks, &worker_group ); + MPI_Comm_create( world, worker_group, &workers ); + MPI_Group_free(&worker_group); + + if (myid == server) /*I am the rand server*/ + { + do + { + MPI_Recv(&request, 1, MPI_INT, MPI_ANY_SOURCE, REQUEST, world, &status); + if (request) + { + for (i=0; i< CHUNKSIZE; i++) + ranks[i]=random(); + MPI_Send(rands, CHUNKSIZE, MPI_INT, status.MPI_SOURCE, REPLY, world); + } + } + while( request>0); + } + else /*I am a worker process*/ + { + request = 1; + done = in = out = 0; + max = INT_MAX; /*max int, for normalization*/ + MPI_Send( &request, 1, MPI_INT, server, REQUEST, world ); + MPI_Comm_rank( workers, &workerid ); + iter = 0; + while (!done) + { + iter++; + request = 1; + MPI_Recv( rands, CHUNKSIZE, MPI_INT, server, REPLY, world, &status ); + for (i=0; i 1000000); + request = (done) ? 0 : 1; + if (myid == 0) + { + printf( "\rpi = %23.20f", Pi ); + MPI_Send( &request, 1, MPI_INT, server, REQUEST, world ); + } else { + if (request) + MPI_Send(&request, 1, MPI_INT, server, REQUEST, world ); + } + } + } + if (myid == server) /*I am the rand server*/ + { + ; + } else { /*I am a worker process*/ + ; + } + if (myid == 0) + { + printf("\npoints: %d\nin: %d, out: %d, to exit\n", totalin+totalout, totalin, totalout ); + getchar(); + } + MPI_Comm_free(&workers); + MPI_Finalize(); + +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/ohioTest.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/ohioTest.c new file mode 100644 index 0000000000..d2830abcca --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/ohioTest.c @@ -0,0 +1,59 @@ + +/*TEST +PATH='tests/ohioTest.c' +CCFLAGS="" +INPUT="" +OUTPUT='PE:0 result is 1.000000 + 2.000000i\n' +STATUS=0 +SKIP=1 +TEST*/ + +#include +#include "mpi.h" + +/* Ohio Supercomputer Center */ + +/* Modified to single rank -- pjm */ + + +typedef struct { + double real,imag; +} complex; + +void cprod(complex *in, complex *inout, int *len, MPI_Datatype *dptr) { + int i; + complex c; + + for (i=0; i<*len; ++i) { + c.real=(*in).real * (*inout).real - (*in).imag * (*inout).imag; + c.imag=(*in).real * (*inout).imag + (*in).imag * (*inout).real; + *inout=c; + in++; + inout++; + } +} + +int main (int argc, char *argv[]) { + int rank; + int root; + complex source,result; + + MPI_Op myop; + MPI_Datatype ctype; + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD,&rank); + + MPI_Type_contiguous(2,MPI_DOUBLE,&ctype); + MPI_Type_commit(&ctype); + MPI_Op_create(cprod,1,&myop); + root=0; + source.real=rank+1; + source.imag=rank+2; + result.real = 0; + result.imag = 0; + MPI_Reduce(&source,&result,1,ctype,myop,root,MPI_COMM_WORLD); + if(rank==root) printf ("PE:%d result is %lf + %lfi\n",rank, result.real, result.imag); + MPI_Finalize(); +} + +/* PE:0 result is 1.000000 + 2.000000i */ diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/simplePi.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/simplePi.c new file mode 100644 index 0000000000..f8f54e9bdd --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/simplePi.c @@ -0,0 +1,53 @@ + +/*TEST +PATH='tests/simplePi.c' +CCFLAGS="" +INPUT="10\n0\n" +OUTPUT='Enter the number of intervals: (0 quits)\npi is approximately 3.1424, Error is 0.0008\nEnter the number of intervals: (0 quits)\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** simplePi.c ********************/ +/******************************************************************/ +/* Authors: William Gropp, Ewing Lusk */ +/* Argonne National Laboratory */ +/* http://www-unix.mcs.anl.gov/mpi/tutorial/mpiintro/ppframe.htm */ +/******************************************************************/ +/******************************************************************/ + +#include +#include "mpi.h" + +int main(int argc, char *argv[]) +{ + int done = 0, n, myid, numprocs, i, rc; + double PI25DT = 3.141592653589793238462643; + double mypi, pi, h, sum, x, a; + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + while(!done) { + if (myid == 0) { + printf("Enter the number of intervals: (0 quits)\n"); + scanf("%d", &n); + } + MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD); + if (n == 0) break; + h = 1.0/ (double) n; + sum = 0.0; + for (i = myid+1; i<=n; i+=numprocs) { + x = h * ((double)i-0.5); + sum += 4.0 / (1.0 + x*x); + } + mypi = h * sum; + MPI_Reduce (&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); + if (myid == 0) + printf("pi is approximately %6.4f, Error is %6.4f\n", pi, fabs(pi-PI25DT)); + /* abs should be fabs */ + } + MPI_Finalize(); + return 0; +} + + diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized0.c new file mode 100644 index 0000000000..e70f0b2116 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized0.c @@ -0,0 +1,37 @@ + +/*TEST +PATH='tests/testFinalized0.c' +CCFLAGS="" +INPUT="" +OUTPUT='flag = 1\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testFinalized0.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 25 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = flag = 1 +STATUS = 0 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int flag; + MPI_Init(&argc, &argv); + MPI_Finalize(); + MPI_Finalized(&flag); + printf ("flag = %d\n",flag); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized1.c new file mode 100644 index 0000000000..48dd3d6c3b --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized1.c @@ -0,0 +1,36 @@ + +/*TEST +PATH='tests/testFinalized1.c' +CCFLAGS="" +INPUT="" +OUTPUT='flag = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testFinalized1.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 25 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = flag = 0 +STATUS = 0 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int flag; + MPI_Init(&argc, &argv); + MPI_Finalized(&flag); + printf ("flag = %d\n",flag); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized2.c new file mode 100644 index 0000000000..51b8284897 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testFinalized2.c @@ -0,0 +1,27 @@ + +/*TEST +PATH='tests/testFinalized2.c' +CCFLAGS="" +INPUT="" +OUTPUT="ERROR: -5016 MPI_FINALIZED: Invalid pointer.\nERROR: -5015 MPI aborting...\n" +STATUS=1 +TEST*/ + +/******************************************************************/ +/* FILE *********** testFinalized2.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 25 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + MPI_Init(&argc, &argv); + MPI_Finalized(NULL); + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize0.c new file mode 100644 index 0000000000..50fa912c11 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize0.c @@ -0,0 +1,34 @@ + +/*TEST +PATH='tests/testInitFinalize0.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testInitFinalize0.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = None +STATUS = 0 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + MPI_Init(&argc, &argv); + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize1.c new file mode 100644 index 0000000000..9ee3f28337 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize1.c @@ -0,0 +1,26 @@ + +/*TEST +PATH='tests/testInitFinalize1.c' +CCFLAGS="" +INPUT="" +OUTPUT="ERROR: -5016 MPI was already finalized\nERROR: -5016 Error with Init status.\nERROR: -5016 MPI aborting..." +STATUS=1 +TEST*/ + +/******************************************************************/ +/* FILE *********** testInitFinalize1.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano June 7 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include "mpi.h" + +int main(int argc, char**argv) +{ + MPI_Init(&argc, &argv); + MPI_Finalize(); + MPI_Init(&argc, &argv); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize2.c new file mode 100644 index 0000000000..d7d0b12422 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize2.c @@ -0,0 +1,24 @@ +/*TEST +PATH='tests/testFinalized2.c' +CCFLAGS="" +INPUT="" +OUTPUT="ERROR: -5016 MPI_FINALIZE: MPI has not been initialized.\nERROR: -5016 MPI aborting...\n" +STATUS=1 +TEST*/ + + +/******************************************************************/ +/* FILE *********** testInitFinalize2.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano June 7 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include "mpi.h" + +int main(int argc, char**argv) +{ + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize3.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize3.c new file mode 100644 index 0000000000..075afa0602 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitFinalize3.c @@ -0,0 +1,24 @@ + +/*TEST +PATH='tests/testInitFinalize3.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testInitFinalize3.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano June 7 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include "mpi.h" + +int main(int argc, char**argv) +{ + MPI_Init(&argc, &argv); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized0.c new file mode 100644 index 0000000000..a501a3e3d7 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized0.c @@ -0,0 +1,37 @@ + +/*TEST +PATH='tests/testInitialized0.c' +CCFLAGS="" +INPUT="" +OUTPUT='flag = 1\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testInitialized0.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 25 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = flag = 1 +STATUS = 0 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int flag; + MPI_Init(&argc, &argv); + MPI_Initialized(&flag); + MPI_Finalize(); + printf ("flag = %d\n",flag); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized1.c new file mode 100644 index 0000000000..9ed24e85b1 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testInitialized1.c @@ -0,0 +1,35 @@ + +/*TEST +PATH='tests/testInitialized1.c' +CCFLAGS="" +INPUT="" +OUTPUT='flag = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testInitialized1.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 25 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = flag = 0 +STATUS = 0 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int flag; + MPI_Initialized(&flag); + printf ("flag = %d\n",flag); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend0.c new file mode 100644 index 0000000000..6b7e6819c4 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend0.c @@ -0,0 +1,57 @@ + +/*TEST +PATH='tests/testIsend0.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend0.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request srequest; + MPI_Request rrequest; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD, &srequest); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &rrequest); + MPI_Wait(&rrequest,&status); + MPI_Wait(&srequest,&status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend1.c new file mode 100644 index 0000000000..57e94e78fc --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend1.c @@ -0,0 +1,60 @@ + +/*TEST +PATH='tests/testIsend1.c' +CCFLAGS="" +INPUT="" +OUTPUT='First-> \nSecond-> Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend1.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +STATUS = 0 +OUTPUT = +First-> +Second-> Hello there +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + sprintf(message2, ""); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + printf("First-> %s\n", message2); + MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD, &request); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + MPI_Wait(&request,&status); + printf("Second-> %s\n", message2); + + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend2.c new file mode 100644 index 0000000000..9896cfa374 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend2.c @@ -0,0 +1,54 @@ + +/*TEST +PATH='tests/testIsend2.c' +CCFLAGS="" +INPUT="" +OUTPUT='request->valid = 500\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend2.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = request-> = 0 + +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + printf("request->valid = %d\n",request->valid); + + /*printf("%s\n", message2);*/ /*This will be garbage*/ + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend3.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend3.c new file mode 100644 index 0000000000..3cbf7c8854 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend3.c @@ -0,0 +1,55 @@ + +/*TEST +SKIP=1 +PATH='tests/testIsend3.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend3.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = ERROR: -5003 MPI_SEND argument error + ERROR: -5003 MPI aborting... +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Isend(message1, strlen(message1)+1, -100, dest, tag, MPI_COMM_WORLD, &request); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend4.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend4.c new file mode 100644 index 0000000000..7806206cd4 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend4.c @@ -0,0 +1,55 @@ + +/*TEST +SKIP=1 +PATH='tests/testIsend4.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend4.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = ERROR: -5005 MPI_SEND argument error + ERROR: -5005 MPI aborting... +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_NULL, &request); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend5.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend5.c new file mode 100644 index 0000000000..98418c635e --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend5.c @@ -0,0 +1,55 @@ + +/*TEST +SKIP=1 +PATH='tests/testIsend5.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend5.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = ERROR: -5005 MPI_SEND argument error + ERROR: -5005 MPI aborting... +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD, &request); + MPI_Irecv(message2, 50, MPI_CHAR, 2, tag, MPI_COMM_WORLD, &request); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend6.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend6.c new file mode 100644 index 0000000000..377ed10e08 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend6.c @@ -0,0 +1,48 @@ + +/*TEST +PATH='tests/testIsend6.c' +CCFLAGS="" +INPUT="" +OUTPUT='Isend = 0\nHello there\nIrecv = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend6.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag, retval; + MPI_Request srequest,rrequest; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + retval = MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD, &srequest); + printf("Isend = %d\n", retval); + retval = MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &rrequest); + MPI_Wait(&rrequest,&status); + printf("%s\n", message2); + printf("Irecv = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend7.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend7.c new file mode 100644 index 0000000000..d54c0f7a3e --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testIsend7.c @@ -0,0 +1,51 @@ + +/*TEST +PATH='tests/testIsend7.c' +CCFLAGS="" +INPUT="" +OUTPUT='Irecv = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testIsend7.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Irecv = -5017 +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag, retval; + MPI_Request request; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + retval = MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request); + printf("Irecv = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize0.c new file mode 100644 index 0000000000..d1e721b26e --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize0.c @@ -0,0 +1,39 @@ + +/*TEST +PATH='tests/testRankSize0.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize0.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = None +STATUS = 1 +#endif + + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize1.c new file mode 100644 index 0000000000..0c754b68d4 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize1.c @@ -0,0 +1,45 @@ + +/*TEST +PATH='tests/testRankSize1.c' +CCFLAGS="" +INPUT="" +OUTPUT='My_rank is 0.\nThe number of processes is 1.\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize1.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Error with my_rank (double instead of int). +STATUS = 1 +#endif + + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + printf("My_rank is %d.\n",my_rank); + printf("The number of processes is %d.\n",p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize2.c new file mode 100644 index 0000000000..2e7ad0d2ca --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize2.c @@ -0,0 +1,46 @@ + +/*TEST +PATH='tests/testRankSize2.c' +CCFLAGS="" +INPUT="" +OUTPUT='My_rank is 0.\nThe number of processes is 1.\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize2.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = My rank is 0. The number of processes is 1. +STATUS = 0 +#endif + + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + my_rank = 99; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + printf("My_rank is %d.\n",my_rank); + printf("The number of processes is %d.\n",p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize3.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize3.c new file mode 100644 index 0000000000..022cc74543 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize3.c @@ -0,0 +1,46 @@ + +/*TEST +SKIP=1 +PATH='tests/testRankSize3.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize3.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = MPI_Comm_Null to get my_rank. +STATUS = 1 +#endif + + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_NULL, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + printf("My_rank is %d.\n",my_rank); + printf("The number of processes is %d.\n",p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize4.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize4.c new file mode 100644 index 0000000000..b2a7a83b8e --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize4.c @@ -0,0 +1,46 @@ + +/*TEST +SKIP=1 +PATH='tests/testRankSize4.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize4.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = MPI_Comm_Null to get comm_size. +STATUS = 1 +#endif + + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_NULL, &p); + + printf("My_rank is %d.\n",my_rank); + printf("The number of processes is %d.\n",p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize5.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize5.c new file mode 100644 index 0000000000..f34ebf7df3 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize5.c @@ -0,0 +1,34 @@ + +/*TEST +PATH='tests/testRankSize5.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize5.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + my_rank = 99; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize6.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize6.c new file mode 100644 index 0000000000..a9187d14cf --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize6.c @@ -0,0 +1,34 @@ + +/*TEST +PATH='tests/testRankSize6.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize6.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + my_rank = 99; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize7.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize7.c new file mode 100644 index 0000000000..d8e37b1da1 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testRankSize7.c @@ -0,0 +1,38 @@ + +/*TEST +SKIP=1 +PATH='tests/testRankSize7.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testRankSize7.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = No MPI_Init call. +STATUS = 1 +#endif + +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce0.c new file mode 100644 index 0000000000..ecfe02e259 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce0.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testReduce0.c' +CCFLAGS="" +INPUT="" +OUTPUT='myNumber = 1010 and total = 222\nmyNumber = 1010 and total = 1010\nretval = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testReduce0.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 16 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = myNumber = 1010 and total = 222 + myNumber = 1010 and total = 1010 + retval = 0 +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + int myNumber, total; + int retval; + + myNumber = 1010; + total = 222; + printf("myNumber = %d and total = %d\n", myNumber, total); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + retval = MPI_Reduce (&myNumber, &total, 1, MPI_INT, MPI_SUM, my_rank, MPI_COMM_WORLD); + printf("myNumber = %d and total = %d\n", myNumber, total); + printf("retval = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce1.c new file mode 100644 index 0000000000..bc2327eb3f --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce1.c @@ -0,0 +1,53 @@ + +/*TEST +SKIP=1 +PATH='tests/testReduce1.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testReduce1.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 16 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = myNumber = 1010 and total = 222 + ERROR: -5001 MPI_REDUCE : Invalid buffer pointer: Arguments must specify different buffers (no aliasing) + ERROR: -5001 MPI aborting... +STATUS = 1 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + int myNumber, total; + int retval; + + myNumber = 1010; + total = 222; + printf("myNumber = %d and total = %d\n", myNumber, total); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + retval = MPI_Reduce (&myNumber, &myNumber, 1, MPI_INT, MPI_SUM, my_rank, MPI_COMM_WORLD); + printf("myNumber = %d and total = %d\n", myNumber, total); + printf("retval = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce2.c new file mode 100644 index 0000000000..4dae5197a8 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce2.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testReduce2.c' +CCFLAGS="" +INPUT="" +OUTPUT='myNumber = 1010 and total = 222\nmyNumber = 1010 and total = 1010\nretval = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testReduce3.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 16 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = myNumber = 1010 and total = 222 + myNumber = 1010 and total = 1010 + retval = 0 +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + int myNumber, total; + int retval; + + myNumber = 1010; + total = 222; + printf("myNumber = %d and total = %d\n", myNumber, total); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + retval = MPI_Reduce (&myNumber, &total, 1, MPI_INT, MPI_MAX, my_rank, MPI_COMM_WORLD); + printf("myNumber = %d and total = %d\n", myNumber, total); + printf("retval = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce3.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce3.c new file mode 100644 index 0000000000..4f56e60cd4 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce3.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testReduce3.c' +CCFLAGS="" +INPUT="" +OUTPUT='myNumber = 1010 and total = 222\nmyNumber = 1010 and total = 1010\nretval = 0\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testReduce3.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 16 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = myNumber = 1010 and total = 222 + myNumber = 1010 and total = 1010 + retval = 0 +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + int myNumber, total; + int retval; + + myNumber = 1010; + total = 222; + printf("myNumber = %d and total = %d\n", myNumber, total); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + retval = MPI_Reduce (&myNumber, &total, 1, MPI_INT, MPI_MAXLOC, my_rank, MPI_COMM_WORLD); + printf("myNumber = %d and total = %d\n", myNumber, total); + printf("retval = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce4.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce4.c new file mode 100644 index 0000000000..a20af8f810 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testReduce4.c @@ -0,0 +1,55 @@ + +/*TEST +SKIP=1 +PATH='tests/testReduce4.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testReduce4.c ********************/ +/******************************************************************/ +/* Author : Lisa ALano July 16 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = myNumber = 1010 and total = 222 + myNumber = 1010 and total = 1010 + retval = 0 +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + int myNumber, total; + int retval; + int MPI_MYMAX; + + MPI_MYMAX = 12; + myNumber = 1010; + total = 222; + printf("myNumber = %d and total = %d\n", myNumber, total); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + retval = MPI_Reduce (&myNumber, &total, 1, MPI_INT, MPI_MYMAX, my_rank, MPI_COMM_WORLD); + printf("myNumber = %d and total = %d\n", myNumber, total); + printf("retval = %d\n", retval); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv0.c new file mode 100644 index 0000000000..6f204d955c --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv0.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testSendRecv0.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv0.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv1.c new file mode 100644 index 0000000000..3cc49ccfc5 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv1.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testSendRecv1.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv1.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there + Although they use the same buffer for send and recv. +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message1, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message1); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv10.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv10.c new file mode 100644 index 0000000000..6afce75cab --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv10.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testSendRecv10.c' +CCFLAGS="" +INPUT="" +OUTPUT='0 1 2 3 4 5 6 7 8 9 \n--\n0 1 2 3 4 5 6 7 8 9\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv10.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p, i; + char message1[15]; + char message2[15]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + for(i = 0 ; i < 10 ; i++) { + message1[i] = i; + } + for(i=0; i<10; i++) { + printf("%d ", message1[i]); + } + printf("\n--\n"); + source = tag = dest = 0; + MPI_Send(message1, 15, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 15, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + for(i=0; i<10; i++) + { + printf("%d ", message2[i]); + } + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv11.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv11.c new file mode 100644 index 0000000000..970c39268f --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv11.c @@ -0,0 +1,57 @@ + +/*TEST +PATH='tests/testSendRecv11.c' +CCFLAGS="" +INPUT="" +OUTPUT='0 1 2 3 4 5 6 7 8 9 \n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv11.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = 0 1 2 3 4 5 6 7 8 9 +STATUS = 0 +#endif + +#include +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p, i; + int message1[15]; + int message2[15]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + for (i=0; i<10; i++) + message1[i] = i; + + source = tag = dest = 0; + MPI_Send(message1, 15, MPI_INT, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 15, MPI_INT, source, tag, MPI_COMM_WORLD, &status); + + for (i=0; i<10; i++) + printf("%d ", message2[i]); + printf("\n"); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv12.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv12.c new file mode 100644 index 0000000000..39ab3773f2 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv12.c @@ -0,0 +1,42 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv12.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv12.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv2.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv2.c new file mode 100644 index 0000000000..e98c4097c8 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv2.c @@ -0,0 +1,52 @@ + +/*TEST +PATH='tests/testSendRecv2.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv2.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = MPI_Status error. Cannot cast from type int. +STATUS = 1 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv3.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv3.c new file mode 100644 index 0000000000..4a8281a6ab --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv3.c @@ -0,0 +1,53 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv3.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv3.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 2, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv4.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv4.c new file mode 100644 index 0000000000..313fa4b7d1 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv4.c @@ -0,0 +1,48 @@ + +/*TEST +PATH='tests/testSendRecv4.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv4.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = None + There is no matching receive for the send +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank, p; + char message1[50]; + int source, dest, tag; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv5.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv5.c new file mode 100644 index 0000000000..bdbb9b86c6 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv5.c @@ -0,0 +1,53 @@ + +/*TEST +PATH='tests/testSendRecv5.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv5.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there + Although there is a compile warning for type mismatch. +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv6.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv6.c new file mode 100644 index 0000000000..f4161919b2 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv6.c @@ -0,0 +1,54 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv6.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv6.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = None + HANGS FOREVER! +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag0, tag1; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = dest = 0; + tag0 = 0; + tag1 = 1; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag0, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag1, MPI_COMM_WORLD, &status); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv7.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv7.c new file mode 100644 index 0000000000..39abb18488 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv7.c @@ -0,0 +1,55 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv7.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv7.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = TEST FLAGS +ARGS = None +INPUT = EOF +OUTPUT = MPI_Receive source invalid. + WAITS FOREVER. +STATUS = 1 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + tag = dest = 0; + source = 1; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv8.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv8.c new file mode 100644 index 0000000000..c4a67dccfb --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv8.c @@ -0,0 +1,53 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv8.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendRecv8.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Abort: Null communicator +STATUS = 1 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_NULL, &status); + + //printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv9.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv9.c new file mode 100644 index 0000000000..bbcad544ac --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendRecv9.c @@ -0,0 +1,51 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendRecv9.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** test2SendRecv9.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano June 5 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Abort: Null communictor. +STATUS = 1 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Send(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_NULL); + MPI_Recv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv0.1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv0.1.c new file mode 100644 index 0000000000..637dd30c05 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv0.1.c @@ -0,0 +1,51 @@ + +/*TEST +PATH='tests/testSendrecv0.1.c' +CCFLAGS="" +INPUT="" +OUTPUT='Hello there\n' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendrecv0.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = Hello there +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Sendrecv(message1, strlen(message1)+1, MPI_CHAR, dest, tag, message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv1.1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv1.1.c new file mode 100644 index 0000000000..5c1f22efcf --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv1.1.c @@ -0,0 +1,53 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendrecv1.1.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendrecv1.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = ERROR: -5001 MPI_RECV argument error + ERROR: -5001 MPI aborting... +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Sendrecv(message1, strlen(message1)+1, MPI_CHAR, dest, tag, NULL, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv2.1.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv2.1.c new file mode 100644 index 0000000000..6b8b3c79fa --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testSendrecv2.1.c @@ -0,0 +1,53 @@ + +/*TEST +SKIP=1 +PATH='tests/testSendrecv2.1.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +/******************************************************************/ +/* FILE *********** testSendrecv2.c ********************/ +/******************************************************************/ +/* Author : Lisa Alano July 29 2002 */ +/* Copyright (c) 2002 University of California Regents */ +/******************************************************************/ +/******************************************************************/ + +#if 0 +CCFLAGS = None +ARGS = None +INPUT = EOF +OUTPUT = ERROR: -5001 MPI_SEND argument error + ERROR: -5001 MPI aborting... +STATUS = 0 +#endif + +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Sendrecv(NULL, strlen(message1)+1, MPI_CHAR, dest, tag, message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); + + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/testTypeContig0.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testTypeContig0.c new file mode 100644 index 0000000000..956de2e856 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/testTypeContig0.c @@ -0,0 +1,44 @@ + +/*TEST +SKIP=1 +PATH='tests/testTypeContig0.c' +CCFLAGS="" +INPUT="" +OUTPUT='' +STATUS=0 +TEST*/ + +#include "mpi.h" +#include +#define SIZE 4 + +int main(argc,argv) +int argc; +char *argv[]; { +int numtasks, rank, source=0, dest, tag=1, i; +float a[SIZE] = + {1.0, 2.0, 3.0, 4.0}; +float b[SIZE]; + +MPI_Status stat; +MPI_Datatype rowtype; + +MPI_Init(&argc,&argv); +MPI_Comm_rank(MPI_COMM_WORLD, &rank); +MPI_Comm_size(MPI_COMM_WORLD, &numtasks); + +MPI_Type_contiguous(SIZE, MPI_FLOAT, &rowtype); +MPI_Type_commit(&rowtype); + +if (rank == 0) { + for (i=0; i +#include +#include +#include "mpi.h" + +int main(int argc, char**argv) +{ + int my_rank; + int p; + char message1[50]; + char message2[50]; + int source, dest, tag; + MPI_Request request1; + MPI_Request request2; + MPI_Status* status; + status = (MPI_Status *) malloc (sizeof(MPI_Status)); + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + source = tag = dest = 0; + sprintf(message1, "Hello there"); + MPI_Isend(message1, strlen(message1)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD, &request1); + MPI_Irecv(message2, 50, MPI_CHAR, source, tag, MPI_COMM_WORLD, &request2); + MPI_Wait (&request1, status); + MPI_Wait (&request2, status); + printf("%s\n", message2); + + MPI_Finalize(); + return 0; +} diff --git a/packages/zoltan/siMPI/pyMPI/siMPI/tests/trapezoidal.c b/packages/zoltan/siMPI/pyMPI/siMPI/tests/trapezoidal.c new file mode 100644 index 0000000000..74beea1b27 --- /dev/null +++ b/packages/zoltan/siMPI/pyMPI/siMPI/tests/trapezoidal.c @@ -0,0 +1,109 @@ + +/*TEST +PATH='tests/trapezoidal.c' +CCFLAGS="" +INPUT="" +OUTPUT="With n = 1024 trapezoids, our estimate\nof the intergral from 0.000000 to 1.000000 = -1.799356" +STATUS=0 +SKIP=1 +TEST*/ + +/*===========================================================================================*/ +/* Parallel Trapezoidal Rule + * Peter S. Pacheco + * + * Input: None. + * Output: Estimate of the intergral from a to b of f(x) + * using the trapezoidal rule and n trapezoids. + * + * Algorithm: + * 1. Each process calculates "its" interval of integration. + * 2. Each process estimates the integral of f(x) over its + * interval using the trapezoidal rule. + * 3a. Each process != 0 sends its integral to 0. + * 3b. Process 0 sums the calculations received from + * the individual processes and prints the result. + * Note: f(x), a, b, and n are all hardwired. + */ + #include + #include "mpi.h" +/*===========================================================================================*/ + float Trap(float local_a, float local_b, int local_n, float h) + { + float integral; + float x; + int i; + + float f(float x); /*function we are integrating */ + integral = (f(local_a)+f(local_b))/2.0; + x = local_a; + for (i = 1; i<=local_n-1; i++) { + x = x+h; + integral = integral+ f(x); + } + integral = integral*h; + return integral; + } /*Trap*/ +/*===========================================================================================*/ + float f(float x) { + float return_val; + /*Calculate f(x) */ + return_val = x*x*x + (50*x); + return return_val; + } +/*===========================================================================================*/ + int main(int argc, char**argv) + { + int my_rank; + int p; + float a = 0.0; + float b = 1.0; + int n = 1024; + float h; + float local_a; + float local_b; + int local_n; + float integral; + float total; + int source; + int dest = 0; + int tag = 0; + MPI_Status status; + + float Trap(float local_a, float local_b, int local_n, float h); /*Calculate local integral*/ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + h = (b-a)/n; /*h is the same for all processes*/ + local_n = n/p; /*So is the number of trapezoids */ + + /*Length of each process's interval of integration = local_n*h. So my interval starts at:*/ + local_a = a + my_rank*local_n*h; + local_b = local_a + local_n*h; + integral - Trap(local_a, local_b, local_n, h); + + /*Add up the integrals calculated by each process*/ + if (my_rank == 0) { + total = integral; + for (source = 1; source < p; source++) { + MPI_Recv(&integral, 1, MPI_FLOAT, source, tag, MPI_COMM_WORLD, &status); + total = total + integral; + } + } else { + MPI_Send(&integral, 1, MPI_FLOAT, dest, tag, MPI_COMM_WORLD); + } + + /*Print the result*/ + if (my_rank == 0) { + printf("With n = %d trapezoids, our estimate\n",n); + printf("of the intergral from %f to %f = %f\n",a, b, total); + } + + /*Shut down MPI*/ + MPI_Finalize(); + return 0; + } /*main*/ + + +/*===========================================================================================*/ diff --git a/packages/zoltan/siMPI/siMPI_README.txt b/packages/zoltan/siMPI/siMPI_README.txt index b7d22ab67a..75280d0789 100644 --- a/packages/zoltan/siMPI/siMPI_README.txt +++ b/packages/zoltan/siMPI/siMPI_README.txt @@ -1,10 +1,10 @@ -siMPI was developed by Pat Miller at Lawrence Livermore +siMPI was developed by Pat Miller at Lawrence Livermore National Laboratory. It is distributed as part of pyMPI at http://sourceforge.net/projects/pympi/ . With permission of the author, Zoltan uses siMPI to satisfy MPI dependencies for serial builds of Trilinos. -siMPI is not owned, copyrighted, licensed, developed or supported by Sandia -National Laboratories or the Trilinos project. +siMPI is not owned, copyrighted, licensed, developed or supported by Sandia +National Laboratories or the Trilinos project. -siMPI is third-party software that does not fall under Trilinos' or +siMPI is third-party software that does not fall under Trilinos' or Zoltan's license. diff --git a/packages/zoltan/siMPI_README.txt b/packages/zoltan/siMPI_README.txt index b7d22ab67a..75280d0789 100644 --- a/packages/zoltan/siMPI_README.txt +++ b/packages/zoltan/siMPI_README.txt @@ -1,10 +1,10 @@ -siMPI was developed by Pat Miller at Lawrence Livermore +siMPI was developed by Pat Miller at Lawrence Livermore National Laboratory. It is distributed as part of pyMPI at http://sourceforge.net/projects/pympi/ . With permission of the author, Zoltan uses siMPI to satisfy MPI dependencies for serial builds of Trilinos. -siMPI is not owned, copyrighted, licensed, developed or supported by Sandia -National Laboratories or the Trilinos project. +siMPI is not owned, copyrighted, licensed, developed or supported by Sandia +National Laboratories or the Trilinos project. -siMPI is third-party software that does not fall under Trilinos' or +siMPI is third-party software that does not fall under Trilinos' or Zoltan's license. diff --git a/packages/zoltan/src/CMakeLists.txt b/packages/zoltan/src/CMakeLists.txt index 22a50a5bf7..1de37e7a6f 100644 --- a/packages/zoltan/src/CMakeLists.txt +++ b/packages/zoltan/src/CMakeLists.txt @@ -482,6 +482,7 @@ APPEND_SET(SOURCES Utilities/Communication/comm_do_reverse.c Utilities/Communication/comm_info.c Utilities/Communication/comm_create.c + Utilities/Communication/comm_default.c Utilities/Communication/comm_resize.c Utilities/Communication/comm_sort_ints.c Utilities/Communication/comm_destroy.c @@ -640,7 +641,7 @@ IF(${PROJECT_NAME}_ENABLE_Fortran AND BUILD_ZOLTAN_F90_INTERFACE) fort/set_unpackobjmulti.if ) - APPEND_SET(SOURCES + APPEND_SET(SOURCES fort/ztypes.f90 fort/zoltan_user_data.f90 fort/fwrap.f90 @@ -655,7 +656,7 @@ IF(${PROJECT_NAME}_ENABLE_Fortran AND BUILD_ZOLTAN_F90_INTERFACE) ${CMAKE_CURRENT_BINARY_DIR}/zoltan_types.mod ${CMAKE_CURRENT_BINARY_DIR}/zoltan_user_data.mod ) - + ENDIF() @@ -682,3 +683,4 @@ TRIBITS_ADD_LIBRARY( ) INSTALL(FILES ${MODULES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) + diff --git a/packages/zoltan/src/Makefile.am b/packages/zoltan/src/Makefile.am index 152e8702ed..b64c53f26e 100644 --- a/packages/zoltan/src/Makefile.am +++ b/packages/zoltan/src/Makefile.am @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER # The following line helps the test harness recover from build errors. diff --git a/packages/zoltan/src/Makefile.in b/packages/zoltan/src/Makefile.in index 01ff3550a7..a42c81aa1a 100644 --- a/packages/zoltan/src/Makefile.in +++ b/packages/zoltan/src/Makefile.in @@ -15,49 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER # The following line helps the test harness recover from build errors. @@ -548,12 +505,12 @@ GRAPH = \ HA_H = \ $(srcdir)/ha/ha_const.h \ - $(srcdir)/ha/ha_ovis.h + $(srcdir)/ha/ha_ovis.h HA = \ $(srcdir)/ha/divide_machine.c \ $(srcdir)/ha/get_processor_name.c \ - $(srcdir)/ha/ha_ovis.c + $(srcdir)/ha/ha_ovis.c HIER_H = \ $(srcdir)/hier/hier.h @@ -618,11 +575,11 @@ MATRIX = \ $(srcdir)/matrix/matrix_distribute.c \ $(srcdir)/matrix/matrix_operations.c \ $(srcdir)/matrix/matrix_sym.c \ - $(srcdir)/matrix/matrix_utils.c + $(srcdir)/matrix/matrix_utils.c ORDER_H = \ $(srcdir)/order/order_const.h \ - $(srcdir)/order/hsfcOrder.h + $(srcdir)/order/hsfcOrder.h ORDER = \ $(srcdir)/order/order.c \ @@ -664,7 +621,7 @@ TPLS_H = \ $(srcdir)/tpls/third_library_const.h \ $(srcdir)/tpls/third_library.h \ $(srcdir)/tpls/third_library_tools.h \ - $(srcdir)/tpls/graph_util.h + $(srcdir)/tpls/graph_util.h TPLS = \ $(srcdir)/tpls/build_graph.c \ @@ -680,9 +637,9 @@ EXTRA_PARMETIS_INTERFACE_H = \ EXTRA_PARMETIS_INTERFACE = \ $(srcdir)/tpls/parmetis_interface.c -@BUILD_PARMETIS_FALSE@PARMETIS_INTERFACE_H = +@BUILD_PARMETIS_FALSE@PARMETIS_INTERFACE_H = @BUILD_PARMETIS_TRUE@PARMETIS_INTERFACE_H = $(EXTRA_PARMETIS_INTERFACE_H) -@BUILD_PARMETIS_FALSE@PARMETIS_INTERFACE = +@BUILD_PARMETIS_FALSE@PARMETIS_INTERFACE = @BUILD_PARMETIS_TRUE@PARMETIS_INTERFACE = $(EXTRA_PARMETIS_INTERFACE) EXTRA_SCOTCH_INTERFACE_H = \ $(srcdir)/tpls/scotch_interface.h @@ -690,9 +647,9 @@ EXTRA_SCOTCH_INTERFACE_H = \ EXTRA_SCOTCH_INTERFACE = \ $(srcdir)/tpls/scotch_interface.c -@BUILD_SCOTCH_FALSE@SCOTCH_INTERFACE_H = +@BUILD_SCOTCH_FALSE@SCOTCH_INTERFACE_H = @BUILD_SCOTCH_TRUE@SCOTCH_INTERFACE_H = $(EXTRA_SCOTCH_INTERFACE_H) -@BUILD_SCOTCH_FALSE@SCOTCH_INTERFACE = +@BUILD_SCOTCH_FALSE@SCOTCH_INTERFACE = @BUILD_SCOTCH_TRUE@SCOTCH_INTERFACE = $(EXTRA_SCOTCH_INTERFACE) PHG_H = \ $(srcdir)/phg/phg_comm.h \ @@ -813,7 +770,7 @@ UTILITIES = \ $(srcdir)/Utilities/shared/zoltan_id.c -# ?? +# ?? # $(srcdir)/Utilities/Communication/Epetra_ZoltanMpiDistributor.cpp \ # $(srcdir)/Utilities/DDirectory/DD_Main_2.cpp \ # $(srcdir)/Utilities/Communication/comm_main_2.cpp @@ -933,17 +890,17 @@ EXTRA_FORTRAN_H = \ $(srcdir)/fort/set_unpackobj.fn \ $(srcdir)/fort/set_unpackobj.if \ $(srcdir)/fort/set_unpackobjmulti.fn \ - $(srcdir)/fort/set_unpackobjmulti.if + $(srcdir)/fort/set_unpackobjmulti.if EXTRA_FORTRAN = \ $(srcdir)/fort/ztypes.f90 \ $(srcdir)/fort/cwrap.c \ $(srcdir)/fort/zoltan_user_data.f90 \ - $(srcdir)/fort/fwrap.f90 + $(srcdir)/fort/fwrap.f90 -@BUILD_ZOLTAN_F90_INTERFACE_FALSE@FORTRAN_H = +@BUILD_ZOLTAN_F90_INTERFACE_FALSE@FORTRAN_H = @BUILD_ZOLTAN_F90_INTERFACE_TRUE@FORTRAN_H = $(EXTRA_FORTRAN_H) -@BUILD_ZOLTAN_F90_INTERFACE_FALSE@FORTRAN = +@BUILD_ZOLTAN_F90_INTERFACE_FALSE@FORTRAN = @BUILD_ZOLTAN_F90_INTERFACE_TRUE@FORTRAN = $(EXTRA_FORTRAN) # ------------------------------------------------------------------------ @@ -1055,7 +1012,7 @@ include_HEADERS = $(INCLUDE_H) $(am__append_1) # ------------------------------------------------------------------------ EXTRA_FORTRAN_INTERFACE = \ $(srcdir)/fort/README \ - $(srcdir)/fort/makefile + $(srcdir)/fort/makefile ZOLTAN_MATLAB = \ $(srcdir)/matlab/README \ @@ -1169,16 +1126,16 @@ execincludedir = $(includedir) nodist_execinclude_HEADERS = include/Zoltan_config.h # Add the absolute path to src/fort to F90 build line, so F90 can find -# the files included in fwrap.f90. -AM_FCFLAGS = -I@abs_top_srcdir@/src/fort -AM_FFLAGS = -I@abs_top_srcdir@/src/fort +# the files included in fwrap.f90. +AM_FCFLAGS = -I@abs_top_srcdir@/src/fort +AM_FFLAGS = -I@abs_top_srcdir@/src/fort # Build zfdrive only if HAVE_MPI; I haven't figured out a proper build of # siMPI's Fortran interface yet (and serial zfdrive is not an important # use case). FDRIVER_SUBDIR = $(am__append_2) @BUILD_TESTS_FALSE@SUBDIRS = . -#SUBDIRS = . +#SUBDIRS = . @BUILD_TESTS_TRUE@SUBDIRS = . driver $(FDRIVER_SUBDIR) # ------------------------------------------------------------------------ @@ -1250,7 +1207,7 @@ uninstall-libLIBRARIES: clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) -libzoltan.a: $(libzoltan_a_OBJECTS) $(libzoltan_a_DEPENDENCIES) $(EXTRA_libzoltan_a_DEPENDENCIES) +libzoltan.a: $(libzoltan_a_OBJECTS) $(libzoltan_a_DEPENDENCIES) $(EXTRA_libzoltan_a_DEPENDENCIES) -rm -f libzoltan.a $(libzoltan_a_AR) libzoltan.a $(libzoltan_a_OBJECTS) $(libzoltan_a_LIBADD) $(RANLIB) libzoltan.a @@ -3860,8 +3817,8 @@ include $(top_builddir)/Makefile.export.zoltan # ------------------------------------------------------------------------ # Explicit FORTRAN dependencies to allow parallel builds (make -j) -# KDD: 4/28/15 Specifying the dependencies does not seem to help -# KDD: the parallel F90 builds (although articles online +# KDD: 4/28/15 Specifying the dependencies does not seem to help +# KDD: the parallel F90 builds (although articles online # KDD: indicate it should). I'll comment them out # KDD: and use .NOTPARALLEL: instead. # ------------------------------------------------------------------------ diff --git a/packages/zoltan/src/Utilities/Communication/README b/packages/zoltan/src/Utilities/Communication/README index 9f61ec3c4e..b6f1623884 100644 --- a/packages/zoltan/src/Utilities/Communication/README +++ b/packages/zoltan/src/Utilities/Communication/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER COMM DIRECTORY -- Package to efficiently perform unstructured communication operations. The same pattern can be created once and diff --git a/packages/zoltan/src/Utilities/Communication/comm.h b/packages/zoltan/src/Utilities/Communication/comm.h index e65f15e571..7ad6fea5f2 100644 --- a/packages/zoltan/src/Utilities/Communication/comm.h +++ b/packages/zoltan/src/Utilities/Communication/comm.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __COMM_H @@ -130,9 +93,9 @@ struct Zoltan_Comm_Obj { /* data for mapping between decompositions */ MPI_Comm comm; /* communicator for operation */ MPI_Request *request; /* MPI requests for posted recvs */ MPI_Status *status; /* MPI status for those recvs */ - + ZOLTAN_COMM_OBJ* plan_reverse; /* to support POST & WAIT */ - char* recv_buff; /* To support POST & WAIT */ + char* recv_buff; /* To support POST & WAIT */ }; /* Red Storm MPI permits a maximum of 2048 receives. We set our diff --git a/packages/zoltan/src/Utilities/Communication/comm_create.c b/packages/zoltan/src/Utilities/Communication/comm_create.c index 6be0689a48..1078c9d080 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_create.c +++ b/packages/zoltan/src/Utilities/Communication/comm_create.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include "comm.h" @@ -111,7 +74,7 @@ int *pnvals_recv) /* returned # vals I own after communication */ starts = (int *) ZOLTAN_MALLOC((nprocs + 1) * sizeof(int)); out_of_mem = FALSE; - if (starts == NULL) { + if (starts == NULL) { out_of_mem = TRUE; goto Mem_Err; } @@ -271,7 +234,7 @@ int *pnvals_recv) /* returned # vals I own after communication */ j += lengths_from[i]; } } - + if (comm_flag != ZOLTAN_OK) { if (comm_flag == ZOLTAN_MEMERR) { ZOLTAN_COMM_ERROR("Out of memory", yo, my_proc); @@ -341,7 +304,7 @@ int *pnvals_recv) /* returned # vals I own after communication */ else{ plan->request = (MPI_Request *) ZOLTAN_MALLOC(plan->nrecvs * sizeof(MPI_Request)); plan->status = (MPI_Status *) ZOLTAN_MALLOC(plan->nrecvs * sizeof(MPI_Status)); - if (plan->nrecvs && ((plan->request == NULL) || (plan->status == NULL))) + if (plan->nrecvs && ((plan->request == NULL) || (plan->status == NULL))) comm_flag = ZOLTAN_MEMERR; } @@ -363,7 +326,7 @@ int *pnvals_recv) /* returned # vals I own after communication */ else { \ to->buf = NULL; \ } - + ZOLTAN_COMM_OBJ *Zoltan_Comm_Copy(ZOLTAN_COMM_OBJ *from) { ZOLTAN_COMM_OBJ *to = NULL; diff --git a/packages/zoltan/src/Utilities/Communication/comm_default.c b/packages/zoltan/src/Utilities/Communication/comm_default.c new file mode 100644 index 0000000000..6b80c85c48 --- /dev/null +++ b/packages/zoltan/src/Utilities/Communication/comm_default.c @@ -0,0 +1,37 @@ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER + +#include "comm.h" +#include + +#ifdef __cplusplus +/* if C++, define the rest of this header file as extern C */ +extern "C" { +#endif +static pthread_mutex_t zoltan_global_mpi_lock; +static MPI_Comm Zoltan_Global_MPI_Comm = MPI_COMM_WORLD; // CHECK: ALLOW MPI_COMM_WORLD + +/* Function to set the default communicator */ +void zoltan_initialize_global_comm(MPI_Comm comm) { + pthread_mutex_lock(&zoltan_global_mpi_lock); + Zoltan_Global_MPI_Comm = comm; + pthread_mutex_unlock(&zoltan_global_mpi_lock); +} + +/* Function to get the default communicator */ +MPI_Comm zoltan_get_global_comm(void) { + pthread_mutex_lock(&zoltan_global_mpi_lock); + MPI_Comm comm = Zoltan_Global_MPI_Comm; + pthread_mutex_unlock(&zoltan_global_mpi_lock); + return comm; +} + +#ifdef __cplusplus +} /* closing bracket for extern "C" */ +#endif diff --git a/packages/zoltan/src/Utilities/Communication/comm_destroy.c b/packages/zoltan/src/Utilities/Communication/comm_destroy.c index 09dbb7c214..55d2d0c02d 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_destroy.c +++ b/packages/zoltan/src/Utilities/Communication/comm_destroy.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER diff --git a/packages/zoltan/src/Utilities/Communication/comm_do.c b/packages/zoltan/src/Utilities/Communication/comm_do.c index 3d5c92d6e8..d1eec942e1 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_do.c +++ b/packages/zoltan/src/Utilities/Communication/comm_do.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -145,7 +108,7 @@ char *recv_data) /* array of data I'll own after comm */ /* Check input parameters */ if (!plan) { - MPI_Comm_rank(MPI_COMM_WORLD, &my_proc); + MPI_Comm_rank(zoltan_get_global_comm(), &my_proc); ZOLTAN_COMM_ERROR("Communication plan = NULL", yo, my_proc); return ZOLTAN_FATAL; } @@ -162,10 +125,10 @@ char *recv_data) /* array of data I'll own after comm */ if ((plan->nsends + plan->self_msg) && !send_data) { size_t sum = 0; if (plan->sizes_to) /* Not an error if all sizes_to == 0 */ - for (i = 0; i < (plan->nsends + plan->self_msg); i++) + for (i = 0; i < (plan->nsends + plan->self_msg); i++) sum += plan->sizes_to[i]; if (!plan->sizes_to || (plan->sizes_to && sum)) { - ZOLTAN_COMM_ERROR("nsends not zero, but send_data = NULL", + ZOLTAN_COMM_ERROR("nsends not zero, but send_data = NULL", yo, my_proc); return ZOLTAN_FATAL; } @@ -173,10 +136,10 @@ char *recv_data) /* array of data I'll own after comm */ if ((plan->nrecvs + plan->self_msg) && !recv_data) { size_t sum = 0; if (plan->sizes_from) /* Not an error if all sizes_from == 0 */ - for (i = 0; i < (plan->nrecvs + plan->self_msg); i++) + for (i = 0; i < (plan->nrecvs + plan->self_msg); i++) sum += plan->sizes_from[i]; if (!plan->sizes_from || (plan->sizes_from && sum)) { - ZOLTAN_COMM_ERROR("nrecvs not zero, but recv_data = NULL", + ZOLTAN_COMM_ERROR("nrecvs not zero, but recv_data = NULL", yo, my_proc); return ZOLTAN_FATAL; } @@ -226,10 +189,10 @@ char *recv_data) /* array of data I'll own after comm */ if (plan->procs_from[i] != my_proc) { if (plan->sizes_from[i]) { MPI_Irecv((void *) - &plan->recv_buff[(size_t)(plan->starts_from_ptr[i]) + &plan->recv_buff[(size_t)(plan->starts_from_ptr[i]) * (size_t)nbytes], plan->sizes_from[i] * nbytes, - (MPI_Datatype) MPI_BYTE, plan->procs_from[i], + (MPI_Datatype) MPI_BYTE, plan->procs_from[i], tag, plan->comm, &plan->request[k]); } else @@ -386,7 +349,7 @@ char *recv_data) /* array of data I'll own after comm */ j++; } if (plan->sizes_to[i]) { - MPI_Rsend((void *) send_buff, + MPI_Rsend((void *) send_buff, plan->sizes_to[i] * nbytes, (MPI_Datatype) MPI_BYTE, plan->procs_to[i], tag, plan->comm); @@ -458,7 +421,7 @@ char *recv_data) /* array of data I'll own after comm */ else { /* Need to copy into recv_data. */ if (plan->self_msg) { /* Unpack own data before waiting */ - for (self_num = 0; self_num < plan->nrecvs + plan->self_msg; self_num++) + for (self_num = 0; self_num < plan->nrecvs + plan->self_msg; self_num++) if (plan->procs_from[self_num] == my_proc) break; k = plan->starts_from[self_num]; if (!plan->sizes_from || plan->sizes_from[self_num]) { @@ -509,7 +472,7 @@ char *recv_data) /* array of data I'll own after comm */ { static char *yo = "Zoltan_Comm_Do_AlltoAll"; char *outbuf=NULL, *inbuf=NULL, *buf=NULL; - int *outbufCounts=NULL, *outbufOffsets=NULL; + int *outbufCounts=NULL, *outbufOffsets=NULL; int *inbufCounts=NULL, *inbufOffsets=NULL; int nprocs, me, i, j, k, p, sorted; int nSendMsgs, nSendItems, nRecvMsgs, nRecvItems; @@ -541,7 +504,7 @@ char *recv_data) /* array of data I'll own after comm */ /* The *_to fields of the plan refer to the items in the send_data buffer, * and how to pull out the correct items for each receiver. The - * *_from fields of the plan refer to the recv_data buffer. Items + * *_from fields of the plan refer to the recv_data buffer. Items * arrive in process rank order, and these fields tell us where to * put them in the recv_data buffer. */ @@ -585,20 +548,20 @@ char *recv_data) /* array of data I'll own after comm */ if (i < nSendMsgs){ if (plan->procs_to[i] == p){ /* procs_to is sorted */ - + for (j=0; j < plan->lengths_to[i]; j++,k++){ itemSize = plan->sizes[plan->indices_to[k]] * nbytes; offset = plan->indices_to_ptr[k] * nbytes; - + memcpy(buf, send_data + offset, itemSize); - + buf += itemSize; length += itemSize; } i++; } } - + outbufCounts[p] = length; if (p){ outbufOffsets[p] = outbufOffsets[p-1] + outbufCounts[p-1]; @@ -632,7 +595,7 @@ char *recv_data) /* array of data I'll own after comm */ if (plan->procs_to[i] == p){ /* procs_to is sorted */ length = plan->sizes_to[i] * nbytes; offset = plan->starts_to_ptr[i] * nbytes; - + if ((!sorted || (plan->nvals > nSendItems)) && length){ memcpy(buf, send_data + offset, length); buf += length; @@ -640,7 +603,7 @@ char *recv_data) /* array of data I'll own after comm */ i++; } } - + outbufCounts[p] = length; if (p){ outbufOffsets[p] = outbufOffsets[p-1] + outbufCounts[p-1]; @@ -662,7 +625,7 @@ char *recv_data) /* array of data I'll own after comm */ for (p=0, i=0, k=0; p < nprocs; p++){ length = 0; - + if (i < nSendMsgs){ if (plan->procs_to[i] == p){ /* procs_to is sorted */ for (j=0; j < plan->lengths_to[i]; j++,k++){ @@ -681,7 +644,7 @@ char *recv_data) /* array of data I'll own after comm */ } } } - else{ + else{ /* item sizes are constant, and items belonging to a * given message are always stored contiguously in send_data @@ -695,7 +658,7 @@ char *recv_data) /* array of data I'll own after comm */ } else{ /* send_data is sorted by process, and we don't skip - * any of the data in the buffer, so we can use send_data + * any of the data in the buffer, so we can use send_data * in the alltoall call */ outbuf = send_data; @@ -704,12 +667,12 @@ char *recv_data) /* array of data I'll own after comm */ for (p=0,i=0; p < nprocs; p++){ length = 0; - + if (i < nSendMsgs){ if (plan->procs_to[i] == p){ /* procs_to is sorted */ offset = plan->starts_to[i] * nbytes; length = plan->lengths_to[i] * nbytes; - + if ((!sorted || (plan->nvals > nSendItems)) && length){ memcpy(buf, send_data + offset, length); buf += length; @@ -756,13 +719,13 @@ char *recv_data) /* array of data I'll own after comm */ if (i < nRecvMsgs){ if (plan->procs_from[i] == p){ - + if (plan->sizes == NULL){ length = plan->lengths_from[i] * nbytes; } else{ length = plan->sizes_from[i] * nbytes; - } + } i++; } } diff --git a/packages/zoltan/src/Utilities/Communication/comm_do_reverse.c b/packages/zoltan/src/Utilities/Communication/comm_do_reverse.c index 907bc83752..9152bed08e 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_do_reverse.c +++ b/packages/zoltan/src/Utilities/Communication/comm_do_reverse.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -75,7 +38,7 @@ static void free_reverse_plan(ZOLTAN_COMM_OBJ *plan) } } -static int create_reverse_plan( +static int create_reverse_plan( ZOLTAN_COMM_OBJ *plan, /* communication data structure */ int tag, int *sizes) /* variable size of objects (if not NULL) */ @@ -156,7 +119,7 @@ int *sizes) /* variable size of objects (if not NULL) */ if (plan->plan_reverse->request == NULL && plan->plan_reverse->nrecvs != 0) { return(ZOLTAN_MEMERR); } - + plan->plan_reverse->status = (MPI_Status *) ZOLTAN_MALLOC(plan->plan_reverse->nrecvs * sizeof(MPI_Status)); if (plan->plan_reverse->status == NULL && plan->plan_reverse->nrecvs != 0) { @@ -197,18 +160,18 @@ char *recv_data) /* array of data I'll own after reverse comm */ if (status == ZOLTAN_OK){ if (plan->plan_reverse->maxed_recvs){ - + /* use MPI_Alltoallv to implement plan->plan_reverse, because comm_do_post * would post more receives that allowed on this machine */ - + status = Zoltan_Comm_Do_AlltoAll(plan->plan_reverse, send_data, nbytes, recv_data); } else{ /* use post/wait which is faster when each sends to few */ status = Zoltan_Comm_Do_Post(plan->plan_reverse, tag, send_data, nbytes, recv_data); - + if (status == ZOLTAN_OK){ status = Zoltan_Comm_Do_Wait (plan->plan_reverse, tag, send_data, nbytes, recv_data); } @@ -218,7 +181,7 @@ char *recv_data) /* array of data I'll own after reverse comm */ free_reverse_plan(plan); return status; -} +} /******************************************************************************/ /* Perform a reverse communication operation. Communication object describes */ /* an action, and this routine does the opposite. Can be used to return */ diff --git a/packages/zoltan/src/Utilities/Communication/comm_exchange_sizes.c b/packages/zoltan/src/Utilities/Communication/comm_exchange_sizes.c index 9c3a3f1729..c1e614d92f 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_exchange_sizes.c +++ b/packages/zoltan/src/Utilities/Communication/comm_exchange_sizes.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -79,7 +42,7 @@ MPI_Comm comm) { /* communicator */ self_index_to = -1; for (i = 0; i < nsends + self_msg; i++) { - if (procs_to[i] != my_proc) + if (procs_to[i] != my_proc) MPI_Send((void *) &sizes_to[i], 1, MPI_INT, procs_to[i], tag, comm); else self_index_to = i; @@ -87,10 +50,10 @@ MPI_Comm comm) { /* communicator */ *total_recv_size = 0; for (i = 0; i < nrecvs + self_msg; i++) { - if (procs_from[i] != my_proc) + if (procs_from[i] != my_proc) MPI_Recv((void *) &sizes_from[i], 1, MPI_INT, procs_from[i], tag, comm, &status); - else + else sizes_from[i] = sizes_to[self_index_to]; *total_recv_size += sizes_from[i]; diff --git a/packages/zoltan/src/Utilities/Communication/comm_info.c b/packages/zoltan/src/Utilities/Communication/comm_info.c index ea278df573..944a24237a 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_info.c +++ b/packages/zoltan/src/Utilities/Communication/comm_info.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -74,7 +37,7 @@ int Zoltan_Comm_Info( int *send_list, /* proc assignment of each value to be sent (same as "assign" in Zoltan_Comm_Create) */ int *nrecvs, /* number of receives in plan */ - int *recv_procs, /* list of procs from which messages are + int *recv_procs, /* list of procs from which messages are received. */ int *recv_lengths, /* number of values to be received from each proc in procs_from */ @@ -90,7 +53,7 @@ int i, j, k, my_proc; /* Check input parameters */ if (!plan) { - MPI_Comm_rank(MPI_COMM_WORLD, &my_proc); + MPI_Comm_rank(zoltan_get_global_comm(), &my_proc); ZOLTAN_COMM_ERROR("Communication plan = NULL", yo, my_proc); return ZOLTAN_FATAL; } @@ -124,7 +87,7 @@ int i, j, k, my_proc; else { for (i = 0; i < plan->nsends + plan->self_msg; i++) { k = plan->starts_to[i]; - for (j = 0; j < plan->lengths_to[i]; j++) + for (j = 0; j < plan->lengths_to[i]; j++) send_list[plan->indices_to[k+j]] = plan->procs_to[i]; } } @@ -159,7 +122,7 @@ int i, j, k, my_proc; else { for (i = 0; i < plan->nrecvs + plan->self_msg; i++) { k = plan->starts_from[i]; - for (j = 0; j < plan->lengths_from[i]; j++) + for (j = 0; j < plan->lengths_from[i]; j++) recv_list[plan->indices_from[k+j]] = plan->procs_from[i]; } } diff --git a/packages/zoltan/src/Utilities/Communication/comm_invert_map.c b/packages/zoltan/src/Utilities/Communication/comm_invert_map.c index c6ca9a7c49..04f9868a80 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_invert_map.c +++ b/packages/zoltan/src/Utilities/Communication/comm_invert_map.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -103,10 +66,10 @@ MPI_Comm comm) /* communicator */ /* Work-around for compiler bug suggested by Rich Schiek. * With 64-bit linux, OpenMPI 1.2.5, and Intel 10.1 compilers with - * optimization, passing the address of out_of_mem to MPI_Allreduce - * causes a crash in MPI_Allreduce. Rich and Tom Russo theorize that in - * Zoltan_Comm_Create, out_of_mem is stored in a register, and taking - * the address of a register is undefined. Copying out_of_mem to a + * optimization, passing the address of out_of_mem to MPI_Allreduce + * causes a crash in MPI_Allreduce. Rich and Tom Russo theorize that in + * Zoltan_Comm_Create, out_of_mem is stored in a register, and taking + * the address of a register is undefined. Copying out_of_mem to a * local variable avoids the problem. * See Zoltan Bugzilla bug 3825 for more info. */ @@ -125,7 +88,7 @@ MPI_Comm comm) /* communicator */ for (i = 0; i < nsends + self_msg; i++) msg_count[procs_to[i]] = 1; -/* +/* * KDDKDD: Replaced MPI_Reduce_scatter with MPI_Reduce and MPI_Scatter * KDDKDD: to avoid reported problems with MPICH 1.5.2.1. * KDDKDD: Some sort of MPI_TYPE_INDEXED error. @@ -144,7 +107,7 @@ MPI_Comm comm) /* communicator */ if (counts[i] > max_nrecvs) max_nrecvs = counts[i]; } - } + } MPI_Bcast(&max_nrecvs, 1, MPI_INT, 0, comm); ZOLTAN_FREE(&counts); @@ -163,23 +126,23 @@ MPI_Comm comm) /* communicator */ ZOLTAN_FREE(&procs_from); return(ZOLTAN_MEMERR); } - + /* Note: I'm counting on having a unique tag or some of my incoming */ /* messages might get confused with others. */ - + for (i=0; i < nrecvs; i++){ MPI_Irecv(lengths_from + i, 1, MPI_INT, MPI_ANY_SOURCE, tag, comm, req + i); } - + for (i=0; i < nsends+self_msg; i++){ MPI_Send(lengths_to + i, 1, MPI_INT, procs_to[i], tag, comm); } - + for (i=0; i < nrecvs; i++){ MPI_Wait(req + i, &status); procs_from[i] = status.MPI_SOURCE; } - + ZOLTAN_FREE(&req); } else{ /* some large HPC machines have a limit on number of posted receives */ diff --git a/packages/zoltan/src/Utilities/Communication/comm_invert_plan.c b/packages/zoltan/src/Utilities/Communication/comm_invert_plan.c index 6d8a5da445..ecc2f056ea 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_invert_plan.c +++ b/packages/zoltan/src/Utilities/Communication/comm_invert_plan.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include "comm.h" @@ -54,12 +17,12 @@ extern "C" { #endif -/* +/* * Given a communication plan, invert the plan for the reverse communication. * The sizes in the inverted plan are assumed to be uniform. * The input plan is overwritten with the inverted plan. * If an error occurs, the old plan is returned unchanged. - * Note: receives in new plan are blocked, even if sends in old + * Note: receives in new plan are blocked, even if sends in old * plan were not. This blocking allows variable sized sends to be * done with the new plan (Zoltan_Comm_Resize). However, it also means * the new plan can not do exactly what Zoltan_Comm_Do_Reverse can do. diff --git a/packages/zoltan/src/Utilities/Communication/comm_resize.c b/packages/zoltan/src/Utilities/Communication/comm_resize.c index d1e12b4073..6bebbade0e 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_resize.c +++ b/packages/zoltan/src/Utilities/Communication/comm_resize.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -91,7 +54,7 @@ int *sum_recv_sizes) /* sum of the sizes of the items I'll receive */ MPI_Comm_rank(plan->comm, &my_proc); i = (sizes != NULL); MPI_Allreduce(&i, &var_sizes, 1, MPI_INT, MPI_LOR, plan->comm); - + if (var_sizes && plan->indices_from != NULL) { /* Can't do w/o individual item sizes */ @@ -119,7 +82,7 @@ int *sum_recv_sizes) /* sum of the sizes of the items I'll receive */ plan->max_send_size = 0; for (i = 0; i < nsends + self_msg; i++) { - if (plan->procs_to[i] != my_proc && + if (plan->procs_to[i] != my_proc && plan->lengths_to[i] > plan->max_send_size) { plan->max_send_size = plan->lengths_to[i]; } @@ -180,7 +143,7 @@ int *sum_recv_sizes) /* sum of the sizes of the items I'll receive */ for (k = 0; k < plan->lengths_to[i]; k++) { sizes_to[i] += sizes[j++]; } - if (sizes_to[i] > plan->max_send_size && + if (sizes_to[i] > plan->max_send_size && plan->procs_to[i] != my_proc) plan->max_send_size = sizes_to[i]; } @@ -226,7 +189,7 @@ int *sum_recv_sizes) /* sum of the sizes of the items I'll receive */ indices_to_ptr[j] = offset[plan->indices_to[j]]; sizes_to[i] += sizes[plan->indices_to[j++]]; } - if (sizes_to[i] > plan->max_send_size && + if (sizes_to[i] > plan->max_send_size && plan->procs_to[i] != my_proc) plan->max_send_size = sizes_to[i]; sum += sizes_to[i]; @@ -240,7 +203,7 @@ int *sum_recv_sizes) /* sum of the sizes of the items I'll receive */ /* Should such functionality reside here? */ Zoltan_Comm_Exchange_Sizes(sizes_to, plan->procs_to, nsends, self_msg, - sizes_from, plan->procs_from, nrecvs, + sizes_from, plan->procs_from, nrecvs, &plan->total_recv_size, my_proc, tag, plan->comm); starts_from_ptr = (int *) ZOLTAN_MALLOC((nrecvs + self_msg) * sizeof(int)); diff --git a/packages/zoltan/src/Utilities/Communication/comm_sort_ints.c b/packages/zoltan/src/Utilities/Communication/comm_sort_ints.c index 3893c9e160..754eb57631 100644 --- a/packages/zoltan/src/Utilities/Communication/comm_sort_ints.c +++ b/packages/zoltan/src/Utilities/Communication/comm_sort_ints.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include "comm.h" @@ -77,8 +40,8 @@ int nvals) /* length of these two arrays */ return ZOLTAN_FATAL; if (nvals == 1) return ZOLTAN_OK; /* fastest way to sort 1 item is to return */ - - /* find largest value (sort sometimes used for non processor lists) */ + + /* find largest value (sort sometimes used for non processor lists) */ top = vals_sort[0]; for (i = 1; i < nvals; i++) { if (vals_sort[i-1] > vals_sort[i]) already_sorted = 0; @@ -113,7 +76,7 @@ int nvals) /* length of these two arrays */ } else err = ZOLTAN_MEMERR; - + Zoltan_Multifree (__FILE__, __LINE__, 3, ©_sort, ©_other, &store); return err; } diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Create.c b/packages/zoltan/src/Utilities/DDirectory/DD_Create.c index 1e2da7aef3..dd811ee1b0 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Create.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Create.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -60,13 +23,13 @@ extern "C" { /* NOTE: See file, README, for associated documentation. (RTH) */ /* Zoltan_DD_Create assumes the global object being managed by the - * directory is a Zoltan global ID, which is a ZOLTAN_ID_TYPE-tuple. - * The "num_gid" parameter is where we specify how many ZOLTAN_ID_TYPEs + * directory is a Zoltan global ID, which is a ZOLTAN_ID_TYPE-tuple. + * The "num_gid" parameter is where we specify how many ZOLTAN_ID_TYPEs * are in the object (zz->Num_GID). * * However, some Zoltan code uses a data directory to manage other * global integer values. When the ZOLTAN_ID_TYPE was always be an - * unsigned integer, that worked. + * unsigned integer, that worked. * * But now that the ZOLTAN_ID_TYPE can be specified at compile time, * we need to be more careful. @@ -79,7 +42,7 @@ extern "C" { * managed by the data directory is a 64-bit int, "num_gid" should * be "2". * - * The "num_lid" parameter specifies the number ZOLTAN_ID_TYPEs in + * The "num_lid" parameter specifies the number ZOLTAN_ID_TYPEs in * the local ID. * * The "user_length" parameter specifies the number of chars in the @@ -92,7 +55,7 @@ int Zoltan_DD_Create ( Zoltan_DD_Directory **dd, /* contains directory state and pointers */ MPI_Comm comm, /* Dup'ed and saved for future use */ int num_gid, /* Number of entries in a global ID. */ - int num_lid, /* Number of entries in a local ID. + int num_lid, /* Number of entries in a local ID. If zero, ignore LIDs */ int user_length, /* Optional user data length in chars, 0 ignore */ int table_length, /* sizeof hash table, use default if 0 */ @@ -193,7 +156,7 @@ int Zoltan_DD_Create ( } /******************* Copy functions ***************************/ - + Zoltan_DD_Directory *Zoltan_DD_Copy(Zoltan_DD_Directory *from) { @@ -221,16 +184,16 @@ int Zoltan_DD_Copy_To(Zoltan_DD_Directory **toptr, Zoltan_DD_Directory *from) if (from) { DD_NodeIdx i; - to = *toptr = + to = *toptr = (Zoltan_DD_Directory *)ZOLTAN_MALLOC( - sizeof (Zoltan_DD_Directory) + + sizeof (Zoltan_DD_Directory) + (from->table_length * sizeof(DD_NodeIdx))); if (!to) { - ZOLTAN_PRINT_ERROR(from->my_proc, yo, "Insufficient memory."); + ZOLTAN_PRINT_ERROR(from->my_proc, yo, "Insufficient memory."); return ZOLTAN_MEMERR; } - + *to = *from; memcpy(to->table, from->table, to->table_length * sizeof(DD_NodeIdx)); @@ -251,7 +214,7 @@ int Zoltan_DD_Copy_To(Zoltan_DD_Directory **toptr, Zoltan_DD_Directory *from) return ZOLTAN_OK; } - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Destroy.c b/packages/zoltan/src/Utilities/DDirectory/DD_Destroy.c index fb6ed1d411..6fe65c1faa 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Destroy.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Destroy.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Find.c b/packages/zoltan/src/Utilities/DDirectory/DD_Find.c index 41edd34491..ec11679d98 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Find.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Find.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Hash2.c b/packages/zoltan/src/Utilities/DDirectory/DD_Hash2.c index 4decb35a4c..1a1d498afe 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Hash2.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Hash2.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -119,7 +82,7 @@ unsigned int Zoltan_DD_Hash2(ZOLTAN_ID_PTR key, int num_id_entries, * * Author: * Erik Boman, eboman@cs.sandia.gov (SNL 9226) - + * Replaced explict constant with #define below. Consider changing * to new constant. Changed name to DD_Hash2. RTH */ diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Memory.c b/packages/zoltan/src/Utilities/DDirectory/DD_Memory.c index f2503ef201..17dc118d38 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Memory.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Memory.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -58,10 +21,10 @@ extern "C" { /* * Idea: Store hash table as array of bucket heads, pointing into - * an array-based linked list of nodes (instead of to individually + * an array-based linked list of nodes (instead of to individually * allocated nodes). * The array-based memory would have a free-memory list running - * through it, allowing items to be added to or deleted from the + * through it, allowing items to be added to or deleted from the * directory. */ @@ -70,7 +33,7 @@ int DD_Memory_Alloc_Nodelist( Zoltan_DD_Directory *dd, /* directory state information */ DD_NodeIdx count, /* Number of GIDs in update list */ float overalloc /* Percentage to extra nodes to - allocate (for future dynamic + allocate (for future dynamic additions). */ ) { @@ -93,7 +56,7 @@ int DD_Memory_Alloc_Nodelist( /* Initialize the freenode list; all nodes are initially free. */ /* Also initialize gid pointers to nodedata. */ dd->nextfreenode = 0; - for (ptr = dd->nodelist, dataptr = dd->nodedata, nodeidx = 0; + for (ptr = dd->nodelist, dataptr = dd->nodedata, nodeidx = 0; nodeidx < len; nodeidx++, ptr++, dataptr += dd->nodedata_size) { ptr->next = nodeidx + 1; @@ -134,7 +97,7 @@ DD_NodeIdx returnnode; /* Reinitialize the gid pointers in the realloc'ed nodelist. */ for (ptr = dd->nodelist, dataptr = dd->nodedata, nodeidx = 0; nodeidx < newlen; - ptr++, dataptr += dd->nodedata_size, nodeidx++) + ptr++, dataptr += dd->nodedata_size, nodeidx++) ptr->gid = (ZOLTAN_ID_PTR) dataptr; /* Initialize free list in the newly extended memory */ @@ -165,7 +128,7 @@ void DD_Memory_Free_Node( ) { /* "free" a node by returning it to the free list. */ - + /* TODO Error check: freenode should be < nodelistlen */ dd->nodelist[freenode].next = dd->nextfreenode; diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Memory.h b/packages/zoltan/src/Utilities/DDirectory/DD_Memory.h index c53aa7a575..9569be812e 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Memory.h +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Memory.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_DD_MEMORY_H_ #define ZOLTAN_DD_MEMORY_H_ diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Print.c b/packages/zoltan/src/Utilities/DDirectory/DD_Print.c index 3c1aeb212f..5948a2481b 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Print.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Print.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Remove.c b/packages/zoltan/src/Utilities/DDirectory/DD_Remove.c index 93f04c2d5e..6c00519d89 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Remove.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Remove.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Hash_Fn.c b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Hash_Fn.c index 26d058fb35..ccf404b5f0 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Hash_Fn.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Hash_Fn.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -61,7 +24,7 @@ extern "C" { static unsigned int dd_hash_user ( - ZOLTAN_ID_PTR gid, int gid_length, + ZOLTAN_ID_PTR gid, int gid_length, unsigned int nproc, void *data, ZOLTAN_HASH_FN *fn) @@ -87,7 +50,7 @@ int Zoltan_DD_Set_Hash_Fn ( dd->hash = (DD_Hash_fn*)dd_hash_user; dd->hashdata = NULL; dd->hashfn = hash; - dd->cleanup = (DD_Cleanup_fn*) NULL; + dd->cleanup = (DD_Cleanup_fn*) NULL; if (dd->debug_level > 0) ZOLTAN_PRINT_INFO (dd->my_proc, yo, "Successful"); diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn1.c b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn1.c index b89ff5efc0..bce1d5bd53 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn1.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn1.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn2.c b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn2.c index c2aa4e499a..c1e0578ad2 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn2.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn2.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -183,17 +146,17 @@ static unsigned int dd_nh2 (ZOLTAN_ID_PTR gid, int gid_length, static int compare_sort (const void *a, const void *b) { - if (((const Range_Info*) a)->low < ((const Range_Info *) b)->low) return -1; - if (((const Range_Info*) a)->low > ((const Range_Info *) b)->low) return 1; + if (((Range_Info*) a)->low < ((Range_Info *) b)->low) return -1; + if (((Range_Info*) a)->low > ((Range_Info *) b)->low) return 1; else return 0 ; } static int compare_search (const void *a, const void *b) { - int temp = (signed) *((const ZOLTAN_ID_TYPE *) a); - if (temp < ((const Range_Info*) b)->low) return -1; - if (temp > ((const Range_Info*) b)->high) return 1; + int temp = (signed) *((ZOLTAN_ID_TYPE *) a); + if (temp < ((Range_Info*) b)->low) return -1; + if (temp > ((Range_Info*) b)->high) return 1; else return 0 ; } diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn3.c b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn3.c index 91483465a5..dba1f9ef4c 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn3.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Set_Neighbor_Hash_Fn3.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Stats.c b/packages/zoltan/src/Utilities/DDirectory/DD_Stats.c index 9a1b564084..30374a30dd 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Stats.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Stats.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/Utilities/DDirectory/DD_Update.c b/packages/zoltan/src/Utilities/DDirectory/DD_Update.c index cf9aa8865a..19f31fa110 100644 --- a/packages/zoltan/src/Utilities/DDirectory/DD_Update.c +++ b/packages/zoltan/src/Utilities/DDirectory/DD_Update.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -179,11 +142,11 @@ int Zoltan_DD_Update ( if (dd->debug_level > 6) ZOLTAN_PRINT_INFO(dd->my_proc, yo, "After Comm_Create"); - /* If dd has no nodes allocated (e.g., first call to DD_Update; - * create the nodelist and freelist + /* If dd has no nodes allocated (e.g., first call to DD_Update; + * create the nodelist and freelist */ if (nrec && dd->nodelistlen == 0) { - DD_Memory_Alloc_Nodelist(dd, (DD_NodeIdx) nrec, 0.); + DD_Memory_Alloc_Nodelist(dd, (DD_NodeIdx) nrec, 0.); /* TODO Add overalloc parameter */ } diff --git a/packages/zoltan/src/Utilities/DDirectory/README b/packages/zoltan/src/Utilities/DDirectory/README index 1bdd561a1b..659daaca70 100644 --- a/packages/zoltan/src/Utilities/DDirectory/README +++ b/packages/zoltan/src/Utilities/DDirectory/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ZOLTAN Distributed Directory (DD) Software Documentation diff --git a/packages/zoltan/src/Utilities/DDirectory/zoltan_dd_const.h b/packages/zoltan/src/Utilities/DDirectory/zoltan_dd_const.h index a135c207ab..40bf8758af 100644 --- a/packages/zoltan/src/Utilities/DDirectory/zoltan_dd_const.h +++ b/packages/zoltan/src/Utilities/DDirectory/zoltan_dd_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_DD_H #define ZOLTAN_DD_H @@ -87,7 +50,7 @@ typedef void DD_Cleanup_fn(void*); /************ Zoltan_DD_Directory, DD_Node **********************/ -typedef int DD_NodeIdx; /* Index into dd->nodelist; +typedef int DD_NodeIdx; /* Index into dd->nodelist; must be a signed type as -1 indicates NULL */ /* The following structure, DD_Node, is the basic unit of the hash table's @@ -100,7 +63,7 @@ typedef struct DD_Node { int owner; /* processor hosting global ID object */ int partition; /* Optional data */ int errcheck; /* Error checking(inconsistent updates) */ - DD_NodeIdx next; /* index in nodelist of next DD_Node in + DD_NodeIdx next; /* index in nodelist of next DD_Node in linked list or free node list */ ZOLTAN_ID_TYPE *gid; /* gid used as key for update & lookup */ /* lid starts at gid + dd->gid_length */ @@ -146,7 +109,7 @@ struct Zoltan_DD_Struct { DD_Node *nodelist; /* Memory for storing all nodes in the directory */ char *nodedata; /* Memory for storing all data in the directory */ DD_NodeIdx nodelistlen; /* Length of the nodelist. */ - DD_NodeIdx nextfreenode;/* Index of first free node in nodelist; + DD_NodeIdx nextfreenode;/* Index of first free node in nodelist; -1 if no nodes are free */ DD_NodeIdx table[1]; /* Hash table heads of the link lists */ }; diff --git a/packages/zoltan/src/Utilities/Memory/README b/packages/zoltan/src/Utilities/Memory/README index 24d1e18a5c..211efb8b71 100644 --- a/packages/zoltan/src/Utilities/Memory/README +++ b/packages/zoltan/src/Utilities/Memory/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER MEMORY UTILITIES -- Routines for memory allocation and deallocation. ---------------------------------------------------------------- diff --git a/packages/zoltan/src/Utilities/Memory/mem.c b/packages/zoltan/src/Utilities/Memory/mem.c index 13ff4d8e38..24f1950b20 100644 --- a/packages/zoltan/src/Utilities/Memory/mem.c +++ b/packages/zoltan/src/Utilities/Memory/mem.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012, 2023 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -79,8 +42,8 @@ static int nfree = 0; /* number of calls to free */ #ifdef ZOLTAN_NO_MPI #define GET_RANK(a) *(a)=0 #else -#include -#define GET_RANK(a) MPI_Comm_rank(MPI_COMM_WORLD, (a)) +#include +#define GET_RANK(a) MPI_Comm_rank(zoltan_get_global_comm(), (a)) #endif #define MAX_STRING_LEN 50 @@ -358,7 +321,7 @@ double *Zoltan_Malloc(size_t n, char *filename, int lineno) else { /* n < 0 */ GET_RANK(&proc); fprintf(stderr, "%s (from %s,%d) ERROR on proc %d: " - "Negative malloc argument. (%lu)\n", yo, filename, lineno, proc, + "Negative malloc argument. (%lu)\n", yo, filename, lineno, proc, (unsigned long) n); return ((double *) NULL); } @@ -517,8 +480,8 @@ void Zoltan_Free (void **ptr, char *filename, int lineno) * This version of free calls the system's free function. It doesn't call * free if ptr is the NULL pointer. */ - - if (ptr == NULL || *ptr == NULL) + + if (ptr == NULL || *ptr == NULL) return; nfree++; @@ -533,7 +496,7 @@ void Zoltan_Free (void **ptr, char *filename, int lineno) if (dbptr == NULL) { GET_RANK(&proc); fprintf(stderr, "Proc %d: Memory error: In free, address (0x%lx) " - "not found in debug list. File=%s, line=%d.\n", proc, + "not found in debug list. File=%s, line=%d.\n", proc, (long) *ptr, filename, lineno); } else { @@ -555,7 +518,7 @@ void Zoltan_Free (void **ptr, char *filename, int lineno) #else free(*ptr); #endif - + /* Set value of ptr to NULL, to flag further references to it. */ *ptr = NULL; @@ -570,7 +533,7 @@ void Zoltan_Multifree(char *filename, int lineno, int n, ...) { int i; va_list va; - + va_start(va, n); for (i=0; i 1) { GET_RANK(&proc); fprintf(stderr, "Proc %d: Calls to malloc = %d, Calls to free = %d, " - "Max bytes = %lu, total bytes = %lu\n", + "Max bytes = %lu, total bytes = %lu\n", proc, nmalloc, nfree, (unsigned long) bytes_max, (unsigned long) bytes_used); - if (nmalloc > nfree) + if (nmalloc > nfree) fprintf(stderr, "Proc %d: Possible memory error: " "# malloc > # free.\n", proc); else if (nfree > nmalloc) @@ -634,7 +597,7 @@ void Zoltan_Memory_Stats(void) fprintf(stderr, "Proc %d: Remaining allocations:\n", proc); for (dbptr = top; dbptr != NULL; dbptr = dbptr->next) { fprintf(stderr, " order=%d, size=%lu, location=0x%lx, " - "file=%s, line=%d\n", + "file=%s, line=%d\n", dbptr->order, (unsigned long) (dbptr->size), (long) dbptr->ptr, dbptr->file, dbptr->line); @@ -663,7 +626,7 @@ size_t Zoltan_Memory_Usage (int type) void Zoltan_Memory_Reset (int type) { -/* Reset total bytes used currently or maximum bytes used at any point +/* Reset total bytes used currently or maximum bytes used at any point to zero. */ if (type == ZOLTAN_MEM_STAT_TOTAL) diff --git a/packages/zoltan/src/Utilities/README b/packages/zoltan/src/Utilities/README index f721007f11..51bad6485a 100644 --- a/packages/zoltan/src/Utilities/README +++ b/packages/zoltan/src/Utilities/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Zoltan Utilities diff --git a/packages/zoltan/src/Utilities/Timer/README b/packages/zoltan/src/Utilities/Timer/README index 9a2c5c410d..e624cf1d6f 100644 --- a/packages/zoltan/src/Utilities/Timer/README +++ b/packages/zoltan/src/Utilities/Timer/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER TIMER UTILITY -- Routines to implement Zoltan_Time and Zoltan_Timer objects. ---------------------------------------------------------------------------- diff --git a/packages/zoltan/src/Utilities/Timer/timer.c b/packages/zoltan/src/Utilities/Timer/timer.c index 2146cc31cb..54ff01cab1 100644 --- a/packages/zoltan/src/Utilities/Timer/timer.c +++ b/packages/zoltan/src/Utilities/Timer/timer.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -81,9 +44,9 @@ double Zoltan_Time(int timer) static clock_t last_num_ticks = 0; static int clock_rollovers = 0; static double secs_per_clock = (double) 1./((double) CLOCKS_PER_SEC); - static double clock_width = + static double clock_width = ((double)(1L<<((int)sizeof(clock_t)*8-2)))*4./((double) CLOCKS_PER_SEC); - static double secs_per_tick = 0.; /* Not necessarily the same as + static double secs_per_tick = 0.; /* Not necessarily the same as secs_per_clock; system-dependent; get value from sysconf(). */ #endif @@ -117,9 +80,9 @@ double Zoltan_Time(int timer) } -/* Resolution (precision) of timer. +/* Resolution (precision) of timer. * This is really a lower bound, the actual resolution may be worse. - * If the precision is unknown, -1 is returned. + * If the precision is unknown, -1 is returned. */ double Zoltan_Time_Resolution(int timer) @@ -133,7 +96,7 @@ double Zoltan_Time_Resolution(int timer) #ifndef NO_TIMES else if (timer==ZOLTAN_TIME_USER) t = (double) 1. / ((double) sysconf(_SC_CLK_TCK)); -#endif +#endif return t; } diff --git a/packages/zoltan/src/Utilities/Timer/timer.h b/packages/zoltan/src/Utilities/Timer/timer.h index daf00f1cbc..d7904c64c0 100644 --- a/packages/zoltan/src/Utilities/Timer/timer.h +++ b/packages/zoltan/src/Utilities/Timer/timer.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __TIMER_H #define __TIMER_H @@ -55,11 +18,11 @@ #endif /* - * POSIX compliant systems should use times() for user timing. + * POSIX compliant systems should use times() for user timing. * This is the default in Zoltan. Make Zoltan with -DNO_TIMES if * your system does not have sys/times.h and times(). * Note: BSD-like systems may use getrusage() instead for user timing, - * but that has not been implemented here. + * but that has not been implemented here. */ #if defined(__PUMAGON__) || defined(__LIBCATAMOUNT__) || defined(_WIN32) diff --git a/packages/zoltan/src/Utilities/Timer/zoltan_timer.c b/packages/zoltan/src/Utilities/Timer/zoltan_timer.c index 9c967208e2..88188d41c8 100644 --- a/packages/zoltan/src/Utilities/Timer/zoltan_timer.c +++ b/packages/zoltan/src/Utilities/Timer/zoltan_timer.c @@ -1,54 +1,18 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "zoltan_timer.h" #include "zoltan_types.h" #include "zoltan_util.h" #include "zoltan_mem.h" +#include "zoltan_comm.h" #ifdef VAMPIR #include @@ -72,12 +36,12 @@ extern "C" { /****************************************************************************/ /* Number of timers initially in Timer object. */ -#define INITLENGTH 30 +#define INITLENGTH 30 /* Length of character strings naming each timer. */ /* If you change this constant, change the string format */ /* in Zoltan_Timer_Print, too. */ -#define MAXNAMELEN 31 +#define MAXNAMELEN 31 /* Flag indicating whether a timer is in use. */ #define INUSE 1 @@ -88,11 +52,11 @@ extern "C" { #define FATALERROR(yo, str) \ { \ int ppproc; \ - MPI_Comm_rank(MPI_COMM_WORLD, &ppproc); \ + MPI_Comm_rank(zoltan_get_global_comm(), &ppproc); \ ZOLTAN_PRINT_ERROR(ppproc, yo, str); \ return ZOLTAN_FATAL; \ } - + /* Macro to ensure that a Timer object is non-NULL */ #define TESTTIMER(zt, yo) \ @@ -106,7 +70,7 @@ extern "C" { /****************************************************************************/ /* Structure that implements an individual timer. */ typedef struct TimeStruct { - double Start_Time; /* Most recent start time; + double Start_Time; /* Most recent start time; set by Zoltan_Timer_Start */ double Stop_Time; /* Most recent end time; set by Zoltan_Timer_Stop */ @@ -128,7 +92,7 @@ typedef struct TimeStruct { #endif } ZTIMER_TS; -/* Timer object consisting of many related timers. +/* Timer object consisting of many related timers. * Applications access this structure. */ typedef struct Zoltan_Timer { int Timer_Flag; /* Zoltan Timer_Flag flag passed to Zoltan_Time */ @@ -174,7 +138,7 @@ int Zoltan_Timer_Copy_To(ZTIMER **to, ZTIMER *from) toptr->Times = NULL; } } - + return ZOLTAN_OK; } @@ -183,7 +147,7 @@ ZTIMER *Zoltan_Timer_Create( int timer_flag ) { -/* Allocates a Timer object for the application; returns a pointer to it. +/* Allocates a Timer object for the application; returns a pointer to it. * Does not start any timers. */ @@ -196,7 +160,7 @@ int i; zt->Length = INITLENGTH; zt->NextTimeStruct = 0; - for (i = 0; i < zt->Length; i++) + for (i = 0; i < zt->Length; i++) zt->Times[i].Status = 0; return zt; @@ -205,7 +169,7 @@ int i; /****************************************************************************/ int Zoltan_Timer_Init( ZTIMER *zt, /* Ptr to Timer object */ - int use_barrier, /* Flag indicating whether to perform a + int use_barrier, /* Flag indicating whether to perform a barrier operation before starting the timer. */ const char *name /* Name of this timer */ @@ -216,7 +180,7 @@ int ret; static char *yo = "Zoltan_Timer_Init"; TESTTIMER(zt, yo); - + ret = zt->NextTimeStruct++; if (ret >= zt->Length) { @@ -240,7 +204,7 @@ static char *yo = "Zoltan_Timer_Init"; int Zoltan_Timer_Reset( ZTIMER *zt, int ts_idx, /* Index of the timer to reset */ - int use_barrier, /* Flag indicating whether to perform a + int use_barrier, /* Flag indicating whether to perform a barrier operation before starting the timer. */ const char *name /* Name of this timer */ @@ -287,7 +251,7 @@ static char *yo = "Zoltan_Timer_ChangeFlag"; int Zoltan_Timer_Start( ZTIMER *zt, /* Ptr to Timer object */ int ts_idx, /* Index of the timer to use */ - MPI_Comm comm, /* Communicator to use for synchronization, + MPI_Comm comm, /* Communicator to use for synchronization, if requested */ char *filename, /* Filename of file calling the Start */ int lineno /* Line number where Start was called */ @@ -302,7 +266,7 @@ static char *yo = "Zoltan_Timer_Start"; ts = &(zt->Times[ts_idx]); if (ts->Status > RUNNING) { char msg[256]; - sprintf(msg, + sprintf(msg, "Cannot start timer %d at %s:%d; timer already running from %s:%d.", ts_idx, filename, lineno, ts->Start_File, ts->Start_Line); FATALERROR(yo, msg) @@ -329,7 +293,7 @@ static char *yo = "Zoltan_Timer_Start"; int Zoltan_Timer_Stop( ZTIMER *zt, /* Ptr to Timer object */ int ts_idx, /* Index of the timer to use */ - MPI_Comm comm, /* Communicator to use for synchronization, + MPI_Comm comm, /* Communicator to use for synchronization, if requested */ char *filename, /* Filename of file calling the Stop */ int lineno /* Line number where Stop was called */ @@ -349,7 +313,7 @@ double my_time; FATALERROR(yo, "Cannot stop timer; timer never started.") else { char msg[256]; - sprintf(msg, + sprintf(msg, "Cannot stop timer %d at %s:%d; " "timer already stopped from %s:%d.", ts_idx, filename, lineno, ts->Stop_File, ts->Stop_Line); @@ -385,9 +349,9 @@ int Zoltan_Timer_Print( FILE *fp ) { -/* Accrues a single timer's values across a communicator and prints +/* Accrues a single timer's values across a communicator and prints * its information. This function must be called by all processors - * within the communicator. + * within the communicator. */ static char *yo = "Zoltan_Timer_Print"; ZTIMER_TS *ts; @@ -415,11 +379,11 @@ double sum_time; MPI_Allreduce(&(ts->My_Tot_Time), &min_time, 1, MPI_DOUBLE, MPI_MIN, comm); MPI_Allreduce(&(ts->My_Tot_Time), &sum_time, 1, MPI_DOUBLE, MPI_SUM, comm); - if (proc == my_proc) + if (proc == my_proc) fprintf(fp, "%3d ZOLTAN_TIMER %3d %23s: MyTime %7.4f " "MaxTime %7.4f MinTime %7.4f AvgTime %7.4f\n", - proc, ts_idx, ts->Name, ts->My_Tot_Time, + proc, ts_idx, ts->Name, ts->My_Tot_Time, max_time, min_time, sum_time/nproc); if (restart) { @@ -434,7 +398,7 @@ double sum_time; int Zoltan_Timer_PrintAll( ZTIMER *zt, int proc, /* Rank of the processor (in comm) that should print the data. */ - MPI_Comm comm, + MPI_Comm comm, FILE *fp ) { @@ -443,7 +407,7 @@ static char *yo = "Zoltan_Timer_PrintAll"; int i, ierr = ZOLTAN_OK; TESTTIMER(zt, yo); - for (i = 0; i < zt->NextTimeStruct; i++) + for (i = 0; i < zt->NextTimeStruct; i++) if ((ierr = Zoltan_Timer_Print(zt, i, proc, comm, fp)) != ZOLTAN_OK) break; diff --git a/packages/zoltan/src/Utilities/shared/zoltan_align.c b/packages/zoltan/src/Utilities/shared/zoltan_align.c index a9c3d9374e..187428f70d 100644 --- a/packages/zoltan/src/Utilities/shared/zoltan_align.c +++ b/packages/zoltan/src/Utilities/shared/zoltan_align.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -60,7 +23,7 @@ extern "C" { */ /*****************************************************************************/ -/* +/* * Plauger alignment algorithm, The Standard C Library. * Forces malloc'ed variable size struct alignment. * ZOLTAN_ALIGN_VAL is defined in Zoltan/include/zoltan_align.h; diff --git a/packages/zoltan/src/Utilities/shared/zoltan_id.c b/packages/zoltan/src/Utilities/shared/zoltan_id.c index ca08e0b803..d039d2f578 100644 --- a/packages/zoltan/src/Utilities/shared/zoltan_id.c +++ b/packages/zoltan/src/Utilities/shared/zoltan_id.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -58,14 +21,14 @@ extern "C" { /*****************************************************************************/ /* - * This file contains routines for manipulating + * This file contains routines for manipulating * the global and local IDs used by Zoltan. * * Some manipulations are performed via macros. In particular, macros * specifying whether global or local IDs are to be manipulated are * provided. Use of these macros is recommended over use of these * basic functions. - * See zoltan_id.h for definitions of these macros. + * See zoltan_id.h for definitions of these macros. */ /*****************************************************************************/ /*****************************************************************************/ @@ -82,8 +45,8 @@ ZOLTAN_ID_PTR ZOLTAN_Malloc_ID(int n, char *file, int line) ZOLTAN_ID_PTR tmp; char *yo = "ZOLTAN_Malloc_ID"; - /* - * Don't use ZOLTAN_MALLOC macro here; prefer to pass file and line + /* + * Don't use ZOLTAN_MALLOC macro here; prefer to pass file and line * where ZOLTAN_Malloc_ID was called. */ tmp = (ZOLTAN_ID_PTR) Zoltan_Malloc(n * sizeof(ZOLTAN_ID_TYPE), file, line); @@ -117,14 +80,14 @@ int i; printf( ZOLTAN_ID_SPEC " ",a[i]); printf(") "); } - + /*****************************************************************************/ /*****************************************************************************/ /* - * Routines to compare Global IDs. + * Routines to compare Global IDs. * Functions are provided to test whether two IDs are equal (EQ), * less than (LT), and greater than (GT). - * The negation operator can be used to test whether two IDs are + * The negation operator can be used to test whether two IDs are * not equal (!ZOLTAN_EQ_ID(n,a,b)), less than or equal (!ZOLTAN_GT_GID(n,a,b)) * or greater than or equal (!ZOLTAN_LT_GID(n,a,b)). */ @@ -132,7 +95,7 @@ int i; int ZOLTAN_EQ_ID(int n, ZOLTAN_ID_PTR a, ZOLTAN_ID_PTR b) { -/* +/* * Returns 1 if a == b; 0 otherwise. * a == b if for all i, a[i] == b[i]. */ @@ -150,7 +113,7 @@ int i; int ZOLTAN_LT_ID(int n, ZOLTAN_ID_PTR a, ZOLTAN_ID_PTR b) { -/* +/* * Returns 1 if a < b; 0 otherwise. * a < b if for some i, a[i] < b[i] and a[j] == b[j] for all j < i. */ @@ -170,7 +133,7 @@ int i; int ZOLTAN_GT_ID(int n, ZOLTAN_ID_PTR a, ZOLTAN_ID_PTR b) { -/* +/* * Returns 1 if a < b; 0 otherwise. * a > b if for some i, a[i] > b[i] and a[j] == b[j] for all j < i. */ diff --git a/packages/zoltan/src/Utilities/shared/zoltan_id.h b/packages/zoltan/src/Utilities/shared/zoltan_id.h index bf2aa8f093..b6b119c312 100644 --- a/packages/zoltan/src/Utilities/shared/zoltan_id.h +++ b/packages/zoltan/src/Utilities/shared/zoltan_id.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_ID_H #define __ZOLTAN_ID_H @@ -62,7 +25,7 @@ extern "C" { /****************************************************************************/ /* - * Default value of ZOLTAN_ID_TYPE; + * Default value of ZOLTAN_ID_TYPE; * IDs allocated with ZOLTAN_MALLOC_ID are initialized with this value. */ #define ZOLTAN_ID_DEFAULT 0 diff --git a/packages/zoltan/src/Utilities/shared/zoltan_util.h b/packages/zoltan/src/Utilities/shared/zoltan_util.h index 1a50801dcd..6a24d6628d 100644 --- a/packages/zoltan/src/Utilities/shared/zoltan_util.h +++ b/packages/zoltan/src/Utilities/shared/zoltan_util.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_UTIL_H #define __ZOLTAN_UTIL_H @@ -142,8 +105,8 @@ extern "C" { #endif /* !AUTOTOOLS_BUILD */ /*****************************************************************************/ -/* - * Macros and definitions that are common to all Zoltan modules and +/* + * Macros and definitions that are common to all Zoltan modules and * utilities. */ /*****************************************************************************/ diff --git a/packages/zoltan/src/all/README b/packages/zoltan/src/all/README index 002bc75fe6..228b516cc8 100644 --- a/packages/zoltan/src/all/README +++ b/packages/zoltan/src/all/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ALL DIRECTORY -- Routines for memory allocation and deallocation. ---------------------------------------------------------------- diff --git a/packages/zoltan/src/all/all_allo.c b/packages/zoltan/src/all/all_allo.c index d85febaf6c..01bbb54d85 100644 --- a/packages/zoltan/src/all/all_allo.c +++ b/packages/zoltan/src/all/all_allo.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -275,7 +238,7 @@ int Zoltan_Special_Free(ZZ *zz, void **array, /****************************************************************************/ /****************************************************************************/ -int Zoltan_Special_Fort_Malloc_Set_Struct(int *zz_addr_bytes, int **fort_zz) +int Zoltan_Special_Fort_Malloc_Set_Struct(int *zz_addr_bytes, int **fort_zz) { Zoltan_Fort_Malloc_Set_Struct(zz_addr_bytes, fort_zz); return 1; diff --git a/packages/zoltan/src/all/all_allo_const.h b/packages/zoltan/src/all/all_allo_const.h index 2a12deb63a..e8f0707f80 100644 --- a/packages/zoltan/src/all/all_allo_const.h +++ b/packages/zoltan/src/all/all_allo_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ALL_ALLO_H @@ -97,7 +60,7 @@ extern int Zoltan_Special_Free(ZZ *zz, void **array, extern void Zoltan_Register_Fort_Malloc(ZOLTAN_FORT_MALLOC_INT_FN *, ZOLTAN_FORT_FREE_INT_FN *, ZOLTAN_FORT_MALLOC_SET_STRUCT_FN *); -extern int Zoltan_Special_Fort_Malloc_Set_Struct(int *zz_addr_bytes, +extern int Zoltan_Special_Fort_Malloc_Set_Struct(int *zz_addr_bytes, int **fort_zz); extern int Zoltan_Special_Fort_Free_Struct(int *fort_zz); diff --git a/packages/zoltan/src/ch/README b/packages/zoltan/src/ch/README index 67ce535594..5548c25185 100644 --- a/packages/zoltan/src/ch/README +++ b/packages/zoltan/src/ch/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER CH DIRECTORY -- code for reading Chaco input files. --------------------------------------------------- diff --git a/packages/zoltan/src/ch/ch_dist_graph.c b/packages/zoltan/src/ch/ch_dist_graph.c index b7e0ddad4c..00e869d0e9 100644 --- a/packages/zoltan/src/ch/ch_dist_graph.c +++ b/packages/zoltan/src/ch/ch_dist_graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -107,7 +70,7 @@ int chaco_dist_graph( /* Initialize */ use_graph = (*xadj != NULL); - + /* Handle serial case and return. */ if (nprocs == 1) { /* Set values expected to be returned by this function. */ @@ -129,7 +92,7 @@ int chaco_dist_graph( /* Initialize the chaco distribution on all processors */ ch_dist_init(nprocs, *gnvtxs, pio_info, assignments, host_proc, comm); - + /* Store pointers to original data */ if (myproc == host_proc) { old_xadj = *xadj; @@ -173,8 +136,8 @@ int chaco_dist_graph( } - /* - * Distribute vertex data (xadj, coordinates, etc ) to all procs + /* + * Distribute vertex data (xadj, coordinates, etc ) to all procs */ if (myproc == host_proc){ @@ -336,8 +299,8 @@ int chaco_dist_graph( } - /* - * Distribute edge data to all procs + /* + * Distribute edge data to all procs */ if (use_graph) { @@ -387,7 +350,7 @@ int chaco_dist_graph( nvtx_edges = old_xadj[v+1] - old_xadj[v]; for (j = 0; j < nvtx_edges; j++) { (*adjncy)[adj_cnt] = old_adjncy[offset+j]; - if (*ewgt_dim){ + if (*ewgt_dim){ for (k=0; k<*ewgt_dim; k++) (*ewgts)[adj_cnt*(*ewgt_dim)+k] = old_ewgts[(offset+j)*(*ewgt_dim)+k]; } @@ -464,7 +427,7 @@ int chaco_dist_graph( safe_free((void **)(void *) &vtx_list); } if (size != NULL) safe_free((void **)(void *) &size); - + DEBUG_TRACE_END(myproc, yo); return 1; } diff --git a/packages/zoltan/src/ch/ch_init_dist.c b/packages/zoltan/src/ch/ch_init_dist.c index ed8d9a7230..680703ba4e 100644 --- a/packages/zoltan/src/ch/ch_init_dist.c +++ b/packages/zoltan/src/ch/ch_init_dist.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -64,11 +27,11 @@ extern "C" { * of the switch statements in this file. * * Methods currently implemented: - * INITIAL_FILE: takes assignments from user input file + * INITIAL_FILE: takes assignments from user input file * (graphname.assign). * INITIAL_LINEAR: assigns the first n/p vertices to proc 0, the * next n/p vertices to proc 1, etc. - * INITIAL_OWNER: same as INITIAL_LINEAR; takes on different meaning + * INITIAL_OWNER: same as INITIAL_LINEAR; takes on different meaning * only for hyperedges. * INITIAL_CYCLIC: deals out the vertices like cards; i.e., proc 0 * gets the first vertex, proc 1 gets the second vertex, @@ -82,13 +45,13 @@ extern "C" { */ /*****************************************************************************/ -/* Global variables for all routines in this file. These variables +/* Global variables for all routines in this file. These variables * are set in ch_dist_init and are used in all subsequent queries of * the chaco distribution. */ static ZOLTAN_GNO_TYPE Gnvtxs; /* Global number of vertices (across all procs) */ static int Num_Proc; /* Global number of processors */ -static int Num_Proc_Dist; /* Number of processors to distribute data; +static int Num_Proc_Dist; /* Number of processors to distribute data; Num_Proc_Dist may be < Num_Proc! */ static int Initial_Method; /* Flag indicating which initial decomposition method to use. */ @@ -96,8 +59,8 @@ static int Initial_Method; /* Flag indicating which initial decomposition /*****************************************************************************/ /* Data structures specifically for INITIAL_LINEAR */ static ZOLTAN_GNO_TYPE *Vtxdist; /* Array of size Num_Proc+1 indicating range of - vertices assigned to a processor. It is - assumed that vertices are numbered + vertices assigned to a processor. It is + assumed that vertices are numbered consecutively. The values stored in Vtxdist assume vertex IDs are zero-based (e.g., the lowest-numbered vertex has ID 0). @@ -117,26 +80,26 @@ void ch_dist_init(int num_proc, int gnvtxs, PARIO_INFO_PTR pio_info, * global variables to be used in the query routines included in this * file. It also performs any initializations that a particular method * may need. - * All processors call this routine prior to the actual distribution of + * All processors call this routine prior to the actual distribution of * graph data. */ int proc, i; int max_assignment, have_assignments; - Num_Proc = num_proc; + Num_Proc = num_proc; Gnvtxs = gnvtxs; Num_Proc_Dist = pio_info->init_dist_procs; - /* If Num_Proc_Dist has an invalid value, set it to Num_Proc by default */ - if ((Num_Proc_Dist <= 0) || (Num_Proc_Dist > Num_Proc)) + /* If Num_Proc_Dist has an invalid value, set it to Num_Proc by default */ + if ((Num_Proc_Dist <= 0) || (Num_Proc_Dist > Num_Proc)) Num_Proc_Dist = Num_Proc; - /* Broadcast initial assignments if they exist. + /* Broadcast initial assignments if they exist. * Assignments can be used for partitions and/or processors. */ - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); /* First, tell other processors whether the assignments array is NULL. */ - if (proc == host_proc) + if (proc == host_proc) have_assignments = (*assignments != NULL); MPI_Bcast(&have_assignments, 1, MPI_INT, host_proc, comm); @@ -176,7 +139,7 @@ int max_assignment, have_assignments; case INITIAL_CYCLIC: /* no initialization needed for this method. */ break; - default: + default: Gen_Error(0, "Invalid Initial Distribution Type in ch_dist_init"); error_report(proc); return; @@ -231,7 +194,7 @@ int num; int ch_dist_max_num_vtx(short *assignments) { -/* Function that returns the maximum number of vertices assigned to any +/* Function that returns the maximum number of vertices assigned to any * processor. */ int i; @@ -251,7 +214,7 @@ void ch_dist_vtx_list( int *vtx_list, int *nvtx, int target_proc, - short *assignments + short *assignments ) { /* Function that returns a list of vertices assigned to proc target_proc. @@ -279,7 +242,7 @@ int i, proc; break; case INITIAL_CYCLIC: if (target_proc < Num_Proc_Dist){ - for (i = proc; i < Gnvtxs; i+=Num_Proc_Dist) + for (i = proc; i < Gnvtxs; i+=Num_Proc_Dist) vtx_list[(*nvtx)++] = i; } break; @@ -296,7 +259,7 @@ int i, proc; int ch_dist_proc(int v, short *assignments, int base) { /* Function that returns the processor to which a vertex v is assigned. - * The function assumes the vertex numbering is "base"-based (i.e., lowest + * The function assumes the vertex numbering is "base"-based (i.e., lowest * numbered vertex is vertex base); this convention is used since the function * is called primarily to find adjacent vertices' processor assignments and * the read-in adjacency information is "base"-based. @@ -314,12 +277,12 @@ ZOLTAN_GNO_TYPE b = (ZOLTAN_GNO_TYPE)base; case INITIAL_LINEAR: case INITIAL_OWNER: for (p = 0; p < Num_Proc_Dist; p++) - /* Since v is "base"-based and Vtxdist is 0-based, add base to + /* Since v is "base"-based and Vtxdist is 0-based, add base to * Vtxdist[p+1]. */ if (v < Vtxdist[p+1]+b) break; break; case INITIAL_CYCLIC: - /* test for (v-base) as v is "base"-based and + /* test for (v-base) as v is "base"-based and * INITIAL_CYCLIC equations are 0-based */ p = (v-b) % Num_Proc_Dist; break; @@ -338,10 +301,10 @@ static void create_Vtxdist() { /* Function that creates Vtxdist for the INITIAL_LINEAR distribution. * Vtxdist is an array of size Num_Proc+1 indicating range of - * vertices assigned to a processor. It is assumed that vertices are numbered - * consecutively. The values stored in Vtxdist assume vertex IDs are 0-based - * (e.g., the lowest-numbered vertex has ID 0). Proc p is assigned vertices - * Vtxdist[p] through (Vtxdist[p+1]-1), inclusive. + * vertices assigned to a processor. It is assumed that vertices are numbered + * consecutively. The values stored in Vtxdist assume vertex IDs are 0-based + * (e.g., the lowest-numbered vertex has ID 0). Proc p is assigned vertices + * Vtxdist[p] through (Vtxdist[p+1]-1), inclusive. */ int rest, i, n; diff --git a/packages/zoltan/src/ch/ch_init_dist_const.h b/packages/zoltan/src/ch/ch_init_dist_const.h index 102652bdaa..1cdee675e7 100644 --- a/packages/zoltan/src/ch/ch_init_dist_const.h +++ b/packages/zoltan/src/ch/ch_init_dist_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef CH_INIT_DIST_CONST_H diff --git a/packages/zoltan/src/ch/ch_input_assign.c b/packages/zoltan/src/ch/ch_input_assign.c index 85b87dc746..76184aaa3b 100644 --- a/packages/zoltan/src/ch/ch_input_assign.c +++ b/packages/zoltan/src/ch/ch_input_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* This software was developed by Bruce Hendrickson and Robert Leland * * at Sandia National Laboratories under US Department of Energy * @@ -236,7 +199,7 @@ short *assignment) /* values to be printed */ if (k <= 0 || k > nvtxs) { printf("ERROR: In assignment file `%s'\n", inassignname); - printf(" Entry %d of set %d invalid (%d)\n", + printf(" Entry %d of set %d invalid (%d)\n", total + i, set, k); ZOLTAN_FILE_close(finassign); DEBUG_TRACE_END(0, yo); diff --git a/packages/zoltan/src/ch/ch_input_const.h b/packages/zoltan/src/ch/ch_input_const.h index 1aa1c948a4..df9f1809be 100644 --- a/packages/zoltan/src/ch/ch_input_const.h +++ b/packages/zoltan/src/ch/ch_input_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __CH_INPUT_CONST_H diff --git a/packages/zoltan/src/ch/ch_input_geom.c b/packages/zoltan/src/ch/ch_input_geom.c index 3d9d42b6a7..b849981cf7 100644 --- a/packages/zoltan/src/ch/ch_input_geom.c +++ b/packages/zoltan/src/ch/ch_input_geom.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER diff --git a/packages/zoltan/src/ch/ch_input_graph.c b/packages/zoltan/src/ch/ch_input_graph.c index e4705b28d0..43d66e803e 100644 --- a/packages/zoltan/src/ch/ch_input_graph.c +++ b/packages/zoltan/src/ch/ch_input_graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER diff --git a/packages/zoltan/src/ch/ch_input_read.c b/packages/zoltan/src/ch/ch_input_read.c index cc5457b13f..0a473ff731 100644 --- a/packages/zoltan/src/ch/ch_input_read.c +++ b/packages/zoltan/src/ch/ch_input_read.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* This software was developed by Bruce Hendrickson and Robert Leland * diff --git a/packages/zoltan/src/coloring/bucket.c b/packages/zoltan/src/coloring/bucket.c index 6ff485f328..e1ff4f6a97 100644 --- a/packages/zoltan/src/coloring/bucket.c +++ b/packages/zoltan/src/coloring/bucket.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -52,7 +15,7 @@ extern "C" { #include #include #include "zoltan_mem.h" -#include "bucket.h" +#include "bucket.h" void Zoltan_Bucket_Insert(Bucket* bs, int id, int value) @@ -60,17 +23,17 @@ void Zoltan_Bucket_Insert(Bucket* bs, int id, int value) #if 0 assert (bs != NULL); assert (value >= 0); - assert (value <= bs->max_value); + assert (value <= bs->max_value); assert (id >= 0); assert (id < bs->nb_elements); #endif - + bs->values[id] = value; - + bs->elements[id].prev = NULL; bs->elements[id].next = bs->buckets[value]; - - if (bs->buckets[value] != NULL) + + if (bs->buckets[value] != NULL) bs->buckets[value]->prev = &(bs->elements[id]); else if (bs->current_min_value > value) bs->current_min_value = value; @@ -85,15 +48,15 @@ void Zoltan_Bucket_Update(Bucket* bs, int id, int new_value) if (old_value == INT_MAX) return; - -#if 0 + +#if 0 assert (bs != NULL); assert (new_value >= 0); - assert (new_value <= bs->max_value); + assert (new_value <= bs->max_value); assert (id >= 0); assert (id < bs->nb_elements); #endif - + bs->values[id] = new_value; @@ -101,7 +64,7 @@ void Zoltan_Bucket_Update(Bucket* bs, int id, int new_value) bs->buckets[old_value] = bs->elements[id].next; else bs->elements[id].prev->next = bs->elements[id].next; - + if (bs->elements[id].next != NULL) bs->elements[id].next->prev = bs->elements[id].prev; @@ -112,7 +75,7 @@ int Zoltan_Bucket_PopMin(Bucket* bs) { int id; -#if 0 +#if 0 assert (bs != NULL); assert (bs->current_min_value >= 0); #endif @@ -136,7 +99,7 @@ Bucket Zoltan_Bucket_Initialize(int max_value, int nb_element) Bucket bs; int i; -#if 0 +#if 0 assert (max_value>=0); assert (nb_element>=0); #endif @@ -160,19 +123,19 @@ Bucket Zoltan_Bucket_Initialize(int max_value, int nb_element) bs.elements[i].next = NULL; } } - - + + bs.current_min_value = max_value+1; - + return bs; } - + void Zoltan_Bucket_Free(Bucket* bs) { ZOLTAN_FREE(&(bs->values)); ZOLTAN_FREE(&(bs->buckets)); ZOLTAN_FREE(&(bs->elements)); -} +} #ifdef __cplusplus diff --git a/packages/zoltan/src/coloring/bucket.h b/packages/zoltan/src/coloring/bucket.h index 303267e050..758862b102 100644 --- a/packages/zoltan/src/coloring/bucket.h +++ b/packages/zoltan/src/coloring/bucket.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __BUCKET__H #define __BUCKET__H @@ -68,7 +31,7 @@ typedef struct arg Bucket_element **buckets; /* actual pointers to bucket heads */ Bucket_element *elements; /* for direct access to bucket elements elements[id] is the id-th element */ - int nb_elements; + int nb_elements; int max_value; int *values; /* needed for update, incase bucket head changed. */ @@ -93,7 +56,7 @@ void Zoltan_Bucket_Free(Bucket* bs); #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif - + #endif diff --git a/packages/zoltan/src/coloring/color_test.c b/packages/zoltan/src/coloring/color_test.c index e21b244b44..515f8a3f37 100644 --- a/packages/zoltan/src/coloring/color_test.c +++ b/packages/zoltan/src/coloring/color_test.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -106,14 +69,14 @@ int Zoltan_Color_Test( ZOLTAN_GNO_TYPE gvtx; /* number of global vertices */ ZOLTAN_GNO_TYPE *vtxdist=NULL, *adjncy=NULL; ZG graph; - ZOLTAN_GNO_TYPE *requested_GNOs = NULL; /* Return GNOs of + ZOLTAN_GNO_TYPE *requested_GNOs = NULL; /* Return GNOs of the requested GIDs. */ int *loc_partialD2 = NULL; /* local binary array showing which vertices to be colored */ int *partialD2 = NULL; /* global binary array showing which vertices to be colored */ struct Zoltan_DD_Struct *dd_color; /* DDirectory for colors */ ZOLTAN_GNO_TYPE *local_GNOs = NULL; ZOLTAN_GNO_TYPE *global_GNOs = NULL; - + memset (&graph, 0, sizeof(ZG)); /* PARAMETER SETTINGS */ @@ -187,11 +150,11 @@ int Zoltan_Color_Test( requested_GNOs = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(num_obj * sizeof(ZOLTAN_GNO_TYPE)); - Zoltan_ZG_Build (zz, &graph, 0, 1, num_obj, + Zoltan_ZG_Build (zz, &graph, 0, 1, num_obj, global_ids, requested_GNOs); Zoltan_ZG_Export (zz, &graph, - &gvtx, &nvtx, NULL, NULL, + &gvtx, &nvtx, NULL, NULL, &vtxdist, &xadj, &adjncy, &adjproc, NULL, NULL); @@ -217,7 +180,7 @@ int Zoltan_Color_Test( for (i=0; iNum_Proc]; ++i) global_GNOs[i] = i; - ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, + ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, sizeof(ZOLTAN_GNO_TYPE)/sizeof(ZOLTAN_ID_TYPE), 0, 0, num_obj, 0); if (ierr != ZOLTAN_OK) ZOLTAN_COLOR_ERROR(ierr, "Cannot construct DDirectory."); @@ -250,32 +213,32 @@ int Zoltan_Color_Test( if (coloring_problem == 'P') { for (i=0; iNum_Proc], MPI_INT, MPI_LOR, zz->Communicator); } else { for (i=0; iNum_Proc]; ++i) partialD2[i] = 1; - } + } } - + /* Check if there is an error in coloring */ if (coloring_problem == '1') { for (i=0; iProc]; if (color[gno] <= 0) { /* object i is not colored properly */ ierr = ZOLTAN_FATAL; - printf("Error in coloring! u:%d, cu:%d\n", gno, color[gno]); + printf("Error in coloring! u:%d, cu:%d\n", gno, color[gno]); break; } for (j = xadj[i]; j < xadj[i+1]; ++j) { int v = (int)adjncy[j]; if (color[gno] == color[v]) { /* neighbors have the same color */ ierr = ZOLTAN_FATAL; - printf("Error in coloring! u:%d, v:%d, cu:%d, cv:%d\n", gno, v, color[gno], color[v]); - break; + printf("Error in coloring! u:%d, v:%d, cu:%d, cv:%d\n", gno, v, color[gno], color[v]); + break; } } if (ierr == ZOLTAN_FATAL) @@ -286,7 +249,7 @@ int Zoltan_Color_Test( int gno = i + (int)vtxdist[zz->Proc]; if (partialD2[gno] && color[gno] <= 0) { /* object i is not colored properly */ ierr = ZOLTAN_FATAL; - printf("Error in coloring! u:%d, cu:%d\n", gno, color[gno]); + printf("Error in coloring! u:%d, cu:%d\n", gno, color[gno]); break; } for (j = xadj[i]; j < xadj[i+1]; ++j) { @@ -298,14 +261,14 @@ int Zoltan_Color_Test( } if (partialD2[gno] && partialD2[v] && color[gno] == color[v]) { /* d-1 neighbors have the same color */ ierr = ZOLTAN_FATAL; - printf("Error in coloring! d1-neigh: u:%d, v:%d, cu:%d, cv:%d pu:%d pv:%d\n", gno, v, color[gno], color[v], partialD2[gno], partialD2[v]); + printf("Error in coloring! d1-neigh: u:%d, v:%d, cu:%d, cv:%d pu:%d pv:%d\n", gno, v, color[gno], color[v], partialD2[gno], partialD2[v]); break; } for (k = j+1; k < xadj[i+1]; ++k) { int w = (int)adjncy[k]; if (partialD2[v] && partialD2[w] && color[v] == color[w]) { /* d-2 neighbors have the same color */ ierr = ZOLTAN_FATAL; - printf("Error in coloring! d2-neigh: v:%d, w:%d, cv:%d, cw:%d pv:%d pw:%d\n", v, w, color[v], color[w], partialD2[v], partialD2[w]); + printf("Error in coloring! d2-neigh: v:%d, w:%d, cv:%d, cw:%d pv:%d pw:%d\n", v, w, color[v], color[w], partialD2[v], partialD2[w]); break; } @@ -314,10 +277,10 @@ int Zoltan_Color_Test( } if (ierr == ZOLTAN_FATAL) break; - } - } else - ZOLTAN_COLOR_ERROR(ZOLTAN_WARN, "Zoltan_Color_Test is only implemented for distance-1 and distance-2 coloring. Unknown coloring, skipping verification."); - + } + } else + ZOLTAN_COLOR_ERROR(ZOLTAN_WARN, "Zoltan_Color_Test is only implemented for distance-1 and distance-2 coloring. Unknown coloring, skipping verification."); + End: if (ierr==ZOLTAN_FATAL) ierr = 2; diff --git a/packages/zoltan/src/coloring/coloring.c b/packages/zoltan/src/coloring/coloring.c index d3b24cf488..45ee13c3ea 100644 --- a/packages/zoltan/src/coloring/coloring.c +++ b/packages/zoltan/src/coloring/coloring.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -108,7 +71,7 @@ static int Recoloring (ZZ *zz, int recoloring_permutation, int recoloring_type, int recoloring_num_of_iterations, int nvtx, int carrierbufsize, int *nConflict, int *confCont, int *nTotConflict, int *nRound,int lastlno, int globmaxnvtx, int *nColor, int *color, int *visit,int *xadj, int *adj, int *xbadj, - int *conflicts, int *rand_key, G2LHash *hash, int *isbound, + int *conflicts, int *rand_key, G2LHash *hash, int *isbound, ZOLTAN_GNO_TYPE **newcolored, int *mark, int gmaxdeg, char coloring_method, char comm_pattern, int *rreqfrom, int *replies, MPI_Request *sreqs, MPI_Request *rreqs, MPI_Status *stats, @@ -183,7 +146,7 @@ int Zoltan_Color( which the colors should be returned. (May be different from local objects.) */ /* The application must allocate enough space */ - int *color_exp /* Output: Colors assigned to objects + int *color_exp /* Output: Colors assigned to objects given by req_objs (may be non-local) */ /* The application must allocate enough space */ ) @@ -221,11 +184,11 @@ int Zoltan_Color( int comm[2],gcomm[2]; ZOLTAN_ID_PTR my_global_ids= NULL; /* gids local to this proc */ struct Zoltan_DD_Struct *dd_color; /* DDirectory for colors */ - ZOLTAN_GNO_TYPE *requested_GNOs = NULL; /* Return GNOs of + ZOLTAN_GNO_TYPE *requested_GNOs = NULL; /* Return GNOs of the requested GIDs. */ -#ifdef _DEBUG_TIMES +#ifdef _DEBUG_TIMES double times[6]={0.,0.,0.,0.,0.,0.}, rtimes[6]; /* Used for timing measurements */ double gtimes[6]={0.,0.,0.,0.,0.,0.}; /* Used for timing measurements */ char *timenames[6]= {"", "setup", "graph build", "renumber", "color", "clean up"}; @@ -237,7 +200,7 @@ int Zoltan_Color( memset (&graph, 0, sizeof(ZG)); memset(&hash, 0 , sizeof(G2LHash)); /* To allow a correct free */ -#ifdef _DEBUG_TIMES +#ifdef _DEBUG_TIMES MPI_Barrier(zz->Communicator); times[0] = Zoltan_Time(zz->Timer); #endif @@ -372,7 +335,7 @@ int Zoltan_Color( ZOLTAN_COLOR_ERROR(ZOLTAN_FATAL, "Cannot construct graph."); ierr = Zoltan_ZG_Export (zz, &graph, - &gvtx, &nvtx, NULL, NULL, + &gvtx, &nvtx, NULL, NULL, &vtxdist, &xadj, &adjncy, &adjproc, NULL, NULL); @@ -424,7 +387,7 @@ int Zoltan_Color( if (sz && !(partialD2 = (int *) ZOLTAN_CALLOC(sz, sizeof(int)))) MEMORY_ERROR; - ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, + ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, sizeof(ZOLTAN_GNO_TYPE)/sizeof(ZOLTAN_ID_TYPE), 0, 0, sz, 0); if (ierr != ZOLTAN_OK) ZOLTAN_COLOR_ERROR(ierr, "Cannot construct DDirectory."); @@ -457,11 +420,11 @@ int Zoltan_Color( recoloring_permutation, recoloring_type, recoloring_num_of_iterations); else if (coloring_problem == '2' || coloring_problem == 'P') D2coloring(zz, coloring_problem, coloring_order, coloring_method, comm_pattern, ss, nvtx, &hash, xadj, (int *)adjncy, adjproc, color, partialD2); -#ifdef _DEBUG_TIMES +#ifdef _DEBUG_TIMES times[4] = Zoltan_Time(zz->Timer); #endif - ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, + ierr = Zoltan_DD_Create (&dd_color, zz->Communicator, sizeof(ZOLTAN_GNO_TYPE)/sizeof(ZOLTAN_ID_TYPE), 0, 0, nvtx, 0); if (ierr != ZOLTAN_OK) ZOLTAN_COLOR_ERROR(ierr, "Cannot construct DDirectory."); @@ -479,14 +442,14 @@ int Zoltan_Color( /* Free DDirectory */ Zoltan_DD_Destroy(&dd_color); - ZOLTAN_FREE(&my_global_ids); + ZOLTAN_FREE(&my_global_ids); -#ifdef _DEBUG_TIMES +#ifdef _DEBUG_TIMES MPI_Barrier(zz->Communicator); times[5] = Zoltan_Time(zz->Timer); rtimes[0] = times[5]-times[0]; - for (i=1; i<6; ++i) - rtimes[i] = times[i]-times[i-1]; + for (i=1; i<6; ++i) + rtimes[i] = times[i]-times[i-1]; MPI_Reduce(rtimes, gtimes, 6, MPI_DOUBLE, MPI_MAX, 0, zz->Communicator); if (!zz->Proc) { int i; @@ -513,21 +476,21 @@ int Zoltan_Color( Largest Degree First ordering. The algorithm used to compute this ordering is a stable count sort. */ static int LargestDegreeFirstOrdering( - ZZ *zz, + ZZ *zz, int *visit, /*Out*/ int *xadj, int n, - int max_degree) -{ + int max_degree) +{ static char* yo = "LargestDegreeFirstOrdering"; int ierr = ZOLTAN_OK; int i; int *cnt; - + cnt = (int*) ZOLTAN_MALLOC (sizeof(int)*(max_degree+1)); if (!cnt) MEMORY_ERROR; - + memset(cnt, 0, sizeof(int)*(max_degree+1)); for (i=0; iTimer); - + #if 0 printf("After reordering: nvtx:%d lastlno=%d Proc:%d\n", nvtx, lastlno, zz->Proc); for (i=0; i < nvtx; i++) { @@ -982,7 +945,7 @@ static int D1coloring( static int D2coloring( ZZ *zz, char coloring_problem,/* Coloring problem. '2' or 'P' in this case */ - char coloring_order, /* (I) interior vertices first (B) boundary vertices first + char coloring_order, /* (I) interior vertices first (B) boundary vertices first (U) interleaved (N) Natural Ordering (L) Largest First (S) Smallest Last Note that LF and SL orderings are same with the ones in distance-1 function.*/ char coloring_method, /* Coloring method. (F) First fit @@ -1165,7 +1128,7 @@ static int D2coloring( for (i=0; iNum_Proc; i++) if (i != zz->Proc) ssendsize[i] += (int) (ceil((double)nvtx / (double)ss) + 1); - + /* Send the superstep info size so that other processors will allocate enough space */ for (sreqcntC=p=0; pNum_Proc; ++p) if (p != zz->Proc) @@ -1283,12 +1246,12 @@ static int D2coloring( if (coloring_order=='U' || coloring_order=='N') { for (i=0; iNum_Proc==1) InternalColoring(zz, coloring_problem, &nColor, nvtx, visit, xadj, adj, color, mark, gmaxcolor, coloring_method); @@ -1315,7 +1278,7 @@ static int D2coloring( rreqfromC, repliesC, sreqsC, rreqsC, rreqfromF, repliesF, sreqsF, rreqsF, rreqfromFx, repliesFx, sreqsFx, rreqsFx, - stats, confChk, ssendsize, srecsize, ssendbuf, srecbuf, ssp, srp, xfp, xfpMark, + stats, confChk, ssendsize, srecsize, ssendbuf, srecbuf, ssp, srp, xfp, xfpMark, wset, &wsize); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) ZOLTAN_COLOR_ERROR(ierr, "Error in D2ParallelColoring"); @@ -1792,7 +1755,7 @@ static int D1ParallelColoring ( /*****************************************************************************/ /* Send forbidden colors for the vertices to be colored in the next superstep */ -static int sendNextStepsForbiddenColors(ZZ *zz, G2LHash *hash, int nlvtx, int p, ZOLTAN_GNO_TYPE **srp, +static int sendNextStepsForbiddenColors(ZZ *zz, G2LHash *hash, int nlvtx, int p, ZOLTAN_GNO_TYPE **srp, int *xadj, int *adj, int *xadjnl, int *adjnl, int *forbsizeS, int **xforbiddenS, int **forbiddenS, int *nColor, int *color, int *mark, int *confChk, int sncnt, int *wset, int *wsize, MPI_Request *sreqsFx, MPI_Request *sreqsF) @@ -1995,7 +1958,7 @@ static int D2ParallelColoring ( /* Mark end of superstep info by -2 */ for (p=0; pNum_Proc; p++) { if (p != zz->Proc) { - if (ssp[p] == ssendbuf[p]) + if (ssp[p] == ssendbuf[p]) *ssp[p] = -2; else if (*(ssp[p]-1) == -1) *(--ssp[p]) = -2; @@ -2338,14 +2301,14 @@ static int pairofintsup_ind_ni(const void* a, const void* b) return pb->y - pa->y; } -static int Recoloring(ZZ *zz, int recoloring_permutation, int recoloring_type, +static int Recoloring(ZZ *zz, int recoloring_permutation, int recoloring_type, int recoloring_num_of_iterations, int nvtx, int carrierbufsize, int *nConflict, int *confCont, int *nTotConflict, int *nRound, int lastlno, int globmaxnvtx, int *nColor, int *color, int *visit,int *xadj, int *adj, int *xbadj, int *conflicts, int *rand_key, G2LHash *hash, int *isbound, ZOLTAN_GNO_TYPE **newcolored, int *mark, int gmaxdeg, char coloring_method, char comm_pattern, int *rreqfrom, int *replies, - MPI_Request *sreqs, MPI_Request *rreqs, MPI_Status *stats, + MPI_Request *sreqs, MPI_Request *rreqs, MPI_Status *stats, int *xrelproc, int *relproc, ZOLTAN_GNO_TYPE **persSbuf, int *Ssize, int plstcnt, int *plst) { @@ -2353,23 +2316,23 @@ static int Recoloring(ZZ *zz, int recoloring_permutation, int recoloring_type, int ierr = ZOLTAN_OK; static char *yo = "Recoloring"; int globnumofcolor = 0; - int numofcolor = 0; + int numofcolor = 0; int nStart, nEnd, length, color_of_i; int *howmanynodeinthatcolor = NULL; /* number of vertices in the color classes of a proc*/ int *howmanynodeinthatcolorglobal = NULL; /* number of vertices in the color classes of all procs */ int *sorted_color = NULL; /* sorted colors wrt to number of vertices at them */ int *permutation = NULL; /* permutation of colors to be used in recoloring permuatations */ - int *dummy = NULL; + int *dummy = NULL; int *prefixcount = NULL; /* count of vertices at each color classes in the specif ird recoloring permutation order */ int *colorindex = NULL; /* starting indexes of color classes */ int *tp = NULL; int *dummyvisit = NULL; - + if (zz->Num_Proc == 1) isSequential = 1; else isSequential = 0; - + /* number of colors in a proc is calculated */ for (i=0; iCommunicator); - + howmanynodeinthatcolorglobal = (int *)ZOLTAN_MALLOC(sizeof(int) * (globnumofcolor + 1)); if (!isSequential) howmanynodeinthatcolor = (int *)ZOLTAN_MALLOC(sizeof(int)*(globnumofcolor+1)); @@ -2394,7 +2357,7 @@ static int Recoloring(ZZ *zz, int recoloring_permutation, int recoloring_type, if (recoloring_permutation == REVERSE) dummyvisit = (int *)ZOLTAN_MALLOC(nvtx * sizeof(int)); - + for (j=0; jCommunicator); - - + + /* colors are sorted based on their counts */ for (i=0; i < 2*globnumofcolor; i+=2) { sorted_color[i] = i/2+1; sorted_color[i+1] = howmanynodeinthatcolorglobal[i/2+1]; } - + if (recoloring_permutation == NONDECREASING) qsort (sorted_color, globnumofcolor, 2 * sizeof(int), pairofintsup_ind_nd); else qsort (sorted_color, globnumofcolor, 2 * sizeof(int), pairofintsup_ind_ni); - + for (i=0; i<2*globnumofcolor; i+=2) permutation[sorted_color[i]] = i/2+1; - + memset(dummy, 0, sizeof(int) * (globnumofcolor+1)); /* color ids are changed acc to new permutation calculated */ for (i=0; imaxsize))==ZOLTAN_MEMERR) return ZOLTAN_MEMERR; - + hash->table = NULL; hash->nodes = NULL; hash->size = 0; @@ -218,12 +181,12 @@ int Zoltan_KVHash_Destroy(KVHash *hash) ZOLTAN_FREE(&hash->nodes); return ZOLTAN_OK; -} +} int Zoltan_KVHash_Insert(KVHash *hash, ZOLTAN_GNO_TYPE key, int value) { int i; - + G2LHashNode *ptr; i = Zoltan_Hash((ZOLTAN_ID_PTR) (void *)&key, hash->num_gid_entries, (unsigned int) hash->maxsize); @@ -233,7 +196,7 @@ int Zoltan_KVHash_Insert(KVHash *hash, ZOLTAN_GNO_TYPE key, int value) ZOLTAN_PRINT_ERROR(-1, "Zoltan_KVHash_Insert", "Hash is full!"); return -1; } - + ptr = &(hash->nodes[hash->size]); ptr->gno = key; ptr->lno = value; @@ -243,11 +206,11 @@ int Zoltan_KVHash_Insert(KVHash *hash, ZOLTAN_GNO_TYPE key, int value) } else value = ptr->lno; - return value; + return value; } -int Zoltan_KVHash_GetValue(KVHash *hash, ZOLTAN_GNO_TYPE key) +int Zoltan_KVHash_GetValue(KVHash *hash, ZOLTAN_GNO_TYPE key) { int i; G2LHashNode *ptr; @@ -259,7 +222,7 @@ int Zoltan_KVHash_GetValue(KVHash *hash, ZOLTAN_GNO_TYPE key) else return ptr->lno; } - + #ifdef __cplusplus diff --git a/packages/zoltan/src/coloring/g2l_hash.h b/packages/zoltan/src/coloring/g2l_hash.h index 5283896d2a..2b482a5421 100644 --- a/packages/zoltan/src/coloring/g2l_hash.h +++ b/packages/zoltan/src/coloring/g2l_hash.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _G2L_HASH_H_ #define _G2L_HASH_H_ @@ -66,7 +29,7 @@ struct G2L_Hash { ZOLTAN_GNO_TYPE base, baseend; /* base and baseend are inclusive gno's of local vertices */ int nlvtx; /* it is #localy owened vertices: simply equal to "baseend-base+1" */ int num_gid_entries; /* multiple of ZOLTAN_ID_TYPEs in a key */ - + G2LHashNode **table; G2LHashNode *nodes; }; @@ -80,7 +43,7 @@ int Zoltan_G2LHash_G2L(G2LHash *hash, ZOLTAN_GNO_TYPE gno); if gno exist it returns lno, if it does not exist, it inserts andr returns newly assigned lno */ int Zoltan_G2LHash_Insert(G2LHash *hash, ZOLTAN_GNO_TYPE gno); - + #define Zoltan_G2LHash_L2G(hash, lno) ((lno<(hash)->nlvtx) ? (hash)->base+lno : (hash)->nodes[lno-(hash)->nlvtx].gno) @@ -94,10 +57,10 @@ int Zoltan_KVHash_Destroy(KVHash *hash); int Zoltan_KVHash_Insert(KVHash *hash, ZOLTAN_GNO_TYPE key, int value); int Zoltan_KVHash_GetValue(KVHash *hash, ZOLTAN_GNO_TYPE key); - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif - + #endif diff --git a/packages/zoltan/src/driver/CMakeLists.txt b/packages/zoltan/src/driver/CMakeLists.txt index 8ae5bee494..f936ea2808 100644 --- a/packages/zoltan/src/driver/CMakeLists.txt +++ b/packages/zoltan/src/driver/CMakeLists.txt @@ -99,3 +99,4 @@ IF (${PACKAGE_NAME}_ENABLE_CPPDRIVER) ) ENDIF() + diff --git a/packages/zoltan/src/driver/Makefile.am b/packages/zoltan/src/driver/Makefile.am index 57d5cdfb4f..fb6316ca0e 100644 --- a/packages/zoltan/src/driver/Makefile.am +++ b/packages/zoltan/src/driver/Makefile.am @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER include $(top_builddir)/Makefile.export.zoltan diff --git a/packages/zoltan/src/driver/Makefile.in b/packages/zoltan/src/driver/Makefile.in index acc7c3f5db..2f2d8828ac 100644 --- a/packages/zoltan/src/driver/Makefile.in +++ b/packages/zoltan/src/driver/Makefile.in @@ -15,49 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -338,8 +295,8 @@ EXPORT_LIBS = $(ZOLTAN_LIBS) EXPORT_INC_PATH = $(ZOLTAN_INCLUDES) AM_CPPFLAGS = $(EXPORT_INC_PATH) -#ZOLTAN_C_TEST_DRIVER = zdrive -@HAVE_ZOLTAN_CPPDRIVER_TRUE@ZOLTAN_CPP_TEST_DRIVER = zCPPdrive +#ZOLTAN_C_TEST_DRIVER = zdrive +@HAVE_ZOLTAN_CPPDRIVER_TRUE@ZOLTAN_CPP_TEST_DRIVER = zCPPdrive COMMON_DRIVER_SRC = $(srcdir)/dr_err.c $(srcdir)/dr_input.c \ $(srcdir)/dr_par_util.c $(srcdir)/dr_util.c \ $(srcdir)/dr_elem.c $(srcdir)/dr_setfixed.c \ @@ -439,10 +396,10 @@ $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -zCPPdrive$(EXEEXT): $(zCPPdrive_OBJECTS) $(zCPPdrive_DEPENDENCIES) $(EXTRA_zCPPdrive_DEPENDENCIES) +zCPPdrive$(EXEEXT): $(zCPPdrive_OBJECTS) $(zCPPdrive_DEPENDENCIES) $(EXTRA_zCPPdrive_DEPENDENCIES) @rm -f zCPPdrive$(EXEEXT) $(CXXLINK) $(zCPPdrive_OBJECTS) $(zCPPdrive_LDADD) $(LIBS) -zdrive$(EXEEXT): $(zdrive_OBJECTS) $(zdrive_DEPENDENCIES) $(EXTRA_zdrive_DEPENDENCIES) +zdrive$(EXEEXT): $(zdrive_OBJECTS) $(zdrive_DEPENDENCIES) $(EXTRA_zdrive_DEPENDENCIES) @rm -f zdrive$(EXEEXT) $(LINK) $(zdrive_OBJECTS) $(zdrive_LDADD) $(LIBS) @@ -1600,7 +1557,7 @@ uninstall-am: include $(top_builddir)/Makefile.export.zoltan # Dummy for new export makefiles -#LIBS = +#LIBS = # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/packages/zoltan/src/driver/README b/packages/zoltan/src/driver/README index 72ba401d63..d7422e5d56 100644 --- a/packages/zoltan/src/driver/README +++ b/packages/zoltan/src/driver/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER DRIVER DIRECTORY -- Zoltan test driver application source code. ------------------------------------------------------------------------ diff --git a/packages/zoltan/src/driver/dr_chaco_io.c b/packages/zoltan/src/driver/dr_chaco_io.c index 59b6675c09..dba8713667 100644 --- a/packages/zoltan/src/driver/dr_chaco_io.c +++ b/packages/zoltan/src/driver/dr_chaco_io.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -118,7 +81,7 @@ int read_chaco_file(int Proc, file_error = (fp == NULL); } - MPI_Bcast(&file_error, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&file_error, 1, MPI_INT, 0, zoltan_get_global_comm()); if (file_error) { sprintf(cmesg, "fatal: Could not open Chaco graph file %s", @@ -236,17 +199,17 @@ for (i=0; ieb_nnodes[0] = 0; else @@ -356,7 +319,7 @@ int i; strcpy(mesh->eb_names[0], "chaco"); /* allocate the element structure array */ - mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len + mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len * sizeof(ELEM_INFO)); if (!(mesh->elements)) { Gen_Error(0, "fatal: insufficient memory"); @@ -367,7 +330,7 @@ int i; * intialize all of the element structs as unused by * setting the globalID to -1 */ - for (i = 0; i < mesh->elem_array_len; i++) + for (i = 0; i < mesh->elem_array_len; i++) initialize_element(&(mesh->elements[i])); /* @@ -375,8 +338,8 @@ int i; * information from the Chaco file */ if (!chaco_fill_elements(Proc, Num_Proc, prob, mesh, pio_info, gnvtxs, nvtxs, - start, adj, vwgt_dim, vwgts, ewgt_dim, ewgts, - ndim, x, y, z, assignments, base)) + start, adj, vwgt_dim, vwgts, ewgt_dim, ewgts, + ndim, x, y, z, assignments, base)) { Gen_Error(0, "fatal: Error returned from chaco_fill_elements"); return 0; @@ -416,14 +379,14 @@ int chaco_fill_elements( int i, j, k, *local_ids = NULL; int num_vtx; int elem_id; - int min_vtx, max_vtx; + int min_vtx, max_vtx; int *vtx_list = NULL; const char *yo = "chaco_fill_elements"; /***************************** BEGIN EXECUTION ******************************/ DEBUG_TRACE_START(Proc, yo); - chaco_init_local_ids(&local_ids, &vtx_list, &min_vtx, &max_vtx, &num_vtx, + chaco_init_local_ids(&local_ids, &vtx_list, &min_vtx, &max_vtx, &num_vtx, assignments, base); for (i = 0; i < num_vtx; i++) { @@ -450,7 +413,7 @@ int chaco_fill_elements( mesh->elements[i].connect[0] = mesh->elements[i].globalID; mesh->elements[i].coord = (float **) malloc(sizeof(float *)); mesh->elements[i].coord[0] = (float *) calloc(mesh->num_dims, - sizeof(float)); + sizeof(float)); mesh->elements[i].coord[0][0] = x[i]; mesh->elements[i].avg_coord[0] = x[i]; if (mesh->num_dims > 1) { @@ -508,7 +471,7 @@ int chaco_fill_elements( * if the adjacent element is on this processor * then find the local id for that element */ - if (k == Proc) + if (k == Proc) mesh->elements[i].adj[j] = (ZOLTAN_ID_TYPE)local_ids[elem_id-base-min_vtx]; else /* use the global id */ mesh->elements[i].adj[j] = (ZOLTAN_ID_TYPE)elem_id; @@ -538,11 +501,11 @@ int chaco_fill_elements( /****************************************************************************/ void chaco_init_local_ids( - int **local_ids, - int **vtx_list, - int *min_vtx, - int *max_vtx, - int *num_vtx, + int **local_ids, + int **vtx_list, + int *min_vtx, + int *max_vtx, + int *num_vtx, short *assignments, int base ) @@ -551,7 +514,7 @@ void chaco_init_local_ids( int i; int Proc; - MPI_Comm_rank(MPI_COMM_WORLD, &Proc); + MPI_Comm_rank(zoltan_get_global_comm(), &Proc); *num_vtx = ch_dist_max_num_vtx(assignments); *vtx_list = (int *) malloc(((int)*num_vtx) * sizeof(int)); @@ -567,7 +530,7 @@ int Proc; *local_ids = (int *) malloc((*max_vtx - *min_vtx + 1) * sizeof(int)); } - for (i = 0; i < *num_vtx; i++) + for (i = 0; i < *num_vtx; i++) (*local_ids)[(*vtx_list)[i] - (*min_vtx)] = i; } diff --git a/packages/zoltan/src/driver/dr_chaco_io.c.shockstem b/packages/zoltan/src/driver/dr_chaco_io.c.shockstem index 839cc80dd9..c7792dbdbd 100644 --- a/packages/zoltan/src/driver/dr_chaco_io.c.shockstem +++ b/packages/zoltan/src/driver/dr_chaco_io.c.shockstem @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -118,7 +81,7 @@ int read_chaco_file(int Proc, file_error = (fp == NULL); } - MPI_Bcast(&file_error, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&file_error, 1, MPI_INT, 0, zoltan_get_global_comm()); if (file_error) { sprintf(cmesg, "fatal: Could not open Chaco graph file %s", @@ -218,7 +181,7 @@ printf("%d KDDKDD NEARESTSFILE %s\n", Proc, chaco_fname); fflush(stdout); } /* Distribute graph */ - if (!chaco_dist_graph(MPI_COMM_WORLD, pio_info, 0, &gnvtxs, &nvtxs, + if (!chaco_dist_graph(zoltan_get_global_comm(), pio_info, 0, &gnvtxs, &nvtxs, &start, &adj, &vwgt_dim, &vwgts, &ewgt_dim, &ewgts, &ndim, &x, &y, &z, &assignments) != 0) { Gen_Error(0, "fatal: Error returned from chaco_dist_graph"); @@ -315,7 +278,7 @@ int i; * Each element has one set of coordinates (i.e., node) if a coords file * was provided; zero otherwise. */ - MPI_Bcast( &no_geom, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast( &no_geom, 1, MPI_INT, 0, zoltan_get_global_comm()); if (no_geom) mesh->eb_nnodes[0] = 0; else @@ -516,7 +479,7 @@ void chaco_init_local_ids( int i; int Proc; - MPI_Comm_rank(MPI_COMM_WORLD, &Proc); + MPI_Comm_rank(zoltan_get_global_comm(), &Proc); *num_vtx = ch_dist_max_num_vtx(assignments); *vtx_list = (int *) malloc(*num_vtx * sizeof(int)); diff --git a/packages/zoltan/src/driver/dr_compress.c b/packages/zoltan/src/driver/dr_compress.c index 37cfd60829..f5fc9464bb 100644 --- a/packages/zoltan/src/driver/dr_compress.c +++ b/packages/zoltan/src/driver/dr_compress.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include diff --git a/packages/zoltan/src/driver/dr_compress_const.h b/packages/zoltan/src/driver/dr_compress_const.h index 408c3860de..91d8b42c71 100644 --- a/packages/zoltan/src/driver/dr_compress_const.h +++ b/packages/zoltan/src/driver/dr_compress_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_COMPRESS_CONST_H #define _DR_COMPRESS_CONST_H diff --git a/packages/zoltan/src/driver/dr_const.h b/packages/zoltan/src/driver/dr_const.h index 3ffce95aa5..258c6620da 100644 --- a/packages/zoltan/src/driver/dr_const.h +++ b/packages/zoltan/src/driver/dr_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_CONST_H #define _DR_CONST_H @@ -64,9 +27,9 @@ extern "C" { #ifndef TRILINOS_NO_CONFIG_H /* - * The macros PACKAGE, PACKAGE_NAME, etc, get defined for + * The macros PACKAGE, PACKAGE_NAME, etc, get defined for * each package and need to - * be undef'd here to avoid warnings when this file is included + * be undef'd here to avoid warnings when this file is included * from another package. * KL 11/25/02 */ @@ -190,18 +153,18 @@ struct Element_Description ZOLTAN_ID_TYPE globalID; /* Global ID of this element, the local ID is the position in the array of elements */ int elem_blk; /* element block number which this element is in */ - int my_part; /* Partition to which the element is assigned; + int my_part; /* Partition to which the element is assigned; default is processor number. */ int fixed_part; /* Partition to which the element should be fixed; this may not be equal to my_part before partitioning, - but a correct partitioning should assign the + but a correct partitioning should assign the element to fixed_part. fixed_part = -1 if the element is not to be assigned to a fixed partition.*/ - int perm_value; /* Value for this element in permutation vector - generated by Zoltan_Order. + int perm_value; /* Value for this element in permutation vector + generated by Zoltan_Order. Default is -1 (no ordering done). */ int invperm_value;/* Value for this element in inverse permutation vector - generated by Zoltan_Order. + generated by Zoltan_Order. Default is -1 (no ordering done). */ float cpu_wgt[MAX_CPU_WGTS]; /* the computational weight(s) associated with the elem */ float mem_wgt; /* the memory weight associated with the elem */ @@ -215,15 +178,15 @@ struct Element_Description ZOLTAN_ID_TYPE *adj; /* list of adjacent elements . For Nemesis input, the list is ordered by side number, to encode side-number info needed to - rebuild communication maps. Value -1 represents + rebuild communication maps. Value -1 represents sides with no neighboring element (e.g., along mesh - boundaries). Chaco doesn't have "sides," so the + boundaries). Chaco doesn't have "sides," so the ordering is irrelevent for Chaco input. */ /* KDD 1/22/15: Using ZOLTAN_ID_TYPE == unsigned int breaks the Exodus interface which uses -1 to indicate sides without neighbors. The solution is to NOT use ZOLTAN_ID_TYPE for this field (and others); instead, - type int should be used. In general, we wouldn't + type int should be used. In general, we wouldn't expect an application to use ZOLTAN_ID_TYPE. However, this bug is not important enough to fix at this time. See bug 6278 and comment in dr_loadbal.c. */ @@ -260,7 +223,7 @@ struct Mesh_Description int *eb_ids; /* element block ids */ ZOLTAN_ID_TYPE *eb_cnts; /* number of elements in each element block */ int *eb_nnodes; /* number of nodes per element in each - element block + element block for Nemesis meshes, this value depends on element type; for Chaco graphs, only one "node" per @@ -273,10 +236,10 @@ struct Mesh_Description communication map. */ int *ecmap_elemids; /* element ids of elements for all elemental communication maps. (local numbering) */ - int *ecmap_sideids; /* side ids of elements for all elemental + int *ecmap_sideids; /* side ids of elements for all elemental communication maps. */ - ZOLTAN_ID_TYPE *ecmap_neighids; /* elements ids of neighboring elements - for all elemental communication maps. + ZOLTAN_ID_TYPE *ecmap_neighids; /* elements ids of neighboring elements + for all elemental communication maps. (global numbering) */ int elem_array_len; /* length that the ELEM_INFO array is allocated for. Need to know this when array @@ -291,21 +254,21 @@ struct Mesh_Description hyperedge. */ /* The following fields usually supply the - pins in the hyperedges (rows). But if - "format" indicates columns instead of rows, + pins in the hyperedges (rows). But if + "format" indicates columns instead of rows, we store vertices and their pins here. */ int format; /* rows (edges) or columns (vertices) */ int nhedges; /* # local edges (if cols: # pin vertices) */ ZOLTAN_ID_TYPE *hgid; /* Global number for edges (or pin vertices), derived implicitly from order pins are read from file. Numbering is 0-based. */ - int *hindex; /* for hypergraphs, an entry for each + int *hindex; /* for hypergraphs, an entry for each edge (or vertex), giving the starting index - into hvertex for hyperedge (or vertex).*/ + into hvertex for hyperedge (or vertex).*/ ZOLTAN_ID_TYPE *hvertex; /* row storage: global number for each pin vertex, col storage: global number for each pin hyperedge */ - int *hvertex_proc; /* row storage: array listing the processor + int *hvertex_proc; /* row storage: array listing the processor owning vertices in hvertex, or NULL if don't care. col storage: NULL */ @@ -351,7 +314,7 @@ struct Test_Flags { ways. */ int Fixed_Objects; /* Registers functions for assigning fixed objects; sets fixed_part within elements in - various way; sets RETURN_LISTS to + various way; sets RETURN_LISTS to "PARTITION ASSIGNMENTS" */ int Drops; /* Exercises point- and box-assign. */ int RCB_Box; /* Exercises Zoltan_RCB_Box. */ diff --git a/packages/zoltan/src/driver/dr_dd.c b/packages/zoltan/src/driver/dr_dd.c index 4ae84839f0..119a4f5272 100644 --- a/packages/zoltan/src/driver/dr_dd.c +++ b/packages/zoltan/src/driver/dr_dd.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" @@ -57,7 +20,7 @@ extern "C" { /****************************************************************************/ -int build_elem_dd(MESH_INFO_PTR mesh) +int build_elem_dd(MESH_INFO_PTR mesh) { /* Create a distributed directory of the elements so we can track their * processor assignment after migrations. @@ -65,8 +28,8 @@ int build_elem_dd(MESH_INFO_PTR mesh) int maxelems; MPI_Allreduce(&(mesh->num_elems), &maxelems, 1, MPI_INT, MPI_MAX, - MPI_COMM_WORLD); - if (Zoltan_DD_Create(&(mesh->dd), MPI_COMM_WORLD, 1, 0, 0, maxelems, 0) != 0){ + zoltan_get_global_comm()); + if (Zoltan_DD_Create(&(mesh->dd), zoltan_get_global_comm(), 1, 0, 0, maxelems, 0) != 0){ Gen_Error(0, "fatal: NULL returned from Zoltan_DD_Create()\n"); return 0; } @@ -81,7 +44,7 @@ int update_elem_dd(MESH_INFO_PTR mesh) * assignments initially and after migration. */ ELEM_INFO_PTR current_elem; -ZOLTAN_ID_PTR gids; +ZOLTAN_ID_PTR gids; int *parts; int i, j; @@ -113,7 +76,7 @@ int update_hvertex_proc(MESH_INFO_PTR mesh) { int npins; - npins = mesh->hindex[mesh->nhedges]; + npins = mesh->hindex[mesh->nhedges]; if (Zoltan_DD_Find(mesh->dd, mesh->hvertex, NULL, NULL, NULL, npins, mesh->hvertex_proc) != 0) { diff --git a/packages/zoltan/src/driver/dr_dd.h b/packages/zoltan/src/driver/dr_dd.h index 671903c3ac..8a1d63f531 100644 --- a/packages/zoltan/src/driver/dr_dd.h +++ b/packages/zoltan/src/driver/dr_dd.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __DR_DD_H #define __DR_DD_H diff --git a/packages/zoltan/src/driver/dr_ddCPP.cpp b/packages/zoltan/src/driver/dr_ddCPP.cpp index 1ae7aa80d8..0dd3b3b2d0 100644 --- a/packages/zoltan/src/driver/dr_ddCPP.cpp +++ b/packages/zoltan/src/driver/dr_ddCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_util_const.h" @@ -54,11 +17,11 @@ static Zoltan_DD *dd = NULL; /****************************************************************************/ -int build_elem_dd(MESH_INFO_PTR mesh) +int build_elem_dd(MESH_INFO_PTR mesh) { destroy_elem_dd(); - dd = new Zoltan_DD(MPI_COMM_WORLD, 1, 0, 0, 0, 0); + dd = new Zoltan_DD(zoltan_get_global_comm(), 1, 0, 0, 0, 0); return update_elem_dd(mesh); } @@ -101,14 +64,14 @@ int update_elem_dd(MESH_INFO_PTR mesh) delete [] gids; delete [] parts; - + return rc; } /****************************************************************************/ int update_hvertex_proc(MESH_INFO_PTR mesh) { - if (dd->Find(mesh->hvertex, NULL, NULL, NULL, + if (dd->Find(mesh->hvertex, NULL, NULL, NULL, mesh->hindex[mesh->nhedges], mesh->hvertex_proc) != 0) { Gen_Error(0, "fatal: NULL returned from Zoltan_DD::Find()\n"); return 0; diff --git a/packages/zoltan/src/driver/dr_elem.c b/packages/zoltan/src/driver/dr_elem.c index 6fb96a1174..3ee0b7adee 100644 --- a/packages/zoltan/src/driver/dr_elem.c +++ b/packages/zoltan/src/driver/dr_elem.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER diff --git a/packages/zoltan/src/driver/dr_elem_const.h b/packages/zoltan/src/driver/dr_elem_const.h index 9a29176c48..f5c6072d31 100644 --- a/packages/zoltan/src/driver/dr_elem_const.h +++ b/packages/zoltan/src/driver/dr_elem_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_ELM_CONST_H @@ -67,7 +30,7 @@ E_Type get_elem_type( const int num_dim /* Number of dimensions of the mesh */ ); -extern +extern const char *get_elem_name( int itype /* ExodusII element type */ ); diff --git a/packages/zoltan/src/driver/dr_elem_util.c b/packages/zoltan/src/driver/dr_elem_util.c index 1c7f72582f..f04737113a 100644 --- a/packages/zoltan/src/driver/dr_elem_util.c +++ b/packages/zoltan/src/driver/dr_elem_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" @@ -135,12 +98,12 @@ void free_mesh_arrays(MESH_INFO_PTR mesh) { int i; - for (i = 0; i < mesh->elem_array_len; i++) + for (i = 0; i < mesh->elem_array_len; i++) free_element_arrays(&(mesh->elements[i]), mesh); safe_free((void **)(void *) &(mesh->elements)); safe_free((void **)(void *) &(mesh->blank)); - for (i = 0; i < mesh->num_el_blks; i++) + for (i = 0; i < mesh->num_el_blks; i++) safe_free((void **)(void *) &(mesh->eb_names[i])); safe_free((void **)(void *) &(mesh->eb_names)); diff --git a/packages/zoltan/src/driver/dr_elem_util_const.h b/packages/zoltan/src/driver/dr_elem_util_const.h index 8bb0979961..96be2d589b 100644 --- a/packages/zoltan/src/driver/dr_elem_util_const.h +++ b/packages/zoltan/src/driver/dr_elem_util_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_ELEM_UTIL_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_err.c b/packages/zoltan/src/driver/dr_err.c index a9701afaf4..147942e3cb 100644 --- a/packages/zoltan/src/driver/dr_err.c +++ b/packages/zoltan/src/driver/dr_err.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -160,18 +123,18 @@ void error_report(int Proc) fprintf(stderr, "Proc %d: \t%s\n", Proc, (error_info+i)->err_mesg); if(error_lev >= 2) - fprintf(stderr, "Proc %d: \t\tin file %s\n", + fprintf(stderr, "Proc %d: \t\tin file %s\n", Proc, (error_info+i)->filename); if(error_lev >= 3) - fprintf(stderr, "Proc %d: \t\t\tat line %d\n", + fprintf(stderr, "Proc %d: \t\t\tat line %d\n", Proc, (error_info+i)->line_no); } } } - MPI_Abort(MPI_COMM_WORLD, -1); + MPI_Abort(zoltan_get_global_comm(), -1); } #ifdef __cplusplus diff --git a/packages/zoltan/src/driver/dr_err_const.h b/packages/zoltan/src/driver/dr_err_const.h index cbd278e588..3fcdd7c805 100644 --- a/packages/zoltan/src/driver/dr_err_const.h +++ b/packages/zoltan/src/driver/dr_err_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_ERR_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_eval.c b/packages/zoltan/src/driver/dr_eval.c index ea33feebb9..08e675b9c7 100644 --- a/packages/zoltan/src/driver/dr_eval.c +++ b/packages/zoltan/src/driver/dr_eval.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_eval_const.h" @@ -78,35 +41,35 @@ ZOLTAN_ID_TYPE gsumcuts, gmaxcuts, gmincuts, elemcount; ZOLTAN_ID_TYPE gsumelems, gmaxelems, gminelems; double gsumload, gmaxload, gminload; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); for (i = 0; i < mesh->necmap; i++) { cuts += mesh->ecmap_cnt[i]; } - + for (i = 0; i < mesh->num_elems; i++) { if (mesh->blank_count && (mesh->blank[i] == 1)) continue; load += mesh->elements[i].cpu_wgt[0]; } - MPI_Allreduce(&cuts, &gsumcuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&cuts, &gmaxcuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&cuts, &gmincuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&cuts, &gsumcuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, zoltan_get_global_comm()); + MPI_Allreduce(&cuts, &gmaxcuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_MAX, zoltan_get_global_comm()); + MPI_Allreduce(&cuts, &gmincuts, 1, ZOLTAN_ID_MPI_TYPE, MPI_MIN, zoltan_get_global_comm()); elemcount = mesh->num_elems - mesh->blank_count; - MPI_Allreduce(&elemcount, &gsumelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&elemcount, &gmaxelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&elemcount, &gminelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&elemcount, &gsumelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, zoltan_get_global_comm()); + MPI_Allreduce(&elemcount, &gmaxelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_MAX, zoltan_get_global_comm()); + MPI_Allreduce(&elemcount, &gminelems, 1, ZOLTAN_ID_MPI_TYPE, MPI_MIN, zoltan_get_global_comm()); - MPI_Allreduce(&load, &gsumload, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&load, &gmaxload, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&load, &gminload, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&load, &gsumload, 1, MPI_DOUBLE, MPI_SUM, zoltan_get_global_comm()); + MPI_Allreduce(&load, &gmaxload, 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); + MPI_Allreduce(&load, &gminload, 1, MPI_DOUBLE, MPI_MIN, zoltan_get_global_comm()); if (proc == 0) { - printf("DRIVER EVAL: load: max %f min %f sum %f\n", + printf("DRIVER EVAL: load: max %f min %f sum %f\n", gmaxload, gminload, gsumload); - printf("DRIVER EVAL: objs: max " ZOLTAN_ID_SPEC " min " ZOLTAN_ID_SPEC " sum " ZOLTAN_ID_SPEC "\n", + printf("DRIVER EVAL: objs: max " ZOLTAN_ID_SPEC " min " ZOLTAN_ID_SPEC " sum " ZOLTAN_ID_SPEC "\n", gmaxelems, gminelems, gsumelems); printf("DRIVER EVAL: cuts: max " ZOLTAN_ID_SPEC " min " ZOLTAN_ID_SPEC " sum " ZOLTAN_ID_SPEC "\n", gmaxcuts, gmincuts, gsumcuts); diff --git a/packages/zoltan/src/driver/dr_eval_const.h b/packages/zoltan/src/driver/dr_eval_const.h index 7ce89ab11b..7a722e3c40 100644 --- a/packages/zoltan/src/driver/dr_eval_const.h +++ b/packages/zoltan/src/driver/dr_eval_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_EVAL_H_ diff --git a/packages/zoltan/src/driver/dr_exoII_io.c b/packages/zoltan/src/driver/dr_exoII_io.c index a5ce95fd12..4c84e7d99e 100644 --- a/packages/zoltan/src/driver/dr_exoII_io.c +++ b/packages/zoltan/src/driver/dr_exoII_io.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -120,8 +83,8 @@ int read_exoII_file(int Proc, gen_par_filename(pio_info->pexo_fname, par_nem_fname, pio_info, Proc, Num_Proc); - /* - * check whether parallel file exists. do the check with fopen + /* + * check whether parallel file exists. do the check with fopen * as ex_open coredumps on the paragon when files do not exist. */ @@ -229,10 +192,10 @@ int read_exoII_file(int Proc, } /* Perform reduction on necessary fields of element blocks. kdd 2/2001 */ - MPI_Allreduce(nnodes, mesh->eb_nnodes, mesh->num_el_blks, MPI_INT, MPI_MAX, - MPI_COMM_WORLD); - MPI_Allreduce(etypes, mesh->eb_etypes, mesh->num_el_blks, MPI_INT, MPI_MIN, - MPI_COMM_WORLD); + MPI_Allreduce(nnodes, mesh->eb_nnodes, mesh->num_el_blks, MPI_INT, MPI_MAX, + zoltan_get_global_comm()); + MPI_Allreduce(etypes, mesh->eb_etypes, mesh->num_el_blks, MPI_INT, MPI_MIN, + zoltan_get_global_comm()); for (i = 0; i < mesh->num_el_blks; i++) { strcpy(mesh->eb_names[i], get_elem_name(mesh->eb_etypes[i])); } @@ -243,7 +206,7 @@ int read_exoII_file(int Proc, * allocate a little extra for element migration latter */ mesh->elem_array_len = mesh->num_elems + 5; - mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len + mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len * sizeof(ELEM_INFO)); if (!(mesh->elements)) { Gen_Error(0, "fatal: insufficient memory"); @@ -254,7 +217,7 @@ int read_exoII_file(int Proc, * intialize all of the element structs as unused by * setting the globalID to ZOLTAN_ID_INVALID. */ - for (i = 0; i < mesh->elem_array_len; i++) + for (i = 0; i < mesh->elem_array_len; i++) initialize_element(&(mesh->elements[i])); /* read the information for the individual elements */ @@ -480,7 +443,7 @@ static int read_elem_info(int pexoid, int Proc, PROB_INFO_PTR prob, /*************************************************************************/ /* Part two: Find the adjacencies on this processor */ - /* and get the edge weights */ + /* and get the edge weights */ /*************************************************************************/ if (!find_adjacency(Proc, mesh, sur_elem, nsurnd, max_nsur)) { Gen_Error(0, "fatal: Error returned from find_adjacency"); @@ -533,7 +496,7 @@ static int find_surnd_elem(MESH_INFO_PTR mesh, int **sur_elem, int *nsurnd, int ielem, inode, lnode; int *alloc_cnt, *tmp_ptr; ELEM_INFO_PTR elements = mesh->elements; - + /***************************** BEGIN EXECUTION ******************************/ alloc_cnt = (int *) malloc(mesh->num_nodes * sizeof(int)); @@ -619,7 +582,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * is temporary, and will be expanded. This will make determining * off processor adjacencies much easier. * - * Adjacency info for an element's side i will be stored in the (i-1) entry + * Adjacency info for an element's side i will be stored in the (i-1) entry * of adj array for the element. Sides without adjacencies will have -1 * as the adj array entries for those sides. This system allows easy * identification of side ids for recomputing element comm maps after @@ -670,7 +633,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, for (nscnt = 0; nscnt < nsides; nscnt++) { /* get the list of nodes on this side set */ - side_cnt = ss_to_node_list((E_Type) (eb_etype[iblk]), + side_cnt = ss_to_node_list((E_Type) (eb_etype[iblk]), elements[ielem].connect, (nscnt+1), side_nodes); @@ -727,7 +690,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * get the side id of entry. Make sure that ielem is * trying to communicate to a valid side of elem */ - side_cnt = get_ss_mirror((E_Type) (eb_etype[iblk]), + side_cnt = get_ss_mirror((E_Type) (eb_etype[iblk]), side_nodes, (nscnt+1), mirror_nodes); @@ -751,7 +714,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * the edge weight is the number of nodes in the * connecting face */ - elements[ielem].edge_wgt[nscnt] = + elements[ielem].edge_wgt[nscnt] = (float) get_elem_info(NSNODES, (E_Type) (eb_etype[iblk]), (nscnt+1)); @@ -843,7 +806,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, return 0; } - if (ne_get_cmap_params(pexoid, NULL, NULL, mesh->ecmap_id, + if (ne_get_cmap_params(pexoid, NULL, NULL, mesh->ecmap_id, mesh->ecmap_cnt, Proc) < 0) { Gen_Error(0, "fatal: Error returned from ne_get_cmap_params"); return 0; @@ -870,7 +833,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, if(ne_get_elem_cmap(pexoid, mesh->ecmap_id[imap], &(mesh->ecmap_elemids[offset]), - &(mesh->ecmap_sideids[offset]), + &(mesh->ecmap_sideids[offset]), &(proc_ids[offset]), Proc) < 0) { Gen_Error(0, "fatal: Error returned from ne_get_elem_cmap"); return 0; @@ -893,7 +856,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, * for the adjacent elements in this communication map. */ - ierr = Zoltan_Comm_Create(&comm_obj, max_len, proc_ids, MPI_COMM_WORLD, + ierr = Zoltan_Comm_Create(&comm_obj, max_len, proc_ids, zoltan_get_global_comm(), msg, &nrecv); if (ierr != ZOLTAN_OK) { Gen_Error(0, "fatal: Error returned from Zoltan_Comm_Create"); @@ -905,9 +868,9 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, return 0; } - /* Exchange ids to neighbors. - * Assuming messages will be stored in order of processor number in - * ecmap_neighids. + /* Exchange ids to neighbors. + * Assuming messages will be stored in order of processor number in + * ecmap_neighids. */ if (nrecv > 0){ @@ -927,12 +890,12 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, free(buf); } - /* Exchange sanity check information. + /* Exchange sanity check information. * Allows to check assumption that messages are stored in order of * processor number. */ if (ierr == ZOLTAN_OK) - ierr = Zoltan_Comm_Do(comm_obj, msg+2, (char *) my_procs, sizeof(int), + ierr = Zoltan_Comm_Do(comm_obj, msg+2, (char *) my_procs, sizeof(int), (char *) recv_procs); if (ierr != ZOLTAN_OK) { @@ -980,7 +943,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, } /* End: "for (ielem = 0; ielem < mesh->ecmap_cnt[imap]; ielem++)" */ offset += mesh->ecmap_cnt[imap]; } /* End: "for for (imap = 0; imap < mesh->necmap; imap++)" */ - + free (proc_ids); DEBUG_TRACE_END(Proc, yo); @@ -994,8 +957,8 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, int write_elem_vars( int Proc, MESH_INFO_PTR mesh, - PARIO_INFO_PTR pio_info, - int num_exp, + PARIO_INFO_PTR pio_info, + int num_exp, ZOLTAN_ID_PTR exp_gids, int *exp_procs, int *exp_to_part @@ -1016,10 +979,10 @@ char cmesg[256]; char *str = "Proc"; /* generate the parallel filename for this processor */ - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); gen_par_filename(pio_info->pexo_fname, tmp_nem_fname, pio_info, Proc, Num_Proc); - /* + /* * Copy the parallel file to a new file (so we don't write results in the * cvs version). */ @@ -1053,14 +1016,14 @@ char *str = "Proc"; if (mesh->elements[i].elem_blk == iblk) { /* Element is in block; see whether it is to be exported. */ if ((tmp=in_list2((int)mesh->elements[i].globalID, num_exp, (int *) exp_gids)) != -1) - vars[j++] = (Output.Plot_Partition ? (float) (exp_to_part[tmp]) + vars[j++] = (Output.Plot_Partition ? (float) (exp_to_part[tmp]) : (float) (exp_procs[tmp])); else - vars[j++] = (Output.Plot_Partition ? mesh->elements[i].my_part + vars[j++] = (Output.Plot_Partition ? mesh->elements[i].my_part : (float) (Proc)); } } - if (ex_put_elem_var(pexoid, 1, 1, mesh->eb_ids[iblk], + if (ex_put_elem_var(pexoid, 1, 1, mesh->eb_ids[iblk], mesh->eb_cnts[iblk], vars) < 0) { Gen_Error(0, "fatal: Error returned from ex_put_elem_var"); return 0; diff --git a/packages/zoltan/src/driver/dr_exoII_ioCPP.cpp b/packages/zoltan/src/driver/dr_exoII_ioCPP.cpp index 7fd4bd0b20..d8ffbddc45 100644 --- a/packages/zoltan/src/driver/dr_exoII_ioCPP.cpp +++ b/packages/zoltan/src/driver/dr_exoII_ioCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include // must appear before stdio or iostream @@ -117,8 +80,8 @@ int read_exoII_file(int Proc, gen_par_filename(pio_info->pexo_fname, par_nem_fname, pio_info, Proc, Num_Proc); - /* - * check whether parallel file exists. do the check with fopen + /* + * check whether parallel file exists. do the check with fopen * as ex_open coredumps on the paragon when files do not exist. */ @@ -225,10 +188,10 @@ int read_exoII_file(int Proc, } /* Perform reduction on necessary fields of element blocks. kdd 2/2001 */ - MPI_Allreduce(nnodes, mesh->eb_nnodes, mesh->num_el_blks, - MPI_INT, MPI_MAX, MPI_COMM_WORLD) ; - MPI_Allreduce(etypes, mesh->eb_etypes, mesh->num_el_blks, - MPI_INT, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(nnodes, mesh->eb_nnodes, mesh->num_el_blks, + MPI_INT, MPI_MAX, zoltan_get_global_comm()) ; + MPI_Allreduce(etypes, mesh->eb_etypes, mesh->num_el_blks, + MPI_INT, MPI_MIN, zoltan_get_global_comm()); for (i = 0; i < mesh->num_el_blks; i++) { strcpy(mesh->eb_names[i], get_elem_name(mesh->eb_etypes[i])); } @@ -239,7 +202,7 @@ int read_exoII_file(int Proc, * allocate a little extra for element migration latter */ mesh->elem_array_len = mesh->num_elems + 5; - mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len + mesh->elements = (ELEM_INFO_PTR) malloc (mesh->elem_array_len * sizeof(ELEM_INFO)); if (!(mesh->elements)) { Gen_Error(0, "fatal: insufficient memory"); @@ -250,7 +213,7 @@ int read_exoII_file(int Proc, * intialize all of the element structs as unused by * setting the globalID to -1 */ - for (i = 0; i < mesh->elem_array_len; i++) + for (i = 0; i < mesh->elem_array_len; i++) initialize_element(&(mesh->elements[i])); /* read the information for the individual elements */ @@ -476,7 +439,7 @@ static int read_elem_info(int pexoid, int Proc, PROB_INFO_PTR prob, /*************************************************************************/ /* Part two: Find the adjacencies on this processor */ - /* and get the edge weights */ + /* and get the edge weights */ /*************************************************************************/ if (!find_adjacency(Proc, mesh, sur_elem, nsurnd, max_nsur)) { Gen_Error(0, "fatal: Error returned from find_adjacency"); @@ -529,7 +492,7 @@ static int find_surnd_elem(MESH_INFO_PTR mesh, int **sur_elem, int *nsurnd, int ielem, inode, lnode; int *alloc_cnt, *tmp_ptr; ELEM_INFO_PTR elements = mesh->elements; - + /***************************** BEGIN EXECUTION ******************************/ alloc_cnt = (int *) malloc(mesh->num_nodes * sizeof(int)); @@ -615,7 +578,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * is temporary, and will be expanded. This will make determining * off processor adjacencies much easier. * - * Adjacency info for an element's side i will be stored in the (i-1) entry + * Adjacency info for an element's side i will be stored in the (i-1) entry * of adj array for the element. Sides without adjacencies will have -1 * as the adj array entries for those sides. This system allows easy * identification of side ids for recomputing element comm maps after @@ -666,7 +629,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, for (nscnt = 0; nscnt < nsides; nscnt++) { /* get the list of nodes on this side set */ - side_cnt = ss_to_node_list((E_Type) (eb_etype[iblk]), + side_cnt = ss_to_node_list((E_Type) (eb_etype[iblk]), elements[ielem].connect, (nscnt+1), side_nodes); @@ -723,7 +686,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * get the side id of entry. Make sure that ielem is * trying to communicate to a valid side of elem */ - side_cnt = get_ss_mirror((E_Type) (eb_etype[iblk]), + side_cnt = get_ss_mirror((E_Type) (eb_etype[iblk]), side_nodes, (nscnt+1), mirror_nodes); @@ -747,7 +710,7 @@ static int find_adjacency(int Proc, MESH_INFO_PTR mesh, * the edge weight is the number of nodes in the * connecting face */ - elements[ielem].edge_wgt[nscnt] = + elements[ielem].edge_wgt[nscnt] = (float) get_elem_info(NSNODES, (E_Type) (eb_etype[iblk]), (nscnt+1)); @@ -838,7 +801,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, return 0; } - if (ne_get_cmap_params(pexoid, NULL, NULL, mesh->ecmap_id, + if (ne_get_cmap_params(pexoid, NULL, NULL, mesh->ecmap_id, mesh->ecmap_cnt, Proc) < 0) { Gen_Error(0, "fatal: Error returned from ne_get_cmap_params"); return 0; @@ -865,7 +828,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, if(ne_get_elem_cmap(pexoid, mesh->ecmap_id[imap], &(mesh->ecmap_elemids[offset]), - &(mesh->ecmap_sideids[offset]), + &(mesh->ecmap_sideids[offset]), &(proc_ids[offset]), Proc) < 0) { Gen_Error(0, "fatal: Error returned from ne_get_elem_cmap"); return 0; @@ -888,26 +851,26 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, * for the adjacent elements in this communication map. */ - comm_obj = new Zoltan_Comm(max_len, proc_ids, MPI_COMM_WORLD, msg, &nrecv); - + comm_obj = new Zoltan_Comm(max_len, proc_ids, zoltan_get_global_comm(), msg, &nrecv); + if (nrecv != max_len) { Gen_Error(0, "fatal: Error returned from Zoltan_Comm constructor"); return 0; } - /* Exchange ids to neighbors. - * Assuming messages will be stored in order of processor number in - * ecmap_neighids. + /* Exchange ids to neighbors. + * Assuming messages will be stored in order of processor number in + * ecmap_neighids. */ - ierr = comm_obj->Do(msg+1, (char *) gids, sizeof(int), + ierr = comm_obj->Do(msg+1, (char *) gids, sizeof(int), (char *) (mesh->ecmap_neighids)); - /* Exchange sanity check information. + /* Exchange sanity check information. * Allows to check assumption that messages are stored in order of * processor number. */ if (ierr == ZOLTAN_OK) - ierr = comm_obj->Do(msg+2, (char *) my_procs, sizeof(int), + ierr = comm_obj->Do(msg+2, (char *) my_procs, sizeof(int), (char *) recv_procs); if (ierr != ZOLTAN_OK) { @@ -955,7 +918,7 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, } /* End: "for (ielem = 0; ielem < mesh->ecmap_cnt[imap]; ielem++)" */ offset += mesh->ecmap_cnt[imap]; } /* End: "for for (imap = 0; imap < mesh->necmap; imap++)" */ - + free (proc_ids); DEBUG_TRACE_END(Proc, yo); @@ -969,8 +932,8 @@ static int read_comm_map_info(int pexoid, int Proc, PROB_INFO_PTR prob, int write_elem_vars( int Proc, MESH_INFO_PTR mesh, - PARIO_INFO_PTR pio_info, - int num_exp, + PARIO_INFO_PTR pio_info, + int num_exp, ZOLTAN_ID_PTR exp_gids, int *exp_procs, int *exp_to_part @@ -990,11 +953,11 @@ char cmesg[256]; /* generate the parallel filename for this processor */ int Num_Proc = 0; - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); gen_par_filename(pio_info->pexo_fname, tmp_nem_fname, pio_info, Proc, Num_Proc); - /* + /* * Copy the parallel file to a new file (so we don't write results in the * cvs version). */ @@ -1034,14 +997,14 @@ char cmesg[256]; if (mesh->elements[i].elem_blk == iblk) { /* Element is in block; see whether it is to be exported. */ if ((tmp=in_list(mesh->elements[i].globalID, num_exp, (int *) exp_gids)) != -1) - vars[j++] = (Output.Plot_Partition ? (float) (exp_to_part[tmp]) + vars[j++] = (Output.Plot_Partition ? (float) (exp_to_part[tmp]) : (float) (exp_procs[tmp])); else - vars[j++] = (Output.Plot_Partition ? mesh->elements[i].my_part + vars[j++] = (Output.Plot_Partition ? mesh->elements[i].my_part : (float) (Proc)); } } - if (ex_put_elem_var(pexoid, 1, 1, mesh->eb_ids[iblk], + if (ex_put_elem_var(pexoid, 1, 1, mesh->eb_ids[iblk], mesh->eb_cnts[iblk], vars) < 0) { Gen_Error(0, "fatal: Error returned from ex_put_elem_var"); return 0; diff --git a/packages/zoltan/src/driver/dr_externs.h b/packages/zoltan/src/driver/dr_externs.h index 37d6379636..68fdc653b2 100644 --- a/packages/zoltan/src/driver/dr_externs.h +++ b/packages/zoltan/src/driver/dr_externs.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_EXTERNS_H #define _DR_EXTERNS_H diff --git a/packages/zoltan/src/driver/dr_gnuplot.c b/packages/zoltan/src/driver/dr_gnuplot.c index 9f02cc012e..9cce4f20ca 100644 --- a/packages/zoltan/src/driver/dr_gnuplot.c +++ b/packages/zoltan/src/driver/dr_gnuplot.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_externs.h" @@ -101,7 +64,7 @@ int output_gnu(const char *cmd_file, * results. * We'll do 3D problems later. * - * One gnuplot file is written for each part. + * One gnuplot file is written for each part. * When number of part == number of processors, there is one file per * processor. * @@ -161,10 +124,10 @@ int output_gnu(const char *cmd_file, return 0; } - /* - * Build arrays of part number to sort by. Index and elem_index arrays - * will be used even when plotting by processor numbers (for generality), - * so build it regardless. + /* + * Build arrays of part number to sort by. Index and elem_index arrays + * will be used even when plotting by processor numbers (for generality), + * so build it regardless. */ nelems = mesh->num_elems - mesh->blank_count; @@ -177,7 +140,7 @@ int output_gnu(const char *cmd_file, if (current_elem->globalID != ZOLTAN_ID_INVALID) { if (mesh->blank_count && (mesh->blank[i] == 1)) continue; - + if (current_elem->my_part > max_part) max_part = current_elem->my_part; parts[j] = (Output.Plot_Partition ? current_elem->my_part : Proc); index[j] = j; @@ -188,9 +151,9 @@ int output_gnu(const char *cmd_file, } if (Output.Plot_Partition) { /* Sort by part numbers. Assumes # parts >= # proc. */ - if (nelems > 0) + if (nelems > 0) Zoltan_quicksort_pointer_inc_int_int(index, parts, NULL, 0, nelems-1); - MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); gnum_part = gmax_part + 1; } @@ -205,7 +168,7 @@ int output_gnu(const char *cmd_file, pio_info->file_type == NO_FILE_POINTS || pio_info->file_type == NO_FILE_TRIANGLES || pio_info->file_type == HYPERGRAPH_FILE) { - /* + /* * For each node of Chaco graph, print the coordinates of the node. * Then, for each neighboring node on the processor, print the neighbor's * coordinates. @@ -215,12 +178,12 @@ int output_gnu(const char *cmd_file, current_elem = &(mesh->elements[elem_index[index[i]]]); if (parts[index[i]] != prev_part) { if (fp != NULL) fclose(fp); - gen_par_filename(ctemp, par_out_fname, pio_info, + gen_par_filename(ctemp, par_out_fname, pio_info, parts[index[i]], Num_Proc); fp = fopen(par_out_fname, "w"); prev_part = parts[index[i]]; } - + /* Include the point itself, so that even if there are no edges, * the point will appear. */ printcoord(fp, mesh->num_dims, "\n", current_elem); @@ -251,9 +214,9 @@ int output_gnu(const char *cmd_file, if (current_elem->adj_proc[j] == Proc) { /* Nbor is on same proc */ if (mesh->blank_count && (mesh->blank[current_elem->adj[j]] == 1)) continue; - if (!Output.Plot_Partition || - mesh->elements[current_elem->adj[j]].my_part == - current_elem->my_part) { + if (!Output.Plot_Partition || + mesh->elements[current_elem->adj[j]].my_part == + current_elem->my_part) { /* Not plotting parts, or nbor is in same part */ /* Plot the edge. Need to include current point and nbor point * for each edge. */ @@ -267,14 +230,14 @@ int output_gnu(const char *cmd_file, } } - MPI_Reduce(&locMinX,&globMinX,1,MPI_FLOAT,MPI_MIN,0,MPI_COMM_WORLD); - MPI_Reduce(&locMinY,&globMinY,1,MPI_FLOAT,MPI_MIN,0,MPI_COMM_WORLD); - MPI_Reduce(&locMaxX,&globMaxX,1,MPI_FLOAT,MPI_MAX,0,MPI_COMM_WORLD); - MPI_Reduce(&locMaxY,&globMaxY,1,MPI_FLOAT,MPI_MAX,0,MPI_COMM_WORLD); + MPI_Reduce(&locMinX,&globMinX,1,MPI_FLOAT,MPI_MIN,0,zoltan_get_global_comm()); + MPI_Reduce(&locMinY,&globMinY,1,MPI_FLOAT,MPI_MIN,0,zoltan_get_global_comm()); + MPI_Reduce(&locMaxX,&globMaxX,1,MPI_FLOAT,MPI_MAX,0,zoltan_get_global_comm()); + MPI_Reduce(&locMaxY,&globMaxY,1,MPI_FLOAT,MPI_MAX,0,zoltan_get_global_comm()); } else if (pio_info->file_type == NEMESIS_FILE) { /* Nemesis input file */ - /* + /* * For each element of Nemesis input file, print the coordinates of its * nodes. No need to follow neighbors, as decomposition is by elements. */ @@ -292,7 +255,7 @@ int output_gnu(const char *cmd_file, current_elem = &(mesh->elements[elem_index[index[i]]]); if (parts[index[i]] != prev_part) { if (fp != NULL) fclose(fp); - gen_par_filename(ctemp, par_out_fname, pio_info, + gen_par_filename(ctemp, par_out_fname, pio_info, parts[index[i]], Num_Proc); fp = fopen(par_out_fname, "w"); prev_part = parts[index[i]]; @@ -300,12 +263,12 @@ int output_gnu(const char *cmd_file, num_nodes = mesh->eb_nnodes[current_elem->elem_blk]; sum[0] = sum[1] = 0.0; for (j = 0; j < num_nodes; j++) { - fprintf(fp, "%e %e\n", + fprintf(fp, "%e %e\n", current_elem->coord[j][0], current_elem->coord[j][1]); sum[0] += current_elem->coord[j][0]; sum[1] += current_elem->coord[j][1]; } - fprintf(fp, "%e %e\n", current_elem->coord[0][0], + fprintf(fp, "%e %e\n", current_elem->coord[0][0], current_elem->coord[0][1]); fprintf(fp, "\n"); /* Print small + in center of element */ @@ -317,13 +280,13 @@ int output_gnu(const char *cmd_file, fprintf(fp, "%e %e\n\n", sum[0], sum[1] + 0.001); } } - - if (nelems == 0 && !Output.Plot_Partition) { + + if (nelems == 0 && !Output.Plot_Partition) { /* Open a file just so one exists; satisfies the gnuload file. */ gen_par_filename(ctemp, par_out_fname, pio_info, Proc, Num_Proc); fp = fopen(par_out_fname, "w"); } - + if (fp != NULL) fclose(fp); safe_free((void **)(void *) &parts); diff --git a/packages/zoltan/src/driver/dr_hg_io.c b/packages/zoltan/src/driver/dr_hg_io.c index eaf3eb4f19..0add0bce3f 100644 --- a/packages/zoltan/src/driver/dr_hg_io.c +++ b/packages/zoltan/src/driver/dr_hg_io.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -85,25 +48,25 @@ extern "C" { #if PRINT_DEBUG_INFO static void debug_elements(int Proc, int Num_Proc, int num, ELEM_INFO_PTR el); -static void debug_lists(int Proc, int Num_Proc, int nedge, int *index, ZOLTAN_ID_TYPE *vtx, +static void debug_lists(int Proc, int Num_Proc, int nedge, int *index, ZOLTAN_ID_TYPE *vtx, int *vtx_proc, ZOLTAN_ID_TYPE *egid); -static void debug_pins(int Proc, int Num_Proc, - ZOLTAN_ID_TYPE nGlobalEdges, ZOLTAN_ID_TYPE nGlobalVtxs, +static void debug_pins(int Proc, int Num_Proc, + ZOLTAN_ID_TYPE nGlobalEdges, ZOLTAN_ID_TYPE nGlobalVtxs, int vtxWDim, int edgeWDim, int nMyPins, ZOLTAN_ID_TYPE *myPinI, ZOLTAN_ID_TYPE *myPinJ, int nMyVtx, ZOLTAN_ID_TYPE *myVtxNum, float *myVtxWgts, int nMyEdgeWgts, ZOLTAN_ID_TYPE *myEWGno, float *myEdgeWgts); #endif -static int dist_hyperedges( MPI_Comm, PARIO_INFO_PTR, int, int, int, +static int dist_hyperedges( MPI_Comm, PARIO_INFO_PTR, int, int, int, int *, int *, int **, int **, int **, int **, int *, float **, short *); static int create_edge_lists(int, ZOLTAN_ID_TYPE *, ZOLTAN_ID_TYPE *, int *, ZOLTAN_ID_TYPE **, int **, ZOLTAN_ID_TYPE **); -static int process_mtxp_file(PARIO_INFO_PTR, char *, size_t , int , int , int, - ZOLTAN_ID_TYPE *, ZOLTAN_ID_TYPE *, int *, int *, int *, - ZOLTAN_ID_TYPE **, ZOLTAN_ID_TYPE **, int *, ZOLTAN_ID_TYPE **, +static int process_mtxp_file(PARIO_INFO_PTR, char *, size_t , int , int , int, + ZOLTAN_ID_TYPE *, ZOLTAN_ID_TYPE *, int *, int *, int *, + ZOLTAN_ID_TYPE **, ZOLTAN_ID_TYPE **, int *, ZOLTAN_ID_TYPE **, float **, int *, ZOLTAN_ID_TYPE **, float **, int); static int read_mtxp_lines(char *, int, int, char **, int *); @@ -214,7 +177,7 @@ int read_hypergraph_file( - MPI_Bcast(&file_error, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&file_error, 1, MPI_INT, 0, zoltan_get_global_comm()); if (file_error) { sprintf(cmesg, @@ -354,7 +317,7 @@ int read_hypergraph_file( } } - MPI_Bcast(&base, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&base, 1, MPI_INT, 0, zoltan_get_global_comm()); if (distributed_pins){ gnhedges = nhedges; @@ -404,14 +367,14 @@ int read_hypergraph_file( /* Distribute hypergraph graph */ /* Use hypergraph vertex information and chaco edge information. */ - if (!chaco_dist_graph(MPI_COMM_WORLD, pio_info, 0, &gnvtxs, &nvtxs, + if (!chaco_dist_graph(zoltan_get_global_comm(), pio_info, 0, &gnvtxs, &nvtxs, &ch_start, &ch_adj, &vwgt_dim, &vwgts, &ch_ewgt_dim, &ch_ewgts, &ch_ndim, &ch_x, &ch_y, &ch_z, &ch_assignments)) { Gen_Error(0, "fatal: Error returned from chaco_dist_graph"); return 0; } - if (!dist_hyperedges(MPI_COMM_WORLD, pio_info, 0, base, gnvtxs, &gnhedges, + if (!dist_hyperedges(zoltan_get_global_comm(), pio_info, 0, base, gnvtxs, &gnhedges, &nhedges, &hgid, &hindex, &hvertex, &hvertex_proc, &hewgt_dim, &hewgts, ch_assignments)) { Gen_Error(0, "fatal: Error returned from dist_hyperedges"); @@ -477,7 +440,7 @@ int read_hypergraph_file( * Each element has one set of coordinates (i.e., node) if a coords file * was provided; zero otherwise. */ - MPI_Bcast( &ch_no_geom, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast( &ch_no_geom, 1, MPI_INT, 0, zoltan_get_global_comm()); if (ch_no_geom) mesh->eb_nnodes[0] = 0; else @@ -500,7 +463,7 @@ int read_hypergraph_file( /* * initialize all of the element structs as unused by - * setting the globalID to ZOLTAN_ID_INVALID + * setting the globalID to ZOLTAN_ID_INVALID */ for (i = 0; i < mesh->elem_array_len; i++) initialize_element(&(mesh->elements[i])); @@ -556,7 +519,7 @@ int read_mtxplus_file( int rc, fsize, i, j; char *filebuf=NULL; FILE* fp; - ZOLTAN_ID_TYPE nGlobalEdges, nGlobalVtxs; + ZOLTAN_ID_TYPE nGlobalEdges, nGlobalVtxs; ZOLTAN_ID_TYPE *myPinI, *myPinJ, *myVtxNum, *myEWGno; ZOLTAN_ID_TYPE *edgeGno, *pinGno; int vtxWDim, edgeWDim; @@ -585,7 +548,7 @@ int read_mtxplus_file( /* Each process reads in the mtxp file and keeps only the parts that it owns. * Buffer is null terminated. * It's possible a process only has mtxp header and owns no vertices, etc. - */ + */ fsize = read_mtxp_lines(filename, Proc, Num_Proc, &filebuf, &num_my_lines); @@ -601,21 +564,21 @@ int read_mtxplus_file( /* Process 0 reads the file and broadcasts it */ if (Proc == 0) { fsize = 0; - + rc = stat(filename, &statbuf); - + if (rc == 0){ fsize = statbuf.st_size; fp = fopen(filename, "r"); - + if (!fp){ fsize = 0; } else{ filebuf = (char *)malloc(fsize+1); - + rc = fread(filebuf, 1, fsize, fp); - + if (rc != fsize){ free(filebuf); fsize = 0; @@ -629,20 +592,20 @@ int read_mtxplus_file( } } } - - MPI_Bcast(&fsize, 1, MPI_INT, 0, MPI_COMM_WORLD); - + + MPI_Bcast(&fsize, 1, MPI_INT, 0, zoltan_get_global_comm()); + if (fsize == 0) { sprintf(cmesg, "fatal: Could not open/read hypergraph file %s", filename); Gen_Error(0, cmesg); return 0; } - + if (Proc > 0){ filebuf = (char *)malloc(fsize); } - - MPI_Bcast(filebuf, fsize, MPI_BYTE, 0, MPI_COMM_WORLD); + + MPI_Bcast(filebuf, fsize, MPI_BYTE, 0, zoltan_get_global_comm()); } else{ /* ERROR - we don't handle the zdrive.inp file request */ @@ -657,9 +620,9 @@ int read_mtxplus_file( &nMyEdgeWgts, &myEWGno, &myEdgeWgts, preprocessed); free(filebuf); - - MPI_Allreduce(&rc, &status, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - + + MPI_Allreduce(&rc, &status, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); + if (status != Num_Proc){ Gen_Error(0, "fatal: invalid mtxp file"); /* TODO better message */ return 0; @@ -682,15 +645,15 @@ int read_mtxplus_file( * initial pins = row each process gets full rows (hedges) initially * and format is ZOLTAN_COMPRESSED_EDGE * - * initial pins = col each process gets full columns (vertices) initially + * initial pins = col each process gets full columns (vertices) initially * and format is ZOLTAN_COMPRESSED_VERTEX */ - if (pio_info->init_dist_pins != INITIAL_COL){ + if (pio_info->init_dist_pins != INITIAL_COL){ rc = create_edge_lists(nMyPins, myPinI, myPinJ, &numHEdges, &edgeGno, &edgeIdx, &pinGno); mesh->format = ZOLTAN_COMPRESSED_EDGE; } - else{ + else{ /* actually creating vertex lists, since we switched * the role of I and J in the argument list. */ @@ -699,7 +662,7 @@ int read_mtxplus_file( mesh->format = ZOLTAN_COMPRESSED_VERTEX; } - MPI_Allreduce(&rc, &status, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&rc, &status, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (status != Num_Proc){ return 0; @@ -825,18 +788,18 @@ void mm_cleanup(MESH_INFO_PTR mesh) { /* Matrix-market files are one-based, but when we read them, we converted * them to zero-based for convenience of indexing arrays. - * However, we should give Zoltan and the output routines IDs - * that have the same base as the input (not converted from one-based - * to zero-based). So if the input was from Matrix-Market files, + * However, we should give Zoltan and the output routines IDs + * that have the same base as the input (not converted from one-based + * to zero-based). So if the input was from Matrix-Market files, * add one to all GIDs. */ - + int i, j, sum; int nhedges = mesh->nhedges; int npins = mesh->hindex[nhedges]; ELEM_INFO_PTR elements = mesh->elements; - + for (i = 0; i < mesh->num_elems; i++) { ELEM_INFO_PTR current_elem = &(elements[i]); current_elem->globalID++; @@ -1226,9 +1189,9 @@ ZOLTAN_ID_TYPE *eidList, *pins, *match; static int process_mtxp_file(PARIO_INFO_PTR pio_info, char *filebuf, size_t fsize, int num_my_lines, int nprocs, int myrank, - ZOLTAN_ID_TYPE *nGlobalEdges, ZOLTAN_ID_TYPE *nGlobalVtxs, + ZOLTAN_ID_TYPE *nGlobalEdges, ZOLTAN_ID_TYPE *nGlobalVtxs, int *vtxWDim, int *edgeWDim, - int *nMyPins, + int *nMyPins, ZOLTAN_ID_TYPE **myPinI, ZOLTAN_ID_TYPE **myPinJ, int *nMyVtx, ZOLTAN_ID_TYPE **myVtxNum, float **myVtxWgts, int *nMyEdgeWgts, ZOLTAN_ID_TYPE **myEdgeNum, float **myEdgeWgts, @@ -1297,7 +1260,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; (pio_info->init_dist_procs < nprocs)){ nDistProcs = pio_info->init_dist_procs; } - + if (pio_info->init_dist_type == INITIAL_LINEAR){ /* vertex distribution */ if (myrank < nDistProcs){ share = nvtxs / nDistProcs; @@ -1378,7 +1341,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; break; line = next_line(line, fsize); } - + while (line){ /* PINS */ make_string(line, linestr); @@ -1415,7 +1378,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; } while(line) { /* VERTICES and possibly WEIGHTS */ - + make_string(line, linestr); rc = sscanf(linestr, ZOLTAN_ID_SPEC, &vid); @@ -1429,10 +1392,10 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; Gen_Error(0, cmesg); goto failure; } - + vid -= 1; mine = my_vtx(proc, vid, myminVtx, mymaxVtx, myrank, nDistProcs, pio_info); - + if (mine){ countMyVtxs++; } @@ -1451,7 +1414,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; line = next_line(line, fsize); } - while(line) { + while(line) { make_string(line, linestr); rc = sscanf(linestr, ZOLTAN_ID_SPEC, &eid); token = get_nth_token(linestr, edim + 1, strlen(linestr), 1, (char)0); @@ -1465,7 +1428,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; goto failure; } proc = atoi(token); - + if ((proc % nprocs) == myrank){ countMyEdges++; } @@ -1474,7 +1437,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; if (line && line[0] == COMMENT_CHAR) break; } } - } + } /* Start over at beginning of file and save my pins, and weights */ @@ -1644,7 +1607,7 @@ char linestr[MATRIX_MARKET_MAX_LINE+1]; } /* Read the mtxp file and return only comments plus lines I "own", - * null-terminate the buffer, and set the number of objects I own. + * null-terminate the buffer, and set the number of objects I own. * Return the size of the buffer, 0 on failure. */ @@ -1659,7 +1622,7 @@ char *c_in_end; char *buf; long count_mine; int rc, max_sanity, total_line_found, line_size=0; -ZOLTAN_ID_TYPE nedges, nvtxs, npins, numew; +ZOLTAN_ID_TYPE nedges, nvtxs, npins, numew; int numOwners, vdim, edim; int i=0; int owning_proc; @@ -1676,7 +1639,7 @@ FILE *fp=NULL; status = 0; goto End; } - + fsize = statbuf.st_size; fp = fopen(fname, "r"); if (!fp){ @@ -1700,7 +1663,7 @@ FILE *fp=NULL; if (!inbuf){ inbufsize *= .75; inbuf = malloc(inbufsize+1); - + if (!inbuf){ inbufsize *= .5; inbuf = malloc(inbufsize+1); @@ -1717,14 +1680,14 @@ FILE *fp=NULL; /* TODO a Zoltan utility that uses hwloc info to decide a reasonable amount of * memory for Zoltan to use. Maybe more of a TO_CONSIDER. */ - + inbufsize = (fsize > 100*1024 ? 100*1024 : fsize); inbuf = malloc(inbufsize+1); if (!inbuf){ inbufsize *= .75; inbuf = malloc(inbufsize+1); - + if (!inbuf){ inbufsize *= .5; inbuf = malloc(inbufsize+1); @@ -1848,7 +1811,7 @@ FILE *fp=NULL; if (nbytes + line_size > outbufsize){ outbufsize += line_size; outbufsize *= 1.2; - + buf = (char *)malloc(outbufsize+1); if (!buf){ status = 0; @@ -1859,7 +1822,7 @@ FILE *fp=NULL; c_out = buf + nbytes; outbuf = buf; } - + sprintf(c_out, "%s\n", c_in); c_out += line_size; nbytes += line_size; @@ -1896,7 +1859,7 @@ FILE *fp=NULL; ******************************************************************************/ static char *get_nth_token(char *line, int nth, /* get nth token (0-based) */ - size_t max, + size_t max, int direction, /* 1: from the front, -1: from the back */ char terminator) /* null or \n terminated */ { @@ -1914,7 +1877,7 @@ int found; l = (size_t)(c1-line); - while ((*c2 != terminator) && (l < max)){ c2++; l++;} + while ((*c2 != terminator) && (l < max)){ c2++; l++;} if ((c2 == c1) || /* no tokens */ (*c2 != terminator)) /* invalid line */ @@ -1929,7 +1892,7 @@ int found; c2--; - while ((c2 > c1) && IS_BLANK(*c2)) c2--; + while ((c2 > c1) && IS_BLANK(*c2)) c2--; *(c2+1) = 0; found = 0; /* null terminate last token */ @@ -1948,7 +1911,7 @@ int found; } else c1 = NULL; - + return c1; } @@ -2020,7 +1983,7 @@ char *c = buf; size_t sanity = 0; /* Skip current line, and any subsequent blank lines. - * Return pointer to the next line. + * Return pointer to the next line. */ if (!buf) return NULL; @@ -2038,7 +2001,7 @@ size_t sanity = 0; static char *next_line_of_data(char *buf, size_t max, char *str) { -char *c; +char *c; /* Skip current line, and any following comments or blank lines. * Return pointer to the next line. Also copy @@ -2065,7 +2028,7 @@ char *c; static char *next_line_of_comment(char *buf, size_t max, char *str) { -char *c; +char *c; /* Skip current line, and any following data or blank lines. * Return pointer to the next line. Also copy @@ -2092,7 +2055,7 @@ char *c; /*************************************************************************/ -static int my_vtx(int proc, +static int my_vtx(int proc, ZOLTAN_ID_TYPE vtx, ZOLTAN_ID_TYPE mymin, ZOLTAN_ID_TYPE mymax, int myrank, int nprocs, PARIO_INFO_PTR pio_info) { @@ -2117,7 +2080,7 @@ static int my_vtx(int proc, return mine; } static int my_pin(ZOLTAN_ID_TYPE eid, ZOLTAN_ID_TYPE vid, int proc, - ZOLTAN_ID_TYPE pin, ZOLTAN_ID_TYPE npins, + ZOLTAN_ID_TYPE pin, ZOLTAN_ID_TYPE npins, ZOLTAN_ID_TYPE mymin, ZOLTAN_ID_TYPE mymax, int myrank, int nprocs, PARIO_INFO_PTR pio_info) { @@ -2189,7 +2152,7 @@ static void debug_elements(int Proc, int Num_Proc, int num, ELEM_INFO_PTR el) printf("\n"); fflush(stdout); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } } static void debug_lists(int Proc, int Num_Proc, int nedge, int *index, ZOLTAN_ID_TYPE *vtx, int *vtx_proc, ZOLTAN_ID_TYPE *egid) @@ -2209,11 +2172,11 @@ static void debug_lists(int Proc, int Num_Proc, int nedge, int *index, ZOLTAN_ID } fflush(stdout); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } } -static void debug_pins(int Proc, int Num_Proc, - ZOLTAN_ID_TYPE nGlobalEdges, ZOLTAN_ID_TYPE nGlobalVtxs, +static void debug_pins(int Proc, int Num_Proc, + ZOLTAN_ID_TYPE nGlobalEdges, ZOLTAN_ID_TYPE nGlobalVtxs, int vtxWDim, int edgeWDim, int nMyPins, ZOLTAN_ID_TYPE *myPinI, ZOLTAN_ID_TYPE *myPinJ, int nMyVtx, ZOLTAN_ID_TYPE *myVtxNum, float *myVtxWgts, @@ -2221,7 +2184,7 @@ static void debug_pins(int Proc, int Num_Proc, { int p,i,j,k; - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); for (p=0; p < Num_Proc; p++){ if (p == Proc){ printf("Process: %d\n",p); @@ -2251,9 +2214,9 @@ int p,i,j,k; } printf("\n"); fflush(stdout); - } - MPI_Barrier(MPI_COMM_WORLD); + } + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } #endif diff --git a/packages/zoltan/src/driver/dr_hg_readfile.c b/packages/zoltan/src/driver/dr_hg_readfile.c index 4ce19c323a..cab9fec0cd 100644 --- a/packages/zoltan/src/driver/dr_hg_readfile.c +++ b/packages/zoltan/src/driver/dr_hg_readfile.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -106,7 +69,7 @@ int HG_readfile ( ERROR(Proc, yo, "Unrecognized file format.", ZOLTAN_FATAL); if (*nVtx <= 1) { /* wrong guess if nVtx really is one! */ - i = sscanf(string, "%d %d %d %d %d %d", + i = sscanf(string, "%d %d %d %d %d %d", base, nVtx, nEdge, nPins, &code, vwgt_dim); if (i == 4) code = 0; diff --git a/packages/zoltan/src/driver/dr_hg_readfile.h b/packages/zoltan/src/driver/dr_hg_readfile.h index 891efab1d2..f06f24adb4 100644 --- a/packages/zoltan/src/driver/dr_hg_readfile.h +++ b/packages/zoltan/src/driver/dr_hg_readfile.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _ZOLTAN_HG_READFILE_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_input.c b/packages/zoltan/src/driver/dr_input.c index c1c09b681f..c9d66e3a1e 100644 --- a/packages/zoltan/src/driver/dr_input.c +++ b/packages/zoltan/src/driver/dr_input.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -692,7 +655,7 @@ int check_inp ( /* Broadcast commands to all processes. - NOTE: This requires manual updating when a new field + NOTE: This requires manual updating when a new field is added to a struct, like Test! */ void brdcst_cmd_info ( @@ -711,7 +674,7 @@ void brdcst_cmd_info ( float_params[k++] = Test.Dynamic_Weights; float_params[k++] = Test.Dynamic_Graph; - MPI_Bcast (float_params, k, MPI_FLOAT, 0, MPI_COMM_WORLD); + MPI_Bcast (float_params, k, MPI_FLOAT, 0, zoltan_get_global_comm()); k = 0; Test.Dynamic_Weights = float_params[k++]; @@ -739,7 +702,7 @@ void brdcst_cmd_info ( int_params[j++] = Test.Gen_Files; int_params[j++] = Test.Vtx_Inc; - MPI_Bcast (int_params, j, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast (int_params, j, MPI_INT, 0, zoltan_get_global_comm()); j = 0; Debug_Driver = int_params[j++]; @@ -763,7 +726,7 @@ void brdcst_cmd_info ( Test.Gen_Files = int_params[j++]; Test.Vtx_Inc = int_params[j++]; - MPI_Bcast (pio_info, sizeof(PARIO_INFO), MPI_BYTE, 0, MPI_COMM_WORLD); + MPI_Bcast (pio_info, sizeof(PARIO_INFO), MPI_BYTE, 0, zoltan_get_global_comm()); switch (pio_info->file_type) { case CHACO_FILE: @@ -785,16 +748,16 @@ void brdcst_cmd_info ( if (Proc != 0) pio_info->dsk_list = (int*) malloc (pio_info->dsk_list_cnt*sizeof(int)); MPI_Bcast (pio_info->dsk_list, pio_info->dsk_list_cnt, MPI_INT, 0, - MPI_COMM_WORLD); + zoltan_get_global_comm()); } /* and broadcast the problem specifications */ - MPI_Bcast (prob, sizeof(PROB_INFO), MPI_BYTE, 0, MPI_COMM_WORLD); + MPI_Bcast (prob, sizeof(PROB_INFO), MPI_BYTE, 0, zoltan_get_global_comm()); if (prob->num_params > 0) { size = prob->num_params * sizeof(Parameter_Pair); if (Proc != 0) prob->params = (Parameter_Pair*) malloc(size); - MPI_Bcast (prob->params, size, MPI_CHAR, 0, MPI_COMM_WORLD); + MPI_Bcast (prob->params, size, MPI_CHAR, 0, zoltan_get_global_comm()); } /* now calculate where the file for this processor is */ diff --git a/packages/zoltan/src/driver/dr_input.c.shockstem b/packages/zoltan/src/driver/dr_input.c.shockstem index df5eb1df81..67cf86c598 100644 --- a/packages/zoltan/src/driver/dr_input.c.shockstem +++ b/packages/zoltan/src/driver/dr_input.c.shockstem @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -656,7 +619,7 @@ void brdcst_cmd_info ( float_params[k++] = Test.Dynamic_Weights; float_params[k++] = Test.Dynamic_Graph; - MPI_Bcast (float_params, k, MPI_FLOAT, 0, MPI_COMM_WORLD); + MPI_Bcast (float_params, k, MPI_FLOAT, 0, zoltan_get_global_comm()); k = 0; Test.Dynamic_Weights = float_params[k++]; @@ -683,7 +646,7 @@ void brdcst_cmd_info ( int_params[j++] = Test.RCB_Box; int_params[j++] = Test.Gen_Files; - MPI_Bcast (int_params, j, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast (int_params, j, MPI_INT, 0, zoltan_get_global_comm()); j = 0; Debug_Driver = int_params[j++]; @@ -706,22 +669,22 @@ void brdcst_cmd_info ( Test.RCB_Box = int_params[j++]; Test.Gen_Files = int_params[j++]; - MPI_Bcast (pio_info, sizeof(PARIO_INFO), MPI_BYTE, 0, MPI_COMM_WORLD); + MPI_Bcast (pio_info, sizeof(PARIO_INFO), MPI_BYTE, 0, zoltan_get_global_comm()); if (pio_info->dsk_list_cnt > 0) { if (Proc != 0) pio_info->dsk_list = (int*) malloc (pio_info->dsk_list_cnt*sizeof(int)); MPI_Bcast (pio_info->dsk_list, pio_info->dsk_list_cnt, MPI_INT, 0, - MPI_COMM_WORLD); + zoltan_get_global_comm()); } /* and broadcast the problem specifications */ - MPI_Bcast (prob, sizeof(PROB_INFO), MPI_BYTE, 0, MPI_COMM_WORLD); + MPI_Bcast (prob, sizeof(PROB_INFO), MPI_BYTE, 0, zoltan_get_global_comm()); if (prob->num_params > 0) { size = prob->num_params * sizeof(Parameter_Pair); if (Proc != 0) prob->params = (Parameter_Pair*) malloc(size); - MPI_Bcast (prob->params, size, MPI_CHAR, 0, MPI_COMM_WORLD); + MPI_Bcast (prob->params, size, MPI_CHAR, 0, zoltan_get_global_comm()); } /* now calculate where the file for this processor is */ diff --git a/packages/zoltan/src/driver/dr_input_const.h b/packages/zoltan/src/driver/dr_input_const.h index 92f45bb74b..fee1ac4731 100644 --- a/packages/zoltan/src/driver/dr_input_const.h +++ b/packages/zoltan/src/driver/dr_input_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_INPUT_CONST_H_ @@ -112,17 +75,17 @@ struct Parallel_IO int chunk_reader; /* for very large matrix market files */ int init_dist_type; /* Flag indicating how input objects should be initially distributed. */ - int init_dist_procs; /* How many procs to use in + int init_dist_procs; /* How many procs to use in the initial distribution. */ - ZOLTAN_ID_TYPE init_size; /* For NO_FILE_* (random) input, the + ZOLTAN_ID_TYPE init_size; /* For NO_FILE_* (random) input, the no. of objects to be created. */ - int init_dim; /* For NO_FILE_* (random) input, the + int init_dim; /* For NO_FILE_* (random) input, the dimension of the problem (1, 2, or 3D) */ - int init_vwgt_dim; /* For NO_FILE_* (random) input, the + int init_vwgt_dim; /* For NO_FILE_* (random) input, the no. of weights per object. */ int matrix_obj; /* What are the objects to be balanced for a sparse matrix? (ROWS, COLUMNS) */ - int init_dist_pins; /* For hypergraphs, how should pins be + int init_dist_pins; /* For hypergraphs, how should pins be initially distributed. */ /* The root location of the parallel disks */ @@ -138,7 +101,7 @@ struct Parallel_IO typedef struct Parallel_IO PARIO_INFO; typedef struct Parallel_IO *PARIO_INFO_PTR; -/* +/* * Generic list of options for programs that want to use * zdrive style of input file. */ @@ -271,7 +234,7 @@ extern int chaco_setup_mesh_struct(int, int, PROB_INFO_PTR, int *, int, float *, int, float *, int, float *, float *, float *, short *, int, int); -extern void chaco_init_local_ids(int **, int **, int *, int *, int *, +extern void chaco_init_local_ids(int **, int **, int *, int *, int *, short *, int); #ifdef __cplusplus diff --git a/packages/zoltan/src/driver/dr_input_const.h.shockstem b/packages/zoltan/src/driver/dr_input_const.h.shockstem index 04375a440e..8f37d9b3a4 100644 --- a/packages/zoltan/src/driver/dr_input_const.h.shockstem +++ b/packages/zoltan/src/driver/dr_input_const.h.shockstem @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_INPUT_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_loadbal.c b/packages/zoltan/src/driver/dr_loadbal.c index c9376f9bb0..1fe676e4f9 100644 --- a/packages/zoltan/src/driver/dr_loadbal.c +++ b/packages/zoltan/src/driver/dr_loadbal.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #ifdef TIMER_CALLBACKS @@ -59,13 +22,8 @@ double Timer_Callback_Time, Timer_Global_Callback_Time; #include #include -#if defined(_WIN32) && !defined(__MINGW32__) #include -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#else #include -#endif #include #include @@ -160,7 +118,7 @@ int setup_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, DEBUG_TRACE_START(Proc, yo); /* Allocate space for arrays. */ - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); Num_Global_Parts = nprocs; Obj_Weight_Dim = 0; psize = (float *) malloc(nprocs*sizeof(float)); @@ -178,7 +136,7 @@ int setup_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, if (prob->params[i].Index>=0) ierr = Zoltan_Set_Param_Vec(zz, prob->params[i].Name, prob->params[i].Val, prob->params[i].Index); - else + else ierr = Zoltan_Set_Param(zz, prob->params[i].Name, prob->params[i].Val); if (ierr == ZOLTAN_FATAL) { sprintf(errmsg, @@ -213,7 +171,7 @@ int setup_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, /* if there is a paramfile specified, read it note: contents of this file may override the parameters set above */ if (strcmp(prob->zoltanParams_file, "")) { - zoltanParams_read_file(zz, prob->zoltanParams_file, MPI_COMM_WORLD); + zoltanParams_read_file(zz, prob->zoltanParams_file, zoltan_get_global_comm()); } if (Test.Fixed_Objects) { @@ -347,7 +305,7 @@ int setup_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, safe_free((void **)(void *) &psize); safe_free((void **)(void *) &partid); - + psize = (float *) malloc(nentries * sizeof(float)); partid = (int *) malloc(2 * nentries * sizeof(int)); idx = partid + nentries; @@ -659,7 +617,7 @@ int run_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, Timer_Callback_Time = 0.0; #endif /* TIMER_CALLBACKS */ - MPI_Barrier(MPI_COMM_WORLD); /* For timings only */ + MPI_Barrier(zoltan_get_global_comm()); /* For timings only */ stime = MPI_Wtime(); ierr = Zoltan_LB_Partition(zz, &new_decomp, @@ -675,14 +633,14 @@ int run_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, } mytime = MPI_Wtime() - stime; - MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) printf("\nDRIVER: Zoltan_LB_Partition time = %g\n", maxtime); Total_Partition_Time += maxtime; #ifdef TIMER_CALLBACKS MPI_Allreduce(&Timer_Callback_Time, &Timer_Global_Callback_Time, - 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) printf("DRIVER: Callback time = %g\n", Timer_Global_Callback_Time); #endif /* TIMER_CALLBACKS */ @@ -691,8 +649,8 @@ int run_zoltan(struct Zoltan_Struct *zz, int Proc, PROB_INFO_PTR prob, {int mine[2], gmax[2], gmin[2]; mine[0] = num_imported; mine[1] = num_exported; - MPI_Allreduce(mine, gmax, 2, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(mine, gmin, 2, MPI_INT, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(mine, gmax, 2, MPI_INT, MPI_MAX, zoltan_get_global_comm()); + MPI_Allreduce(mine, gmin, 2, MPI_INT, MPI_MIN, zoltan_get_global_comm()); if (Proc == 0) { printf("DRIVER: new_decomp %d Min/Max Import: %d %d\n", new_decomp, gmin[0], gmax[0]); printf("DRIVER: new_decomp %d Min/Max Export: %d %d\n", new_decomp, gmin[1], gmax[1]); @@ -728,7 +686,7 @@ for (i = 0; i < num_exported; i++) fprintf(fp, "%d\n", export_to_part[i]); /* fprintf(fp, "%d : %d\n", export_gids[(i+1)*Num_GID-1], export_to_part[i]); */ fclose(fp); -MPI_Barrier(MPI_COMM_WORLD); +MPI_Barrier(zoltan_get_global_comm()); MPI_Finalize(); exit(-1); } @@ -738,7 +696,7 @@ exit(-1); /* * Call another routine to perform the migration */ - MPI_Barrier(MPI_COMM_WORLD); /* For timings only */ + MPI_Barrier(zoltan_get_global_comm()); /* For timings only */ stime = MPI_Wtime(); if (new_decomp && (num_exported != -1 || num_imported != -1)) { if (Export_Lists_Special) { @@ -782,7 +740,7 @@ exit(-1); } mytime = MPI_Wtime() - stime; - MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) printf("DRIVER: Total migration time = %g\n", maxtime); @@ -799,7 +757,7 @@ exit(-1); current_elem->my_part); } } - MPI_Allreduce(&errcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&errcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gerrcnt) { Zoltan_LB_Free_Part(&import_gids, &import_lids, &import_procs, &import_to_part); @@ -927,7 +885,7 @@ exit(-1); return 0; } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if (Proc == 0) printf("\nOrdering time = %f seconds\n", MPI_Wtime() - kddstart); @@ -980,12 +938,12 @@ exit(-1); printf("Turn off \"test dynamic graph\".\n"); } - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); if (Debug_Driver > 0 && nprocs>1) { if (Proc == 0) addIDs = (mesh->num_elems > addIDs ) ? addIDs : mesh->num_elems; - MPI_Bcast(&addIDs, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&addIDs, 1, MPI_INT, 0, zoltan_get_global_comm()); checkIDs = addIDs; } @@ -1013,8 +971,8 @@ exit(-1); lids[i*num_lid_entries+num_lid_entries-1] = -1; } } - MPI_Bcast(gids+(mesh->num_elems*num_gid_entries), addIDs*num_gid_entries, ZOLTAN_ID_MPI_TYPE, 0, MPI_COMM_WORLD); - MPI_Bcast(lids+(mesh->num_elems*num_gid_entries), addIDs*num_gid_entries, ZOLTAN_ID_MPI_TYPE, 0, MPI_COMM_WORLD); + MPI_Bcast(gids+(mesh->num_elems*num_gid_entries), addIDs*num_gid_entries, ZOLTAN_ID_MPI_TYPE, 0, zoltan_get_global_comm()); + MPI_Bcast(lids+(mesh->num_elems*num_gid_entries), addIDs*num_gid_entries, ZOLTAN_ID_MPI_TYPE, 0, zoltan_get_global_comm()); if (Proc == 0) addIDs = 0; } @@ -1047,7 +1005,7 @@ exit(-1); if (color[i] > maxcolor) maxcolor = color[i]; MPI_Allreduce(&maxcolor, &gmaxcolor, 1, - MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_INT, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) printf("Valid coloring found; #colors = %d.\n", gmaxcolor); @@ -1066,7 +1024,7 @@ exit(-1); for (i = 0; inum_elems; inum_elems+checkIDs; ++i) { if (color[i] != bColor[i-mesh->num_elems]) { @@ -1594,10 +1552,10 @@ void get_edge_list_multi (void *data, int num_gid_entries, int num_lid_entries, for (i = 0; i < current_elem->adj_len; i++) { /* Skip NULL adjacencies (sides that are not adjacent to another elem). */ - /* KDD 1/22/15 See bug 6278 and comment in dr_const.h. - * This line is needed only for Exodus inputs which will not work correctly - * with current definition of adj as ZOLTAN_ID_PTR, and it generates - * compiler warnings. If the Exodus interface is revived, this line + /* KDD 1/22/15 See bug 6278 and comment in dr_const.h. + * This line is needed only for Exodus inputs which will not work correctly + * with current definition of adj as ZOLTAN_ID_PTR, and it generates + * compiler warnings. If the Exodus interface is revived, this line * should again be included. * if (current_elem->adj[i] == -1) continue; @@ -1677,10 +1635,10 @@ void get_edge_list (void *data, int num_gid_entries, int num_lid_entries, for (i = 0; i < current_elem->adj_len; i++) { /* Skip NULL adjacencies (sides that are not adjacent to another elem). */ - /* KDD 1/22/15 See bug 6278 and comment in dr_const.h. - * This line is needed only for Exodus inputs which will not work correctly - * with current definition of adj as ZOLTAN_ID_PTR, and it generates - * compiler warnings. If the Exodus interface is revived, this line + /* KDD 1/22/15 See bug 6278 and comment in dr_const.h. + * This line is needed only for Exodus inputs which will not work correctly + * with current definition of adj as ZOLTAN_ID_PTR, and it generates + * compiler warnings. If the Exodus interface is revived, this line * should again be included. * if (current_elem->adj[i] == -1) continue; @@ -1978,7 +1936,7 @@ void get_nemesis_hg_size( /* KDDKDD { int me; -MPI_Comm_rank(MPI_COMM_WORLD, &me); +MPI_Comm_rank(zoltan_get_global_comm(), &me); printf("%d KDDKDD HGSIZE numlist %d format %d numpins %d\n", me, *num_lists, *format, *num_pins); } */ @@ -2041,7 +1999,7 @@ void get_nemesis_hg( /* KDDKDD { int me; -MPI_Comm_rank(MPI_COMM_WORLD, &me); +MPI_Comm_rank(zoltan_get_global_comm(), &me); printf("%d KDDKDD EDGELIST %d: ", me, elemGID[nelems*num_gid_entries+gid]); for (j = 0; j < nnodes; j++) printf("%d ", meshvtxGID[(j*num_gid_entries)+edgelistPtr[nelems]+gid]); printf("\n"); @@ -2392,12 +2350,12 @@ int test_both; /* If true, test both Zoltan_*_Assign and Zoltan_*_PP_Assign. */ /* True if # parts == # processors. */ /* Find maximum part number across all processors. */ - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); max_part = gmax_part = -1; for (i = 0; i < mesh->num_elems; i++) if (mesh->elements[i].my_part > max_part) max_part = mesh->elements[i].my_part; - MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); test_both = ((gmax_part == (Num_Proc-1)) && (Test.Local_Parts == 0)); /* generate the parallel filename for this processor */ diff --git a/packages/zoltan/src/driver/dr_loadbalCPP.cpp b/packages/zoltan/src/driver/dr_loadbalCPP.cpp index 47d196cafa..84bbfd2361 100644 --- a/packages/zoltan/src/driver/dr_loadbalCPP.cpp +++ b/packages/zoltan/src/driver/dr_loadbalCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef TIMER_CALLBACKS /* Code that times how much time is spent in the callback functions. @@ -75,13 +38,7 @@ using namespace std; #include "zoltan_cpp.h" #include "dr_param_fileCPP.h" -#if defined(_WIN32) && !defined(__MINGW32__) -#include -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#else #include -#endif static void test_drops(int, MESH_INFO_PTR, PARIO_INFO_PTR, Zoltan &); static int Num_Global_Parts; @@ -144,7 +101,7 @@ int setup_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, /* Allocate space for arrays. */ int nprocs = 0; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); Num_Global_Parts = nprocs; float *psize = new float [nprocs]; @@ -183,7 +140,7 @@ int setup_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, /* if there is a paramfile specified, read it note: contents of this file may override the parameters set above */ if (strcmp(prob->zoltanParams_file, "")) { - zoltanParams_read_file(zz, prob->zoltanParams_file, MPI_COMM_WORLD); + zoltanParams_read_file(zz, prob->zoltanParams_file, zoltan_get_global_comm()); } if (Test.Fixed_Objects) { @@ -555,7 +512,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, Timer_Callback_Time = 0.0; #endif /* TIMER_CALLBACKS */ - MPI_Barrier(MPI_COMM_WORLD); /* For timings only */ + MPI_Barrier(zoltan_get_global_comm()); /* For timings only */ double stime = MPI_Wtime(); @@ -569,7 +526,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, } double mytime = MPI_Wtime() - stime; double maxtime = 0.0; - MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) cout << "DRIVER: Zoltan_LB_Partition time = " << maxtime << endl; @@ -577,7 +534,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, #ifdef TIMER_CALLBACKS MPI_Allreduce(&Timer_Callback_Time, &Timer_Global_Callback_Time, - 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) cout << "DRIVER: Callback time = " << Timer_Global_Callback_Time << endl; #endif /* TIMER_CALLBACKS */ @@ -586,8 +543,8 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, {int mine[2], gmax[2], gmin[2]; mine[0] = num_imported; mine[1] = num_exported; - MPI_Allreduce(mine, gmax, 2, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(mine, gmin, 2, MPI_INT, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(mine, gmax, 2, MPI_INT, MPI_MAX, zoltan_get_global_comm()); + MPI_Allreduce(mine, gmin, 2, MPI_INT, MPI_MIN, zoltan_get_global_comm()); if (Proc == 0) { cout << "DRIVER: Min/Max Import: " << gmin[0] << " " << gmax[0] << endl; @@ -611,7 +568,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, /* * Call another routine to perform the migration */ - MPI_Barrier(MPI_COMM_WORLD); /* For timings only */ + MPI_Barrier(zoltan_get_global_comm()); /* For timings only */ stime = MPI_Wtime(); if (new_decomp && num_exported != -1 && num_imported != -1) { /* Migrate if new decomposition and RETURN_LISTS != NONE */ @@ -624,7 +581,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, } } mytime = MPI_Wtime() - stime; - MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&mytime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, zoltan_get_global_comm()); if (Proc == 0) cout << "DRIVER: Total migration time = " << maxtime << endl; @@ -642,7 +599,7 @@ int run_zoltan(Zoltan &zz, int Proc, PROB_INFO_PTR prob, current_elem->my_part); } } - MPI_Allreduce(&errcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&errcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gerrcnt) { zz.LB_Free_Part(&import_gids, &import_lids, &import_procs, &import_to_part); @@ -1701,7 +1658,7 @@ void get_nemesis_hg_size( /* KDDKDD { int me; -MPI_Comm_rank(MPI_COMM_WORLD, &me); +MPI_Comm_rank(zoltan_get_global_comm(), &me); printf("%d KDDKDD HGSIZE numlist %d format %d numpins %d\n", me, *num_lists, *format, *num_pins); } */ @@ -1764,7 +1721,7 @@ void get_nemesis_hg( /* KDDKDD { int me; -MPI_Comm_rank(MPI_COMM_WORLD, &me); +MPI_Comm_rank(zoltan_get_global_comm(), &me); printf("%d KDDKDD EDGELIST %d: ", me, elemGID[nelems*num_gid_entries+gid]); for (j = 0; j < nnodes; j++) printf("%d ", meshvtxGID[(j*num_gid_entries)+edgelistPtr[nelems]+gid]); printf("\n"); @@ -2116,13 +2073,13 @@ ZOLTAN_ID_TYPE zgid, zlid; /* Find maximum partition number across all processors. */ int Num_Proc = 0; - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); max_part = gmax_part = -1; for (i = 0; i < mesh->num_elems; i++) if (mesh->elements[i].my_part > max_part) max_part = mesh->elements[i].my_part; - MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&max_part, &gmax_part, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); test_both = ((gmax_part == (Num_Proc-1)) && (Test.Local_Parts == 0)); @@ -2252,7 +2209,7 @@ int i; /* Test part-only interface */ status = zz.LB_Point_PP_Assign(x, one_part_only); - if (status != ZOLTAN_OK) + if (status != ZOLTAN_OK) fprintf(fp, "error returned from part-only version of " "Zoltan_LB_Point_PP_Assign()\n"); else { diff --git a/packages/zoltan/src/driver/dr_loadbal_const.h b/packages/zoltan/src/driver/dr_loadbal_const.h index 6cb26df877..56685cf84c 100644 --- a/packages/zoltan/src/driver/dr_loadbal_const.h +++ b/packages/zoltan/src/driver/dr_loadbal_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_LOADBAL_CONST_H_ @@ -65,15 +28,15 @@ #endif extern int setup_zoltan(ZOLTAN_STRUCT, int, PROB_INFO_PTR, MESH_INFO_PTR, - PARIO_INFO_PTR); -extern void setup_fixed_obj(MESH_INFO_PTR, int); + PARIO_INFO_PTR); +extern void setup_fixed_obj(MESH_INFO_PTR, int); extern int run_zoltan(ZOLTAN_STRUCT, int, PROB_INFO_PTR, MESH_INFO_PTR, - PARIO_INFO_PTR); + PARIO_INFO_PTR); extern int migrate_elements(int, MESH_INFO_PTR, ZOLTAN_STRUCT, - int, int, + int, int, int, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, int *, int *, int, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, int *, int *); diff --git a/packages/zoltan/src/driver/dr_main.c b/packages/zoltan/src/driver/dr_main.c index 935a22d2a4..2ebdd42b37 100644 --- a/packages/zoltan/src/driver/dr_main.c +++ b/packages/zoltan/src/driver/dr_main.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include /*--------------------------------------------------------------------------*/ @@ -160,8 +123,8 @@ int main(int argc, char *argv[]) #endif /* get some machine information */ - MPI_Comm_rank(MPI_COMM_WORLD, &Proc); - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_rank(zoltan_get_global_comm(), &Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); my_rank = Proc; @@ -174,7 +137,7 @@ int main(int argc, char *argv[]) #endif #ifdef ZOLTAN_PURIFY - printf("%d of %d ZDRIVE LAUNCH pid = %d file = %s\n", + printf("%d of %d ZDRIVE LAUNCH pid = %d file = %s\n", Proc, Num_Proc, getpid(), argv[1]); #endif @@ -276,7 +239,7 @@ int main(int argc, char *argv[]) print_input_info(stdout, Num_Proc, &prob, &pio_info, version); } - MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); if (gerror) goto End; /* broadcast the command info to all of the processor */ @@ -288,7 +251,7 @@ int main(int argc, char *argv[]) /* * Create a Zoltan structure. */ - if ((zz = Zoltan_Create(MPI_COMM_WORLD)) == NULL) { + if ((zz = Zoltan_Create(zoltan_get_global_comm())) == NULL) { Gen_Error(0, "fatal: NULL returned from Zoltan_Create()\n"); return 0; } @@ -313,7 +276,7 @@ int main(int argc, char *argv[]) for (iteration = 1; iteration <= Number_Iterations; iteration++) { if (Proc == 0) { - printf("Starting iteration %d\n", iteration); + printf("Starting iteration %d\n", iteration); fflush(stdout); } @@ -376,13 +339,13 @@ int main(int argc, char *argv[]) } fclose(fp); } - MPI_Bcast (CITESEER, 200, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast (CITESEER, 200, MPI_INT, 0, zoltan_get_global_comm()); } } if (Test.Dynamic_Graph > 0.0){ if (mesh.data_type == ZOLTAN_GRAPH) { - remove_random_vertices(&mesh, iteration, Test.Dynamic_Graph); + remove_random_vertices(&mesh, iteration, Test.Dynamic_Graph); } else{ Gen_Error(0, "fatal: \"test dynamic graph\" only works on graphs, not hypergraphs\n"); @@ -411,7 +374,7 @@ int main(int argc, char *argv[]) * now run Zoltan to get a new load balance and perform * the migration */ - + #ifdef IGNORE_FIRST_ITERATION_STATS if (iteration == 1) { /* Exercise partitioner once on Tbird because first run is slow. */ @@ -491,7 +454,7 @@ if (iteration == 1) { } /* change the ParMETIS Seed */ sprintf(str, "%d", iteration); -#ifdef ZOLTAN_PARMETIS +#ifdef ZOLTAN_PARMETIS Zoltan_Set_Param(zz, "PARMETIS_SEED", str); #endif } @@ -499,9 +462,9 @@ if (iteration == 1) { } /* End of loop over read and balance */ if (Proc == 0) { - printf("FILE %s: Total: %e seconds in Partitioning\n", + printf("FILE %s: Total: %e seconds in Partitioning\n", cmd_file, Total_Partition_Time); - printf("FILE %s: Average: %e seconds per Iteration\n", + printf("FILE %s: Average: %e seconds per Iteration\n", cmd_file, Total_Partition_Time/Number_Iterations); } @@ -531,7 +494,7 @@ if (iteration == 1) { free_mesh_arrays(&mesh); if (prob.params != NULL) free(prob.params); MPI_Finalize(); - + #ifdef VAMPIR VT_finalize(); #endif @@ -589,7 +552,7 @@ static int read_mesh( Gen_Error(0, "fatal: Error returned from read_mtxplus_file\n"); return 0; } - /* KDDKDD 3/26/10: + /* KDDKDD 3/26/10: * Eventually, we should do cleanup here to address bug 3346. * but doing so will change the answer files. * mm_cleanup(mesh); @@ -624,11 +587,11 @@ static int read_mesh( printf("Process %d:\n",i); print_mesh(Proc, mesh, &pins, &he, &verts); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Reduce(&pins, &tpins, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); - MPI_Reduce(&he, &the, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); - MPI_Reduce(&verts, &tverts, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Reduce(&pins, &tpins, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); + MPI_Reduce(&he, &the, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); + MPI_Reduce(&verts, &tverts, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); if (Proc == 0){ if (mesh->format == ZOLTAN_COMPRESSED_EDGE){ printf("Total pins %d, total vertices %d, total rows %d\n", @@ -645,7 +608,7 @@ static int read_mesh( /*****************************************************************************/ /*****************************************************************************/ -static void print_input_info(FILE *fp, int Num_Proc, PROB_INFO_PTR prob, +static void print_input_info(FILE *fp, int Num_Proc, PROB_INFO_PTR prob, PARIO_INFO_PTR pio, float zoltan_version) { int i; @@ -665,7 +628,7 @@ char *idtypename; fprintf(fp, "\t\t%s %s\n", prob->params[i].Name, prob->params[i].Val); if ((pio->init_dist_procs > 0) && (pio->init_dist_procs != Num_Proc)){ - fprintf(fp, "\n Distribute input objects to only %d processes initially.\n", + fprintf(fp, "\n Distribute input objects to only %d processes initially.\n", pio->init_dist_procs); } if (pio->chunk_reader > 0){ @@ -763,8 +726,8 @@ static void initialize_mesh(MESH_INFO_PTR mesh, int proc) mesh->visible_nvtx = 0; } -static void remove_random_vertices(MESH_INFO_PTR mesh, int iteration, - float blank_factor) +static void remove_random_vertices(MESH_INFO_PTR mesh, int iteration, + float blank_factor) { int i, j, blankmine = (mesh->proc % 2) == (iteration % 2); ZOLTAN_ID_TYPE tmp, total_vertices; @@ -780,7 +743,7 @@ ELEM_INFO *elem; /* * Mark some portion of vertices as blanked. The graph callbacks - * will not report blanked vertices. + * will not report blanked vertices. */ if ((blank_factor <= 0.0) || (blank_factor >= 1.0)){ @@ -793,9 +756,9 @@ ELEM_INFO *elem; error_report(mesh->proc); return; } - + for (i=0; i < mesh->num_elems; i++){ - + /* Each vertex (element) has probability given by * by blank_factor of being blanked. The blanked vertices should * vary somewhat in each iteration. @@ -831,11 +794,11 @@ ELEM_INFO *elem; } } - MPI_Allreduce(&mesh->blank_count, &mesh->global_blank_count, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&mesh->blank_count, &mesh->global_blank_count, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, zoltan_get_global_comm()); tmp = (ZOLTAN_ID_TYPE)mesh->num_elems; - MPI_Reduce(&tmp, &total_vertices, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Reduce(&tmp, &total_vertices, 1, ZOLTAN_ID_MPI_TYPE, MPI_SUM, 0, zoltan_get_global_comm()); if (mesh->proc == 0){ printf("Dynamic graph factor %0.4f, " ZOLTAN_ID_SPEC " vertices, " ZOLTAN_ID_SPEC " blanked (%0.2f%%)\n", @@ -844,7 +807,7 @@ ELEM_INFO *elem; } fflush(stdout); if (Debug_Driver > 1) { - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if (mesh->num_elems){ printf("Proc %d: %d vertices, %d blanked (%0.2f%%)\n", mesh->proc, mesh->num_elems, mesh->blank_count, @@ -854,7 +817,7 @@ ELEM_INFO *elem; printf("Proc %d: 0 vertices\n", mesh->proc); } fflush(stdout); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } } @@ -879,12 +842,12 @@ static void print_mesh(int proc, MESH_INFO_PTR m, int *tp, int *the, int *tv) } printf("\n"); } - + printf("Total pins: %d\n", m->hindex[m->nhedges]); printf("%d vertices: ", m->num_elems); el = m->elements; - + for (i=0; inum_elems; i++){ printf(ZOLTAN_ID_SPEC " (%d adj: ", el->globalID, el->nadj); for (j=0; jnadj; j++){ @@ -894,7 +857,7 @@ static void print_mesh(int proc, MESH_INFO_PTR m, int *tp, int *the, int *tv) } else{ globalID = adj; - } + } if (j && (j%15==0)) printf("\n "); printf(ZOLTAN_ID_SPEC " ",globalID); } diff --git a/packages/zoltan/src/driver/dr_main.c.shockstem b/packages/zoltan/src/driver/dr_main.c.shockstem index 3f13f1779a..83134ce600 100644 --- a/packages/zoltan/src/driver/dr_main.c.shockstem +++ b/packages/zoltan/src/driver/dr_main.c.shockstem @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include /*--------------------------------------------------------------------------*/ @@ -148,8 +111,8 @@ int main(int argc, char *argv[]) #endif /* get some machine information */ - MPI_Comm_rank(MPI_COMM_WORLD, &Proc); - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_rank(zoltan_get_global_comm(), &Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); #ifdef ZOLTAN_PURIFY printf("%d of %d ZDRIVE LAUNCH pid = %d file = %s\n", @@ -251,7 +214,7 @@ int main(int argc, char *argv[]) print_input_info(stdout, Num_Proc, &prob, &pio_info, version); } - MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); if (gerror) goto End; /* broadcast the command info to all of the processor */ @@ -263,7 +226,7 @@ int main(int argc, char *argv[]) /* * Create a Zoltan structure. */ - if ((zz = Zoltan_Create(MPI_COMM_WORLD)) == NULL) { + if ((zz = Zoltan_Create(zoltan_get_global_comm())) == NULL) { Gen_Error(0, "fatal: NULL returned from Zoltan_Create()\n"); return 0; } @@ -509,11 +472,11 @@ static int read_mesh( printf("Process %d:\n",i); print_mesh(Proc, mesh, &pins, &he, &verts); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Reduce(&pins, &tpins, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); - MPI_Reduce(&he, &the, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); - MPI_Reduce(&verts, &tverts, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Reduce(&pins, &tpins, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); + MPI_Reduce(&he, &the, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); + MPI_Reduce(&verts, &tverts, 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); if (Proc == 0){ if (mesh->format == ZOLTAN_COMPRESSED_EDGE){ printf("Total pins %d, total vertices %d, total rows %d\n", @@ -710,10 +673,10 @@ ELEM_INFO *elem; } MPI_Allreduce(&mesh->blank_count, &mesh->global_blank_count, - 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); MPI_Reduce(&mesh->num_elems, &total_vertices, - 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + 1, MPI_INT, MPI_SUM, 0, zoltan_get_global_comm()); if (mesh->proc == 0){ printf("Dynamic graph factor %0.4f, %d vertices, %d blanked (%0.2f%%)\n", @@ -722,7 +685,7 @@ ELEM_INFO *elem; } fflush(stdout); if (Debug_Driver > 1) { - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if (mesh->num_elems){ printf("Proc %d: %d vertices, %d blanked (%0.2f%%)\n", mesh->proc, mesh->num_elems, mesh->blank_count, @@ -732,7 +695,7 @@ ELEM_INFO *elem; printf("Proc %d: 0 vertices\n", mesh->proc); } fflush(stdout); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } } diff --git a/packages/zoltan/src/driver/dr_mainCPP.cpp b/packages/zoltan/src/driver/dr_mainCPP.cpp index 03801efc57..ccab70e228 100644 --- a/packages/zoltan/src/driver/dr_mainCPP.cpp +++ b/packages/zoltan/src/driver/dr_mainCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include // must appear before stdio or iostream @@ -78,7 +41,7 @@ double Total_Partition_Time = 0.0; /* Total over Number_Iterations */ static int read_mesh(int, int, PROB_INFO_PTR, PARIO_INFO_PTR, MESH_INFO_PTR); static void initialize_mesh(MESH_INFO_PTR); -static void print_input_info(ostream &os, int Num_Proc, PROB_INFO_PTR prob, +static void print_input_info(ostream &os, int Num_Proc, PROB_INFO_PTR prob, PARIO_INFO_PTR pio, float zoltan_version); /****************************************************************************/ @@ -99,13 +62,13 @@ int main(int argc, char *argv[]) // We must use the C bindings to MPI because the C++ bindings are // are not available or not complete on some of our platforms. - + MPI_Init(&argc, &argv); /* get some machine information */ int Proc = 0, Num_Proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &Proc); - MPI_Comm_size(MPI_COMM_WORLD, &Num_Proc); + MPI_Comm_rank(zoltan_get_global_comm(), &Proc); + MPI_Comm_size(zoltan_get_global_comm(), &Num_Proc); /* Initialize flags */ Test.DDirectory = 0; @@ -148,12 +111,12 @@ int main(int argc, char *argv[]) break; } - /* Initialize Zoltan + /* Initialize Zoltan * Not part of C++ interface at this time. (C++ wishlist) */ float version; - + if ((error = Zoltan_Initialize(argc, argv, &version)) != ZOLTAN_OK) { sprintf(cmesg, "fatal: Zoltan_Initialize returned error code, %d", error); Gen_Error(0, cmesg); @@ -163,7 +126,7 @@ int main(int argc, char *argv[]) } /* - * Create a Zoltan structure. + * Create a Zoltan structure. * No exception handling at this time. (C++ wishlist) * We must dynamically create the object so that we can delete it * before MPI_Finalize(). (If zz is created on the stack, it will @@ -222,7 +185,7 @@ int main(int argc, char *argv[]) print_input_info(cout, Num_Proc, &prob, &pio_info, version); } - MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); if (gerror) goto End; @@ -257,7 +220,7 @@ int main(int argc, char *argv[]) print_output = 0; goto End; } - /* + /* * Create a Zoltan DD for tracking elements during repartitioning. */ @@ -319,7 +282,7 @@ int main(int argc, char *argv[]) } /* change the ParMETIS Seed */ sprintf(str, "%d", iteration%10000); -#ifdef ZOLTAN_PARMETIS +#ifdef ZOLTAN_PARMETIS zz->Set_Param("PARMETIS_SEED", str); #endif } @@ -336,7 +299,7 @@ int main(int argc, char *argv[]) } End: - + if (mesh.data_type == ZOLTAN_HYPERGRAPH) { destroy_elem_dd(); @@ -415,7 +378,7 @@ static int read_mesh( else if (pio_info->file_type == MATRIXMARKET_PLUS_FILE) { if (!read_mtxplus_file(Proc, Num_Proc, prob, pio_info, mesh)) { Gen_Error(0, "fatal: Error returned from read_mtxplus_file\n"); - + } } else if (pio_info->file_type == NO_FILE_POINTS) { @@ -433,7 +396,7 @@ static int read_mesh( /*****************************************************************************/ /*****************************************************************************/ -static void print_input_info(ostream &os, int Num_Proc, PROB_INFO_PTR prob, +static void print_input_info(ostream &os, int Num_Proc, PROB_INFO_PTR prob, PARIO_INFO_PTR pio, float zoltan_version) { int i; diff --git a/packages/zoltan/src/driver/dr_maps.c b/packages/zoltan/src/driver/dr_maps.c index cddad1ad3f..211f7300a6 100644 --- a/packages/zoltan/src/driver/dr_maps.c +++ b/packages/zoltan/src/driver/dr_maps.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_externs.h" #include "dr_maps_const.h" @@ -71,7 +34,7 @@ struct map_list_head { }; static void compare_maps_with_ddirectory_results(int, MESH_INFO_PTR); -static void sort_and_compare_maps(int, int, MESH_INFO_PTR, +static void sort_and_compare_maps(int, int, MESH_INFO_PTR, struct map_list_head *, int, int *); /*****************************************************************************/ @@ -137,13 +100,13 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /* * Look for off-processor adjacencies. - * Loop over all elements + * Loop over all elements */ num_alloc_maps = MAP_ALLOC; mesh->ecmap_id = (int *) malloc(num_alloc_maps * sizeof(int)); mesh->ecmap_cnt = (int *) malloc(num_alloc_maps * sizeof(int)); - tmp_maps = (struct map_list_head*) malloc(num_alloc_maps + tmp_maps = (struct map_list_head*) malloc(num_alloc_maps * sizeof(struct map_list_head)); if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || tmp_maps == NULL) { @@ -163,9 +126,9 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; iadj_proc = elem->adj_proc[j]; if (iadj_proc != proc) { - /* + /* * Adjacent element is off-processor. - * Add this element to the temporary data structure for + * Add this element to the temporary data structure for * the appropriate neighboring processor. */ if ((indx = in_list2(iadj_proc, mesh->necmap, mesh->ecmap_id)) == -1) { @@ -181,7 +144,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; num_alloc_maps * sizeof(int)); tmp_maps = (struct map_list_head *) realloc(tmp_maps, num_alloc_maps * sizeof(struct map_list_head)); - if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || + if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || tmp_maps == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -195,7 +158,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; map->elem_id = (int *) malloc(MAP_ALLOC * sizeof(int)); map->side_id = (int *) malloc(MAP_ALLOC * sizeof(int)); map->neigh_id = (ZOLTAN_ID_TYPE *) malloc(MAP_ALLOC * sizeof(ZOLTAN_ID_TYPE)); - if (map->glob_id == NULL || map->elem_id == NULL || + if (map->glob_id == NULL || map->elem_id == NULL || map->side_id == NULL || map->neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -209,15 +172,15 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; map = &(tmp_maps[indx]); if (mesh->ecmap_cnt[indx] >= map->map_alloc_size) { map->map_alloc_size += MAP_ALLOC; - map->glob_id = (ZOLTAN_ID_TYPE *) realloc(map->glob_id, + map->glob_id = (ZOLTAN_ID_TYPE *) realloc(map->glob_id, map->map_alloc_size * sizeof(ZOLTAN_ID_TYPE)); - map->elem_id = (int *) realloc(map->elem_id, + map->elem_id = (int *) realloc(map->elem_id, map->map_alloc_size * sizeof(int)); - map->side_id = (int *) realloc(map->side_id, + map->side_id = (int *) realloc(map->side_id, map->map_alloc_size * sizeof(int)); - map->neigh_id = (ZOLTAN_ID_TYPE *) realloc(map->neigh_id, + map->neigh_id = (ZOLTAN_ID_TYPE *) realloc(map->neigh_id, map->map_alloc_size * sizeof(ZOLTAN_ID_TYPE)); - if (map->glob_id == NULL || map->elem_id == NULL || + if (map->glob_id == NULL || map->elem_id == NULL || map->side_id == NULL || map->neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -235,8 +198,8 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; } } - /* - * If no communication maps, don't need to do anything else. + /* + * If no communication maps, don't need to do anything else. */ if (mesh->necmap > 0) { @@ -267,20 +230,20 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /* * Sort the map so that adjacent processors have the same ordering - * for the communication. + * for the communication. * Assume the ordering of the lower-numbered processor in the pair * of communicating processors. */ - if (proc < mesh->ecmap_id[i]) - quicksort_pointer_inc_id_id(sindex, map->glob_id, map->neigh_id, + if (proc < mesh->ecmap_id[i]) + quicksort_pointer_inc_id_id(sindex, map->glob_id, map->neigh_id, 0, mesh->ecmap_cnt[i]-1); else - quicksort_pointer_inc_id_id(sindex, map->neigh_id, map->glob_id, + quicksort_pointer_inc_id_id(sindex, map->neigh_id, map->glob_id, 0, mesh->ecmap_cnt[i]-1); /* - * Copy sorted data into elem map arrays. + * Copy sorted data into elem map arrays. */ offset = cnt; @@ -305,7 +268,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; safe_free((void **)(void *) &tmp_maps); safe_free((void **)(void *) &sindex); - if (Test.DDirectory) + if (Test.DDirectory) compare_maps_with_ddirectory_results(proc, mesh); DEBUG_TRACE_END(proc, yo); @@ -316,13 +279,13 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /******************************************************************************/ static void compare_maps_with_ddirectory_results( - int proc, + int proc, MESH_INFO_PTR mesh ) { /* - * Routine to demonstrate the use of the Zoltan Distributed Directory - * to build communication maps. This functionality essentially duplicates + * Routine to demonstrate the use of the Zoltan Distributed Directory + * to build communication maps. This functionality essentially duplicates * that in build_elem_comm_maps. It provides a test of the DDirectory, * as the maps generated by the directory should match those generated * by build_elem_comm_maps. @@ -382,13 +345,13 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; } } - /* - * Create DDirectory and register all owned elements. + /* + * Create DDirectory and register all owned elements. */ - MPI_Allreduce(&num_elems, &max_nelems, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&num_elems, &max_nelems, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); - ierr = Zoltan_DD_Create(&dd, MPI_COMM_WORLD, 1, 1, 0, max_nelems, 0); + ierr = Zoltan_DD_Create(&dd, zoltan_get_global_comm(), 1, 1, 0, max_nelems, 0); if (ierr) { Gen_Error(0, "Fatal: Error returned by Zoltan_DD_Create"); error = 1; @@ -436,8 +399,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; free(gids); - /* - * Use the DDirectory to find owners of off-processor neighboring elements. + /* + * Use the DDirectory to find owners of off-processor neighboring elements. * Of course, we have this info in ELEM_INFO, but we do the find to test * the DDirectory. */ @@ -451,8 +414,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; my_gids = nbor_lids + num_nbor; ownerlist = (int *) malloc(sizeof(int) * num_nbor); - /* - * Get list of elements whose info is needed. + /* + * Get list of elements whose info is needed. */ cnt = 0; for (i = 0; i < num_elems; i++) { @@ -489,16 +452,16 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; Gen_Error(0, "Fatal: Error returned by Zoltan_DD_Find of dd"); error = 1; } - + if (proc == 0) printf(" Test Destroy\n"); Zoltan_DD_Destroy(&dd); Zoltan_DD_Destroy(&ddCopy); /* - * Check for errors + * Check for errors */ - MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gerror) { Gen_Error(0, "Fatal: Error returned by DDirectory Test"); error_report(proc); @@ -507,8 +470,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; return; } - /* - * Use the Communication library to invert this information and build + /* + * Use the Communication library to invert this information and build * communication maps. * We know what to receive and from where; compute what to send and * to whom. @@ -516,10 +479,10 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; * testing DDirectory here. */ - /* + /* * Build list of off-proc elements (and their owners) * that this proc wants. - * This list includes duplicate entries when an element + * This list includes duplicate entries when an element * is a neighbor of > 1 element on this processor. */ @@ -537,7 +500,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; i_want[j++] = my_gids[i]; } - ierr = Zoltan_Comm_Create(&comm, num_nbor, ownerlist, MPI_COMM_WORLD, 747, + ierr = Zoltan_Comm_Create(&comm, num_nbor, ownerlist, zoltan_get_global_comm(), 747, &num_others); if (ierr) { Gen_Error(0, "Fatal: Error returned from Zoltan_Comm_Create"); @@ -556,7 +519,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; } ierr = Zoltan_Comm_Copy_To(&comm, comm_copy); - + if (ierr){ Gen_Error(0, "Fatal: Error returned from Zoltan_Comm_Copy_To"); return; @@ -564,8 +527,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; Zoltan_Comm_Destroy(&comm_copy); - /* - * Do communication to determine which of this proc's data is wanted by + /* + * Do communication to determine which of this proc's data is wanted by * other procs. * This info will determine what is put in this proc's communication maps. */ @@ -576,7 +539,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; return; } - ierr = Zoltan_Comm_Do(comm, 757, (char *) i_want, want_size * sizeof(ZOLTAN_ID_TYPE), + ierr = Zoltan_Comm_Do(comm, 757, (char *) i_want, want_size * sizeof(ZOLTAN_ID_TYPE), (char *) others_want); if (ierr) { Gen_Error(0, "Fatal: Error returned from Zoltan_Comm_Do"); @@ -590,8 +553,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; return; } - /* - * Find number of maps and the size of the largest map. + /* + * Find number of maps and the size of the largest map. * The maps should be grouped by neighboring processor * in others_want. */ @@ -614,8 +577,8 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; "%d != %d\n", proc, num_maps, mesh->necmap); } - /* - * For each map, + /* + * For each map, * build a map_list_head for the map; * sort the map_list_head appropriately (as in build_elem_comm_maps); * compare sorted lists with actually communication maps. @@ -634,12 +597,12 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; map.glob_id = (ZOLTAN_ID_TYPE *) malloc(max_map_size * sizeof(ZOLTAN_ID_TYPE)); map.neigh_id= (ZOLTAN_ID_TYPE *) malloc(max_map_size * sizeof(ZOLTAN_ID_TYPE)); - + if (max_map_size > 0 && map.neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); return; } - + if (Debug_Driver > 3) { /* For high debug levels, serialize the following section so that * output of generated map is serialized (and not junked up). @@ -656,7 +619,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; for (k = 0; k < current->adj_len; k++) { /* Skip NULL adjacencies (sides that are not adjacent to another elem). */ if (current->adj[k] == ZOLTAN_ID_INVALID) continue; - if (current->adj_proc[k] == nbor_proc && + if (current->adj_proc[k] == nbor_proc && current->adj[k] == others_want[j+3]) { map.side_id[map_size] = k + 1; map.neigh_id[map_size] = current->adj[k]; @@ -670,7 +633,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; * Sort and compare the current map. */ sort_and_compare_maps(proc, nbor_proc, mesh, &map, map_size, sindex); - + /* * Reinitialize data structures for new map. */ @@ -683,7 +646,7 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; * output of generated map is serialized (and not junked up). */ int nprocs; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); print_sync_end(proc, nprocs, 1); } @@ -701,9 +664,9 @@ ZOLTAN_COMM_OBJ *comm, *comm_copy; static void sort_and_compare_maps( int proc, int nbor_proc, - MESH_INFO_PTR mesh, - struct map_list_head *map, - int map_size, + MESH_INFO_PTR mesh, + struct map_list_head *map, + int map_size, int *sindex ) { @@ -730,10 +693,10 @@ int indx; if (proc < nbor_proc) quicksort_pointer_inc_id_id(sindex, map->glob_id, map->neigh_id, 0, map_size-1); - else + else quicksort_pointer_inc_id_id(sindex, map->neigh_id, map->glob_id, 0, map_size-1); - + /* * Compute offset into mesh communication maps for the given nbor proc. */ @@ -763,7 +726,7 @@ int indx; j = sindex[i]; if (map->elem_id[j] != mesh->ecmap_elemids[i+cnt]) { printf("%d DDirectory Test: Different element IDs for nbor_proc %d: " - "%d != %d\n", proc, nbor_proc, map->elem_id[j], + "%d != %d\n", proc, nbor_proc, map->elem_id[j], mesh->ecmap_elemids[i+cnt]); } } @@ -772,7 +735,7 @@ int indx; j = sindex[i]; if (map->side_id[j] != mesh->ecmap_sideids[i+cnt]) { printf("%d DDirectory Test: Different side IDs for nbor_proc %d: " - "%d != %d\n", proc, nbor_proc, map->side_id[j], + "%d != %d\n", proc, nbor_proc, map->side_id[j], mesh->ecmap_sideids[i+cnt]); } } @@ -781,7 +744,7 @@ int indx; j = sindex[i]; if (map->neigh_id[j] != mesh->ecmap_neighids[i+cnt]) { printf("%d DDirectory Test: Different neigh IDs for nbor_proc %d: " - ZOLTAN_ID_SPEC " != " ZOLTAN_ID_SPEC "\n", proc, nbor_proc, map->neigh_id[j], + ZOLTAN_ID_SPEC " != " ZOLTAN_ID_SPEC "\n", proc, nbor_proc, map->neigh_id[j], mesh->ecmap_neighids[i+cnt]); } } @@ -792,8 +755,8 @@ int indx; printf("Local ID\tSide ID\tGlobal ID\tNeigh ID\n"); for (i = 0; i < map_size; i++) { j = sindex[i]; - printf("\t%d\t%d\t" ZOLTAN_ID_SPEC "\t" ZOLTAN_ID_SPEC "\n", - map->elem_id[j], map->side_id[j], + printf("\t%d\t%d\t" ZOLTAN_ID_SPEC "\t" ZOLTAN_ID_SPEC "\n", + map->elem_id[j], map->side_id[j], map->glob_id[j], map->neigh_id[j]); } } diff --git a/packages/zoltan/src/driver/dr_mapsCPP.cpp b/packages/zoltan/src/driver/dr_mapsCPP.cpp index a41abd7ced..3404178019 100644 --- a/packages/zoltan/src/driver/dr_mapsCPP.cpp +++ b/packages/zoltan/src/driver/dr_mapsCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_externs.h" @@ -74,7 +37,7 @@ struct map_list_head { }; static void compare_maps_with_ddirectory_results(int, MESH_INFO_PTR); -static void sort_and_compare_maps(int, int, MESH_INFO_PTR, +static void sort_and_compare_maps(int, int, MESH_INFO_PTR, struct map_list_head *, int, int *); /*****************************************************************************/ @@ -135,13 +98,13 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /* * Look for off-processor adjacencies. - * Loop over all elements + * Loop over all elements */ num_alloc_maps = MAP_ALLOC; mesh->ecmap_id = (int *) malloc(num_alloc_maps * sizeof(int)); mesh->ecmap_cnt = (int *) malloc(num_alloc_maps * sizeof(int)); - tmp_maps = (struct map_list_head*) malloc(num_alloc_maps + tmp_maps = (struct map_list_head*) malloc(num_alloc_maps * sizeof(struct map_list_head)); if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || tmp_maps == NULL) { @@ -161,9 +124,9 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; iadj_proc = elem->adj_proc[j]; if (iadj_proc != proc) { - /* + /* * Adjacent element is off-processor. - * Add this element to the temporary data structure for + * Add this element to the temporary data structure for * the appropriate neighboring processor. */ if ((indx = in_list2(iadj_proc, mesh->necmap, mesh->ecmap_id)) == -1) { @@ -179,7 +142,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; num_alloc_maps * sizeof(int)); tmp_maps = (struct map_list_head *) realloc(tmp_maps, num_alloc_maps * sizeof(struct map_list_head)); - if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || + if (mesh->ecmap_id == NULL || mesh->ecmap_cnt == NULL || tmp_maps == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -193,7 +156,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; map->elem_id = (int *) malloc(MAP_ALLOC * sizeof(int)); map->side_id = (int *) malloc(MAP_ALLOC * sizeof(int)); map->neigh_id = (ZOLTAN_ID_TYPE *) malloc(MAP_ALLOC * sizeof(ZOLTAN_ID_TYPE)); - if (map->glob_id == NULL || map->elem_id == NULL || + if (map->glob_id == NULL || map->elem_id == NULL || map->side_id == NULL || map->neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -208,12 +171,12 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; if (mesh->ecmap_cnt[indx] >= map->map_alloc_size) { map->map_alloc_size += MAP_ALLOC; map->glob_id = (ZOLTAN_ID_TYPE *) realloc(map->glob_id, map->map_alloc_size * sizeof(ZOLTAN_ID_TYPE)); - map->elem_id = (int *) realloc(map->elem_id, + map->elem_id = (int *) realloc(map->elem_id, map->map_alloc_size * sizeof(int)); - map->side_id = (int *) realloc(map->side_id, + map->side_id = (int *) realloc(map->side_id, map->map_alloc_size * sizeof(int)); map->neigh_id = (ZOLTAN_ID_TYPE *) realloc(map->neigh_id, map->map_alloc_size * sizeof(ZOLTAN_ID_TYPE)); - if (map->glob_id == NULL || map->elem_id == NULL || + if (map->glob_id == NULL || map->elem_id == NULL || map->side_id == NULL || map->neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); DEBUG_TRACE_END(proc, yo); @@ -232,8 +195,8 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; } } - /* - * If no communication maps, don't need to do anything else. + /* + * If no communication maps, don't need to do anything else. */ if (mesh->necmap > 0) { @@ -265,12 +228,12 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /* * Sort the map so that adjacent processors have the same ordering - * for the communication. + * for the communication. * Assume the ordering of the lower-numbered processor in the pair * of communicating processors. */ - if (proc < mesh->ecmap_id[i]) + if (proc < mesh->ecmap_id[i]) quicksort_pointer_inc_id_id(sindex, map->glob_id, map->neigh_id, 0, mesh->ecmap_cnt[i]-1); else @@ -278,7 +241,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; 0, mesh->ecmap_cnt[i]-1); /* - * Copy sorted data into elem map arrays. + * Copy sorted data into elem map arrays. */ offset = cnt; @@ -303,7 +266,7 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; safe_free((void **) &tmp_maps); safe_free((void **) &sindex); - if (Test.DDirectory) + if (Test.DDirectory) compare_maps_with_ddirectory_results(proc, mesh); DEBUG_TRACE_END(proc, yo); @@ -314,13 +277,13 @@ struct map_list_head *tmp_maps = NULL, *map = NULL; /******************************************************************************/ static void compare_maps_with_ddirectory_results( - int proc, + int proc, MESH_INFO_PTR mesh ) { /* - * Routine to demonstrate the use of the Zoltan Distributed Directory - * to build communication maps. This functionality essentially duplicates + * Routine to demonstrate the use of the Zoltan Distributed Directory + * to build communication maps. This functionality essentially duplicates * that in build_elem_comm_maps. It provides a test of the DDirectory, * as the maps generated by the directory should match those generated * by build_elem_comm_maps. @@ -376,11 +339,11 @@ Zoltan_Comm *comm; } } - /* - * Create DDirectory and register all owned elements. + /* + * Create DDirectory and register all owned elements. */ - dd = new Zoltan_DD(MPI_COMM_WORLD, 1, 1, 0, 0, 0); + dd = new Zoltan_DD(zoltan_get_global_comm(), 1, 1, 0, 0, 0); ierr = dd->Update(gids, lids, NULL, NULL, num_elems); @@ -404,8 +367,8 @@ Zoltan_Comm *comm; dd = &ddNew; - /* - * Use the DDirectory to find owners of off-processor neighboring elements. + /* + * Use the DDirectory to find owners of off-processor neighboring elements. * Of course, we have this info in ELEM_INFO, but we do the find to test * the DDirectory. */ @@ -419,8 +382,8 @@ Zoltan_Comm *comm; my_gids = nbor_lids + num_nbor; ownerlist = (int *) malloc(sizeof(int) * num_nbor); - /* - * Get list of elements whose info is needed. + /* + * Get list of elements whose info is needed. */ cnt = 0; for (i = 0; i < num_elems; i++) { @@ -450,10 +413,10 @@ Zoltan_Comm *comm; } /* - * Check for errors + * Check for errors */ - MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&error, &gerror, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gerror) { Gen_Error(0, "Fatal: Error returned by DDirectory Test"); @@ -463,8 +426,8 @@ Zoltan_Comm *comm; return; } - /* - * Use the Communication library to invert this information and build + /* + * Use the Communication library to invert this information and build * communication maps. * We know what to receive and from where; compute what to send and * to whom. @@ -472,10 +435,10 @@ Zoltan_Comm *comm; * testing DDirectory here. */ - /* + /* * Build list of off-proc elements (and their owners) * that this proc wants. - * This list includes duplicate entries when an element + * This list includes duplicate entries when an element * is a neighbor of > 1 element on this processor. */ @@ -493,7 +456,7 @@ Zoltan_Comm *comm; i_want[j++] = my_gids[i]; } - comm = new Zoltan_Comm(num_nbor, ownerlist, MPI_COMM_WORLD, 747, + comm = new Zoltan_Comm(num_nbor, ownerlist, zoltan_get_global_comm(), 747, &num_others); /* @@ -510,8 +473,8 @@ printf("Test comm copy functions\n"); comm = &commNew; - /* - * Do communication to determine which of this proc's data is wanted by + /* + * Do communication to determine which of this proc's data is wanted by * other procs. * This info will determine what is put in this proc's communication maps. */ @@ -522,7 +485,7 @@ printf("Test comm copy functions\n"); return; } - ierr = comm->Do(757, (char *) i_want, want_size * sizeof(ZOLTAN_ID_TYPE), + ierr = comm->Do(757, (char *) i_want, want_size * sizeof(ZOLTAN_ID_TYPE), (char *) others_want); if (ierr) { Gen_Error(0, "Fatal: Error returned from Zoltan_Comm::Do"); @@ -531,8 +494,8 @@ printf("Test comm copy functions\n"); free(i_want); - /* - * Find number of maps and the size of the largest map. + /* + * Find number of maps and the size of the largest map. * The maps should be grouped by neighboring processor * in others_want. */ @@ -555,8 +518,8 @@ printf("Test comm copy functions\n"); "%d != %d\n", proc, num_maps, mesh->necmap); } - /* - * For each map, + /* + * For each map, * build a map_list_head for the map; * sort the map_list_head appropriately (as in build_elem_comm_maps); * compare sorted lists with actually communication maps. @@ -573,12 +536,12 @@ printf("Test comm copy functions\n"); map.elem_id = (int *) malloc(max_map_size * sizeof(int)); map.side_id = (int *) malloc(max_map_size * sizeof(int)); map.neigh_id = (ZOLTAN_ID_TYPE *) malloc(max_map_size * sizeof(ZOLTAN_ID_TYPE)); - + if (max_map_size > 0 && map.neigh_id == NULL) { Gen_Error(0, "Fatal: insufficient memory"); return; } - + if (Debug_Driver > 3) { /* For high debug levels, serialize the following section so that * output of generated map is serialized (and not junked up). @@ -595,7 +558,7 @@ printf("Test comm copy functions\n"); for (k = 0; k < current->adj_len; k++) { /* Skip NULL adjacencies (sides that are not adjacent to another elem). */ if (current->adj[k] == ZOLTAN_ID_INVALID) continue; - if (current->adj_proc[k] == nbor_proc && + if (current->adj_proc[k] == nbor_proc && current->adj[k] == others_want[j+3]) { map.side_id[map_size] = k + 1; map.neigh_id[map_size] = current->adj[k]; @@ -609,7 +572,7 @@ printf("Test comm copy functions\n"); * Sort and compare the current map. */ sort_and_compare_maps(proc, nbor_proc, mesh, &map, map_size, sindex); - + /* * Reinitialize data structures for new map. */ @@ -622,7 +585,7 @@ printf("Test comm copy functions\n"); * output of generated map is serialized (and not junked up). */ int nprocs = 0; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); print_sync_end(proc, nprocs, 1); } @@ -640,9 +603,9 @@ printf("Test comm copy functions\n"); static void sort_and_compare_maps( int proc, int nbor_proc, - MESH_INFO_PTR mesh, - struct map_list_head *map, - int map_size, + MESH_INFO_PTR mesh, + struct map_list_head *map, + int map_size, int *sindex ) { @@ -669,10 +632,10 @@ int indx; if (proc < nbor_proc) quicksort_pointer_inc_id_id(sindex, map->glob_id, map->neigh_id, 0, map_size-1); - else + else quicksort_pointer_inc_id_id(sindex, map->neigh_id, map->glob_id, 0, map_size-1); - + /* * Compute offset into mesh communication maps for the given nbor proc. */ @@ -702,7 +665,7 @@ int indx; j = sindex[i]; if (map->elem_id[j] != mesh->ecmap_elemids[i+cnt]) { printf("%d DDirectory Test: Different element IDs for nbor_proc %d: " - "%d != %d\n", proc, nbor_proc, map->elem_id[j], + "%d != %d\n", proc, nbor_proc, map->elem_id[j], mesh->ecmap_elemids[i+cnt]); } } @@ -711,7 +674,7 @@ int indx; j = sindex[i]; if (map->side_id[j] != mesh->ecmap_sideids[i+cnt]) { printf("%d DDirectory Test: Different side IDs for nbor_proc %d: " - "%d != %d\n", proc, nbor_proc, map->side_id[j], + "%d != %d\n", proc, nbor_proc, map->side_id[j], mesh->ecmap_sideids[i+cnt]); } } @@ -720,7 +683,7 @@ int indx; j = sindex[i]; if (map->neigh_id[j] != mesh->ecmap_neighids[i+cnt]) { printf("%d DDirectory Test: Different neigh IDs for nbor_proc %d: " - ZOLTAN_ID_SPEC " != " ZOLTAN_ID_SPEC "\n", proc, nbor_proc, map->neigh_id[j], + ZOLTAN_ID_SPEC " != " ZOLTAN_ID_SPEC "\n", proc, nbor_proc, map->neigh_id[j], mesh->ecmap_neighids[i+cnt]); } } @@ -731,8 +694,8 @@ int indx; printf("Local ID\tSide ID\tGlobal ID\tNeigh ID\n"); for (i = 0; i < map_size; i++) { j = sindex[i]; - printf("\t%d\t%d\t" ZOLTAN_ID_SPEC "\t" ZOLTAN_ID_SPEC "\n", - map->elem_id[j], map->side_id[j], + printf("\t%d\t%d\t" ZOLTAN_ID_SPEC "\t" ZOLTAN_ID_SPEC "\n", + map->elem_id[j], map->side_id[j], map->glob_id[j], map->neigh_id[j]); } } diff --git a/packages/zoltan/src/driver/dr_maps_const.h b/packages/zoltan/src/driver/dr_maps_const.h index 16ddeb46f7..7c8d04e4c1 100644 --- a/packages/zoltan/src/driver/dr_maps_const.h +++ b/packages/zoltan/src/driver/dr_maps_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_MAPS_CONST_H diff --git a/packages/zoltan/src/driver/dr_migrate.c b/packages/zoltan/src/driver/dr_migrate.c index 6b111c3ec8..f065d4f969 100644 --- a/packages/zoltan/src/driver/dr_migrate.c +++ b/packages/zoltan/src/driver/dr_migrate.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /*--------------------------------------------------------------------------*/ /* Purpose: Call Zoltan to migrate elements. */ @@ -55,7 +18,7 @@ /* migration) on this processor, and the global ID for adj elems that */ /* are not or will not be (after migration) on this processor. */ /* 2. When exporting elements, convert all the export elems' adjacencies' */ -/* local IDs to global IDs. */ +/* local IDs to global IDs. */ /* 3. When importing elements, convert import elems' adjacencies that are */ /* local elements to local ids. */ /* */ @@ -122,14 +85,14 @@ static struct New_Elem_Hash_Node *New_Elem_Hash_Nodes = NULL; decomposition; used for quick globalID -> localID lookup. */ -static ZOLTAN_ID_TYPE *New_Elem_Index = NULL; /* Array containing globalIDs of +static ZOLTAN_ID_TYPE *New_Elem_Index = NULL; /* Array containing globalIDs of elements in the new decomposition, ordered in the same order as the elements array. Built in migrate_pre_process; used in migrate_pre_process to adjust - element adjacencies; used in - migrate_unpack_elem to store + element adjacencies; used in + migrate_unpack_elem to store imported elements. */ static int New_Elem_Index_Size = 0; /* Number of integers allocated in New_Elem_Index. */ @@ -137,7 +100,7 @@ static int Use_Edge_Wgts = 0; /* Flag indicating whether elements store edge weights. */ /*static int Vertex_Blanking = 0; We're dynamically altering the graph in each iteration by blanking portions - of it, so we must migrate flags + of it, so we must migrate flags indicating whether adjacent vertices of migrated elements were blanked on the originating process. */ @@ -149,7 +112,7 @@ int migrate_elements( int Proc, MESH_INFO_PTR mesh, struct Zoltan_Struct *zz, - int num_gid_entries, + int num_gid_entries, int num_lid_entries, int num_imp, ZOLTAN_ID_PTR imp_gids, @@ -175,14 +138,14 @@ char *yo = "migrate_elements"; /* If not passing NULL lists, let Help_Migrate call the * pre-processing and post-processing routines. */ - if (Zoltan_Set_Fn(zz, ZOLTAN_PRE_MIGRATE_PP_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_PRE_MIGRATE_PP_FN_TYPE, (void (*)()) migrate_pre_process, (void *) mesh) == ZOLTAN_FATAL) { Gen_Error(0, "fatal: error returned from Zoltan_Set_Fn()\n"); return 0; } - if (Zoltan_Set_Fn(zz, ZOLTAN_POST_MIGRATE_PP_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_POST_MIGRATE_PP_FN_TYPE, (void (*)()) migrate_post_process, (void *) mesh) == ZOLTAN_FATAL) { Gen_Error(0, "fatal: error returned from Zoltan_Set_Fn()\n"); @@ -191,7 +154,7 @@ char *yo = "migrate_elements"; } if (Test.Multi_Callbacks) { - if (Zoltan_Set_Fn(zz, ZOLTAN_OBJ_SIZE_MULTI_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_OBJ_SIZE_MULTI_FN_TYPE, (void (*)()) migrate_elem_size_multi, (void *) mesh) == ZOLTAN_FATAL) { Gen_Error(0, "fatal: error returned from Zoltan_Set_Fn()\n"); @@ -204,7 +167,7 @@ char *yo = "migrate_elements"; Gen_Error(0, "fatal: error returned from Zoltan_Set_Fn()\n"); return 0; } - + if (Zoltan_Set_Fn(zz, ZOLTAN_UNPACK_OBJ_MULTI_FN_TYPE, (void (*)()) migrate_unpack_elem_multi, (void *) mesh) == ZOLTAN_FATAL) { @@ -220,7 +183,7 @@ char *yo = "migrate_elements"; return 0; } - if (Zoltan_Set_Fn(zz, ZOLTAN_PACK_OBJ_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_PACK_OBJ_FN_TYPE, (void (*)()) migrate_pack_elem, (void *) mesh) == ZOLTAN_FATAL) { Gen_Error(0, "fatal: error returned from Zoltan_Set_Fn()\n"); @@ -270,7 +233,7 @@ char *yo = "migrate_elements"; return 0; } } - migrate_post_process((void *) mesh, 1, 1, + migrate_post_process((void *) mesh, 1, 1, num_imp, imp_gids, imp_lids, imp_procs, imp_to_part, num_exp, exp_gids, exp_lids, exp_procs, exp_to_part, &ierr); @@ -306,7 +269,7 @@ int j; /*****************************************************************************/ int find_in_hash( ZOLTAN_ID_TYPE globalID -) +) { int idx; @@ -332,7 +295,7 @@ int idx, hidx, prev; prev = idx; idx = New_Elem_Hash_Nodes[idx].next; } - if (prev == -1) + if (prev == -1) New_Elem_Hash_Table[hidx] = New_Elem_Hash_Nodes[idx].next; else New_Elem_Hash_Nodes[prev].next = New_Elem_Hash_Nodes[idx].next; @@ -344,8 +307,8 @@ int idx, hidx, prev; /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -void migrate_pre_process(void *data, int num_gid_entries, int num_lid_entries, - int num_import, +void migrate_pre_process(void *data, int num_gid_entries, int num_lid_entries, + int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, @@ -356,7 +319,7 @@ void migrate_pre_process(void *data, int num_gid_entries, int num_lid_entries, { int i, j, k, idx, maxlen, proc, offset; int *proc_ids = NULL; /* Temp array of processor assignments for elements.*/ -char *change = NULL; /* Temp array indicating whether local element's adj +char *change = NULL; /* Temp array indicating whether local element's adj list must be updated due to a nbor's migration. */ int new_proc; /* New processor assignment for nbor element. */ int exp_elem; /* index of an element being exported */ @@ -384,7 +347,7 @@ char msg[256]; /* * Set some flags. Assume if true for one element, true for all elements. - * Note that some procs may have no elements. + * Note that some procs may have no elements. */ if (elements[0].edge_wgt != NULL) @@ -392,7 +355,7 @@ char msg[256]; else k = 0; /* Make sure all procs have the same value */ - MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); /* NOT IMPLEMENTED: blanking information is not sent along. Subsequent lb_eval may be incorrect, since imported elements may have blanked @@ -402,18 +365,18 @@ char msg[256]; k = 1; else k = 0; - - MPI_Allreduce(&k, &Vertex_Blanking, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + + MPI_Allreduce(&k, &Vertex_Blanking, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); */ /* * For all elements, update adjacent elements' processor information. * That way, when perform migration, will be migrating updated adjacency - * information. + * information. */ - - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + + MPI_Comm_rank(zoltan_get_global_comm(), &proc); /* * Build New_Elem_Index array and list of processor assignments. @@ -421,22 +384,22 @@ char msg[256]; New_Elem_Index_Size = mesh->num_elems + num_import - num_export; - if (mesh->elem_array_len > New_Elem_Index_Size) + if (mesh->elem_array_len > New_Elem_Index_Size) New_Elem_Index_Size = mesh->elem_array_len; New_Elem_Index = (ZOLTAN_ID_TYPE *) malloc(New_Elem_Index_Size * sizeof(ZOLTAN_ID_TYPE)); New_Elem_Hash_Table = (int *) malloc(New_Elem_Index_Size * sizeof(int)); - New_Elem_Hash_Nodes = (struct New_Elem_Hash_Node *) + New_Elem_Hash_Nodes = (struct New_Elem_Hash_Node *) malloc(New_Elem_Index_Size * sizeof(struct New_Elem_Hash_Node)); - if (New_Elem_Index == NULL || + if (New_Elem_Index == NULL || New_Elem_Hash_Table == NULL || New_Elem_Hash_Nodes == NULL) { Gen_Error(0, "fatal: insufficient memory"); *ierr = ZOLTAN_MEMERR; return; } - for (i = 0; i < New_Elem_Index_Size; i++) + for (i = 0; i < New_Elem_Index_Size; i++) New_Elem_Hash_Table[i] = -1; for (i = 0; i < New_Elem_Index_Size; i++) { New_Elem_Hash_Nodes[i].globalID = ZOLTAN_ID_INVALID; @@ -472,7 +435,7 @@ char msg[256]; if (num_lid_entries) exp_elem = export_local_ids[lid+i*num_lid_entries]; else /* testing num_lid_entries == 0 */ - search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], + search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], &exp_elem); if (export_procs[i] != proc) { @@ -488,7 +451,7 @@ char msg[256]; if (import_procs[i] != proc) { /* Import is moving from a new processor, not just from a new partition */ /* search for first free location */ - for ( ; j < New_Elem_Index_Size; j++) + for ( ; j < New_Elem_Index_Size; j++) if (New_Elem_Index[j] == ZOLTAN_ID_INVALID) break; New_Elem_Index[j] = import_global_ids[gid+i*num_gid_entries]; @@ -496,8 +459,8 @@ char msg[256]; } } - /* - * Update local information + /* + * Update local information */ /* Set change flag for elements whose adjacent elements are being exported */ @@ -507,12 +470,12 @@ char msg[256]; if (num_lid_entries) exp_elem = export_local_ids[lid+i*num_lid_entries]; else /* testing num_lid_entries == 0 */ - search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], + search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], &exp_elem); elements[exp_elem].my_part = export_to_part[i]; - if (export_procs[i] == proc) + if (export_procs[i] == proc) continue; /* No adjacency changes needed if export is changing only partition, not processor. */ @@ -551,11 +514,11 @@ char msg[256]; safe_free((void **)(void *) &change); /* - * Update off-processor information + * Update off-processor information */ maxlen = 0; - for (i = 0; i < mesh->necmap; i++) + for (i = 0; i < mesh->necmap; i++) maxlen += mesh->ecmap_cnt[i]; if (maxlen > 0) { @@ -580,7 +543,7 @@ char msg[256]; /* Perform boundary exchange */ boundary_exchange(mesh, 1, send_vec, recv_vec); - + /* Unload receive vector */ offset = 0; @@ -605,7 +568,7 @@ char msg[256]; /* element is moving to this processor; */ /* convert adj from global to local ID. */ idx = find_in_hash(mesh->ecmap_neighids[offset]); - if (idx >= 0) + if (idx >= 0) idx = New_Elem_Hash_Nodes[idx].localID; else { sprintf(msg, "fatal: unable to locate element " ZOLTAN_ID_SPEC " in " @@ -649,7 +612,7 @@ char msg[256]; /*****************************************************************************/ /*****************************************************************************/ void migrate_post_process(void *data, int num_gid_entries, int num_lid_entries, - int num_import, + int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, @@ -672,8 +635,8 @@ ZOLTAN_ID_TYPE adj_elem; elements = mesh->elements; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); - MPI_Comm_size(MPI_COMM_WORLD, &num_proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); + MPI_Comm_size(zoltan_get_global_comm(), &num_proc); /* compact elements array, as the application expects the array to be dense */ for (i = 0; i < New_Elem_Index_Size; i++) { @@ -733,7 +696,7 @@ ZOLTAN_ID_TYPE adj_elem; for (k=0; kelements[elem_lid[lid]]) : search_by_global_id(mesh, elem_gid[gid], &idx)); num_nodes = mesh->eb_nnodes[current_elem->elem_blk]; @@ -810,19 +773,19 @@ int idx; } size = 200; - + /* Add space to correct alignment so casts work in (un)packing. */ size = Zoltan_Align(size); - /* Add space for connect table. + /* Add space for connect table. * Using "8" instead of sizeof(ZOLTAN_ID_TYPE). */ - + if (mesh->num_dims > 0) size += num_nodes * 8; /* Add space for adjacency info (elements[].adj) * Using "8" instead of sizeof(ZOLTAN_ID_TYPE). */ - + size += current_elem->adj_len * 8; /* Add space for adjacency info (elements[].adj_proc). */ @@ -838,7 +801,7 @@ int idx; /* Add space for coordinate info */ size = Zoltan_Align(size); size += num_nodes * mesh->num_dims * sizeof(float); - + /* For dynamic weights test, multiply size by vertex weight. */ /* This simulates mesh refinement. */ if (Test.Dynamic_Weights){ @@ -875,9 +838,9 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, mesh = (MESH_INFO_PTR) data; elem = mesh->elements; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); - current_elem = (num_lid_entries + current_elem = (num_lid_entries ? &(elem[elem_lid[lid]]) : search_by_global_id(mesh, elem_gid[gid], &idx)); num_nodes = mesh->eb_nnodes[current_elem->elem_blk]; @@ -895,7 +858,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, */ /* Pad the buffer so the following casts will work. */ - + size = Zoltan_Align(size); buf_id_type = (ZOLTAN_ID_TYPE *) (buf + size); @@ -912,7 +875,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /* copy the adjacency info - all global IDs, then all processes owning global IDs */ for (i = 0; i < current_elem->adj_len; i++) { - if (current_elem->adj[i] != ZOLTAN_ID_INVALID && current_elem->adj_proc[i] == proc) + if (current_elem->adj[i] != ZOLTAN_ID_INVALID && current_elem->adj_proc[i] == proc) *buf_id_type++ = New_Elem_Index[current_elem->adj[i]]; else *buf_id_type++ = current_elem->adj[i]; @@ -966,7 +929,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /* * need to remove this entry from this procs list of elements - * do so by setting the globalID to ZOLTAN_ID_INVALID. + * do so by setting the globalID to ZOLTAN_ID_INVALID. */ current_elem->globalID = ZOLTAN_ID_INVALID; free_element_arrays(current_elem, mesh); @@ -976,7 +939,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, * number of nodes on this processor until all of the migration is * completed. */ - if (size > elem_data_size) + if (size > elem_data_size) *ierr = ZOLTAN_WARN; else *ierr = ZOLTAN_OK; @@ -985,7 +948,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid, +void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid, int elem_data_size, char *buf, int *ierr) { MESH_INFO_PTR mesh; @@ -1008,10 +971,10 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid elem = mesh->elements; elem_mig = (ELEM_INFO *) buf; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); idx = find_in_hash((int)elem_gid[gid]); - if (idx >= 0) + if (idx >= 0) idx = New_Elem_Hash_Nodes[idx].localID; else { Gen_Error(0, "fatal: Unable to locate position for element"); @@ -1074,13 +1037,13 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid if (current_elem->adj[i] != ZOLTAN_ID_INVALID && current_elem->adj_proc[i] == proc) { int nidx = find_in_hash(current_elem->adj[i]); - if (nidx >= 0) + if (nidx >= 0) current_elem->adj[i] = (ZOLTAN_ID_TYPE)New_Elem_Hash_Nodes[nidx].localID; else { Gen_Error(0, "fatal: Unable to locate position for neighbor"); *ierr = ZOLTAN_FATAL; return; - } + } } } size += (adjgids_len + adjprocs_len); @@ -1092,7 +1055,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid size = Zoltan_Align(size); buf_float = (float *) (buf + size); - current_elem->edge_wgt = (float *) malloc(current_elem->adj_len + current_elem->edge_wgt = (float *) malloc(current_elem->adj_len * sizeof(float)); if (current_elem->edge_wgt == NULL) { Gen_Error(0, "fatal: insufficient memory"); @@ -1140,7 +1103,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid mesh->num_elems++; mesh->eb_cnts[current_elem->elem_blk]++; - if (size > elem_data_size) + if (size > elem_data_size) *ierr = ZOLTAN_WARN; else *ierr = ZOLTAN_OK; diff --git a/packages/zoltan/src/driver/dr_migrate.c.shockstem b/packages/zoltan/src/driver/dr_migrate.c.shockstem index 3533972e54..813319c7de 100644 --- a/packages/zoltan/src/driver/dr_migrate.c.shockstem +++ b/packages/zoltan/src/driver/dr_migrate.c.shockstem @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /****************************************************************************/ /* ALTERNATE FILE FOR SHOCKSTEM ADAPTIVE MESH REFINEMENT EXPERIMENTS ONLY. */ @@ -399,7 +362,7 @@ char msg[256]; else k = 0; /* Make sure all procs have the same value */ - MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); /* NOT IMPLEMENTED: blanking information is not sent along. Subsequent lb_eval may be incorrect, since imported elements may have blanked @@ -410,7 +373,7 @@ char msg[256]; else k = 0; - MPI_Allreduce(&k, &Vertex_Blanking, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&k, &Vertex_Blanking, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); */ @@ -420,7 +383,7 @@ char msg[256]; * information. */ - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); /* * Build New_Elem_Index array and list of processor assignments. @@ -677,8 +640,8 @@ int adj_elem; elements = mesh->elements; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); - MPI_Comm_size(MPI_COMM_WORLD, &num_proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); + MPI_Comm_size(zoltan_get_global_comm(), &num_proc); /* compact elements array, as the application expects the array to be dense */ for (i = 0; i < New_Elem_Index_Size; i++) { @@ -862,7 +825,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, mesh = (MESH_INFO_PTR) data; elem = mesh->elements; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); current_elem = (num_lid_entries ? &(elem[elem_lid[lid]]) @@ -989,7 +952,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid elem = mesh->elements; elem_mig = (ELEM_INFO *) buf; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); idx = find_in_hash(elem_gid[gid]); if (idx >= 0) diff --git a/packages/zoltan/src/driver/dr_migrateCPP.cpp b/packages/zoltan/src/driver/dr_migrateCPP.cpp index 944e930d28..729408267e 100644 --- a/packages/zoltan/src/driver/dr_migrateCPP.cpp +++ b/packages/zoltan/src/driver/dr_migrateCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include // must appear before stdio or iostream @@ -79,14 +42,14 @@ ZOLTAN_UNPACK_OBJ_MULTI_FN migrate_unpack_elem_multi; /* * Static global variables to help with migration. */ -static ZOLTAN_ID_TYPE *New_Elem_Index = NULL; /* Array containing globalIDs of +static ZOLTAN_ID_TYPE *New_Elem_Index = NULL; /* Array containing globalIDs of elements in the new decomposition, ordered in the same order as the elements array. Built in migrate_pre_process; used in migrate_pre_process to adjust - element adjacencies; used in - migrate_unpack_elem to store + element adjacencies; used in + migrate_unpack_elem to store imported elements. */ static int New_Elem_Index_Size = 0; /* Number of integers allocated in New_Elem_Index. */ @@ -100,7 +63,7 @@ int migrate_elements( int Proc, MESH_INFO_PTR mesh, Zoltan &zz, - int num_gid_entries, + int num_gid_entries, int num_lid_entries, int num_imp, ZOLTAN_ID_PTR imp_gids, @@ -151,7 +114,7 @@ const char *yo = "migrate_elements"; Gen_Error(0, "fatal: error returned from Set_Pack_Obj_Multi_Fn()\n"); return 0; } - + if (zz.Set_Unpack_Obj_Multi_Fn(migrate_unpack_elem_multi, (void *) mesh) == ZOLTAN_FATAL) { Gen_Error(0, "fatal: error returned from Set_Unpack_Obj_Multi_Fn()\n"); @@ -211,7 +174,7 @@ const char *yo = "migrate_elements"; return 0; } } - migrate_post_process((void *) mesh, 1, 1, + migrate_post_process((void *) mesh, 1, 1, num_imp, imp_gids, imp_lids, imp_procs, imp_to_part, num_exp, exp_gids, exp_lids, exp_procs, exp_to_part, &ierr); @@ -225,8 +188,8 @@ const char *yo = "migrate_elements"; /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -void migrate_pre_process(void *data, int num_gid_entries, int num_lid_entries, - int num_import, +void migrate_pre_process(void *data, int num_gid_entries, int num_lid_entries, + int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, @@ -250,7 +213,7 @@ char msg[256]; /* * Set some flags. Assume if true for one element, true for all elements. - * Note that some procs may have no elements. + * Note that some procs may have no elements. */ int k = 0; @@ -260,23 +223,23 @@ char msg[256]; /* Make sure all procs have the same value */ - MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&k, &Use_Edge_Wgts, 1, MPI_INT, MPI_MAX, zoltan_get_global_comm()); /* * For all elements, update adjacent elements' processor information. * That way, when perform migration, will be migrating updated adjacency - * information. + * information. */ - + int proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); /* * Build New_Elem_Index array and list of processor assignments. */ New_Elem_Index_Size = mesh->num_elems + num_import - num_export; - if (mesh->elem_array_len > New_Elem_Index_Size) + if (mesh->elem_array_len > New_Elem_Index_Size) New_Elem_Index_Size = mesh->elem_array_len; New_Elem_Index = new ZOLTAN_ID_TYPE [New_Elem_Index_Size]; @@ -320,7 +283,7 @@ char msg[256]; if (num_lid_entries) exp_elem = export_local_ids[lid+i*num_lid_entries]; else /* testing num_lid_entries == 0 */ - search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], + search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], &exp_elem); if (export_procs[i] != proc) { @@ -335,15 +298,15 @@ char msg[256]; /* Import is moving from a new processor, not just from a new partition */ /* search for first free location */ int j=0; - for (j = 0; j < New_Elem_Index_Size; j++) + for (j = 0; j < New_Elem_Index_Size; j++) if (New_Elem_Index[j] == ZOLTAN_ID_INVALID) break; New_Elem_Index[j] = import_global_ids[gid+i*num_gid_entries]; } } - /* - * Update local information + /* + * Update local information */ /* Set change flag for elements whose adjacent elements are being exported */ @@ -355,12 +318,12 @@ char msg[256]; if (num_lid_entries) exp_elem = export_local_ids[lid+i*num_lid_entries]; else /* testing num_lid_entries == 0 */ - search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], + search_by_global_id(mesh, export_global_ids[gid+i*num_gid_entries], &exp_elem); elements[exp_elem].my_part = export_to_part[i]; - if (export_procs[i] == proc) + if (export_procs[i] == proc) continue; /* No adjacency changes needed if export is changing only partition, not processor. */ @@ -400,13 +363,13 @@ char msg[256]; delete [] change; /* - * Update off-processor information + * Update off-processor information */ int maxlen = 0; int *send_vec = NULL; - for (int i = 0; i < mesh->necmap; i++) + for (int i = 0; i < mesh->necmap; i++) maxlen += mesh->ecmap_cnt[i]; if (maxlen > 0) { @@ -435,7 +398,7 @@ char msg[256]; /* Perform boundary exchange */ boundary_exchange(mesh, 1, send_vec, recv_vec); - + /* Unload receive vector */ int offset = 0; @@ -508,7 +471,7 @@ char msg[256]; /*****************************************************************************/ /*****************************************************************************/ void migrate_post_process(void *data, int num_gid_entries, int num_lid_entries, - int num_import, + int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, @@ -525,8 +488,8 @@ void migrate_post_process(void *data, int num_gid_entries, int num_lid_entries, ELEM_INFO *elements = mesh->elements; int proc = 0, num_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); - MPI_Comm_size(MPI_COMM_WORLD, &num_proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); + MPI_Comm_size(zoltan_get_global_comm(), &num_proc); /* compact elements array, as the application expects the array to be dense */ for (int i = 0; i < New_Elem_Index_Size; i++) { @@ -588,7 +551,7 @@ void migrate_post_process(void *data, int num_gid_entries, int num_lid_entries, for (int k=0; kelements[elem_lid[lid]]) : search_by_global_id(mesh, elem_gid[gid], &idx)); int num_nodes = mesh->eb_nnodes[current_elem->elem_blk]; @@ -653,7 +616,7 @@ int idx = 0; /* 152 is hardcoded size of ELEM_INFO for 64-bit archs; * Need it to make 32-bit and 64-bit repartitioning results match. */ int size = (sizeof(ELEM_INFO) > 152 ? sizeof(ELEM_INFO) : 152); - + /* Add space to correct alignment so casts work in (un)packing. */ size = Zoltan_Align(size); @@ -677,7 +640,7 @@ int idx = 0; /* Add space for coordinate info */ size = Zoltan_Align(size); size += num_nodes * mesh->num_dims * sizeof(float); - + return (size); } @@ -699,11 +662,11 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, ELEM_INFO *elem = mesh->elements; int proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); int idx; - ELEM_INFO *current_elem = (num_lid_entries + ELEM_INFO *current_elem = (num_lid_entries ? &(elem[elem_lid[lid]]) : search_by_global_id(mesh, elem_gid[gid], &idx)); @@ -722,7 +685,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, */ /* Pad the buffer so the following casts will work. */ - + size = Zoltan_Align(size); ZOLTAN_ID_TYPE *buf_id_type = (ZOLTAN_ID_TYPE *) (buf + size); @@ -739,7 +702,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /* send globalID for all adjacencies */ for (int i = 0; i < current_elem->adj_len; i++) { - if (current_elem->adj[i] != ZOLTAN_ID_INVALID && current_elem->adj_proc[i] == proc) + if (current_elem->adj[i] != ZOLTAN_ID_INVALID && current_elem->adj_proc[i] == proc) *buf_id_type++ = New_Elem_Index[current_elem->adj[i]]; else *buf_id_type++ = current_elem->adj[i]; @@ -797,7 +760,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /* * need to remove this entry from this procs list of elements - * do so by setting the globalID to ZOLTAN_ID_INVALID. + * do so by setting the globalID to ZOLTAN_ID_INVALID. */ current_elem->globalID = ZOLTAN_ID_INVALID; free_element_arrays(current_elem, mesh); @@ -807,7 +770,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, * number of nodes on this processor until all of the migration is * completed. */ - if (size > elem_data_size) + if (size > elem_data_size) *ierr = ZOLTAN_WARN; else *ierr = ZOLTAN_OK; @@ -816,7 +779,7 @@ void migrate_pack_elem(void *data, int num_gid_entries, int num_lid_entries, /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid, +void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid, int elem_data_size, char *buf, int *ierr) { int gid = num_gid_entries-1; @@ -830,7 +793,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid ELEM_INFO *elem_mig = (ELEM_INFO *) buf; int proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); int idx = 0; ZOLTAN_ID_TYPE egid = elem_gid[gid]; @@ -917,7 +880,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid size = Zoltan_Align(size); buf_float = (float *) (buf + size); - current_elem->edge_wgt = (float *) malloc(current_elem->adj_len + current_elem->edge_wgt = (float *) malloc(current_elem->adj_len * sizeof(float)); if (current_elem->edge_wgt == NULL) { Gen_Error(0, "fatal: insufficient memory"); @@ -965,7 +928,7 @@ void migrate_unpack_elem(void *data, int num_gid_entries, ZOLTAN_ID_PTR elem_gid mesh->num_elems++; mesh->eb_cnts[current_elem->elem_blk]++; - if (size > elem_data_size) + if (size > elem_data_size) *ierr = ZOLTAN_WARN; else *ierr = ZOLTAN_OK; diff --git a/packages/zoltan/src/driver/dr_mm_readfile.c b/packages/zoltan/src/driver/dr_mm_readfile.c index df7c5b3d4b..f416f2e966 100644 --- a/packages/zoltan/src/driver/dr_mm_readfile.c +++ b/packages/zoltan/src/driver/dr_mm_readfile.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include #include "zoltan.h" @@ -104,7 +67,7 @@ char line[128]; int *sendcount = NULL, *start = NULL, *outVals = NULL; int *myVals= NULL, *inVals= NULL, *inptr = NULL; struct ijv *myIJV = NULL, *iptr = NULL; -int remaining, chunksize, amt, myInCount, myMaxCount, myCount; +int remaining, chunksize, amt, myInCount, myMaxCount, myCount; int rc, edge, vtx, idx,owner, num_lone_vertices; short *assignments=NULL; int error = 0; /* flag to indicate status */ @@ -158,9 +121,9 @@ int error = 0; /* flag to indicate status */ M=N=gnz=0; } } - MPI_Bcast(&gnz, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&M, 1, MPI_INT, 0, MPI_COMM_WORLD); - MPI_Bcast(&N, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&gnz, 1, MPI_INT, 0, zoltan_get_global_comm()); + MPI_Bcast(&M, 1, MPI_INT, 0, zoltan_get_global_comm()); + MPI_Bcast(&N, 1, MPI_INT, 0, zoltan_get_global_comm()); if (pio_info->matrix_obj==COLUMNS){ *nVtx = N; @@ -205,7 +168,7 @@ int error = 0; /* flag to indicate status */ /* Initialize which process owns which vertex, and global * variables used by graph callbacks. */ - ch_dist_init(Num_Proc, *nVtx, pio_info, &assignments, 0, MPI_COMM_WORLD); + ch_dist_init(Num_Proc, *nVtx, pio_info, &assignments, 0, zoltan_get_global_comm()); if (Proc == 0){ sendcount = (int *)malloc(Num_Proc * sizeof(int)); @@ -264,7 +227,7 @@ int error = 0; /* flag to indicate status */ start[0] = 0; for (j=0; j 0){ - MPI_Send(sendcount + j, 1, MPI_INT, j, 0x0101, MPI_COMM_WORLD); + MPI_Send(sendcount + j, 1, MPI_INT, j, 0x0101, zoltan_get_global_comm()); } start[j+1] = start[j] + sendcount[j]; sendcount[j] = 0; @@ -285,7 +248,7 @@ int error = 0; /* flag to indicate status */ } for (j=1; ji]+cnt[iptr->i]; adj[idx] = iptr->j; - if (*ch_ewgt_dim) + if (*ch_ewgt_dim) ewgts[idx] = iptr->v; cnt[iptr->i]++; } @@ -565,7 +528,7 @@ static int comp(const void *a, const void *b) else return (ai - bi); } -static int add_new_vals(int *newvals, int newCount, +static int add_new_vals(int *newvals, int newCount, int **myVals, int *myCount, int *myMaxCount) { int newsize; diff --git a/packages/zoltan/src/driver/dr_mmio.c b/packages/zoltan/src/driver/dr_mmio.c index c78dd4344f..8091222b09 100644 --- a/packages/zoltan/src/driver/dr_mmio.c +++ b/packages/zoltan/src/driver/dr_mmio.c @@ -1,3 +1,11 @@ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* * Matrix Market I/O library for ANSI C * diff --git a/packages/zoltan/src/driver/dr_mmio.h b/packages/zoltan/src/driver/dr_mmio.h index 1ef4fe88f0..54e2d66be6 100644 --- a/packages/zoltan/src/driver/dr_mmio.h +++ b/packages/zoltan/src/driver/dr_mmio.h @@ -1,4 +1,12 @@ -/* +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER +/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. @@ -91,7 +99,7 @@ int mm_is_valid(MM_typecode matcode); /* too complex for a macro */ MM_matrix_typecode: 4-character sequence - ojbect sparse/ data storage + ojbect sparse/ data storage dense type scheme string position: [0] [1] [2] [3] @@ -106,7 +114,7 @@ int mm_is_valid(MM_typecode matcode); /* too complex for a macro */ #define MM_MTX_STR "matrix" #define MM_ARRAY_STR "array" #define MM_DENSE_STR "array" -#define MM_COORDINATE_STR "coordinate" +#define MM_COORDINATE_STR "coordinate" #define MM_SPARSE_STR "coordinate" #define MM_COMPLEX_STR "complex" #define MM_REAL_STR "real" diff --git a/packages/zoltan/src/driver/dr_output.c b/packages/zoltan/src/driver/dr_output.c index 96270ffc12..16b4a9a2cf 100644 --- a/packages/zoltan/src/driver/dr_output.c +++ b/packages/zoltan/src/driver/dr_output.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "dr_const.h" #include "dr_externs.h" @@ -70,8 +33,8 @@ static void echo_cmd_file(FILE *fp, const char *cmd_file); /*****************************************************************************/ void print_distributed_mesh( - int Proc, - int Num_Proc, + int Proc, + int Num_Proc, MESH_INFO_PTR mesh) { int i, j, k; @@ -82,7 +45,7 @@ ELEM_INFO_PTR current_elem; /* * Print the distributed mesh description for each processor. This routine - * is useful for debugging the input meshes (Nemesis or Chaco). It is + * is useful for debugging the input meshes (Nemesis or Chaco). It is * serial, so it should not be used for production runs. */ @@ -111,7 +74,7 @@ ELEM_INFO_PTR current_elem; current_elem = &(mesh->elements[i]); if (current_elem->globalID == ZOLTAN_ID_INVALID) continue; - printf(ZOLTAN_ID_SPEC " in part %d (%f):\n", current_elem->globalID, + printf(ZOLTAN_ID_SPEC " in part %d (%f):\n", current_elem->globalID, current_elem->my_part, current_elem->cpu_wgt[0]); for (j = 0; j < mesh->eb_nnodes[current_elem->elem_blk]; j++) { printf("\t" ZOLTAN_ID_SPEC " |", current_elem->connect[j]); @@ -158,7 +121,7 @@ ELEM_INFO_PTR current_elem; for (j = 0; j < mesh->ecmap_cnt[i]; j++) { k = j + offset; printf(" %d %d " ZOLTAN_ID_SPEC " " ZOLTAN_ID_SPEC "\n", mesh->ecmap_elemids[k], - mesh->ecmap_sideids[k], + mesh->ecmap_sideids[k], mesh->elements[mesh->ecmap_elemids[k]].globalID, mesh->ecmap_neighids[k]); } @@ -181,14 +144,14 @@ ELEM_INFO_PTR current_elem; } if (mesh->hewgt_dim && (mesh->heNumWgts > 0)){ printf("\nHyperedge Weights\n"); - for (i=0; iheNumWgts; i++){ + for (i=0; iheNumWgts; i++){ if (mesh->heWgtId){ printf("Hyperedge " ZOLTAN_ID_SPEC " (%d): (", mesh->heWgtId[i], i); } else{ printf("Hyperedge " ZOLTAN_ID_SPEC " (%d): (", mesh->hgid[i], i); } - for (j = 0; j < mesh->hewgt_dim; j++) + for (j = 0; j < mesh->hewgt_dim; j++) printf("%f ", mesh->hewgts[i*mesh->hewgt_dim + j]); printf(")\n"); } @@ -272,14 +235,14 @@ int output_results(const char *cmd_file, return 0; } - if (Proc == 0) + if (Proc == 0) echo_cmd_file(fp, cmd_file); fprintf(fp, "Global element ids assigned to processor %d\n", Proc); fprintf(fp, "GID\tPart\tPerm\tIPerm\n"); for (i = 0; i < mesh->num_elems; i++) { j = index[i]; - fprintf(fp, ZOLTAN_ID_SPEC "\t%d\t%d\t%d\n", + fprintf(fp, ZOLTAN_ID_SPEC "\t%d\t%d\t%d\n", global_ids[j], (int)parts[j], (int)perm[j], (int)invperm[j]); } @@ -308,7 +271,7 @@ int output_results(const char *cmd_file, for (j = 0; j < mesh->eb_nnodes[current_element->elem_blk]; j++) { global_ids[k] = (ZOLTAN_ID_TYPE)(current_element->connect[j]); x[k] = current_element->coord[j][0]; - if (mesh->num_dims > 1) + if (mesh->num_dims > 1) y[k] = current_element->coord[j][1]; if (mesh->num_dims > 2) z[k] = current_element->coord[j][2]; @@ -317,7 +280,7 @@ int output_results(const char *cmd_file, } } - quicksort_pointer_inc_id_id(index, global_ids, NULL, + quicksort_pointer_inc_id_id(index, global_ids, NULL, 0, total_nodes-1); strcat(par_out_fname, ".mesh"); @@ -341,7 +304,7 @@ int output_results(const char *cmd_file, } fprintf(fp, ")\n"); } - + fclose(fp); free(global_ids); free(x); @@ -374,7 +337,7 @@ FILE *cmd_fp; while(fgets(inp_line, MAX_INPUT_STR_LN, cmd_fp)) { /* skip any line that is a comment */ - if((inp_line[0] != '#') && (inp_line[0] != '\n')) + if((inp_line[0] != '#') && (inp_line[0] != '\n')) fprintf(fp, "%s", inp_line); } diff --git a/packages/zoltan/src/driver/dr_output_const.h b/packages/zoltan/src/driver/dr_output_const.h index 6f7f45403c..12941b0bd3 100644 --- a/packages/zoltan/src/driver/dr_output_const.h +++ b/packages/zoltan/src/driver/dr_output_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_OUTPUT_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_par_util.c b/packages/zoltan/src/driver/dr_par_util.c index 9724cecf97..62298d40f0 100644 --- a/packages/zoltan/src/driver/dr_par_util.c +++ b/packages/zoltan/src/driver/dr_par_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -88,10 +51,10 @@ void print_sync_start(int proc, int do_print_line) int from, flag; MPI_Status status; - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if ( proc != 0) { from = proc - 1; - MPI_Recv((void *) &flag, 1, MPI_INT, from, 0, MPI_COMM_WORLD, &status); + MPI_Recv((void *) &flag, 1, MPI_INT, from, 0, zoltan_get_global_comm(), &status); } else { if (do_print_line) { @@ -153,14 +116,14 @@ void print_sync_end(int proc, int nprocs, int do_print_line) if (proc == 0) { from = nprocs - 1; - MPI_Irecv((void *) &flag, 1, MPI_INT, from, 0, MPI_COMM_WORLD, &req); + MPI_Irecv((void *) &flag, 1, MPI_INT, from, 0, zoltan_get_global_comm(), &req); #ifdef DEBUG_PSYNC (void) printf("\t\t\t Proc 0 posted receive from %5d\n", from); #endif } - MPI_Send((void *) &flag, 1, MPI_INT, to, 0, MPI_COMM_WORLD); + MPI_Send((void *) &flag, 1, MPI_INT, to, 0, zoltan_get_global_comm()); if (proc == 0) { MPI_Wait(&req, &status); @@ -172,7 +135,7 @@ void print_sync_end(int proc, int nprocs, int do_print_line) * (Num_Proc-1) */ - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } @@ -199,16 +162,16 @@ MPI_Request *req = NULL; /* Post receives */ offset = 0; for (i = 0; i < mesh->necmap; i++) { - MPI_Irecv(&(recv_vec[offset]), mesh->ecmap_cnt[i]*vec_len, MPI_INT, - mesh->ecmap_id[i], msg_type, MPI_COMM_WORLD, &(req[i])); + MPI_Irecv(&(recv_vec[offset]), mesh->ecmap_cnt[i]*vec_len, MPI_INT, + mesh->ecmap_id[i], msg_type, zoltan_get_global_comm(), &(req[i])); offset += mesh->ecmap_cnt[i]*vec_len; } /* Send messages */ offset = 0; for (i = 0; i < mesh->necmap; i++) { - MPI_Send(&(send_vec[offset]), mesh->ecmap_cnt[i]*vec_len, MPI_INT, - mesh->ecmap_id[i], msg_type, MPI_COMM_WORLD); + MPI_Send(&(send_vec[offset]), mesh->ecmap_cnt[i]*vec_len, MPI_INT, + mesh->ecmap_id[i], msg_type, zoltan_get_global_comm()); offset += mesh->ecmap_cnt[i]*vec_len; } diff --git a/packages/zoltan/src/driver/dr_par_util_const.h b/packages/zoltan/src/driver/dr_par_util_const.h index 875323f827..84c3ed4a4b 100644 --- a/packages/zoltan/src/driver/dr_par_util_const.h +++ b/packages/zoltan/src/driver/dr_par_util_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_PAR_UTIL_CONST_H_ diff --git a/packages/zoltan/src/driver/dr_param_file.c b/packages/zoltan/src/driver/dr_param_file.c index adeb149260..0740e62f11 100644 --- a/packages/zoltan/src/driver/dr_param_file.c +++ b/packages/zoltan/src/driver/dr_param_file.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Code imported to Zoltan zdrive from @@ -67,13 +30,8 @@ #include #include #include -#if defined(_WIN32) && !defined(__MINGW32__) #include -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#else #include -#endif #include "zoltan.h" #include "dr_param_file.h" #include "dr_const.h" @@ -86,7 +44,7 @@ fflush(stdout); \ fprintf(stderr,"in file %s, line %d, failed to allocate %ld bytes",\ __FILE__,__LINE__,size); \ - MPI_Abort(MPI_COMM_WORLD,1); \ + MPI_Abort(zoltan_get_global_comm(),1); \ } \ } @@ -137,7 +95,7 @@ void zoltanParams_hier_set_num_levels(int levels) { int i; #ifdef DEBUG - printf("(zoltanParams_hier_set_num_levels) setting to %d\n", levels); + printf("(zoltanParams_hier_set_num_levels) setting to %d\n", levels); fflush(stdout); #endif @@ -153,11 +111,11 @@ void zoltanParams_hier_set_num_levels(int levels) { num_levels = levels; - SAFE_MALLOC(zph, struct zoltanParams_hier_struct **, + SAFE_MALLOC(zph, struct zoltanParams_hier_struct **, (long)sizeof(struct zoltanParams_hier_struct *) * levels); for (i=0; ipartition = 0; zph[i]->first = NULL; @@ -170,7 +128,7 @@ void zoltanParams_hier_set_partition(int level, int partition) { int mypid; MPI_Comm_rank(comm, &mypid); - printf("[%d] will compute partition %d at level %d\n", + printf("[%d] will compute partition %d at level %d\n", mypid, partition, level); fflush(stdout); #endif @@ -185,7 +143,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { #ifdef DEBUG int mypid; MPI_Comm_rank(comm, &mypid); - printf("[%d] will set param <%s> to <%s> at level %d\n", + printf("[%d] will set param <%s> to <%s> at level %d\n", mypid, param, value, level); fflush(stdout); #endif @@ -197,7 +155,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { strcpy(newparam->param, param); strcpy(newparam->value, value); newparam->next = NULL; - + if (!zph[level]->first) { zph[level]->first = newparam; return; @@ -205,7 +163,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { nextparam = zph[level]->first; while (nextparam->next) nextparam=nextparam->next; - nextparam->next = newparam; + nextparam->next = newparam; } int zoltanParams_hier_get_num_levels() { @@ -225,7 +183,7 @@ void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr *ierr = ZOLTAN_OK; check_level(level); - + nextparam = zph[level]->first; while (nextparam) { @@ -233,7 +191,7 @@ void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr if (*ierr != ZOLTAN_OK) return; nextparam = nextparam->next; } - + } static int get_num_levels(void *data, int *ierr) { @@ -264,20 +222,20 @@ void zoltanParams_set_comm(MPI_Comm thecomm) { void zoltanParams_hier_setup(struct Zoltan_Struct *zz) { /* make sure the hierarchical balancing callbacks are in place */ - if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_NUM_LEVELS_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_NUM_LEVELS_FN_TYPE, (void (*)()) get_num_levels, NULL) == ZOLTAN_FATAL) { fprintf(stderr,"zoltanParams_hier_setup: set NUM_LEVELS callback failed\n"); } - if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_PART_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_PART_FN_TYPE, (void (*)()) get_partition, NULL) == ZOLTAN_FATAL) { fprintf(stderr,"zoltanParams_hier_setup: set PART callback failed\n"); } - if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_METHOD_FN_TYPE, + if (Zoltan_Set_Fn(zz, ZOLTAN_HIER_METHOD_FN_TYPE, (void (*)()) get_method, NULL) == ZOLTAN_FATAL) { fprintf(stderr,"zoltanParams_hier_setup: set METHOD callback failed\n"); - } + } } /* @@ -307,7 +265,7 @@ void zoltanParams_hier_setup(struct Zoltan_Struct *zz) { End file with EOF */ -void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, +void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, MPI_Comm thecomm) { FILE *fp; char str1[500], str2[500]; @@ -325,7 +283,7 @@ void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, if (!fp) { fprintf(stderr,"Cannot open file %s for reading", file); return; - } + } #ifdef DEBUG if (mypid == 0) { @@ -366,7 +324,7 @@ void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, while ((fscanf(fp, "%s %s\n", str1, str2) == 2) && (strcmp(str1, "LEVEL") != 0) && (strcmp(str2, "END") != 0)) { - + zoltanParams_hier_set_param(level, str1, str2); } } diff --git a/packages/zoltan/src/driver/dr_param_file.h b/packages/zoltan/src/driver/dr_param_file.h index bf5279d988..5e51eee328 100644 --- a/packages/zoltan/src/driver/dr_param_file.h +++ b/packages/zoltan/src/driver/dr_param_file.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Code imported to Zoltan zdrive from @@ -80,10 +43,10 @@ void zoltanParams_hier_set_partition(int level, int partition); void zoltanParams_hier_set_param(int level, char *param, char *value); int zoltanParams_hier_get_num_levels(); int zoltanParams_hier_get_partition(int level); -void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, +void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr); void zoltanParams_set_comm(MPI_Comm thecomm); void zoltanParams_hier_setup(struct Zoltan_Struct *zz); -void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, +void zoltanParams_read_file(struct Zoltan_Struct *lb, char *file, MPI_Comm thecomm); #endif diff --git a/packages/zoltan/src/driver/dr_param_fileCPP.cpp b/packages/zoltan/src/driver/dr_param_fileCPP.cpp index 22ce088704..e405ce4eb0 100644 --- a/packages/zoltan/src/driver/dr_param_fileCPP.cpp +++ b/packages/zoltan/src/driver/dr_param_fileCPP.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Code imported to Zoltan zdrive from @@ -78,7 +41,7 @@ fflush(stdout); \ fprintf(stderr,"in file %s, line %d, failed to allocate %ld bytes",\ __FILE__,__LINE__,size); \ - MPI_Abort(MPI_COMM_WORLD,1); \ + MPI_Abort(zoltan_get_global_comm(),1); \ } \ } @@ -128,7 +91,7 @@ void zoltanParams_hier_set_num_levels(int levels) { int i; #ifdef DEBUG - printf("(zoltanParams_hier_set_num_levels) setting to %d\n", levels); + printf("(zoltanParams_hier_set_num_levels) setting to %d\n", levels); fflush(stdout); #endif @@ -144,11 +107,11 @@ void zoltanParams_hier_set_num_levels(int levels) { num_levels = levels; - SAFE_MALLOC(zph, struct zoltanParams_hier_struct **, + SAFE_MALLOC(zph, struct zoltanParams_hier_struct **, (long)sizeof(struct zoltanParams_hier_struct *) * levels); for (i=0; ipartition = 0; zph[i]->first = NULL; @@ -161,7 +124,7 @@ void zoltanParams_hier_set_partition(int level, int partition) { int mypid; MPI_Comm_rank(comm, &mypid); - printf("[%d] will compute partition %d at level %d\n", + printf("[%d] will compute partition %d at level %d\n", mypid, partition, level); fflush(stdout); #endif @@ -176,7 +139,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { #ifdef DEBUG int mypid; MPI_Comm_rank(comm, &mypid); - printf("[%d] will set param <%s> to <%s> at level %d\n", + printf("[%d] will set param <%s> to <%s> at level %d\n", mypid, param, value, level); fflush(stdout); #endif @@ -188,7 +151,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { newparam->param = strdup(param); newparam->value = strdup(value); newparam->next = NULL; - + if (!zph[level]->first) { zph[level]->first = newparam; return; @@ -196,7 +159,7 @@ void zoltanParams_hier_set_param(int level, char *param, char *value) { nextparam = zph[level]->first; while (nextparam->next) nextparam=nextparam->next; - nextparam->next = newparam; + nextparam->next = newparam; } int zoltanParams_hier_get_num_levels() { @@ -216,7 +179,7 @@ void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr *ierr = ZOLTAN_OK; check_level(level); - + nextparam = zph[level]->first; while (nextparam) { @@ -224,7 +187,7 @@ void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr if (*ierr != ZOLTAN_OK) return; nextparam = nextparam->next; } - + } static int get_num_levels(void *data, int *ierr) { @@ -265,7 +228,7 @@ void zoltanParams_hier_setup(Zoltan &zz) { if (zz.Set_Hier_Method_Fn(get_method, NULL) == ZOLTAN_FATAL) { fprintf(stderr,"zoltanParams_hier_setup: set METHOD callback failed\n"); - } + } } /* @@ -295,7 +258,7 @@ void zoltanParams_hier_setup(Zoltan &zz) { End file with EOF */ -void zoltanParams_read_file(Zoltan &lb, char *file, +void zoltanParams_read_file(Zoltan &lb, char *file, MPI_Comm thecomm) { FILE *fp; char str1[500], str2[500]; @@ -313,7 +276,7 @@ void zoltanParams_read_file(Zoltan &lb, char *file, if (!fp) { fprintf(stderr,"Cannot open file %s for reading", file); return; - } + } #ifdef DEBUG if (mypid == 0) { @@ -354,7 +317,7 @@ void zoltanParams_read_file(Zoltan &lb, char *file, while ((fscanf(fp, "%s %s\n", str1, str2) == 2) && (strcmp(str1, "LEVEL") != 0) && (strcmp(str2, "END") != 0)) { - + zoltanParams_hier_set_param(level, str1, str2); } } diff --git a/packages/zoltan/src/driver/dr_param_fileCPP.h b/packages/zoltan/src/driver/dr_param_fileCPP.h index 7299a6ac89..879750ef57 100644 --- a/packages/zoltan/src/driver/dr_param_fileCPP.h +++ b/packages/zoltan/src/driver/dr_param_fileCPP.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Code imported to Zoltan zdrive from @@ -80,10 +43,10 @@ void zoltanParams_hier_set_partition(int level, int partition); void zoltanParams_hier_set_param(int level, char *param, char *value); int zoltanParams_hier_get_num_levels(); int zoltanParams_hier_get_partition(int level); -void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, +void zoltanParams_hier_use_params(int level, struct Zoltan_Struct *zz, int *ierr); void zoltanParams_set_comm(MPI_Comm thecomm); void zoltanParams_hier_setup(Zoltan &zz); -void zoltanParams_read_file(Zoltan &lb, char *file, +void zoltanParams_read_file(Zoltan &lb, char *file, MPI_Comm thecomm); #endif diff --git a/packages/zoltan/src/driver/dr_random_io.c b/packages/zoltan/src/driver/dr_random_io.c index e002b2987f..7b616a5da2 100644 --- a/packages/zoltan/src/driver/dr_random_io.c +++ b/packages/zoltan/src/driver/dr_random_io.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -157,7 +120,7 @@ int create_random_triangles( /* Generate random triangles and vertex weights. */ srand(0); - diff = 1.0/50.0; + diff = 1.0/50.0; switch (ndim) { case 1: @@ -176,7 +139,7 @@ int create_random_triangles( y[i+1] = y[i]; x[i+2] = x[i]; y[i+2] = y[i] + diff; - if (fpc != NULL) fprintf(fpc, "%e %e\n%e %e\n%e %e\n", + if (fpc != NULL) fprintf(fpc, "%e %e\n%e %e\n%e %e\n", x[i], y[i],x[i+1], y[i+1],x[i+2], y[i+2]); } break; @@ -191,7 +154,7 @@ int create_random_triangles( x[i+2] = x[i]; y[i+2] = y[i] + diff; z[i+2] = z[i]; - if (fpc != NULL) fprintf(fpc, "%e %e %e\n%e %e %e\n%e %e %e\n", + if (fpc != NULL) fprintf(fpc, "%e %e %e\n%e %e %e\n%e %e %e\n", x[i], y[i], z[i],x[i+1], y[i+1], z[i+1],x[i+2], y[i+2], z[i+2]); } break; @@ -247,9 +210,9 @@ int create_random_triangles( fprintf(fpg, "%d %d 010\n", nvtxs, nvtxs); else fprintf(fpg, "%d %d 010 %d\n", nvtxs, nvtxs, vwgt_dim); - + for (i = 0, w=0; i < nvtxs; i++, w += 2) { - for (j = 0; j < vwgt_dim; j++) + for (j = 0; j < vwgt_dim; j++) fprintf(fpg, "%e ", vwgts[i*vwgt_dim+j]); fprintf(fpg, "%d %d",adj[w],adj[w+1]); fprintf(fpg, "\n"); @@ -262,8 +225,8 @@ int create_random_triangles( /* Distribute graph */ - if (!chaco_dist_graph(MPI_COMM_WORLD, pio_info, 0, &gnvtxs, &nvtxs, - &start, &adj, &vwgt_dim, &vwgts, &ewgt_dim, &ewgts, + if (!chaco_dist_graph(zoltan_get_global_comm(), pio_info, 0, &gnvtxs, &nvtxs, + &start, &adj, &vwgt_dim, &vwgts, &ewgt_dim, &ewgts, &ndim, &x, &y, &z, &assignments)) { Gen_Error(0, "fatal: Error returned from chaco_dist_graph"); return 0; @@ -276,7 +239,7 @@ int create_random_triangles( return 0; } - + safe_free((void **)(void *) &adj); safe_free((void **)(void *) &vwgts); safe_free((void **)(void *) &ewgts); @@ -378,7 +341,7 @@ int create_random_input( } for (i = 0; i < nvtxs; i++) { - if (pio_info->init_vwgt_dim == 0) + if (pio_info->init_vwgt_dim == 0) /* Unit weights if no weights were requested. */ vwgts[i] = 1.0; else @@ -408,8 +371,8 @@ int create_random_input( fprintf(fpg, "%d %d 010 %d\n", nvtxs, start[nvtxs], vwgt_dim); } for (i = 0; i < nvtxs; i++) { - if (fpg != NULL) - for (j = 0; j < vwgt_dim; j++) + if (fpg != NULL) + for (j = 0; j < vwgt_dim; j++) fprintf(fpg, "%e ", vwgts[i*vwgt_dim+j]); /* KDDSJP Print edges here */ if (fpg != NULL) fprintf(fpg, "\n"); @@ -421,8 +384,8 @@ int create_random_input( /* Distribute graph */ - if (!chaco_dist_graph(MPI_COMM_WORLD, pio_info, 0, &gnvtxs, &nvtxs, - &start, &adj, &vwgt_dim, &vwgts, &ewgt_dim, &ewgts, + if (!chaco_dist_graph(zoltan_get_global_comm(), pio_info, 0, &gnvtxs, &nvtxs, + &start, &adj, &vwgt_dim, &vwgts, &ewgt_dim, &ewgts, &ndim, &x, &y, &z, &assignments)) { Gen_Error(0, "fatal: Error returned from chaco_dist_graph"); return 0; @@ -494,15 +457,15 @@ int create_a_graph( { const char *yo = "create_a_graph"; - /* The graph (and geometry) is created in parallel by each process, as opposed to being + /* The graph (and geometry) is created in parallel by each process, as opposed to being * created by process 0 and then dealt out to the other processes. This allows us to * create graphs where the number of vertices is larger than a number which would * fit in the memory of one process. * * Geometrically the graph is a cylinder extending in the z-direction. * - * Each process creates points along a circle in an x-y plane, and knows which process has the - * plane adjacent to it and what global ID has been assigned to the neighbors with the same + * Each process creates points along a circle in an x-y plane, and knows which process has the + * plane adjacent to it and what global ID has been assigned to the neighbors with the same * x and y value as its points. So adjacency information is easily created. */ @@ -518,7 +481,7 @@ int create_a_graph( float *ewgts = NULL, *vwgts = NULL; float *x = NULL, *y = NULL, *z = NULL; - double theta, delta, radius, m, length, step; + double theta, delta, radius, m, length, step; /***************************** BEGIN EXECUTION ******************************/ @@ -533,7 +496,7 @@ int create_a_graph( nvtxs = gnvtxs / Num_Proc; - if (nvtxs > 4){ + if (nvtxs > 4){ num4 = nvtxs / 4; nvtxs = num4 * 4; } @@ -570,7 +533,7 @@ int create_a_graph( step = 1.0 / 500.0; length = (double)nvtxs * step; x[0] = length * (float)Proc; - + for (i=1; i < nvtxs; i++){ x[i] = x[i+1] + step; } @@ -581,11 +544,11 @@ int create_a_graph( theta = (2 * M_PI ) / (double)Num_Proc; delta = theta / (double)nvtxs; m = (theta * Proc); - + for (i=0; i < nvtxs; i++, m += delta){ x[i] = radius * cos(m); y[i] = radius * sin(m); - } + } } else if (ndim == 3){ /* a cylinder */ @@ -623,7 +586,7 @@ int create_a_graph( } for (i = 0; i < nvtxs; i++) { - if (pio_info->init_vwgt_dim == 0) + if (pio_info->init_vwgt_dim == 0) /* Unit weights if no weights were requested. */ vwgts[i] = 1.0; else { @@ -676,7 +639,7 @@ int create_a_graph( } } } - else{ + else{ /* each vertex has 2 neighbors on this process, and one or two off process */ @@ -819,14 +782,14 @@ ZOLTAN_ID_TYPE min_vtx; /* write element data */ - for (i = 0; i < mesh->elem_array_len; i++) + for (i = 0; i < mesh->elem_array_len; i++) initialize_element(&(mesh->elements[i])); min_vtx = local_to_global_id_map(0, Proc); for (i = 0; i < nvtxs; i++) { mesh->elements[i].globalID = local_to_global_id_map(i, Proc); - + if (vwgts != NULL){ for (j=0; jelements[i].cpu_wgt[j] = vwgts[i*vwgt_dim+j]; @@ -843,7 +806,7 @@ ZOLTAN_ID_TYPE min_vtx; mesh->elements[i].connect = (ZOLTAN_ID_TYPE *) malloc(sizeof(ZOLTAN_ID_TYPE)); mesh->elements[i].connect[0] = mesh->elements[i].globalID; mesh->elements[i].coord = (float **) malloc(sizeof(float *)); - mesh->elements[i].coord[0] = (float *) calloc(mesh->num_dims, sizeof(float)); + mesh->elements[i].coord[0] = (float *) calloc(mesh->num_dims, sizeof(float)); mesh->elements[i].coord[0][0] = x[i]; mesh->elements[i].avg_coord[0] = x[i]; if (mesh->num_dims > 1) { @@ -890,7 +853,7 @@ ZOLTAN_ID_TYPE min_vtx; * if the adjacent element is on this processor * then find the local id for that element */ - if (k == Proc) + if (k == Proc) mesh->elements[i].adj[j] = elem_id-min_vtx; else /* use the global id */ mesh->elements[i].adj[j] = elem_id; diff --git a/packages/zoltan/src/driver/dr_setfixed.c b/packages/zoltan/src/driver/dr_setfixed.c index 14ad956324..d0d6cfeba3 100644 --- a/packages/zoltan/src/driver/dr_setfixed.c +++ b/packages/zoltan/src/driver/dr_setfixed.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -64,8 +27,8 @@ int i, part; int proc, nprocs; FILE *fp; - MPI_Comm_rank(MPI_COMM_WORLD, &proc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_rank(zoltan_get_global_comm(), &proc); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); /* Initialize fixed elements in mesh */ for (i = 0; i < mesh->num_elems; i++) mesh->elements[i].fixed_part = -1; @@ -142,7 +105,7 @@ FILE *fp; fprintf(stderr, "ERROR in opening file fixed.dat. No fixed vertices set.\n"); else { while (1){ - if (feof(fp)) break; + if (feof(fp)) break; /* read (i, part) for each fixed vertex */ fscanf(fp, "%i%i\n", &i, &part); if ((part >= 0) && (part < Num_Global_Parts)){ diff --git a/packages/zoltan/src/driver/dr_util.c b/packages/zoltan/src/driver/dr_util.c index 33645cf783..fc12dd51cd 100644 --- a/packages/zoltan/src/driver/dr_util.c +++ b/packages/zoltan/src/driver/dr_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include #include @@ -457,7 +420,7 @@ static void quickpart_pointer_inc_id_id ( int *sorted, ZOLTAN_ID_TYPE *val1, ZOLTAN_ID_TYPE *val2, int start, int end, int *equal, int *larger) { -int i, next; +int i, next; ZOLTAN_ID_TYPE key1, key1_next, key2, key2_next; i = (end + start) / 2; diff --git a/packages/zoltan/src/driver/dr_util_const.h b/packages/zoltan/src/driver/dr_util_const.h index 7ce96f96ed..c67b8a56d0 100644 --- a/packages/zoltan/src/driver/dr_util_const.h +++ b/packages/zoltan/src/driver/dr_util_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef _DR_UTIL_CONST_H_ diff --git a/packages/zoltan/src/driver/order_test.c b/packages/zoltan/src/driver/order_test.c index f7cf9bcb79..659c7f278d 100644 --- a/packages/zoltan/src/driver/order_test.c +++ b/packages/zoltan/src/driver/order_test.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { diff --git a/packages/zoltan/src/fdriver/CMakeLists.txt b/packages/zoltan/src/fdriver/CMakeLists.txt index 9c9619311b..1e6409e652 100644 --- a/packages/zoltan/src/fdriver/CMakeLists.txt +++ b/packages/zoltan/src/fdriver/CMakeLists.txt @@ -2,15 +2,15 @@ IF(${PROJECT_NAME}_ENABLE_Fortran AND BUILD_ZOLTAN_F90_INTERFACE) SET(ZFDRIVE_SOURCES - fdr_migrate.f90 - fdr_sort.f90 - fdr_main.f90 - fdr_loadbal.f90 - fdr_input.f90 - fdr_param_file.f90 - fdr_chaco_io.f90 - fdr_mm_io.f90 - fdr_const.f90 + fdr_migrate.f90 + fdr_sort.f90 + fdr_main.f90 + fdr_loadbal.f90 + fdr_input.f90 + fdr_param_file.f90 + fdr_chaco_io.f90 + fdr_mm_io.f90 + fdr_const.f90 mmio.f mpi_h.f ) diff --git a/packages/zoltan/src/fdriver/Makefile.am b/packages/zoltan/src/fdriver/Makefile.am index 3c6200d4e4..49f6ed8ecf 100644 --- a/packages/zoltan/src/fdriver/Makefile.am +++ b/packages/zoltan/src/fdriver/Makefile.am @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER include $(top_builddir)/Makefile.export.zoltan diff --git a/packages/zoltan/src/fdriver/Makefile.in b/packages/zoltan/src/fdriver/Makefile.in index 11cd994e0a..59434d85ba 100644 --- a/packages/zoltan/src/fdriver/Makefile.in +++ b/packages/zoltan/src/fdriver/Makefile.in @@ -15,49 +15,6 @@ @SET_MAKE@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -287,7 +244,7 @@ zfdrive_SOURCES = \ $(srcdir)/fdr_mm_io.f90 \ $(srcdir)/fdr_migrate.f90 \ $(srcdir)/fdr_loadbal.f90 \ - $(srcdir)/fdr_main.f90 + $(srcdir)/fdr_main.f90 zfdrive_DEPENDENCIES = \ $(ZOLTAN_DEPS) @@ -341,7 +298,7 @@ $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -zfdrive$(EXEEXT): $(zfdrive_OBJECTS) $(zfdrive_DEPENDENCIES) $(EXTRA_zfdrive_DEPENDENCIES) +zfdrive$(EXEEXT): $(zfdrive_OBJECTS) $(zfdrive_DEPENDENCIES) $(EXTRA_zfdrive_DEPENDENCIES) @rm -f zfdrive$(EXEEXT) $(F77LINK) $(zfdrive_OBJECTS) $(zfdrive_LDADD) $(LIBS) diff --git a/packages/zoltan/src/fdriver/README.mpich b/packages/zoltan/src/fdriver/README.mpich index 19b5851f78..2828090cc8 100644 --- a/packages/zoltan/src/fdriver/README.mpich +++ b/packages/zoltan/src/fdriver/README.mpich @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER I had the darndest time getting MPICH to work on Linux because they use command line arguments, which is not standard in Fortran. I do not yet know how much this effects other operating systems with one f90. Under the default build of diff --git a/packages/zoltan/src/fdriver/farg_nagf95.f b/packages/zoltan/src/fdriver/farg_nagf95.f index ca73dcc3b5..3b418a114a 100644 --- a/packages/zoltan/src/fdriver/farg_nagf95.f +++ b/packages/zoltan/src/fdriver/farg_nagf95.f @@ -1,48 +1,13 @@ -!! +!! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! ! Command line argument functions for NAGWare f95 4.0 @@ -60,3 +25,4 @@ subroutine mpir_getarg( i, s ) call getarg(i,s,lenarg,ierr) return end + diff --git a/packages/zoltan/src/fdriver/farg_typical.f b/packages/zoltan/src/fdriver/farg_typical.f index ea4da700dc..51c7e973df 100644 --- a/packages/zoltan/src/fdriver/farg_typical.f +++ b/packages/zoltan/src/fdriver/farg_typical.f @@ -1,48 +1,13 @@ -!! +!! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! ! Command line argument functions for typical iargc, getarg implementations diff --git a/packages/zoltan/src/fdriver/fdr_chaco_io.f90 b/packages/zoltan/src/fdriver/fdr_chaco_io.f90 index 22e92b54d9..ac45fe81f0 100644 --- a/packages/zoltan/src/fdriver/fdr_chaco_io.f90 +++ b/packages/zoltan/src/fdriver/fdr_chaco_io.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module dr_chaco_io use zoltan @@ -139,7 +104,7 @@ logical function read_chaco_mesh(Proc, Num_Proc, prob, pio_info, elements) endif ! Proc == 0 ! Distribute graph - if (.not.chaco_dist_graph(MPI_COMM_WORLD, 0, nvtxs, vtxdist, start, adj, & + if (.not.chaco_dist_graph(zoltan_get_global_comm(), 0, nvtxs, vtxdist, start, adj, & vwgts, ewgts, ndim, x, y, z)) then print *, "fatal: Error returned from chaco_dist_graph" read_chaco_mesh = .false. diff --git a/packages/zoltan/src/fdriver/fdr_const.f90 b/packages/zoltan/src/fdriver/fdr_const.f90 index b259610841..4552e8087d 100644 --- a/packages/zoltan/src/fdriver/fdr_const.f90 +++ b/packages/zoltan/src/fdriver/fdr_const.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------- ! File dr_const.h translated to Fortran by William F. Mitchell ! diff --git a/packages/zoltan/src/fdriver/fdr_input.f90 b/packages/zoltan/src/fdriver/fdr_input.f90 index de6abee595..2f977cc486 100644 --- a/packages/zoltan/src/fdriver/fdr_input.f90 +++ b/packages/zoltan/src/fdriver/fdr_input.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module dr_input use zoltan use dr_const @@ -410,23 +375,23 @@ subroutine brdcst_cmd_info(Proc, prob, pio_info) integer(Zoltan_INT) :: ierr, i !**************************** BEGIN EXECUTION ***************************** - call MPI_Bcast(Test_Multi_Callbacks, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(Test_Local_Partitions, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(Test_Drops, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(Test_Gen_Files, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(Driver_Action, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%dsk_list_cnt, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%rdisk, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%num_dsk_ctrlrs, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%pdsk_add_fact, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%zeros, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(pio_info%file_type, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + call MPI_Bcast(Test_Multi_Callbacks, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(Test_Local_Partitions, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(Test_Drops, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(Test_Gen_Files, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(Driver_Action, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%dsk_list_cnt, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%rdisk, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%num_dsk_ctrlrs, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%pdsk_add_fact, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%zeros, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(pio_info%file_type, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) call MPI_Bcast(pio_info%pdsk_root, len(pio_info%pdsk_root), MPI_CHARACTER, & - 0, MPI_COMM_WORLD, ierr) + 0, zoltan_get_global_comm(), ierr) call MPI_Bcast(pio_info%pdsk_subdir, len(pio_info%pdsk_root), MPI_CHARACTER, & - 0, MPI_COMM_WORLD, ierr) + 0, zoltan_get_global_comm(), ierr) call MPI_Bcast(pio_info%pexo_fname, len(pio_info%pdsk_root), MPI_CHARACTER, & - 0, MPI_COMM_WORLD, ierr) + 0, zoltan_get_global_comm(), ierr) if(pio_info%dsk_list_cnt > 0) then if(Proc /= 0) then @@ -434,16 +399,16 @@ subroutine brdcst_cmd_info(Proc, prob, pio_info) endif call MPI_Bcast(pio_info%dsk_list, pio_info%dsk_list_cnt, MPI_INTEGER, & - 0, MPI_COMM_WORLD, ierr) + 0, zoltan_get_global_comm(), ierr) endif ! broadcast the param file name call MPI_Bcast(prob%ztnPrm_file, len(prob%ztnPrm_file), MPI_CHARACTER, & - 0, MPI_COMM_WORLD, ierr) + 0, zoltan_get_global_comm(), ierr) ! and broadcast the problem specifications - call MPI_Bcast(prob%method, len(prob%method), MPI_CHARACTER, 0,MPI_COMM_WORLD,ierr) - call MPI_Bcast(prob%num_params, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + call MPI_Bcast(prob%method, len(prob%method), MPI_CHARACTER, 0,zoltan_get_global_comm(),ierr) + call MPI_Bcast(prob%num_params, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) if (prob%num_params > 0) then size = len(prob%params(0)%str(0)) if (Proc /= 0) then @@ -451,9 +416,9 @@ subroutine brdcst_cmd_info(Proc, prob, pio_info) endif do i=0,prob%num_params-1 call MPI_Bcast(prob%params(i)%str(0), size, MPI_CHARACTER, 0, & - MPI_COMM_WORLD, ierr) + zoltan_get_global_comm(), ierr) call MPI_Bcast(prob%params(i)%str(1), size, MPI_CHARACTER, 0, & - MPI_COMM_WORLD, ierr) + zoltan_get_global_comm(), ierr) end do endif diff --git a/packages/zoltan/src/fdriver/fdr_loadbal.f90 b/packages/zoltan/src/fdriver/fdr_loadbal.f90 index 4b6a99dfd1..9f37e77e6e 100644 --- a/packages/zoltan/src/fdriver/fdr_loadbal.f90 +++ b/packages/zoltan/src/fdriver/fdr_loadbal.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module dr_loadbal use zoltan use zoltan_user_data @@ -135,7 +100,7 @@ logical function run_zoltan(Proc, prob, pio_info) ! Allocate space for arrays. - call MPI_Comm_size(MPI_COMM_WORLD, nprocs, ierr) + call MPI_Comm_size(zoltan_get_global_comm(), nprocs, ierr) allocate(psize(nprocs)) allocate(partid(nprocs)) allocate(idx(nprocs)) @@ -143,7 +108,7 @@ logical function run_zoltan(Proc, prob, pio_info) ! ! * Create a load-balancing object. ! - zz_obj => Zoltan_Create(MPI_COMM_WORLD) + zz_obj => Zoltan_Create(zoltan_get_global_comm()) if (.not.associated(zz_obj)) then print *, "fatal: NULL object returned from Zoltan_Create()" run_zoltan = .false. @@ -168,7 +133,7 @@ logical function run_zoltan(Proc, prob, pio_info) ! note: contents of this file may override the parameters set above if (prob%ztnPrm_file /= "") then call ztnPrm_read_file(zz_obj, prob%ztnPrm_file, & - MPI_COMM_WORLD) + zoltan_get_global_comm()) endif ! @@ -1027,7 +992,7 @@ subroutine get_edge_list (data, num_gid_entries, num_lid_entries, & endif ! get the processor number - call MPI_Comm_rank(MPI_COMM_WORLD, proc, mpierr) + call MPI_Comm_rank(zoltan_get_global_comm(), proc, mpierr) j = 1 do i = 0, current_elem%adj_len-1 @@ -1239,7 +1204,7 @@ subroutine test_drops_rtn(Proc, mesh, pio_info, zz) mesh => Mesh ! Find maximum partition number across all processors. - call MPI_Comm_size(MPI_COMM_WORLD, Num_Proc, ierr) + call MPI_Comm_size(zoltan_get_global_comm(), Num_Proc, ierr) max_part = -1 gmax_part = -1 do i = 0, mesh%num_elems-1 @@ -1248,7 +1213,7 @@ subroutine test_drops_rtn(Proc, mesh, pio_info, zz) endif end do call MPI_Allreduce(max_part, gmax_part, 1, MPI_INTEGER, MPI_MAX, & - MPI_COMM_WORLD, ierr) + zoltan_get_global_comm(), ierr) if ((gmax_part == (Num_Proc-1)) .and. (Test_Local_Partitions == 0)) then test_both = 1 else diff --git a/packages/zoltan/src/fdriver/fdr_main.f90 b/packages/zoltan/src/fdriver/fdr_main.f90 index 5ea8a94b44..70be65a453 100644 --- a/packages/zoltan/src/fdriver/fdr_main.f90 +++ b/packages/zoltan/src/fdriver/fdr_main.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------------- ! Purpose: Driver for dynamic load-balance library, ZOLTAN. @@ -138,8 +103,8 @@ end function output_results call MPI_Init(error) ! get some machine information - call MPI_Comm_rank(MPI_COMM_WORLD, Proc, error) - call MPI_Comm_size(MPI_COMM_WORLD, Num_Proc, error) + call MPI_Comm_rank(zoltan_get_global_comm(), Proc, error) + call MPI_Comm_size(zoltan_get_global_comm(), Num_Proc, error) call MPI_Get_processor_name(procname, namelen, error) print *,"Processor ",Proc," of ",Num_Proc," on host ",procname(1:namelen) diff --git a/packages/zoltan/src/fdriver/fdr_migrate.f90 b/packages/zoltan/src/fdriver/fdr_migrate.f90 index b79e404bd4..f1ac82f7b1 100644 --- a/packages/zoltan/src/fdriver/fdr_migrate.f90 +++ b/packages/zoltan/src/fdriver/fdr_migrate.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module dr_migrate @@ -265,7 +230,7 @@ subroutine migrate_pre_process(data, num_gid_entries, num_lid_entries, & endif ! Make sure all procs have the same value. call MPI_Allreduce(flag, Use_Edge_Wgts, 1, MPI_LOGICAL, MPI_LOR, & - MPI_COMM_WORLD, mpierr) + zoltan_get_global_comm(), mpierr) ! @@ -276,7 +241,7 @@ subroutine migrate_pre_process(data, num_gid_entries, num_lid_entries, & if (Mesh%num_elems == 0) return ! No elements to update - call MPI_Comm_rank(MPI_COMM_WORLD, proc, mpierr) + call MPI_Comm_rank(zoltan_get_global_comm(), proc, mpierr) ! ! * Build New_Elem_Index array and list of processor assignments. @@ -515,8 +480,8 @@ subroutine migrate_post_process(data, num_gid_entries, num_lid_entries, & integer(Zoltan_INT) :: adj_elem - call MPI_Comm_rank(MPI_COMM_WORLD, proc, mpierr) - call MPI_Comm_size(MPI_COMM_WORLD, num_proc, mpierr) + call MPI_Comm_rank(zoltan_get_global_comm(), proc, mpierr) + call MPI_Comm_size(zoltan_get_global_comm(), num_proc, mpierr) ! compact elements array, as the application expects the array to be dense do i = 0, New_Elem_Index_Size-1 @@ -713,7 +678,7 @@ subroutine migrate_pack_elem(data, num_gid_entries, num_lid_entries, & gid = num_gid_entries; lid = num_lid_entries; - call MPI_Comm_rank(MPI_COMM_WORLD, proc, mpierr) + call MPI_Comm_rank(zoltan_get_global_comm(), proc, mpierr) if (num_lid_entries.gt.0) then @@ -862,7 +827,7 @@ subroutine migrate_unpack_elem(data, num_gid_entries, & gid = num_gid_entries; - call MPI_Comm_rank(MPI_COMM_WORLD, proc, mpierr) + call MPI_Comm_rank(zoltan_get_global_comm(), proc, mpierr) idx = in_list(elem_gid(gid), New_Elem_Index_Size, New_Elem_Index) @@ -1014,7 +979,7 @@ subroutine boundary_exchange(vec_len,send_vec,recv_vec) do i = 0, Mesh%necmap-1 ! RISKY old style assumption the address of recv_vec(offset) is passed call MPI_Irecv(recv_vec(offset), Mesh%ecmap_cnt(i), MPI_INTEGER, & - Mesh%ecmap_id(i), msg_type, MPI_COMM_WORLD, req(i), ierr) + Mesh%ecmap_id(i), msg_type, zoltan_get_global_comm(), req(i), ierr) offset = offset + Mesh%ecmap_cnt(i) end do @@ -1023,7 +988,7 @@ subroutine boundary_exchange(vec_len,send_vec,recv_vec) do i = 0, Mesh%necmap-1 ! RISKY old style assumption the address of send_vec(offset) is passed call MPI_Send(send_vec(offset), Mesh%ecmap_cnt(i), MPI_INTEGER, & - Mesh%ecmap_id(i), msg_type, MPI_COMM_WORLD, ierr) + Mesh%ecmap_id(i), msg_type, zoltan_get_global_comm(), ierr) offset = offset + Mesh%ecmap_cnt(i) end do diff --git a/packages/zoltan/src/fdriver/fdr_mm_io.f90 b/packages/zoltan/src/fdriver/fdr_mm_io.f90 index 2b36f1bde1..e7234c0d0b 100644 --- a/packages/zoltan/src/fdriver/fdr_mm_io.f90 +++ b/packages/zoltan/src/fdriver/fdr_mm_io.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module dr_mm_io use zoltan @@ -210,9 +175,9 @@ logical function read_mm_file(Proc, Num_Proc, prob, pio_info) endif ! Proc == 0 ! BCast pertinent info to all procs. - call MPI_Bcast(mm_ncol, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(mm_nrow, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) - call MPI_Bcast(mm_nnz, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + call MPI_Bcast(mm_ncol, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(mm_nrow, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) + call MPI_Bcast(mm_nnz, 1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Assume linear distribution of vertices. @@ -318,7 +283,7 @@ logical function read_mm_file(Proc, Num_Proc, prob, pio_info) endif ! Allocate arrays to receive pins. - call MPI_Bcast(pindist, Num_Proc+1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr); + call MPI_Bcast(pindist, Num_Proc+1, MPI_INTEGER, 0, zoltan_get_global_comm(), ierr); npins = pindist(Proc+1) - pindist(Proc) allocate(iidx(0:npins-1),stat=allocstat) allocate(jidx(0:npins-1),stat=allocstat) @@ -330,9 +295,9 @@ logical function read_mm_file(Proc, Num_Proc, prob, pio_info) do i = 1, Num_Proc-1 sendsize = pindist(i+1)-pindist(i) call MPI_Send(mm_iidx(pindist(i)), sendsize, MPI_INTEGER, & - i, 1, MPI_COMM_WORLD, ierr) + i, 1, zoltan_get_global_comm(), ierr) call MPI_Send(mm_jidx(pindist(i)), sendsize, MPI_INTEGER, & - i, 2, MPI_COMM_WORLD, ierr) + i, 2, zoltan_get_global_comm(), ierr) enddo ! Copy Proc zero's pins. do i = 0, pindist(1)-1 @@ -340,9 +305,9 @@ logical function read_mm_file(Proc, Num_Proc, prob, pio_info) jidx(i) = mm_jidx(i) enddo else - call MPI_Recv(iidx, npins, MPI_INTEGER, 0, 1, MPI_COMM_WORLD, & + call MPI_Recv(iidx, npins, MPI_INTEGER, 0, 1, zoltan_get_global_comm(), & status, ierr) - call MPI_Recv(jidx, npins, MPI_INTEGER, 0, 2, MPI_COMM_WORLD, & + call MPI_Recv(jidx, npins, MPI_INTEGER, 0, 2, zoltan_get_global_comm(), & status, ierr) endif diff --git a/packages/zoltan/src/fdriver/fdr_param_file.f90 b/packages/zoltan/src/fdriver/fdr_param_file.f90 index 180776f221..57aa97592b 100644 --- a/packages/zoltan/src/fdriver/fdr_param_file.f90 +++ b/packages/zoltan/src/fdriver/fdr_param_file.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! ! *************************************************************************** ! ! Code imported to Zoltan zdrive from diff --git a/packages/zoltan/src/fdriver/fdr_sort.f90 b/packages/zoltan/src/fdriver/fdr_sort.f90 index b4a76530a1..52dd02f026 100644 --- a/packages/zoltan/src/fdriver/fdr_sort.f90 +++ b/packages/zoltan/src/fdriver/fdr_sort.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------------- ! Purpose: Driver for dynamic load-balance library, ZOLTAN. diff --git a/packages/zoltan/src/fdriver/makefile b/packages/zoltan/src/fdriver/makefile index 68b2f0905d..bd24be13d4 100644 --- a/packages/zoltan/src/fdriver/makefile +++ b/packages/zoltan/src/fdriver/makefile @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ZOD = ../$(ZOLTAN_OBJ_DIR) ZOM = $(F90_MODULE_PREFIX)$(ZOD) diff --git a/packages/zoltan/src/fdriver/mmio.f b/packages/zoltan/src/fdriver/mmio.f index 6a22252758..339f834690 100644 --- a/packages/zoltan/src/fdriver/mmio.f +++ b/packages/zoltan/src/fdriver/mmio.f @@ -1,6 +1,14 @@ +c @HEADER +c ***************************************************************************** +c Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +c +c Copyright 2012 NTESS and the Zoltan contributors. +c SPDX-License-Identifier: BSD-3-Clause +c ***************************************************************************** +c @HEADER subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, * indx,jndx,ival,rval,cval) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c This routine will read data from a matrix market formatted file. c The data may be either sparse coordinate format, or dense array format. @@ -14,66 +22,66 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, c -fixed non-ansi zero stringlength c -incorrect size calculation for skew-symmetric arrays c Other changes in mmio.f: -c -added integer value parameter to calling sequences +c -added integer value parameter to calling sequences c -enforced proper count in size info line c -added routine to count words in string (countwd) c (Thanks to G.P.Leendetse and H.Oudshoom for their review c of the initial version and suggested fixes.) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Arguments: c c name type in/out description c --------------------------------------------------------------- -c +c c iunit integer in Unit identifier for the file c containing the data to be read. c Must be open prior to call. c Will be rewound on return. -c -c rep character*10 out Matrix Market 'representation' +c +c rep character*10 out Matrix Market 'representation' c indicator. On return: -c +c c coordinate (for sparse data) c array (for dense data) -c elemental (to be added) -c +c elemental (to be added) +c c field character*7 out Matrix Market 'field'. On return: -c -c real +c +c real c complex c integer c pattern -c +c c symm character*19 out Matrix Market 'field'. On return: -c +c c symmetric c hermitian c skew-symmetric -c general -c +c general +c c rows integer out Number of rows in matrix. -c +c c cols integer out Number of columns in matrix. -c +c c nnz integer out Number of nonzero entries required to c store matrix. -c +c c nnzmax integer in Maximum dimension of data arrays. -c +c c indx integer(nnz)out Row indices for coordinate format. c Undefined for array format. -c +c c jndx integer(nnz)out Column indices for coordinate format. c Undefined for array format. -c +c c ival integer(nnz) out Integer data (if applicable, see 'field') -c +c c rval double(nnz) out Real data (if applicable, see 'field') -c +c c cval complex(nnz)out Complex data (if applicable, see 'field') -c -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +c +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Declarations: c @@ -126,10 +134,10 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, c if (rep .ne. 'coordinate' .and. rep .ne. 'array' ) * go to 6000 - if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. - * field .ne. 'real' .and. field .ne. 'complex' .and. + if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. + * field .ne. 'real' .and. field .ne. 'complex' .and. * field .ne. 'pattern') go to 7000 - if (rep .eq. 'array' .and. field .ne. 'integer' .and. + if (rep .eq. 'array' .and. field .ne. 'integer' .and. * field .ne. 'real' .and. field .ne. 'complex' ) go to 8000 if (symm .ne. 'general' .and. symm .ne. 'symmetric' .and. * symm .ne. 'hermitian' .and. symm .ne. 'skew-symmetric') @@ -165,7 +173,7 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, c backspace (iunit) c - if ( rep .eq. 'coordinate' ) then + if ( rep .eq. 'coordinate' ) then c c Read matrix in sparse coordinate format c @@ -175,7 +183,7 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, c if ( nnz .gt. nnzmax ) then print *,'insufficent array lengths for matrix of ',nnz, - * ' nonzeros.' + * ' nonzeros.' print *,'resize nnzmax to at least ',nnz,'. (currently ', * nnzmax,')' stop @@ -199,8 +207,8 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, elseif ( field .eq. 'pattern' ) then do 50 i=1,nnz read (iunit,fmt=*,end=4000) indx(i),jndx(i) - 50 continue - else + 50 continue + else print *,'''',field,''' data type not recognized.' stop endif @@ -219,7 +227,7 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, nnzreq = (rows*cols - rows)/2 + rows nnz = nnzreq elseif ( symm .eq. 'skew-symmetric' ) then - nnzreq = (rows*cols - rows)/2 + nnzreq = (rows*cols - rows)/2 nnz = nnzreq else nnzreq = rows*cols @@ -313,17 +321,17 @@ subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax, print *, ' hermitian' print *, ' skew-symmetric' stop -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc end -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c End of subroutine mmread -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c -c This routine will read header information from a Matrix Market -c formatted file. +c This routine will read header information from a Matrix Market +c formatted file. c c The unit iunit must be open, and the file will be rewound on return. c @@ -334,50 +342,50 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) c -fixed non-ansi zero stringlength c -incorrect size calculation for skew-symmetric arrays c Other changes in mmio.f: -c -added integer value parameter to calling sequences +c -added integer value parameter to calling sequences c -enforced proper count in size info line c -added routine to count words in string (countwd) c (Thanks to G.P.Leendetse and H.Oudshoom for their review c of the initial version and suggested fixes.) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Arguments: c c name type in/out description c --------------------------------------------------------------- -c +c c iunit integer in Unit identifier for the open file c containing the data to be read. -c -c rep character*10 out Matrix Market 'representation' +c +c rep character*10 out Matrix Market 'representation' c indicator. On return: -c +c c coordinate (for sparse data) c array (for dense data) -c elemental (to be added) -c +c elemental (to be added) +c c field character*7 out Matrix Market 'field'. On return: -c -c real +c +c real c complex c integer c pattern -c +c c symm character*19 out Matrix Market 'field'. On return: -c +c c symmetric c hermitian c skew-symmetric -c general -c +c general +c c rows integer out Number of rows in matrix. -c +c c cols integer out Number of columns in matrix. -c -c nnz integer out Number of nonzero entries required to store +c +c nnz integer out Number of nonzero entries required to store c the matrix. -c -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +c +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Declarations: c @@ -427,10 +435,10 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) c if (rep .ne. 'coordinate' .and. rep .ne. 'array' ) * go to 6000 - if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. - * field .ne. 'real' .and. field .ne. 'complex' .and. + if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. + * field .ne. 'real' .and. field .ne. 'complex' .and. * field .ne. 'pattern') go to 7000 - if (rep .eq. 'array' .and. field .ne. 'integer' .and. + if (rep .eq. 'array' .and. field .ne. 'integer' .and. * field .ne. 'real' .and. field .ne. 'complex' ) go to 8000 if (symm .ne. 'general' .and. symm .ne. 'symmetric' .and. * symm .ne. 'hermitian' .and. symm .ne. 'skew-symmetric') @@ -442,7 +450,7 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) 200 format(1a) c KDDKDD Changed max number of comment lines j from 2 to 50, as "do 10" loop c KDDKDD wasn't working with j=2 - j = 50 + j = 50 do 10 i=1,j if ( tmp2(1:1) .ne. '%' ) then go to 20 @@ -470,13 +478,13 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) c backspace (iunit) c - if ( rep .eq. 'coordinate' ) then + if ( rep .eq. 'coordinate' ) then c c Read matrix in sparse coordinate format c read (iunit,fmt=*) rows,cols,nnz c -c Rewind before returning +c Rewind before returning c rewind(iunit) return @@ -489,12 +497,12 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) if ( symm .eq. 'symmetric' .or. symm .eq. 'hermitian' ) then nnz = (rows*cols - rows)/2 + rows elseif ( symm .eq. 'skew-symmetric' ) then - nnz = (rows*cols - rows)/2 + nnz = (rows*cols - rows)/2 else nnz = rows*cols endif c -c Rewind before returning +c Rewind before returning c rewind(iunit) return @@ -553,15 +561,15 @@ subroutine mminfo(iunit,rep,field,symm,rows,cols,nnz) print *, ' hermitian' print *, ' skew-symmetric' stop -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc end -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -c End of subroutine mmread -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +c End of subroutine mmread +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, * indx,jndx,ival,rval,cval) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c This routine will write data to a matrix market formatted file. c The data may be either sparse coordinate format, or dense array format. @@ -575,63 +583,63 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, c -fixed non-ansi zero stringlength c -incorrect size calculation for skew-symmetric arrays c Other changes in mmio.f: -c -added integer value parameter to calling sequences +c -added integer value parameter to calling sequences c -enforced proper count in size info line c -added routine to count words in string (countwd) c (Thanks to G.P.Leendetse and H.Oudshoom for their review c of the initial version and suggested fixes.) -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Arguments: c c name type in/out description c --------------------------------------------------------------- -c +c c ounit integer in Unit identifier for the file c to which the data will be written. c Must be open prior to call. -c -c rep character* in Matrix Market 'representation' +c +c rep character* in Matrix Market 'representation' c indicator. Valid inputs: -c +c c coordinate (for sparse data) c array (for dense data) -c *elemental* (to be added) -c +c *elemental* (to be added) +c c field character* in Matrix Market 'field'. Valid inputs: -c -c real +c +c real c complex c integer c pattern (not valid for dense arrays) -c +c c symm character* in Matrix Market 'field'. Valid inputs: -c +c c symmetric c hermitian c skew-symmetric -c general -c +c general +c c rows integer in Number of rows in matrix. -c +c c cols integer in Number of columns in matrix. -c +c c nnz integer in Number of nonzero entries in matrix. c (rows*cols for array matrices) -c +c c indx integer(nnz)in Row indices for coordinate format. c Undefined for array format. -c +c c jndx integer(nnz)in Column indices for coordinate format. c Undefined for array format. -c +c c ival integer(nnz) in Integer data (if applicable, see 'field') -c +c c rval double(nnz) in Real data (if applicable, see 'field') -c +c c cval complex(nnz)in Complex data (if applicable, see 'field') -c -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +c +ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Declarations: c @@ -647,10 +655,10 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, c if (rep .ne. 'coordinate' .and. rep .ne. 'array' ) * go to 1000 - if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. - * field .ne. 'real' .and. field .ne. 'complex' .and. + if (rep .eq. 'coordinate' .and. field .ne. 'integer' .and. + * field .ne. 'real' .and. field .ne. 'complex' .and. * field .ne. 'pattern') go to 2000 - if (rep .eq. 'array' .and. field .ne. 'integer' .and. + if (rep .eq. 'array' .and. field .ne. 'integer' .and. * field .ne. 'real' .and. field .ne. 'complex' ) go to 3000 if (symm .ne. 'general' .and. symm .ne. 'symmetric' .and. * symm .ne. 'hermitian' .and. symm .ne. 'skew-symmetric') @@ -680,7 +688,7 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, * real(cval(i)),aimag(cval(i)) 30 continue else -c field .eq. 'pattern' +c field .eq. 'pattern' do 40 i=1,nnzreq write(unit=ounit,fmt=*)indx(i),jndx(i) 40 continue @@ -689,12 +697,12 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, c rep .eq. 'array' if ( symm .eq. 'general' ) then nnzreq = rows*cols - elseif ( symm .eq. 'symmetric' .or. + elseif ( symm .eq. 'symmetric' .or. * symm .eq. 'hermitian' ) then nnzreq = (rows*cols - rows)/2 + rows - else -c symm .eq. 'skew-symmetric' - nnzreq = (rows*cols - rows)/2 + else +c symm .eq. 'skew-symmetric' + nnzreq = (rows*cols - rows)/2 endif write(unit=ounit,fmt=*)rows,cols if ( field .eq. 'integer' ) then @@ -706,7 +714,7 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, write(unit=ounit,fmt=*)rval(i) 60 continue else -c field .eq. 'complex' +c field .eq. 'complex' do 70 i=1,nnzreq write(unit=ounit,fmt=*)real(cval(i)),aimag(cval(i)) 70 continue @@ -741,17 +749,17 @@ subroutine mmwrite(ounit,rep,field,symm,rows,cols,nnz, print *, ' hermitian' print *, ' skew-symmetric' stop -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc end -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c End of subroutine mmwrite -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine lowerc(string,pos,len) -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Convert uppercase letters to lowercase letters in string with c starting postion pos and length len. -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc integer pos, len character*(*) string @@ -768,17 +776,17 @@ subroutine lowerc(string,pos,len) end subroutine getwd(word,string,slen,start,next,wlen) -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Getwd extracts the first word from string starting c at position start. On return, next is the position -c of the blank which terminates the word in string. +c of the blank which terminates the word in string. c If the found word is longer than the allocated space -c for the word in the calling program, the word will be +c for the word in the calling program, the word will be c truncated to fit. c Count is set to the length of the word found. -c +c c 30-Oct-96 Bug fix: fixed non-ansi zero stringlength -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc integer slen, start, next, begin, space, wlen character*(*) word character*(*) string @@ -804,11 +812,11 @@ subroutine getwd(word,string,slen,start,next,wlen) end subroutine countwd(string,slen,start,count) -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Countwd counts the number of words in string starting c at position start. On return, count is the number of words. c 30-Oct-96 Routine added -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc character*(*) string integer slen, start, next, wordlength, count character tmp2*2 diff --git a/packages/zoltan/src/fdriver/mpi_h.f b/packages/zoltan/src/fdriver/mpi_h.f index a28c261993..71556826ca 100644 --- a/packages/zoltan/src/fdriver/mpi_h.f +++ b/packages/zoltan/src/fdriver/mpi_h.f @@ -1,57 +1,22 @@ -!! +!! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------------- -! Purpose: Provide the MPI include file as a module. +! Purpose: Provide the MPI include file as a module. !-------------------------------------------------------------------------- -! Author(s): William F. Mitchell +! Author(s): William F. Mitchell !-------------------------------------------------------------------------- !-------------------------------------------------------------------------- -! Revision History: -! 2 September 1999: Date of creation. +! Revision History: +! 2 September 1999: Date of creation. !-------------------------------------------------------------------------- module mpi_h diff --git a/packages/zoltan/src/fdriver/zoltan_user_data.f90.old b/packages/zoltan/src/fdriver/zoltan_user_data.f90.old index 6557521726..d3a80467c0 100644 --- a/packages/zoltan/src/fdriver/zoltan_user_data.f90.old +++ b/packages/zoltan/src/fdriver/zoltan_user_data.f90.old @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module zoltan_user_data use zoltan_types implicit none diff --git a/packages/zoltan/src/fort/README b/packages/zoltan/src/fort/README index 319036d713..c6b6cc4496 100644 --- a/packages/zoltan/src/fort/README +++ b/packages/zoltan/src/fort/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER FORT DIRECTORY -- F90 interface. diff --git a/packages/zoltan/src/fort/cwrap.c b/packages/zoltan/src/fort/cwrap.c index c9520e82bc..3c09a3800e 100644 --- a/packages/zoltan/src/fort/cwrap.c +++ b/packages/zoltan/src/fort/cwrap.c @@ -1,54 +1,17 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /***************************************************************************** * KDD: 2/7/11 - * KDD: This interface uses pointer aliasing to translate C pointers to - * KDD: something that F90 can store and return. It worked fine until - * KDD: gcc 4.5, where compiler optimizations removed assignment - * KDD: statements in Zfw_Set_Fn (assignments to the Fortran callbacks), + * KDD: This interface uses pointer aliasing to translate C pointers to + * KDD: something that F90 can store and return. It worked fine until + * KDD: gcc 4.5, where compiler optimizations removed assignment + * KDD: statements in Zfw_Set_Fn (assignments to the Fortran callbacks), * KDD: causing segmentation faults when Zoltan attempted to call those * KDD: callbacks. This problem was fixed by declaring all Zoltan_Structs * KDD: using this aliasing to be "volatile". A better fix would use the @@ -124,7 +87,7 @@ void Zfw_Get_Address_int(int *addr, /* Assuming sizeof(long) == pointer size. True on most linux systems. */ /* May not be true in 64-bit Windows, but does anyone use F90 on Windoze? */ if (sizeof(long) != sizeof(int *)) { - ZOLTAN_PRINT_ERROR(-1, "Zfw_Get_Address_int", + ZOLTAN_PRINT_ERROR(-1, "Zfw_Get_Address_int", "sizeof(long) != sizeof(int *); F90 allocation will not work properly.\n Contact Zoltan developers for help."); } *ret_addr = (long)addr; @@ -136,7 +99,7 @@ void Zfw_Get_Address_struct(int *addr, /* Assuming sizeof(long) == pointer size. True on most linux systems. */ /* May not be true in 64-bit Windows, but does anyone use F90 on Windoze? */ if (sizeof(long) != sizeof(int *)) { - ZOLTAN_PRINT_ERROR(-1, "Zfw_Get_Address_struct", + ZOLTAN_PRINT_ERROR(-1, "Zfw_Get_Address_struct", "sizeof(long) != sizeof(int *); F90 allocation will not work properly.\n Contact Zoltan developers for help."); } *ret_addr = (long)addr; @@ -162,7 +125,7 @@ int Zfw_Get_Comm_Dim(int *addr_lb, int *nbytes) /* Reverse wrappers for callbacks */ /*--------------------------------------------------------------------*/ -void Zoltan_Part_Multi_Fort_Wrapper(void *data, +void Zoltan_Part_Multi_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_obj, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *parts, int *ierr) @@ -174,7 +137,7 @@ void Zoltan_Part_Multi_Fort_Wrapper(void *data, /*****************************************************************************/ -int Zoltan_Part_Fort_Wrapper(void *data, +int Zoltan_Part_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr) @@ -185,7 +148,7 @@ int Zoltan_Part_Fort_Wrapper(void *data, } /*****************************************************************************/ -int Zoltan_Num_Edges_Fort_Wrapper(void *data, +int Zoltan_Num_Edges_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr) @@ -196,19 +159,19 @@ int Zoltan_Num_Edges_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Num_Edges_Multi_Fort_Wrapper(void *data, +void Zoltan_Num_Edges_Multi_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_obj, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *num_edges, int *ierr) { Zoltan_Current->Get_Num_Edges_Multi_Fort(data, &num_gid_entries, &num_lid_entries, - &num_obj, global_id, local_id, + &num_obj, global_id, local_id, num_edges, ierr); } /*****************************************************************************/ -void Zoltan_Edge_List_Fort_Wrapper(void *data, +void Zoltan_Edge_List_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, ZOLTAN_ID_PTR nbor_global_id, int *nbor_procs, @@ -221,7 +184,7 @@ void Zoltan_Edge_List_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Edge_List_Multi_Fort_Wrapper(void *data, +void Zoltan_Edge_List_Multi_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_obj, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *num_edges, ZOLTAN_ID_PTR nbor_global_id, int *nbor_procs, @@ -279,13 +242,13 @@ void Zoltan_Obj_List_Fort_Wrapper(void *data, } /*****************************************************************************/ -int Zoltan_First_Obj_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +int Zoltan_First_Obj_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR first_global_id, ZOLTAN_ID_PTR first_local_id, int wdim, float *first_obj_wgt, int *ierr) { - return Zoltan_Current->Get_First_Obj_Fort(data, + return Zoltan_Current->Get_First_Obj_Fort(data, &num_gid_entries, &num_lid_entries, first_global_id, first_local_id, &wdim, @@ -293,14 +256,14 @@ int Zoltan_First_Obj_Fort_Wrapper(void *data, } /*****************************************************************************/ -int Zoltan_Next_Obj_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +int Zoltan_Next_Obj_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, ZOLTAN_ID_PTR next_global_id, ZOLTAN_ID_PTR next_local_id, int wdim, float *next_obj_wgt, int *ierr) { - return Zoltan_Current->Get_Next_Obj_Fort(data, - &num_gid_entries, &num_lid_entries, + return Zoltan_Current->Get_Next_Obj_Fort(data, + &num_gid_entries, &num_lid_entries, global_id, local_id, next_global_id, next_local_id, &wdim, next_obj_wgt, ierr); @@ -313,20 +276,20 @@ int Zoltan_Num_Border_Obj_Fort_Wrapper(void *data, int nbor_proc, int *ierr) } /*****************************************************************************/ -void Zoltan_Border_Obj_List_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +void Zoltan_Border_Obj_List_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, int nbor_proc, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int wdim, float *objwgts, int *ierr) { - Zoltan_Current->Get_Border_Obj_List_Fort(data, - &num_gid_entries, &num_lid_entries, + Zoltan_Current->Get_Border_Obj_List_Fort(data, + &num_gid_entries, &num_lid_entries, &nbor_proc, global_ids, local_ids, &wdim, objwgts, ierr); } /*****************************************************************************/ -int Zoltan_First_Border_Obj_Fort_Wrapper(void *data, +int Zoltan_First_Border_Obj_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int nbor_proc, ZOLTAN_ID_PTR first_global_id, @@ -334,9 +297,9 @@ int Zoltan_First_Border_Obj_Fort_Wrapper(void *data, int wdim, float *first_obj_wgt, int *ierr) { - return Zoltan_Current->Get_First_Border_Obj_Fort(data, - &num_gid_entries, - &num_lid_entries, + return Zoltan_Current->Get_First_Border_Obj_Fort(data, + &num_gid_entries, + &num_lid_entries, &nbor_proc, first_global_id, first_local_id, &wdim, @@ -344,7 +307,7 @@ int Zoltan_First_Border_Obj_Fort_Wrapper(void *data, } /*****************************************************************************/ -int Zoltan_Next_Border_Obj_Fort_Wrapper(void *data, +int Zoltan_Next_Border_Obj_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int nbor_proc, @@ -353,7 +316,7 @@ int Zoltan_Next_Border_Obj_Fort_Wrapper(void *data, int wdim, float *next_obj_wgt, int *ierr) { - return Zoltan_Current->Get_Next_Border_Obj_Fort(data, + return Zoltan_Current->Get_Next_Border_Obj_Fort(data, &num_gid_entries, &num_lid_entries, global_id, local_id, @@ -364,7 +327,7 @@ int Zoltan_Next_Border_Obj_Fort_Wrapper(void *data, /*****************************************************************************/ int Zoltan_Obj_Size_Fort_Wrapper(void *data, int num_gid_entries, - int num_lid_entries, ZOLTAN_ID_PTR global_id, + int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr) { return Zoltan_Current->Get_Obj_Size_Fort(data, @@ -389,7 +352,7 @@ void Zoltan_Obj_Size_Multi_Fort_Wrapper( } /*****************************************************************************/ -void Zoltan_Pre_Migrate_PP_Fort_Wrapper(void *data, +void Zoltan_Pre_Migrate_PP_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -398,16 +361,16 @@ void Zoltan_Pre_Migrate_PP_Fort_Wrapper(void *data, ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *export_to_proc, int *ierr) { - Zoltan_Current->Migrate.Pre_Migrate_PP_Fort(data, + Zoltan_Current->Migrate.Pre_Migrate_PP_Fort(data, &num_gid_entries, &num_lid_entries, - &num_import, import_global_ids, import_local_ids, + &num_import, import_global_ids, import_local_ids, import_procs, import_to_proc, &num_export, export_global_ids, export_local_ids, export_procs, export_to_proc, ierr); } /*****************************************************************************/ -void Zoltan_Mid_Migrate_PP_Fort_Wrapper(void *data, +void Zoltan_Mid_Migrate_PP_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -425,7 +388,7 @@ void Zoltan_Mid_Migrate_PP_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Post_Migrate_PP_Fort_Wrapper(void *data, +void Zoltan_Post_Migrate_PP_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -444,7 +407,7 @@ void Zoltan_Post_Migrate_PP_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Pre_Migrate_Fort_Wrapper(void *data, +void Zoltan_Pre_Migrate_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -453,7 +416,7 @@ void Zoltan_Pre_Migrate_Fort_Wrapper(void *data, ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *ierr) { - Zoltan_Current->Migrate.Pre_Migrate_Fort(data, + Zoltan_Current->Migrate.Pre_Migrate_Fort(data, &num_gid_entries, &num_lid_entries, &num_import, @@ -465,7 +428,7 @@ void Zoltan_Pre_Migrate_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Mid_Migrate_Fort_Wrapper(void *data, +void Zoltan_Mid_Migrate_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -486,7 +449,7 @@ void Zoltan_Mid_Migrate_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Post_Migrate_Fort_Wrapper(void *data, +void Zoltan_Post_Migrate_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, int num_import, ZOLTAN_ID_PTR import_global_ids, @@ -496,7 +459,7 @@ void Zoltan_Post_Migrate_Fort_Wrapper(void *data, int *ierr) { Zoltan_Current->Migrate.Post_Migrate_Fort(data, - &num_gid_entries, &num_lid_entries, + &num_gid_entries, &num_lid_entries, &num_import, import_global_ids, import_local_ids, import_procs, @@ -506,13 +469,13 @@ void Zoltan_Post_Migrate_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Pack_Obj_Fort_Wrapper(void *data, +void Zoltan_Pack_Obj_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int dest_proc, int size, char *buf, int *ierr) { - Zoltan_Current->Pack_Obj_Fort(data, - &num_gid_entries, &num_lid_entries, + Zoltan_Current->Pack_Obj_Fort(data, + &num_gid_entries, &num_lid_entries, global_id, local_id, &dest_proc, &size, buf, ierr); } @@ -533,27 +496,27 @@ void Zoltan_Pack_Obj_Multi_Fort_Wrapper( { int factor = sizeof(int) / sizeof(char); int i; - + /* Convert index array from indices into char * to indices into int *. */ /* Add 1 for F90 one-based indexing. */ for (i = 0; i < num_ids; i++) { /* Sanity check */ if (index[i] % factor != 0) { - ZOLTAN_PRINT_ERROR(-1, "Zoltan_Pack_Obj_Multi_Fort_Wrapper", + ZOLTAN_PRINT_ERROR(-1, "Zoltan_Pack_Obj_Multi_Fort_Wrapper", "Alignment problem in index array."); - + *ierr = ZOLTAN_FATAL; return; } index[i] = index[i]/factor + 1; } - + Zoltan_Current->Pack_Obj_Multi_Fort(data, &num_gid_entries, &num_lid_entries, &num_ids, global_ids, local_ids, dest_proc, size, index, buffer, ierr); /* Restore index array to original condition. */ - for (i = 0; i < num_ids; i++) + for (i = 0; i < num_ids; i++) index[i] = (index[i] - 1) * factor; } @@ -562,7 +525,7 @@ void Zoltan_Unpack_Obj_Fort_Wrapper(void *data, int num_gid_entries, ZOLTAN_ID_PTR global_id, int size, char *buf, int *ierr) { - Zoltan_Current->Unpack_Obj_Fort(data, &num_gid_entries, + Zoltan_Current->Unpack_Obj_Fort(data, &num_gid_entries, global_id, &size, buf, ierr); } @@ -579,26 +542,26 @@ void Zoltan_Unpack_Obj_Multi_Fort_Wrapper( { int factor = sizeof(int) / sizeof(char); int i; - + /* Convert index array from indices into char * to indices into int *. */ /* Add 1 for F90 one-based indexing. */ for (i = 0; i < num_ids; i++) { /* Sanity check */ if (index[i] % factor != 0) { - ZOLTAN_PRINT_ERROR(-1, "Zoltan_Pack_Obj_Multi_Fort_Wrapper", + ZOLTAN_PRINT_ERROR(-1, "Zoltan_Pack_Obj_Multi_Fort_Wrapper", "Alignment problem in index array."); - + *ierr = ZOLTAN_FATAL; return; } index[i] = index[i]/factor + 1; } - + Zoltan_Current->Unpack_Obj_Multi_Fort(data, &num_gid_entries, &num_ids, global_ids, size, index, buffer, ierr); /* Restore index array to original condition. */ - for (i = 0; i < num_ids; i++) + for (i = 0; i < num_ids; i++) index[i] = (index[i] - 1) * factor; } @@ -610,14 +573,14 @@ int Zoltan_Num_Coarse_Obj_Fort_Wrapper(void *data, int *ierr) } /*****************************************************************************/ -void Zoltan_Coarse_Obj_List_Fort_Wrapper(void *data, +void Zoltan_Coarse_Obj_List_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *assigned, int *num_vert, ZOLTAN_ID_PTR vertices, int *in_order, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex, int *ierr) { - Zoltan_Current->Get_Coarse_Obj_List_Fort(data, + Zoltan_Current->Get_Coarse_Obj_List_Fort(data, &num_gid_entries, &num_lid_entries, global_ids, local_ids, assigned, num_vert, vertices, @@ -626,7 +589,7 @@ void Zoltan_Coarse_Obj_List_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_HG_Size_CS_Fort_Wrapper(void *data, +void Zoltan_HG_Size_CS_Fort_Wrapper(void *data, int *num_lists, int *num_pins, int *format, int *ierr) { Zoltan_Current->Get_HG_Size_CS_Fort(data, num_lists, num_pins, format, @@ -638,7 +601,7 @@ void Zoltan_HG_Size_Edge_Wts_Fort_Wrapper(void *data, int *num_edges, int *ierr) Zoltan_Current->Get_HG_Size_Edge_Wts_Fort(data, num_edges, ierr); } /*****************************************************************************/ -void Zoltan_HG_CS_Fort_Wrapper(void *data, +void Zoltan_HG_CS_Fort_Wrapper(void *data, int num_gid_entries, int nrowcol, int npins, int format, ZOLTAN_ID_PTR rowcol_GID, int *rowcol_ptr, ZOLTAN_ID_PTR pin_GID, int *ierr) @@ -665,24 +628,24 @@ int Zoltan_Num_Fixed_Obj_Fort_Wrapper(void *data, int *ierr) } /*****************************************************************************/ void Zoltan_Fixed_Obj_List_Fort_Wrapper(void *data, - int num_fixed_obj, int num_gid_entries, + int num_fixed_obj, int num_gid_entries, ZOLTAN_ID_PTR fixed_gids, int *fixed_part, int *ierr) { Zoltan_Current->Get_Fixed_Obj_List_Fort(data, - &num_fixed_obj, &num_gid_entries, + &num_fixed_obj, &num_gid_entries, fixed_gids, fixed_part, ierr); } /*****************************************************************************/ -int Zoltan_First_Coarse_Obj_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +int Zoltan_First_Coarse_Obj_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *assigned, int *num_vert, ZOLTAN_ID_PTR vertices, int *in_order, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex, int *ierr) { - return Zoltan_Current->Get_First_Coarse_Obj_Fort(data, - &num_gid_entries, + return Zoltan_Current->Get_First_Coarse_Obj_Fort(data, + &num_gid_entries, &num_lid_entries, global_id, local_id, assigned, num_vert, vertices, @@ -691,10 +654,10 @@ int Zoltan_First_Coarse_Obj_Fort_Wrapper(void *data, } /*****************************************************************************/ -int Zoltan_Next_Coarse_Obj_Fort_Wrapper(void *data, int num_gid_entries, +int Zoltan_Next_Coarse_Obj_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, - ZOLTAN_ID_PTR next_global_id, + ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR next_global_id, ZOLTAN_ID_PTR next_local_id, int *assigned, int *num_vert, ZOLTAN_ID_PTR vertices, @@ -709,19 +672,19 @@ int Zoltan_Next_Coarse_Obj_Fort_Wrapper(void *data, int num_gid_entries, } /*****************************************************************************/ -int Zoltan_Num_Child_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +int Zoltan_Num_Child_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr) { - return Zoltan_Current->Get_Num_Child_Fort(data, + return Zoltan_Current->Get_Num_Child_Fort(data, &num_gid_entries, &num_lid_entries, global_id, local_id, ierr); } /*****************************************************************************/ -void Zoltan_Child_List_Fort_Wrapper(void *data, - int num_gid_entries, int num_lid_entries, +void Zoltan_Child_List_Fort_Wrapper(void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR parent_gid, ZOLTAN_ID_PTR parent_lid, ZOLTAN_ID_PTR child_gids, ZOLTAN_ID_PTR child_lids, int *assigned, @@ -737,12 +700,12 @@ void Zoltan_Child_List_Fort_Wrapper(void *data, } /*****************************************************************************/ -void Zoltan_Child_Weight_Fort_Wrapper(void *data, +void Zoltan_Child_Weight_Fort_Wrapper(void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int wgt_dim, float *obj_wgt, int *ierr) { - Zoltan_Current->Get_Child_Weight_Fort(data, + Zoltan_Current->Get_Child_Weight_Fort(data, &num_gid_entries, &num_lid_entries, global_id, local_id, &wgt_dim, obj_wgt, ierr); @@ -761,7 +724,7 @@ int Zoltan_Hier_Part_Fort_Wrapper(void *data, int level, int *ierr) } /*****************************************************************************/ -void Zoltan_Hier_Method_Fort_Wrapper(void *data, int level, +void Zoltan_Hier_Method_Fort_Wrapper(void *data, int level, struct Zoltan_Struct *zz, int *ierr) { int *fort_zz; /* maybe this should be void *? */ @@ -813,7 +776,7 @@ int Zfw_Initialize1(int *argc, int *argv, int *starts, float *ver) } myArgv[*argc] = NULL; result = Zoltan_Initialize(*argc,myArgv,ver); - for (i=0; i<(*argc); i++) + for (i=0; i<(*argc); i++) ZOLTAN_FREE(&(myArgv[i])); ZOLTAN_FREE(&myArgv); return result; @@ -881,202 +844,202 @@ int Zfw_Set_Fn(int *addr_lb, int *nbytes, ZOLTAN_FN_TYPE *type, void (*fn)(), switch(*type) { case ZOLTAN_PART_MULTI_FN_TYPE: lb->Get_Part_Multi_Fort = (ZOLTAN_PART_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Part_Multi_Fort_Wrapper, data); break; case ZOLTAN_PART_FN_TYPE: lb->Get_Part_Fort = (ZOLTAN_PART_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Part_Fort_Wrapper, data); break; case ZOLTAN_NUM_EDGES_MULTI_FN_TYPE: lb->Get_Num_Edges_Multi_Fort = (ZOLTAN_NUM_EDGES_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Edges_Multi_Fort_Wrapper, data); break; case ZOLTAN_EDGE_LIST_MULTI_FN_TYPE: lb->Get_Edge_List_Multi_Fort = (ZOLTAN_EDGE_LIST_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Edge_List_Multi_Fort_Wrapper, data); break; case ZOLTAN_NUM_EDGES_FN_TYPE: lb->Get_Num_Edges_Fort = (ZOLTAN_NUM_EDGES_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Edges_Fort_Wrapper, data); break; case ZOLTAN_EDGE_LIST_FN_TYPE: lb->Get_Edge_List_Fort = (ZOLTAN_EDGE_LIST_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Edge_List_Fort_Wrapper, data); break; case ZOLTAN_NUM_GEOM_FN_TYPE: lb->Get_Num_Geom_Fort = (ZOLTAN_NUM_GEOM_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Geom_Fort_Wrapper, data); break; case ZOLTAN_GEOM_MULTI_FN_TYPE: lb->Get_Geom_Multi_Fort = (ZOLTAN_GEOM_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Geom_Multi_Fort_Wrapper, data); break; case ZOLTAN_GEOM_FN_TYPE: lb->Get_Geom_Fort = (ZOLTAN_GEOM_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Geom_Fort_Wrapper, data); break; case ZOLTAN_NUM_OBJ_FN_TYPE: lb->Get_Num_Obj_Fort = (ZOLTAN_NUM_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Obj_Fort_Wrapper, data); break; case ZOLTAN_OBJ_LIST_FN_TYPE: lb->Get_Obj_List_Fort = (ZOLTAN_OBJ_LIST_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Obj_List_Fort_Wrapper, data); break; case ZOLTAN_FIRST_OBJ_FN_TYPE: lb->Get_First_Obj_Fort = (ZOLTAN_FIRST_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_First_Obj_Fort_Wrapper, data); break; case ZOLTAN_NEXT_OBJ_FN_TYPE: lb->Get_Next_Obj_Fort = (ZOLTAN_NEXT_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Next_Obj_Fort_Wrapper, data); break; case ZOLTAN_NUM_BORDER_OBJ_FN_TYPE: lb->Get_Num_Border_Obj_Fort = (ZOLTAN_NUM_BORDER_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Border_Obj_Fort_Wrapper, data); break; case ZOLTAN_BORDER_OBJ_LIST_FN_TYPE: lb->Get_Border_Obj_List_Fort = (ZOLTAN_BORDER_OBJ_LIST_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Border_Obj_List_Fort_Wrapper, data); break; case ZOLTAN_FIRST_BORDER_OBJ_FN_TYPE: lb->Get_First_Border_Obj_Fort = (ZOLTAN_FIRST_BORDER_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_First_Border_Obj_Fort_Wrapper, data); break; case ZOLTAN_NEXT_BORDER_OBJ_FN_TYPE: lb->Get_Next_Border_Obj_Fort = (ZOLTAN_NEXT_BORDER_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Next_Border_Obj_Fort_Wrapper, data); break; case ZOLTAN_PRE_MIGRATE_PP_FN_TYPE: lb->Migrate.Pre_Migrate_PP_Fort = (ZOLTAN_PRE_MIGRATE_PP_FORT_FN *)fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Pre_Migrate_PP_Fort_Wrapper, data); break; case ZOLTAN_MID_MIGRATE_PP_FN_TYPE: lb->Migrate.Mid_Migrate_PP_Fort = (ZOLTAN_MID_MIGRATE_PP_FORT_FN *)fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Mid_Migrate_PP_Fort_Wrapper, data); break; case ZOLTAN_POST_MIGRATE_PP_FN_TYPE: lb->Migrate.Post_Migrate_PP_Fort =(ZOLTAN_POST_MIGRATE_PP_FORT_FN*)fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Post_Migrate_PP_Fort_Wrapper, data); break; case ZOLTAN_PRE_MIGRATE_FN_TYPE: lb->Migrate.Pre_Migrate_Fort = (ZOLTAN_PRE_MIGRATE_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Pre_Migrate_Fort_Wrapper, data); break; case ZOLTAN_MID_MIGRATE_FN_TYPE: lb->Migrate.Mid_Migrate_Fort = (ZOLTAN_MID_MIGRATE_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Mid_Migrate_Fort_Wrapper, data); break; case ZOLTAN_POST_MIGRATE_FN_TYPE: lb->Migrate.Post_Migrate_Fort = (ZOLTAN_POST_MIGRATE_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Post_Migrate_Fort_Wrapper, data); break; case ZOLTAN_OBJ_SIZE_FN_TYPE: lb->Get_Obj_Size_Fort = (ZOLTAN_OBJ_SIZE_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Obj_Size_Fort_Wrapper, data); break; case ZOLTAN_PACK_OBJ_FN_TYPE: lb->Pack_Obj_Fort = (ZOLTAN_PACK_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Pack_Obj_Fort_Wrapper, data); break; case ZOLTAN_UNPACK_OBJ_FN_TYPE: lb->Unpack_Obj_Fort = (ZOLTAN_UNPACK_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Unpack_Obj_Fort_Wrapper, data); break; case ZOLTAN_OBJ_SIZE_MULTI_FN_TYPE: lb->Get_Obj_Size_Multi_Fort = (ZOLTAN_OBJ_SIZE_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Obj_Size_Multi_Fort_Wrapper, data); break; case ZOLTAN_PACK_OBJ_MULTI_FN_TYPE: lb->Pack_Obj_Multi_Fort = (ZOLTAN_PACK_OBJ_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Pack_Obj_Multi_Fort_Wrapper, data); break; case ZOLTAN_UNPACK_OBJ_MULTI_FN_TYPE: lb->Unpack_Obj_Multi_Fort = (ZOLTAN_UNPACK_OBJ_MULTI_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Unpack_Obj_Multi_Fort_Wrapper, data); break; case ZOLTAN_NUM_COARSE_OBJ_FN_TYPE: lb->Get_Num_Coarse_Obj_Fort = (ZOLTAN_NUM_COARSE_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Coarse_Obj_Fort_Wrapper, data); break; case ZOLTAN_COARSE_OBJ_LIST_FN_TYPE: lb->Get_Coarse_Obj_List_Fort = (ZOLTAN_COARSE_OBJ_LIST_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Coarse_Obj_List_Fort_Wrapper, data); break; case ZOLTAN_FIRST_COARSE_OBJ_FN_TYPE: lb->Get_First_Coarse_Obj_Fort = (ZOLTAN_FIRST_COARSE_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_First_Coarse_Obj_Fort_Wrapper, data); break; case ZOLTAN_NEXT_COARSE_OBJ_FN_TYPE: lb->Get_Next_Coarse_Obj_Fort = (ZOLTAN_NEXT_COARSE_OBJ_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Next_Coarse_Obj_Fort_Wrapper, data); break; case ZOLTAN_NUM_CHILD_FN_TYPE: lb->Get_Num_Child_Fort = (ZOLTAN_NUM_CHILD_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Num_Child_Fort_Wrapper, data); break; case ZOLTAN_CHILD_LIST_FN_TYPE: lb->Get_Child_List_Fort = (ZOLTAN_CHILD_LIST_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Child_List_Fort_Wrapper, data); break; case ZOLTAN_CHILD_WEIGHT_FN_TYPE: lb->Get_Child_Weight_Fort = (ZOLTAN_CHILD_WEIGHT_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Child_Weight_Fort_Wrapper, data); break; case ZOLTAN_HG_SIZE_CS_FN_TYPE: lb->Get_HG_Size_CS_Fort = (ZOLTAN_HG_SIZE_CS_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_HG_Size_CS_Fort_Wrapper, data); break; case ZOLTAN_HG_SIZE_EDGE_WTS_FN_TYPE: lb->Get_HG_Size_Edge_Wts_Fort = (ZOLTAN_HG_SIZE_EDGE_WTS_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_HG_Size_Edge_Wts_Fort_Wrapper, data); break; case ZOLTAN_HG_CS_FN_TYPE: lb->Get_HG_CS_Fort = (ZOLTAN_HG_CS_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_HG_CS_Fort_Wrapper, data); break; case ZOLTAN_HG_EDGE_WTS_FN_TYPE: lb->Get_HG_Edge_Wts_Fort = (ZOLTAN_HG_EDGE_WTS_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_HG_Edge_Wts_Fort_Wrapper, data); break; case ZOLTAN_NUM_FIXED_OBJ_FN_TYPE: @@ -1091,17 +1054,17 @@ int Zfw_Set_Fn(int *addr_lb, int *nbytes, ZOLTAN_FN_TYPE *type, void (*fn)(), break; case ZOLTAN_HIER_NUM_LEVELS_FN_TYPE: lb->Get_Hier_Num_Levels_Fort = (ZOLTAN_HIER_NUM_LEVELS_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Hier_Num_Levels_Fort_Wrapper, data); break; case ZOLTAN_HIER_PART_FN_TYPE: lb->Get_Hier_Part_Fort = (ZOLTAN_HIER_PART_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Hier_Part_Fort_Wrapper, data); break; case ZOLTAN_HIER_METHOD_FN_TYPE: lb->Get_Hier_Method_Fort = (ZOLTAN_HIER_METHOD_FORT_FN *) fn; - return Zoltan_Set_Fn(lb, *type, + return Zoltan_Set_Fn(lb, *type, (void (*)())Zoltan_Hier_Method_Fort_Wrapper, data); break; default: @@ -1334,7 +1297,7 @@ int Zfw_Set_Param_Vec(int *addr_lb, int *nbytes, int *int_param_name, } /*****************************************************************************/ -int Zfw_LB_Partition(int *addr_lb, int *nbytes, int *changes, +int Zfw_LB_Partition(int *addr_lb, int *nbytes, int *changes, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR *import_global_ids, ZOLTAN_ID_PTR *import_local_ids, @@ -1405,7 +1368,7 @@ int Zfw_LB_Partition(int *addr_lb, int *nbytes, int *changes, /* call Zoltan_LB_Partition */ - return Zoltan_LB_Partition(lb, changes, num_gid_entries, num_lid_entries, + return Zoltan_LB_Partition(lb, changes, num_gid_entries, num_lid_entries, num_import, temp_imp_gid, temp_imp_lid, temp_imp_proc, temp_imp_to_part, num_export, temp_exp_gid, temp_exp_lid, @@ -1464,7 +1427,7 @@ int Zfw_LB_Box_Assign(int *addr_lb, int *nbytes, double *xmin, double *ymin, volatile struct Zoltan_Struct *lb; ADDR_TO_LB(addr_lb, lb); - return Zoltan_LB_Box_Assign(lb, *xmin, *ymin, *zmin, *xmax, *ymax, *zmax, + return Zoltan_LB_Box_Assign(lb, *xmin, *ymin, *zmin, *xmax, *ymax, *zmax, procs, numprocs); } @@ -1481,14 +1444,14 @@ int Zfw_LB_Box_PP_Assign(int *addr_lb, int *nbytes, double *xmin, double *ymin, } /*****************************************************************************/ -int Zfw_Invert_Lists(int *addr_lb, int *nbytes, +int Zfw_Invert_Lists(int *addr_lb, int *nbytes, int *num_input, ZOLTAN_ID_PTR input_global_ids, ZOLTAN_ID_PTR input_local_ids, int *input_procs, int *input_to_part, int *num_output, ZOLTAN_ID_PTR *output_global_ids, ZOLTAN_ID_PTR *output_local_ids, int **output_procs, int **output_to_part #ifdef PGI - ,int *output_gid_hide, int *output_lid_hide, int *output_proc_hide, + ,int *output_gid_hide, int *output_lid_hide, int *output_proc_hide, int *output_to_part_hide #endif #ifdef FUJITSU @@ -1497,7 +1460,7 @@ int Zfw_Invert_Lists(int *addr_lb, int *nbytes, int *input_global_ids_hide, int *input_local_ids_hide, int *input_procs_hide, int *input_to_part_hide, int *num_output_hide, - int *output_gid_hide, int *output_lid_hide, + int *output_gid_hide, int *output_lid_hide, int *output_proc_hide, int *output_to_part_hide #endif ) @@ -1537,7 +1500,7 @@ int Zfw_Invert_Lists(int *addr_lb, int *nbytes, /* call Zoltan_Invert_Lists */ - return Zoltan_Invert_Lists(lb, + return Zoltan_Invert_Lists(lb, *num_input, input_global_ids, input_local_ids, input_procs, input_to_part, num_output, temp_output_gid, temp_output_lid, @@ -1545,7 +1508,7 @@ int Zfw_Invert_Lists(int *addr_lb, int *nbytes, } /*****************************************************************************/ -int Zfw_Compute_Destinations(int *addr_lb, int *nbytes, +int Zfw_Compute_Destinations(int *addr_lb, int *nbytes, int *num_input, ZOLTAN_ID_PTR input_global_ids, ZOLTAN_ID_PTR input_local_ids, int *input_procs, int *num_output, @@ -1595,16 +1558,16 @@ int Zfw_Compute_Destinations(int *addr_lb, int *nbytes, /* call Zoltan_Compute_Destinations */ - return Zoltan_Compute_Destinations(lb, + return Zoltan_Compute_Destinations(lb, *num_input, input_global_ids, - input_local_ids, input_procs, + input_local_ids, input_procs, num_output, temp_output_gid, temp_output_lid, temp_output_proc); } /*****************************************************************************/ -int Zfw_Migrate(int *addr_lb, int *nbytes, +int Zfw_Migrate(int *addr_lb, int *nbytes, int *num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, int *num_export, @@ -1623,7 +1586,7 @@ int Zfw_Migrate(int *addr_lb, int *nbytes, } /*****************************************************************************/ -int Zfw_Help_Migrate(int *addr_lb, int *nbytes, +int Zfw_Help_Migrate(int *addr_lb, int *nbytes, int *num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *num_export, @@ -1645,7 +1608,7 @@ int Zfw_Order( int *addr_lb, int *nbytes, int *num_gid_entries, int *num_obj, - ZOLTAN_ID_PTR gids, + ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR perm) { volatile struct Zoltan_Struct *lb; @@ -1661,7 +1624,7 @@ int Zfw_Order( /*****************************************************************************/ int Zfw_Color( int *addr_lb, int *nbytes, - int *num_gid_entries, + int *num_gid_entries, int *num_obj, ZOLTAN_ID_PTR gids, int *color_exp) @@ -1716,7 +1679,7 @@ int Zfw_Generate_Files(int *addr_lb, int *nbytes, int *int_filename, /*****************************************************************************/ int Zfw_RCB_Box(int *addr_lb, int *nbytes, int *part, int *ndim, - double *xmin, double *ymin, double *zmin, + double *xmin, double *ymin, double *zmin, double *xmax, double *ymax, double *zmax) { volatile struct Zoltan_Struct *lb; @@ -1735,9 +1698,9 @@ void Zfw_Register_Fort_Malloc(ZOLTAN_FORT_MALLOC_INT_FN *fort_malloc_int, /*****************************************************************************/ void Zfw_Reftree_Get_Child_Order( - int *addr_lb, - int *nbytes, - int *order, + int *addr_lb, + int *nbytes, + int *order, int *ierr) { volatile struct Zoltan_Struct *lb; diff --git a/packages/zoltan/src/fort/cwrap_fmangle.h b/packages/zoltan/src/fort/cwrap_fmangle.h index be50aafb4c..9ae56edd3b 100644 --- a/packages/zoltan/src/fort/cwrap_fmangle.h +++ b/packages/zoltan/src/fort/cwrap_fmangle.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef CWRAPFMANGLEH_ #define CWRAPFMANGLEH_ @@ -117,12 +80,12 @@ #define Zfw_Initialize zfw_initialize #define Zfw_Initialize1 zfw_initialize1 -#define Zfw_Create zfw_create +#define Zfw_Create zfw_create #define Zfw_Copy zfw_copy #define Zfw_Copy_To zfw_copy_to -#define Zfw_Destroy zfw_destroy -#define Zfw_Align zfw_align -#define Zfw_Memory_Stats zfw_memory_stats +#define Zfw_Destroy zfw_destroy +#define Zfw_Align zfw_align +#define Zfw_Memory_Stats zfw_memory_stats #define Zfw_Set_Fn0f zfw_set_fn0f #define Zfw_Set_Fn1f zfw_set_fn1f #define Zfw_Set_Fn2f zfw_set_fn2f @@ -158,13 +121,13 @@ #define Zfw_LB_Box_PP_Assign zfw_lb_box_pp_assign #define Zfw_Invert_Lists zfw_invert_lists #define Zfw_Compute_Destinations zfw_compute_destinations -#define Zfw_Migrate zfw_migrate -#define Zfw_Help_Migrate zfw_help_migrate -#define Zfw_Order zfw_order -#define Zfw_Color zfw_color -#define Zfw_Color_Test zfw_color_test -#define Zfw_Generate_Files zfw_generate_files -#define Zfw_RCB_Box zfw_rcb_box +#define Zfw_Migrate zfw_migrate +#define Zfw_Help_Migrate zfw_help_migrate +#define Zfw_Order zfw_order +#define Zfw_Color zfw_color +#define Zfw_Color_Test zfw_color_test +#define Zfw_Generate_Files zfw_generate_files +#define Zfw_RCB_Box zfw_rcb_box #define Zfw_Register_Fort_Malloc zfw_register_fort_malloc #define Zfw_Get_Address_int zfw_get_address_int #define Zfw_Get_Address_struct zfw_get_address_struct @@ -218,11 +181,11 @@ #define Zfw_Invert_Lists zfw_invert_lists_ #define Zfw_Compute_Destinations zfw_compute_destinations_ #define Zfw_Migrate zfw_migrate_ -#define Zfw_Help_Migrate zfw_help_migrate_ -#define Zfw_Order zfw_order_ -#define Zfw_Color zfw_color_ -#define Zfw_Color_Test zfw_color_test_ -#define Zfw_Generate_Files zfw_generate_files_ +#define Zfw_Help_Migrate zfw_help_migrate_ +#define Zfw_Order zfw_order_ +#define Zfw_Color zfw_color_ +#define Zfw_Color_Test zfw_color_test_ +#define Zfw_Generate_Files zfw_generate_files_ #define Zfw_RCB_Box zfw_rcb_box_ #define Zfw_Register_Fort_Malloc zfw_register_fort_malloc_ #define Zfw_Get_Address_int zfw_get_address_int_ @@ -294,12 +257,12 @@ #define Zfw_Initialize ZFW_INITIALIZE #define Zfw_Initialize1 ZFW_INITIALIZE1 -#define Zfw_Create ZFW_CREATE +#define Zfw_Create ZFW_CREATE #define Zfw_Copy ZFW_COPY #define Zfw_Copy_To ZFW_COPY_TO -#define Zfw_Destroy ZFW_DESTROY +#define Zfw_Destroy ZFW_DESTROY #define Zfw_Align ZFW_ALIGN -#define Zfw_Memory_Stats ZFW_MEMORY_STATS +#define Zfw_Memory_Stats ZFW_MEMORY_STATS #define Zfw_Set_Fn0f ZFW_SET_FN0F #define Zfw_Set_Fn1f ZFW_SET_FN1F #define Zfw_Set_Fn2f ZFW_SET_FN2F @@ -334,14 +297,14 @@ #define Zfw_LB_Box_Assign ZFW_LB_BOX_ASSIGN #define Zfw_LB_Box_PP_Assign ZFW_LB_BOX_PP_ASSIGN #define Zfw_Invert_Lists ZFW_INVERT_LISTS -#define Zfw_Compute_Destinations ZFW_COMPUTE_DESTINATIONS -#define Zfw_Migrate ZFW_MIGRATE -#define Zfw_Help_Migrate ZFW_HELP_MIGRATE -#define Zfw_Order ZFW_ORDER -#define Zfw_Color ZFW_COLOR -#define Zfw_Color_Test ZFW_COLOR_TEST -#define Zfw_Generate_Files ZFW_GENERATE_FILES -#define Zfw_RCB_Box ZFW_RCB_BOX +#define Zfw_Compute_Destinations ZFW_COMPUTE_DESTINATIONS +#define Zfw_Migrate ZFW_MIGRATE +#define Zfw_Help_Migrate ZFW_HELP_MIGRATE +#define Zfw_Order ZFW_ORDER +#define Zfw_Color ZFW_COLOR +#define Zfw_Color_Test ZFW_COLOR_TEST +#define Zfw_Generate_Files ZFW_GENERATE_FILES +#define Zfw_RCB_Box ZFW_RCB_BOX #define Zfw_Register_Fort_Malloc ZFW_REGISTER_FORT_MALLOC #define Zfw_Get_Address_int ZFW_GET_ADDRESS_INT #define Zfw_Get_Address_struct ZFW_GET_ADDRESS_STRUCT diff --git a/packages/zoltan/src/fort/fwrap.f90 b/packages/zoltan/src/fort/fwrap.f90 index 964f8fe197..327a8ceb48 100644 --- a/packages/zoltan/src/fort/fwrap.f90 +++ b/packages/zoltan/src/fort/fwrap.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! !-------------------------------------------------------------------------- ! preprocessor directives to handle special case compilers diff --git a/packages/zoltan/src/fort/makefile b/packages/zoltan/src/fort/makefile index 65c23bce44..7059ac30df 100644 --- a/packages/zoltan/src/fort/makefile +++ b/packages/zoltan/src/fort/makefile @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ZOD = ../$(ZOLTAN_OBJ_DIR) ZOM = $(F90_MODULE_PREFIX)$(ZOD) -I../fort diff --git a/packages/zoltan/src/fort/zoltan_user_data.f90 b/packages/zoltan/src/fort/zoltan_user_data.f90 index 47ab1e2cc1..7f44da9741 100644 --- a/packages/zoltan/src/fort/zoltan_user_data.f90 +++ b/packages/zoltan/src/fort/zoltan_user_data.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module zoltan_user_data use zoltan_types diff --git a/packages/zoltan/src/fort/ztypes.f90 b/packages/zoltan/src/fort/ztypes.f90 index 0cc11a7dee..edb2023bd6 100644 --- a/packages/zoltan/src/fort/ztypes.f90 +++ b/packages/zoltan/src/fort/ztypes.f90 @@ -1,48 +1,13 @@ !! !! @HEADER -!! -!!!!********************************************************************** -!! +!! ***************************************************************************** !! Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -!! Copyright 2012 Sandia Corporation -!! -!! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!! the U.S. Government retains certain rights in this software. -!! -!! Redistribution and use in source and binary forms, with or without -!! modification, are permitted provided that the following conditions are -!! met: -!! -!! 1. Redistributions of source code must retain the above copyright -!! notice, this list of conditions and the following disclaimer. -!! -!! 2. Redistributions in binary form must reproduce the above copyright -!! notice, this list of conditions and the following disclaimer in the -!! documentation and/or other materials provided with the distribution. -!! -!! 3. Neither the name of the Corporation nor the names of the -!! contributors may be used to endorse or promote products derived from -!! this software without specific prior written permission. -!! -!! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!! -!! Questions? Contact Karen Devine kddevin@sandia.gov -!! Erik Boman egboman@sandia.gov -!! -!!!!********************************************************************** !! +!! Copyright 2012 NTESS and the Zoltan contributors. +!! SPDX-License-Identifier: BSD-3-Clause +!! ***************************************************************************** !! @HEADER - !! +!! module zoltan_types diff --git a/packages/zoltan/src/graph/graph.c b/packages/zoltan/src/graph/graph.c index 25ab7ed3d8..d1f03aeaef 100644 --- a/packages/zoltan/src/graph/graph.c +++ b/packages/zoltan/src/graph/graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -66,15 +29,15 @@ extern "C" { /* This function needs a distribution : rows then cols to work properly */ int Zoltan_ZG_Build (ZZ* zz, ZG* graph, int local, - int request_GNOs, /* Input: Flag indicating calling code + int request_GNOs, /* Input: Flag indicating calling code needs translation of extra GIDs to GNOs; partial 2D coloring needs this feature. */ - int num_requested, /* Input: Local # of GIDs needing + int num_requested, /* Input: Local # of GIDs needing translation to GNOs. */ - ZOLTAN_ID_PTR requested_GIDs, /* Input: Calling code requests the + ZOLTAN_ID_PTR requested_GIDs, /* Input: Calling code requests the GNOs for these GIDs */ - ZOLTAN_GNO_TYPE *requested_GNOs /* Output: Return GNOs of + ZOLTAN_GNO_TYPE *requested_GNOs /* Output: Return GNOs of the requested GIDs. */ ) { @@ -252,7 +215,7 @@ Zoltan_ZG_Export (ZZ* zz, const ZG* const graph, ZOLTAN_GNO_TYPE *gvtx, int *nvt AFFECT_NOT_NULL(gvtx, graph->mtx.mtx.globalY); AFFECT_NOT_NULL(nvtx, graph->mtx.mtx.nY); AFFECT_NOT_NULL(vtxdist, graph->mtx.dist_y); - AFFECT_NOT_NULL(xadj, graph->mtx.mtx.ystart); + AFFECT_NOT_NULL(xadj, graph->mtx.mtx.ystart); AFFECT_NOT_NULL(adjncy, graph->mtx.mtx.pinGNO); AFFECT_NOT_NULL(partialD2, graph->fixed_vertices); diff --git a/packages/zoltan/src/graph/graph.h b/packages/zoltan/src/graph/graph.h index 4ca05711a9..13d5f02e16 100644 --- a/packages/zoltan/src/graph/graph.h +++ b/packages/zoltan/src/graph/graph.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __GRAPH_H #define __GRAPH_H @@ -56,7 +19,7 @@ extern "C" { typedef struct ZG_ { Zoltan_matrix_2d mtx; - int *fixed_vertices; + int *fixed_vertices; int bipartite; int fixObj; } ZG; diff --git a/packages/zoltan/src/graph/graph_const.h b/packages/zoltan/src/graph/graph_const.h index 8128ce70cb..0f9319a59e 100644 --- a/packages/zoltan/src/graph/graph_const.h +++ b/packages/zoltan/src/graph/graph_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __GRAPH_CONST_H diff --git a/packages/zoltan/src/graph/graph_params.h b/packages/zoltan/src/graph/graph_params.h index fc674d5235..f3dbffcd08 100644 --- a/packages/zoltan/src/graph/graph_params.h +++ b/packages/zoltan/src/graph/graph_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __GRAPH_PARAMS_H #define __GRAPH_PARAMS_H diff --git a/packages/zoltan/src/ha/README b/packages/zoltan/src/ha/README index bff0837db6..c550678a51 100644 --- a/packages/zoltan/src/ha/README +++ b/packages/zoltan/src/ha/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER HA DIRECTORY -- Routines to support heterogeneous architectures diff --git a/packages/zoltan/src/ha/divide_machine.c b/packages/zoltan/src/ha/divide_machine.c index 111364ece7..f5b44eabb2 100644 --- a/packages/zoltan/src/ha/divide_machine.c +++ b/packages/zoltan/src/ha/divide_machine.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -52,14 +15,13 @@ extern "C" { #include "zz_const.h" -#include "ha_const.h" int Zoltan_Divide_Machine( ZZ *zz, /* The Zoltan structure (not used now, will be used for pointer to machine details */ int obj_wgt_dim, /* Number of different weights (loads). */ - float *part_sizes, /* Array of part sizes, containing percentage of + float *part_sizes, /* Array of part sizes, containing percentage of work per part. (length= obj_wgt_dim*num_parts) */ int proc, /* my processor number in global sense */ MPI_Comm comm, /* communicator for part of machine to be divided */ @@ -89,8 +51,8 @@ double *sum = NULL; * into two pieces. * For now, it simply divides the machine in half. In the future, it will * be a more complicated routine taking into account the architecture of - * the machine and communication network. - * The two resulting sets contain contiguously numbered processors + * the machine and communication network. + * The two resulting sets contain contiguously numbered processors * and parts. */ @@ -118,7 +80,7 @@ double *sum = NULL; while (np == 0 && (++i) < totalprocs) { Zoltan_LB_Proc_To_Part(zz, i, &np, &fpartmid); } - if (np) + if (np) *partmid = fpartmid; else *partmid = totalparts; @@ -131,7 +93,7 @@ double *sum = NULL; i = Zoltan_LB_Part_To_Proc(zz, *partmid, NULL); if (i != *procmid) { - /* Part is spread across several processors. + /* Part is spread across several processors. Don't allow mid to fall within a part; reset procmid so that it falls at a part boundary. */ @@ -169,7 +131,7 @@ double *sum = NULL; *set = 0; *num_parts = *partmid - *partlower; *num_procs = *procmid - *proclower; - } + } else { *set = 1; *num_parts = totalparts - *partmid; @@ -184,7 +146,7 @@ int Zoltan_Divide_Parts( ZZ *zz, /* The Zoltan structure (not used now, will be used for pointer to machine details */ int obj_wgt_dim, /* Number of different weights (loads). */ - float *part_sizes, /* Array of part sizes, containing percentage of + float *part_sizes, /* Array of part sizes, containing percentage of work per part. (length= obj_wgt_dim*num_parts) */ int num_parts, /* Input: # of parts to be divided */ int *partlower, /* lowest numbered part in first set */ @@ -198,7 +160,7 @@ int dim = obj_wgt_dim; double *sum = NULL; /* This SERIAL routine divides the current group of parts - * into two pieces with roughly equal numbers of parts per piece. + * into two pieces with roughly equal numbers of parts per piece. * It is designed to be used within a single processor to divide its * parts into two sets (e.g., in serial_rcb). */ diff --git a/packages/zoltan/src/ha/get_processor_name.c b/packages/zoltan/src/ha/get_processor_name.c index 4e2e9987f6..7dd10b5a1e 100644 --- a/packages/zoltan/src/ha/get_processor_name.c +++ b/packages/zoltan/src/ha/get_processor_name.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -56,8 +19,8 @@ extern "C" { int Zoltan_Get_Processor_Name( ZZ *zz, /* The Zoltan structure. */ - char *name /* A string uniquely identifying the processor. - We assume that at least MAX_PROC_NAME_LEN + char *name /* A string uniquely identifying the processor. + We assume that at least MAX_PROC_NAME_LEN characters have been allocated. */ ) { diff --git a/packages/zoltan/src/ha/ha_const.h b/packages/zoltan/src/ha/ha_const.h index 988eef0613..001b072110 100644 --- a/packages/zoltan/src/ha/ha_const.h +++ b/packages/zoltan/src/ha/ha_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __HA_CONST_H #define __HA_CONST_H @@ -57,7 +20,7 @@ extern "C" { extern int Zoltan_Get_Processor_Name(ZZ *, char *); -extern int Zoltan_Divide_Machine(ZZ *, int, float *, int, MPI_Comm, int *, +extern int Zoltan_Divide_Machine(ZZ *, int, float *, int, MPI_Comm, int *, int *, int *, int *, int *, int *, int *, double *); extern int Zoltan_Divide_Parts(ZZ *, int, float *, int, int *, int *, double *); diff --git a/packages/zoltan/src/ha/ha_ovis.c b/packages/zoltan/src/ha/ha_ovis.c index 23436536a6..1a1eaac2f4 100644 --- a/packages/zoltan/src/ha/ha_ovis.c +++ b/packages/zoltan/src/ha/ha_ovis.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -75,7 +38,7 @@ static PARAM_VARS OVIS_params[] = { int Zoltan_OVIS_Setup( ZZ *zz, /* Input: Zoltan structure with input parameter strings */ struct OVIS_parameters *ovisParameters /* Output: parameter values */ -) +) { /* Allow OVIS parameters to be passed to Zoltan via Zoltan_Set_Param */ /* Three example parameters below. */ @@ -87,13 +50,13 @@ int Zoltan_OVIS_Setup( strcpy(ovisParameters->dll, ""); /* Tell Zoltan to associate parameter names with the variables. */ - Zoltan_Bind_Param(OVIS_params, "OVIS_HELLO", + Zoltan_Bind_Param(OVIS_params, "OVIS_HELLO", ovisParameters->hello); - Zoltan_Bind_Param(OVIS_params, "OVIS_DLL", + Zoltan_Bind_Param(OVIS_params, "OVIS_DLL", ovisParameters->dll); - Zoltan_Bind_Param(OVIS_params, "OVIS_OUTPUT_LEVEL", + Zoltan_Bind_Param(OVIS_params, "OVIS_OUTPUT_LEVEL", (void *) &(ovisParameters->outputLevel)); - Zoltan_Bind_Param(OVIS_params, "OVIS_MINVERSION", + Zoltan_Bind_Param(OVIS_params, "OVIS_MINVERSION", (void *) &(ovisParameters->minVersion)); /* Tell Zoltan to look for parameters matching the names above */ diff --git a/packages/zoltan/src/ha/ha_ovis.h b/packages/zoltan/src/ha/ha_ovis.h index 8c8e3ab7f6..27eb08cbf5 100644 --- a/packages/zoltan/src/ha/ha_ovis.h +++ b/packages/zoltan/src/ha/ha_ovis.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __HA_OVIS_H #define __HA_OVIS_H diff --git a/packages/zoltan/src/hier/README b/packages/zoltan/src/hier/README index b0aa2ca0d4..a596173582 100644 --- a/packages/zoltan/src/hier/README +++ b/packages/zoltan/src/hier/README @@ -1,46 +1,11 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER HIER DIRECTORY -- Hierarchical partitioning and rebalancing support diff --git a/packages/zoltan/src/hier/hier.c b/packages/zoltan/src/hier/hier.c index 965cca9fca..a0e3a11c1a 100644 --- a/packages/zoltan/src/hier/hier.c +++ b/packages/zoltan/src/hier/hier.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -1115,14 +1078,14 @@ static int Zoltan_Hier_Initialize_Params(ZZ *zz, HierPartParams *hpp) { } if (hpp->output_level >= HIER_DEBUG_LIST){ - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); for (i=0; i < zz->Num_Proc; i++){ if (i == zz->Proc){ view_hierarchy_specification(hpp->spec, i, (i==0)); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); } return ZOLTAN_OK; @@ -1746,6 +1709,7 @@ int Zoltan_Hier( ZOLTAN_FREE(&hpp.adjproc); ZOLTAN_FREE(&hpp.geom_vec); MPI_Comm_free(&hpp.hier_comm); + hpp.hier_comm = MPI_COMM_NULL; } ierr = Zoltan_LB_Free_Part(&hier_import_gids, &hier_import_lids, diff --git a/packages/zoltan/src/hier/hier.h b/packages/zoltan/src/hier/hier.h index f4e90c0f41..d8e12159b6 100644 --- a/packages/zoltan/src/hier/hier.h +++ b/packages/zoltan/src/hier/hier.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __HIER_H #define __HIER_H @@ -91,9 +54,9 @@ struct HierPartParamsStruct { int num_levels; /* number of levels I do */ int level; /* level currently being processed */ MPI_Comm hier_comm; /* MPI communicator for each level */ - + ZZ *origzz; /* Zoltan struct passed into top level */ - ZZ *hierzz; /* internal zoltan struct for balancing + ZZ *hierzz; /* internal zoltan struct for balancing within the hierarchy */ int part_to_compute; /* part to compute at each level */ diff --git a/packages/zoltan/src/hier/hier_free_struct.c b/packages/zoltan/src/hier/hier_free_struct.c index f6b906f87f..067d3be40c 100644 --- a/packages/zoltan/src/hier/hier_free_struct.c +++ b/packages/zoltan/src/hier/hier_free_struct.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/hsfc/hsfc.c b/packages/zoltan/src/hsfc/hsfc.c index 8e750f5145..2dcd799d7a 100644 --- a/packages/zoltan/src/hsfc/hsfc.c +++ b/packages/zoltan/src/hsfc/hsfc.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -698,8 +661,8 @@ int Zoltan_HSFC( /* routine for bsearch locating the partition segment holding key */ int Zoltan_HSFC_compare (const void *key, const void *arg) { - if ( *(const double*) key >= ((const Partition*) arg)->r) return 1; - if ( *(const double*) key < ((const Partition*) arg)->l) return -1; + if ( *(double*) key >= ((Partition*) arg)->r) return 1; + if ( *(double*) key < ((Partition*) arg)->l) return -1; return 0; /* key in arg interval [l,r) */ } diff --git a/packages/zoltan/src/hsfc/hsfc.h b/packages/zoltan/src/hsfc/hsfc.h index 1540fcd4c2..635569c194 100644 --- a/packages/zoltan/src/hsfc/hsfc.h +++ b/packages/zoltan/src/hsfc/hsfc.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_HSFC_H #define ZOLTAN_HSFC_H @@ -57,7 +20,7 @@ #include "zz_const.h" #include "all_allo_const.h" #include "params_const.h" -#include "zoltan_util.h" +#include "zoltan_util.h" #include "hsfc_hilbert_const.h" #include "hsfc_const.h" diff --git a/packages/zoltan/src/hsfc/hsfc_box_assign.c b/packages/zoltan/src/hsfc/hsfc_box_assign.c index 3dafd855ff..9e7cd27d69 100644 --- a/packages/zoltan/src/hsfc/hsfc_box_assign.c +++ b/packages/zoltan/src/hsfc/hsfc_box_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -116,11 +79,11 @@ int Zoltan_HSFC_Box_Assign ( } if (d->tran.Target_Dim > 0){ /* It must be 1 or 2 */ - /* + /* * Degenerate geometry: * Transform query box into coordinates that were used for partitioning, - * and place an axis aligned bounding box around it. This box in the new - * coordinates may encompass more "dots" than did the original box, but + * and place an axis aligned bounding box around it. This box in the new + * coordinates may encompass more "dots" than did the original box, but * it won't miss any dots. */ lo[0] = xlo; lo[1] = ylo; lo[2] = zlo; @@ -138,7 +101,7 @@ int Zoltan_HSFC_Box_Assign ( dim = d->tran.Target_Dim; } else if (d->tran.Target_Dim == 1){ - /* + /* * Don't let Point_Assign transform coordinates (we already * did that) or remap partition numbers (we'll do that at "fini"). */ @@ -152,7 +115,7 @@ int Zoltan_HSFC_Box_Assign ( for (i = n; i <= loop; i++) /* loop < n */ part_array[i] = 1; d->tran.Target_Dim = 1; - d->ndimension = dim; + d->ndimension = dim; zz->LB.Remap = remap; goto fini; } @@ -324,7 +287,7 @@ static double next_query_2d (ZZ *zz, double *lquerybox, double *hquerybox, /* convert floating minimum query hilbert coordinate to integer */ start[1] = (unsigned int) (modf (s * (double) IMAX, &t) * (double) IMAX); start[0] = (unsigned int) t; - + /* initializations before starting main loop */ state = 0; prune = 1; @@ -397,7 +360,7 @@ static double next_query_2d (ZZ *zz, double *lquerybox, double *hquerybox, /* discard results below backtrack level */ keyx &= ~(IMAX >> savelevel); keyy &= ~(IMAX >> savelevel); - + nptx &= ~(IMAX >> savelevel); nptx &= ~(IMAX >> savelevel); } @@ -490,7 +453,7 @@ static double next_query_3d (ZZ *zz, double *lquerybox, double *hquerybox, x = ((nptx | temp) > qhix) ? qhix : (nptx | temp); y = ((npty | temp) > qhiy) ? qhiy : (npty | temp); z = ((nptz | temp) > qhiz) ? qhiz : (nptz | temp); - intersect_hi = ((x >> (29-level)) & 4) + intersect_hi = ((x >> (29-level)) & 4) | ((y >> (30-level)) & 2) | ((z >> (31-level)) & 1); @@ -498,7 +461,7 @@ static double next_query_3d (ZZ *zz, double *lquerybox, double *hquerybox, x = ((nptx & temp) < qlox) ? qlox : (nptx & temp); y = ((npty & temp) < qloy) ? qloy : (npty & temp); z = ((nptz & temp) < qloz) ? qloz : (nptz & temp); - intersect_lo = ((x >> (29-level)) & 4) + intersect_lo = ((x >> (29-level)) & 4) | ((y >> (30-level)) & 2) | ((z >> (31-level)) & 1); @@ -571,7 +534,7 @@ static double next_query_3d (ZZ *zz, double *lquerybox, double *hquerybox, for (i = 0; i < MAXLEVEL; i++) { start[0] = (start[0] << 3) | (start[1] >> 29); start[1] = (start[1] << 3) | ((keyx >> (29-i)) & 4) - | ((keyy >> (30-i)) & 2) + | ((keyy >> (30-i)) & 2) | ((keyz >> (31-i)) & 1); } return ldexp ((double) start[0], -22) + ldexp((double) start[1], -54); diff --git a/packages/zoltan/src/hsfc/hsfc_const.h b/packages/zoltan/src/hsfc/hsfc_const.h index b0b2b0a26b..fe6effc4e4 100644 --- a/packages/zoltan/src/hsfc/hsfc_const.h +++ b/packages/zoltan/src/hsfc/hsfc_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_HSFC_CONST_H #define ZOLTAN_HSFC_CONST_H diff --git a/packages/zoltan/src/hsfc/hsfc_hilbert.c b/packages/zoltan/src/hsfc/hsfc_hilbert.c index 79c75a5600..a39bb20c52 100644 --- a/packages/zoltan/src/hsfc/hsfc_hilbert.c +++ b/packages/zoltan/src/hsfc/hsfc_hilbert.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -86,7 +49,7 @@ double Zoltan_HSFC_InvHilbert2d (ZZ *zz, double *coord) char *yo = "Zoltan_HSFC_InvHilbert2d"; /* sanity check for input arguments */ - if ((coord[0] < 0.0) || (coord[0] > 1.0) || (coord[1] < 0.0) + if ((coord[0] < 0.0) || (coord[0] > 1.0) || (coord[1] < 0.0) || (coord[1] > 1.0)) ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Spatial Coordinates out of range."); @@ -168,12 +131,12 @@ double Zoltan_HSFC_InvHilbert3d (ZZ *zz, double *coord) } - + /* Note: the following code has been tested and is fine. It was necessary during the testing for the new box assign algorithm. Since it is potentially useful, I am leaving this code intact, but ifdef'ing it out because of the SQA coverage requirement. */ - + #ifdef RTHRTH /* Given the Hilbert key, returns it as the coordinate in [0,1] */ void Zoltan_HSFC_Hilbert1d (ZZ *zz, double *coord, double key) @@ -323,9 +286,10 @@ Change the declaration to static const int MAXLEVEL = 32; Eliminate the lines that convert the orginal double arguement of key to ikey. -*/ +*/ #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/hsfc/hsfc_hilbert_const.h b/packages/zoltan/src/hsfc/hsfc_hilbert_const.h index 630f56a90f..15e05d5290 100644 --- a/packages/zoltan/src/hsfc/hsfc_hilbert_const.h +++ b/packages/zoltan/src/hsfc/hsfc_hilbert_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __HSFC_HILBERT_CONST_H #define __HSFC_HILBERT_CONST_H @@ -55,7 +18,7 @@ extern "C" { #endif /*************************************************************************** -* The modules and data arrays in hsfc_hilbert.c and hsfc_box_assign.c are +* The modules and data arrays in hsfc_hilbert.c and hsfc_box_assign.c are * influenced by a series of papers: * "Load balancing for the parallel adaptive solution of partial differential * equations", 1994, deCougny, Devine, Flaherty, Loy, Ozturan, Shephard @@ -75,7 +38,7 @@ extern "C" { * data queries, etc. is "Fundamentals of Spatial Information Systems, 1992, * Laurini, Thompson. * -* Useful code examples for the generation of Hilbert and Inverse Hilbert +* Useful code examples for the generation of Hilbert and Inverse Hilbert * coordinates came from Octree (in above papers) also using state tables, * H. Carter Edwards (1997), (Ph.D. dissertation, code copyrighted 1997), * Doug Moore, Rice University (copyrighted 1998-2000) whose code also diff --git a/packages/zoltan/src/hsfc/hsfc_params.h b/packages/zoltan/src/hsfc/hsfc_params.h index 0bbd6bfd58..2a6f2c799d 100644 --- a/packages/zoltan/src/hsfc/hsfc_params.h +++ b/packages/zoltan/src/hsfc/hsfc_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __HSFC_PARAMS_H #define __HSFC_PARAMS_H diff --git a/packages/zoltan/src/hsfc/hsfc_point_assign.c b/packages/zoltan/src/hsfc/hsfc_point_assign.c index eef394cc6a..abfc53221d 100644 --- a/packages/zoltan/src/hsfc/hsfc_point_assign.c +++ b/packages/zoltan/src/hsfc/hsfc_point_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -60,8 +23,8 @@ extern "C" { /* Point drop for refinement after above partitioning */ int Zoltan_HSFC_Point_Assign ( - ZZ *zz, - double *x, + ZZ *zz, + double *x, int *proc, int *part) { @@ -116,7 +79,7 @@ int Zoltan_HSFC_Point_Assign ( *part = p->index; } if (proc != NULL) { - if (zz->LB.Remap) + if (zz->LB.Remap) *proc = Zoltan_LB_Part_To_Proc(zz, zz->LB.Remap[p->index], NULL); else *proc = Zoltan_LB_Part_To_Proc(zz, p->index, NULL); diff --git a/packages/zoltan/src/include/README b/packages/zoltan/src/include/README index 6133691824..5d21d7d8af 100644 --- a/packages/zoltan/src/include/README +++ b/packages/zoltan/src/include/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Include files for the Zoltan interface. diff --git a/packages/zoltan/src/include/lbi_const.h b/packages/zoltan/src/include/lbi_const.h index 68c9223556..8a93cbd11a 100644 --- a/packages/zoltan/src/include/lbi_const.h +++ b/packages/zoltan/src/include/lbi_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __LBI_CONST_H #define __LBI_CONST_H diff --git a/packages/zoltan/src/include/zoltan.h b/packages/zoltan/src/include/zoltan.h index 6bb2712a0c..58d818358c 100644 --- a/packages/zoltan/src/include/zoltan.h +++ b/packages/zoltan/src/include/zoltan.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012, 2023 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_H #define __ZOLTAN_H @@ -56,14 +19,13 @@ #include "zoltan_eval.h" /* - * Define this prior to #ifdef __cplusplus to avoid a + * Define this prior to #ifdef __cplusplus to avoid a * compiler warning when compiling C++ on Solaris */ typedef void ZOLTAN_VOID_FN(void); #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ - // NOLINTBEGIN extern "C" { #endif @@ -172,15 +134,15 @@ struct Zoltan_Struct; /*****************************************************************************/ /* - * Function to return, for a list of object IDs, + * Function to return, for a list of object IDs, * the partition numbers the objects are assigned to. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a local ID - * num_obj -- number of objects for which partition values + * num_obj -- number of objects for which partition values * should be returned. * global_id -- the Global IDs for the objects * local_id -- the Local IDs for the objects @@ -191,23 +153,23 @@ struct Zoltan_Struct; */ typedef void ZOLTAN_PART_MULTI_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, int num_obj, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *parts, int *ierr ); typedef void ZOLTAN_PART_MULTI_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, int *num_obj, - ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR local_id, int *parts, int *ierr ); @@ -220,7 +182,7 @@ typedef void ZOLTAN_PART_MULTI_FORT_FN( /* * Function to return, for the object with a given ID, * the partition number the object is assigned to. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -234,20 +196,20 @@ typedef void ZOLTAN_PART_MULTI_FORT_FN( */ typedef int ZOLTAN_PART_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr ); typedef int ZOLTAN_PART_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR local_id, int *ierr ); @@ -260,7 +222,7 @@ typedef int ZOLTAN_PART_FORT_FN( * Function to return, for the object with a given ID, * the object's number of edges (i.e., the number of objects with which * the given object must communicate). - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -274,20 +236,20 @@ typedef int ZOLTAN_PART_FORT_FN( */ typedef int ZOLTAN_NUM_EDGES_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr ); typedef int ZOLTAN_NUM_EDGES_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR local_id, int *ierr ); @@ -296,7 +258,7 @@ typedef int ZOLTAN_NUM_EDGES_FORT_FN( * Function to return, for a list of object with a given IDs, * each object's number of edges (i.e., the number of objects with which * the given object must communicate). - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -313,33 +275,33 @@ typedef int ZOLTAN_NUM_EDGES_FORT_FN( */ typedef void ZOLTAN_NUM_EDGES_MULTI_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, int num_obj, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *num_edges, int *ierr ); typedef void ZOLTAN_NUM_EDGES_MULTI_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, int *num_obj, - ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR local_id, int *num_edges, int *ierr ); /*****************************************************************************/ /* - * Function to return, for the object with a given ID, + * Function to return, for the object with a given ID, * the object's edge list (i.e., objects with which the given object must * communicate. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -352,35 +314,35 @@ typedef void ZOLTAN_NUM_EDGES_MULTI_FORT_FN( * Output: * nbor_global_ids -- Array of Global IDs of neighboring objects. * nbor_procs -- Array of neighboring procs. - * nbor_ewgts -- Array of edge weights, where + * nbor_ewgts -- Array of edge weights, where * nbor_ewgts[i*wdim:(i+1)*wdim-1] * corresponds to the weight of edge i * ierr -- error code */ typedef void ZOLTAN_EDGE_LIST_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, - ZOLTAN_ID_PTR nbor_global_id, + ZOLTAN_ID_PTR nbor_global_id, int *nbor_procs, - int wdim, - float *nbor_ewgts, + int wdim, + float *nbor_ewgts, int *ierr ); typedef void ZOLTAN_EDGE_LIST_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR local_id, ZOLTAN_ID_PTR nbor_global_id, - int *nbor_procs, - int *wdim, - float *nbor_ewgts, + int *nbor_procs, + int *wdim, + float *nbor_ewgts, int *ierr ); @@ -389,7 +351,7 @@ typedef void ZOLTAN_EDGE_LIST_FORT_FN( * Function to return, for an array of objects, * each object's edge list (i.e., objects with which the given object must * communicate. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -404,47 +366,47 @@ typedef void ZOLTAN_EDGE_LIST_FORT_FN( * edge weights are not sought. * Output: * nbor_global_ids -- Array of Global IDs of neighboring objects. - * Nbors are stored consecutively; + * Nbors are stored consecutively; * nbor_global_ids[sum:sum+num_edges[i]-1], * sum = sum j from 0 to i-1 of num_edges[j], * holds nbors for the i-th global_id. * nbor_procs -- Array of neighboring procs. Storage is parallel * to nbor_global_ids. - * nbor_ewgts -- Array of edge weights, where + * nbor_ewgts -- Array of edge weights, where * nbor_ewgts[sum*wdim:(num_edges[i]+sum)*wdim-1], * sum = sum j from 0 to i-1 of num_edges[j], - * corresponds to the weights for edges of the + * corresponds to the weights for edges of the * i-th global_id. * ierr -- error code */ typedef void ZOLTAN_EDGE_LIST_MULTI_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, int num_obj, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *num_edges, - ZOLTAN_ID_PTR nbor_global_id, + ZOLTAN_ID_PTR nbor_global_id, int *nbor_procs, - int wdim, - float *nbor_ewgts, + int wdim, + float *nbor_ewgts, int *ierr ); typedef void ZOLTAN_EDGE_LIST_MULTI_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, int *num_obj, - ZOLTAN_ID_PTR global_ids, - ZOLTAN_ID_PTR local_ids, + ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR local_ids, int *num_edges, ZOLTAN_ID_PTR nbor_global_id, - int *nbor_procs, - int *wdim, - float *nbor_ewgts, + int *nbor_procs, + int *wdim, + float *nbor_ewgts, int *ierr ); @@ -453,7 +415,7 @@ typedef void ZOLTAN_EDGE_LIST_MULTI_FORT_FN( * Function to return * the number of geometry fields per object (e.g., the number of values * used to express the coordinates of the object). - * Input: + * Input: * data -- pointer to user defined data structure * Output: * ierr -- error code @@ -461,20 +423,20 @@ typedef void ZOLTAN_EDGE_LIST_MULTI_FORT_FN( */ typedef int ZOLTAN_NUM_GEOM_FN( - void *data, + void *data, int *ierr ); typedef int ZOLTAN_NUM_GEOM_FORT_FN( - void *data, + void *data, int *ierr ); /*****************************************************************************/ /* - * Function to return the geometry information (e.g., coordinates) for + * Function to return the geometry information (e.g., coordinates) for * all objects. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -482,38 +444,38 @@ typedef int ZOLTAN_NUM_GEOM_FORT_FN( * in a local ID * num_obj -- number of objects whose coordinates are needed. * global_id -- array of Global IDs for the objects - * local_id -- array of Local IDs for the objects; + * local_id -- array of Local IDs for the objects; * NULL if num_lid_entries == 0. * num_dim -- dimension of coordinates for each object. * Output: - * geom_vec -- the geometry info for the objects; + * geom_vec -- the geometry info for the objects; * (e.g., coordinates) - * If num_dim == n, geom_vec[i*n+j] is the + * If num_dim == n, geom_vec[i*n+j] is the * jth coordinate for object i. * ierr -- error code */ typedef void ZOLTAN_GEOM_MULTI_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, int num_obj, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int num_dim, - double *geom_vec, + double *geom_vec, int *ierr ); typedef void ZOLTAN_GEOM_MULTI_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, int *num_obj, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *num_dim, - double *geom_vec, + double *geom_vec, int *ierr ); @@ -521,7 +483,7 @@ typedef void ZOLTAN_GEOM_MULTI_FORT_FN( /* * Function to return, for the object with a given ID, * the geometry information for the object (e.g., coordinates). - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -536,30 +498,30 @@ typedef void ZOLTAN_GEOM_MULTI_FORT_FN( */ typedef void ZOLTAN_GEOM_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, - double *geom_vec, + double *geom_vec, int *ierr ); typedef void ZOLTAN_GEOM_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, - double *geom_vec, + double *geom_vec, int *ierr ); /*****************************************************************************/ /* - * Function to return, for the calling processor, the number of objects + * Function to return, for the calling processor, the number of objects * located in that processor's memory. - * Input: + * Input: * data -- pointer to user defined data structure * Output: * ierr -- error code @@ -567,54 +529,54 @@ typedef void ZOLTAN_GEOM_FORT_FN( */ typedef int ZOLTAN_NUM_OBJ_FN( - void *data, + void *data, int *ierr ); typedef int ZOLTAN_NUM_OBJ_FORT_FN( - void *data, + void *data, int *ierr ); /*****************************************************************************/ /* * Function to return a list of all local objects on a processor. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a local ID * wdim -- dimension of object weights, or 0 if - * object weights are not sought. + * object weights are not sought. * Output: * global_ids -- array of Global IDs of all objects on the * processor. * local_ids -- array of Local IDs of all objects on the * processor. * objwgts -- objwgts[i*wdim:(i+1)*wdim-1] correponds - * to the weight of object i + * to the weight of object i * ierr -- error code */ typedef void ZOLTAN_OBJ_LIST_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, - int wdim, - float *objwgts, + int wdim, + float *objwgts, int *ierr ); typedef void ZOLTAN_OBJ_LIST_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, - int *wdim, + int *wdim, float *objwgts, int *ierr ); @@ -639,29 +601,29 @@ typedef void ZOLTAN_OBJ_LIST_FORT_FN( * first_obj_wgt -- weight vector for first object * (undefined if wdim=0) * ierr -- error code - * Returned value: -- 1 if a valid object is returned; + * Returned value: -- 1 if a valid object is returned; * 0 if no more objects exist on the processor. */ typedef int ZOLTAN_FIRST_OBJ_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR first_global_id, - ZOLTAN_ID_PTR first_local_id, - int wdim, - float *first_obj_wgt, + ZOLTAN_ID_PTR first_local_id, + int wdim, + float *first_obj_wgt, int *ierr ); typedef int ZOLTAN_FIRST_OBJ_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR first_global_id, - ZOLTAN_ID_PTR first_local_id, + ZOLTAN_ID_PTR first_local_id, int *wdim, - float *first_obj_wgt, + float *first_obj_wgt, int *ierr ); @@ -669,7 +631,7 @@ typedef int ZOLTAN_FIRST_OBJ_FORT_FN( /* * Iterator function for local objects; return the next local object. * This function should be used with ZOLTAN_FIRST_OBJ_FN. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -693,28 +655,28 @@ typedef int ZOLTAN_FIRST_OBJ_FORT_FN( */ typedef int ZOLTAN_NEXT_OBJ_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, - ZOLTAN_ID_PTR next_global_id, + ZOLTAN_ID_PTR next_global_id, ZOLTAN_ID_PTR next_local_id, - int wdim, - float *next_obj_wgt, + int wdim, + float *next_obj_wgt, int *ierr ); typedef int ZOLTAN_NEXT_OBJ_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, ZOLTAN_ID_PTR next_global_id, ZOLTAN_ID_PTR next_local_id, - int *wdim, - float *next_obj_wgt, + int *wdim, + float *next_obj_wgt, int *ierr ); @@ -722,8 +684,8 @@ typedef int ZOLTAN_NEXT_OBJ_FORT_FN( /*****************************************************************************/ /* * Function to return the size (in bytes) of data associated with an object. - * - * Input: + * + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -741,7 +703,7 @@ typedef int ZOLTAN_OBJ_SIZE_FN( void *data, int num_gid_entries, int num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr ); @@ -750,17 +712,17 @@ typedef int ZOLTAN_OBJ_SIZE_FORT_FN( void *data, int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int *ierr ); /*****************************************************************************/ -/* - * MULTI-ID version of ZOLTAN_OBJ_SIZE_FN +/* + * MULTI-ID version of ZOLTAN_OBJ_SIZE_FN * Function to return the size (in bytes) of data associated with each of * multiple objects. - * + * * Input: * data -- pointer to user-defined data structure. * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE @@ -768,10 +730,10 @@ typedef int ZOLTAN_OBJ_SIZE_FORT_FN( * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a local ID * num_ids -- number of objects whose size is sought - * global_ids -- the Global IDs for the objects + * global_ids -- the Global IDs for the objects * local_ids -- the Local IDs for the objects * Output: - * num_bytes -- array of sizes (in bytes) for the given IDs + * num_bytes -- array of sizes (in bytes) for the given IDs * ierr -- Zoltan error code */ @@ -799,11 +761,11 @@ typedef void ZOLTAN_OBJ_SIZE_MULTI_FORT_FN( /*****************************************************************************/ /* * Function to pack data to be migrated for the given object. - * This function is needed only when the application wants the load-balancer + * This function is needed only when the application wants the load-balancer * to help migrate the data. It packs all data related to the given object * into a communication buffer, the starting address of which is provided * by the load-balancer. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -823,7 +785,7 @@ typedef void ZOLTAN_OBJ_SIZE_MULTI_FORT_FN( */ typedef void ZOLTAN_PACK_OBJ_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -835,7 +797,7 @@ typedef void ZOLTAN_PACK_OBJ_FN( ); typedef void ZOLTAN_PACK_OBJ_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -848,7 +810,7 @@ typedef void ZOLTAN_PACK_OBJ_FORT_FN( /*****************************************************************************/ /* - * MULTI-ID version of ZOLTAN_PACK_OBJ_FN + * MULTI-ID version of ZOLTAN_PACK_OBJ_FN * Function to pack data for multiple given objects. * * Input: @@ -858,22 +820,22 @@ typedef void ZOLTAN_PACK_OBJ_FORT_FN( * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a local ID * num_ids -- number of objects whose data is to be packed - * global_ids -- the Global IDs for the objects + * global_ids -- the Global IDs for the objects * local_ids -- the Local IDs for the objects * dest_proc -- Processor IDs of the destination processor for the * objects. * size -- number of bytes allowed for each object to * be packed. - * size[i] = # of bytes to store the i-th object's + * size[i] = # of bytes to store the i-th object's * data. Each size includes padding for alignment. - * index -- Indices into buf giving the starting location + * index -- Indices into buf giving the starting location * of each object's data; * data for the i-th object are stored in * buf[index[i]], * buf[index[i]+1], ..., * buf[index[i]+size[i]-1]. * Since Zoltan adds some tag information - * to packed data, index[i] != sum[j=0,i-1](size[j]) + * to packed data, index[i] != sum[j=0,i-1](size[j]) * buf -- starting address of buffer into which to * pack the object. * Output: @@ -913,10 +875,10 @@ typedef void ZOLTAN_PACK_OBJ_MULTI_FORT_FN( /*****************************************************************************/ /* * Function to unpack data for an object migrated to a new processor. - * This function is needed only when the application wants the load-balancer + * This function is needed only when the application wants the load-balancer * to help migrate the data. The data is stored in a buffer (char *); the * size of the data for the object is included. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -930,9 +892,9 @@ typedef void ZOLTAN_PACK_OBJ_MULTI_FORT_FN( */ typedef void ZOLTAN_UNPACK_OBJ_FN( - void *data, + void *data, int num_gid_entries, - ZOLTAN_ID_PTR global_id, + ZOLTAN_ID_PTR global_id, int size, char *buf, int *ierr @@ -940,7 +902,7 @@ typedef void ZOLTAN_UNPACK_OBJ_FN( typedef void ZOLTAN_UNPACK_OBJ_FORT_FN( void *data, - int *num_gid_entries, + int *num_gid_entries, ZOLTAN_ID_PTR global_id, int *size, char *buf, @@ -949,11 +911,11 @@ typedef void ZOLTAN_UNPACK_OBJ_FORT_FN( /*****************************************************************************/ -/* - * MULTI-ID version of ZOLTAN_UNPACK_OBJ_FN +/* + * MULTI-ID version of ZOLTAN_UNPACK_OBJ_FN * Function to unpack data for an object migrated to a new processor. * - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -971,7 +933,7 @@ typedef void ZOLTAN_UNPACK_OBJ_FORT_FN( * buf[index[i]+size[i]-1]. * Since Zoltan adds some tag information * to packed data, - * index[i] != sum[j=0,i-1](size[j]) + * index[i] != sum[j=0,i-1](size[j]) * buf -- starting address of buffer from which to * unpack the objects. * Output: @@ -1003,12 +965,12 @@ typedef void ZOLTAN_UNPACK_OBJ_MULTI_FORT_FN( /*****************************************************************************/ /* * Function called as a pre-processor to migration; it includes partition - * as well as processor information. This function is + * as well as processor information. This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * pre-processing in this function. * - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1030,7 +992,7 @@ typedef void ZOLTAN_UNPACK_OBJ_MULTI_FORT_FN( */ typedef void ZOLTAN_PRE_MIGRATE_PP_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1047,17 +1009,17 @@ typedef void ZOLTAN_PRE_MIGRATE_PP_FN( ); typedef void ZOLTAN_PRE_MIGRATE_PP_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *export_to_part, int *ierr @@ -1067,12 +1029,12 @@ typedef void ZOLTAN_PRE_MIGRATE_PP_FORT_FN( /* * Function called between the packing and unpacking phases of data migration. * It includes partition as well as processor information. - * Within Zoltan_Migrate, the data to be migrated is packed and - * communicated; then this function is called (if specified). This function is + * Within Zoltan_Migrate, the data to be migrated is packed and + * communicated; then this function is called (if specified). This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * processing in this function. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1094,7 +1056,7 @@ typedef void ZOLTAN_PRE_MIGRATE_PP_FORT_FN( */ typedef void ZOLTAN_MID_MIGRATE_PP_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1111,17 +1073,17 @@ typedef void ZOLTAN_MID_MIGRATE_PP_FN( ); typedef void ZOLTAN_MID_MIGRATE_PP_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *export_to_part, int *ierr @@ -1129,12 +1091,12 @@ typedef void ZOLTAN_MID_MIGRATE_PP_FORT_FN( /*****************************************************************************/ /* - * Function called as a post-processor to the migration. It includes - * partition as well as processor information. This function is + * Function called as a post-processor to the migration. It includes + * partition as well as processor information. This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * post-processing in this function. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1156,7 +1118,7 @@ typedef void ZOLTAN_MID_MIGRATE_PP_FORT_FN( */ typedef void ZOLTAN_POST_MIGRATE_PP_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1173,17 +1135,17 @@ typedef void ZOLTAN_POST_MIGRATE_PP_FN( ); typedef void ZOLTAN_POST_MIGRATE_PP_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, int *import_to_part, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *export_to_part, int *ierr @@ -1192,12 +1154,12 @@ typedef void ZOLTAN_POST_MIGRATE_PP_FORT_FN( /*****************************************************************************/ /* * Function called as a pre-processor to migration; it includes only - * processor information. This function is + * processor information. This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * pre-processing in this function. * - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1217,7 +1179,7 @@ typedef void ZOLTAN_POST_MIGRATE_PP_FORT_FN( */ typedef void ZOLTAN_PRE_MIGRATE_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1232,16 +1194,16 @@ typedef void ZOLTAN_PRE_MIGRATE_FN( ); typedef void ZOLTAN_PRE_MIGRATE_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *ierr ); @@ -1250,12 +1212,12 @@ typedef void ZOLTAN_PRE_MIGRATE_FORT_FN( /* * Function called between the packing and unpacking phases of data migration. * It includes only processor information. - * Within Zoltan_Migrate, the data to be migrated is packed and - * communicated; then this function is called (if specified). This function is + * Within Zoltan_Migrate, the data to be migrated is packed and + * communicated; then this function is called (if specified). This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * processing in this function. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1275,7 +1237,7 @@ typedef void ZOLTAN_PRE_MIGRATE_FORT_FN( */ typedef void ZOLTAN_MID_MIGRATE_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1290,28 +1252,28 @@ typedef void ZOLTAN_MID_MIGRATE_FN( ); typedef void ZOLTAN_MID_MIGRATE_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *ierr ); /*****************************************************************************/ /* - * Function called as a post-processor to the migration. It includes - * only processor information. This function is + * Function called as a post-processor to the migration. It includes + * only processor information. This function is * optional, and is used only when the application wants Zoltan - * to help migrate the data. The application can perform any type of + * to help migrate the data. The application can perform any type of * post-processing in this function. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -1331,7 +1293,7 @@ typedef void ZOLTAN_MID_MIGRATE_FORT_FN( */ typedef void ZOLTAN_POST_MIGRATE_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, int num_import, @@ -1346,28 +1308,28 @@ typedef void ZOLTAN_POST_MIGRATE_FN( ); typedef void ZOLTAN_POST_MIGRATE_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, int *num_import, ZOLTAN_ID_PTR import_global_ids, - ZOLTAN_ID_PTR import_local_ids, + ZOLTAN_ID_PTR import_local_ids, int *import_procs, - int *num_export, + int *num_export, ZOLTAN_ID_PTR export_global_ids, - ZOLTAN_ID_PTR export_local_ids, + ZOLTAN_ID_PTR export_local_ids, int *export_procs, int *ierr ); /*****************************************************************************/ /* Function to get the name of the physical processor on which - * the current process is running. + * the current process is running. * - * Input: + * Input: * data -- pointer to user defined data structure * * Output: - * name -- name of the processor + * name -- name of the processor * length -- length of the name * ierr -- error code */ @@ -1375,7 +1337,7 @@ typedef void ZOLTAN_POST_MIGRATE_FORT_FN( typedef void ZOLTAN_PROC_NAME_FN( void *data, char *name, - int *length, + int *length, int *ierr ); @@ -1394,12 +1356,12 @@ typedef void ZOLTAN_PROC_NAME_FN( */ typedef int ZOLTAN_NUM_COARSE_OBJ_FN( - void *data, + void *data, int *ierr ); typedef int ZOLTAN_NUM_COARSE_OBJ_FORT_FN( - void *data, + void *data, int *ierr ); @@ -1423,7 +1385,7 @@ typedef int ZOLTAN_NUM_COARSE_OBJ_FORT_FN( * is ignored. * num_vert -- array containing the number of vertices * for each object - * vertices -- array containing the vertices for each + * vertices -- array containing the vertices for each * object. If the sum of the number of * vertices for objects 0 through i-1 is N, * then the vertices for object i are in @@ -1443,7 +1405,7 @@ typedef int ZOLTAN_NUM_COARSE_OBJ_FORT_FN( */ typedef void ZOLTAN_COARSE_OBJ_LIST_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_ids, @@ -1461,7 +1423,7 @@ typedef void ZOLTAN_COARSE_OBJ_LIST_FORT_FN( void *data, int *num_gid_entries, int *num_lid_entries, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *assigned, int *num_vert, @@ -1509,7 +1471,7 @@ typedef void ZOLTAN_COARSE_OBJ_LIST_FORT_FN( */ typedef int ZOLTAN_FIRST_COARSE_OBJ_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1574,7 +1536,7 @@ typedef int ZOLTAN_FIRST_COARSE_OBJ_FORT_FN( */ typedef int ZOLTAN_NEXT_COARSE_OBJ_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1590,7 +1552,7 @@ typedef int ZOLTAN_NEXT_COARSE_OBJ_FN( ); typedef int ZOLTAN_NEXT_COARSE_OBJ_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1625,7 +1587,7 @@ typedef int ZOLTAN_NEXT_COARSE_OBJ_FORT_FN( */ typedef int ZOLTAN_NUM_CHILD_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1634,7 +1596,7 @@ typedef int ZOLTAN_NUM_CHILD_FN( ); typedef int ZOLTAN_NUM_CHILD_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1665,7 +1627,7 @@ typedef int ZOLTAN_NUM_CHILD_FORT_FN( * is ignored. * num_vert -- array containing the number of vertices * for each child - * vertices -- array containing the vertices for each + * vertices -- array containing the vertices for each * child. If the sum of the number of * vertices for children 0 through i-1 is N, * then the vertices for child i are in @@ -1683,7 +1645,7 @@ typedef int ZOLTAN_NUM_CHILD_FORT_FN( */ typedef void ZOLTAN_CHILD_LIST_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR parent_gid, @@ -1700,7 +1662,7 @@ typedef void ZOLTAN_CHILD_LIST_FN( ); typedef void ZOLTAN_CHILD_LIST_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR parent_gid, @@ -1738,7 +1700,7 @@ typedef void ZOLTAN_CHILD_LIST_FORT_FN( */ typedef void ZOLTAN_CHILD_WEIGHT_FN( - void *data, + void *data, int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1749,7 +1711,7 @@ typedef void ZOLTAN_CHILD_WEIGHT_FN( ); typedef void ZOLTAN_CHILD_WEIGHT_FORT_FN( - void *data, + void *data, int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR global_id, @@ -1792,7 +1754,7 @@ typedef void ZOLTAN_HG_SIZE_CS_FORT_FN( /*****************************************************************************/ /* * Function to return the pins (non-zeroes) of a hypergraph in - * compressed vertex or compressed hyperedge storage format. + * compressed vertex or compressed hyperedge storage format. * * Input: * data -- pointer to user defined data structure @@ -1804,19 +1766,19 @@ typedef void ZOLTAN_HG_SIZE_CS_FORT_FN( * * Output: * vtxedge_GID -- if ZOLTAN_COMPRESSED_EDGE: global edge ID for each edge - * if ZOLTAN_COMPRESSED_VERTEX: global vertex ID for each + * if ZOLTAN_COMPRESSED_VERTEX: global vertex ID for each * vertex - * vtxedge_ptr -- if ZOLTAN_COMPRESSED_EDGE: - * vtxedge_ptr[i+1]-vtxedge_ptr[i] is the number of + * vtxedge_ptr -- if ZOLTAN_COMPRESSED_EDGE: + * vtxedge_ptr[i+1]-vtxedge_ptr[i] is the number of * vertices belonging to edge i (i.e., pins or non-zeros) * specified by this processor in pin_GID. The starting - * index in pin_GID of edge i's vertices is + * index in pin_GID of edge i's vertices is * vtxedge_ptr[i]*num_gid_entries. - * if ZOLTAN_COMPRESSED_VERTEX: - * vtxedge_ptr[i+1]-vtxedge_ptr[i] is the number of - * edges to which vertex i belongs + * if ZOLTAN_COMPRESSED_VERTEX: + * vtxedge_ptr[i+1]-vtxedge_ptr[i] is the number of + * edges to which vertex i belongs * specified by this processor in pin_GID. The starting - * index in pin_GID of vertex i's edges is + * index in pin_GID of vertex i's edges is * vtxedge_ptr[i]*num_gid_entries. * pin_GID -- if ZOLTAN_COMPRESSED_EDGE: global vertex ID for each * pin (non-zero) in each edge @@ -1920,7 +1882,7 @@ typedef void ZOLTAN_HG_EDGE_WTS_FORT_FN( /* * Function to return * the number of objects on a given processor fixed to particular partitions. - * Input: + * Input: * data -- pointer to user defined data structure * Output: * ierr -- error code @@ -1928,12 +1890,12 @@ typedef void ZOLTAN_HG_EDGE_WTS_FORT_FN( */ typedef int ZOLTAN_NUM_FIXED_OBJ_FN( - void *data, + void *data, int *ierr ); typedef int ZOLTAN_NUM_FIXED_OBJ_FORT_FN( - void *data, + void *data, int *ierr ); @@ -1973,9 +1935,9 @@ typedef void ZOLTAN_FIXED_OBJ_LIST_FORT_FN( /*****************************************************************************/ /* - * Function to return, for the calling processor, the number of objects + * Function to return, for the calling processor, the number of objects * sharing a subdomain border with a given processor. - * Input: + * Input: * data -- pointer to user defined data structure * nbor_proc -- processor ID of the neighboring processor. * Output: @@ -1984,22 +1946,22 @@ typedef void ZOLTAN_FIXED_OBJ_LIST_FORT_FN( */ typedef int ZOLTAN_NUM_BORDER_OBJ_FN( - void *data, - int nbor_proc, + void *data, + int nbor_proc, int *ierr ); typedef int ZOLTAN_NUM_BORDER_OBJ_FORT_FN( - void *data, - int *nbor_proc, + void *data, + int *nbor_proc, int *ierr ); /*****************************************************************************/ /* - * Function to return a list of all objects sharing a subdomain border + * Function to return a list of all objects sharing a subdomain border * with a given processor. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -2012,44 +1974,44 @@ typedef int ZOLTAN_NUM_BORDER_OBJ_FORT_FN( * global_ids -- array of Global IDs of all objects on the * processor border with the given neighboring * processor. - * local_ids -- array of Local IDs of all objects on the - * processor border with the given neighboring + * local_ids -- array of Local IDs of all objects on the + * processor border with the given neighboring * processor. * objwgts -- objwgts[i*wdim:(i+1)*wdim-1] correponds - * to the weight of object i + * to the weight of object i * (objwgts is undefined if wdim=0) * ierr -- error code */ typedef void ZOLTAN_BORDER_OBJ_LIST_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, int nbor_proc, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, - int wdim, - float *objwgts, + int wdim, + float *objwgts, int *ierr ); typedef void ZOLTAN_BORDER_OBJ_LIST_FORT_FN( void *data, - int *num_gid_entries, + int *num_gid_entries, int *num_lid_entries, int *nbor_proc, - ZOLTAN_ID_PTR global_ids, + ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, - int *wdim, - float *objwgts, + int *wdim, + float *objwgts, int *ierr ); /*****************************************************************************/ /* - * Iterator function for border objects; return the first local object + * Iterator function for border objects; return the first local object * along the subdomain boundary with a given processor. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -2061,7 +2023,7 @@ typedef void ZOLTAN_BORDER_OBJ_LIST_FORT_FN( * Output: * first_global_id -- Global ID of the first object; NULL if no * objects. - * first_local_id -- Local ID of the first object; NULL if no + * first_local_id -- Local ID of the first object; NULL if no * objects. * first_obj_wgt -- weight vector for the first object * (undefined if wdim=0) @@ -2072,34 +2034,34 @@ typedef void ZOLTAN_BORDER_OBJ_LIST_FORT_FN( */ typedef int ZOLTAN_FIRST_BORDER_OBJ_FN( - void *data, - int num_gid_entries, - int num_lid_entries, + void *data, + int num_gid_entries, + int num_lid_entries, int nbor_proc, ZOLTAN_ID_PTR first_global_id, - ZOLTAN_ID_PTR first_local_id, - int wdim, + ZOLTAN_ID_PTR first_local_id, + int wdim, float *first_obj_wgt, int *ierr ); typedef int ZOLTAN_FIRST_BORDER_OBJ_FORT_FN( - void *data, - int *num_gid_entries, - int *num_lid_entries, + void *data, + int *num_gid_entries, + int *num_lid_entries, int *nbor_proc, ZOLTAN_ID_PTR first_global_id, - ZOLTAN_ID_PTR first_local_id, - int *wdim, + ZOLTAN_ID_PTR first_local_id, + int *wdim, float *first_obj_wgt, int *ierr ); /*****************************************************************************/ /* - * Iterator function for border objects; return the next local object + * Iterator function for border objects; return the next local object * along the subdomain boundary with a given processor. - * Input: + * Input: * data -- pointer to user defined data structure * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE * in a global ID @@ -2113,7 +2075,7 @@ typedef int ZOLTAN_FIRST_BORDER_OBJ_FORT_FN( * Output: * next_global_id -- Global ID of the next object; NULL if no * more objects. - * next_local_id -- Local ID of the next object; NULL if no + * next_local_id -- Local ID of the next object; NULL if no * more objects. * next_obj_wgt -- weight vector for the next object * (undefined if wdim=0) @@ -2124,29 +2086,29 @@ typedef int ZOLTAN_FIRST_BORDER_OBJ_FORT_FN( */ typedef int ZOLTAN_NEXT_BORDER_OBJ_FN( - void *data, - int num_gid_entries, + void *data, + int num_gid_entries, int num_lid_entries, ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR local_id, int nbor_proc, ZOLTAN_ID_PTR next_global_id, - ZOLTAN_ID_PTR next_local_id, - int wdim, + ZOLTAN_ID_PTR next_local_id, + int wdim, float *next_obj_wgt, int *ierr ); typedef int ZOLTAN_NEXT_BORDER_OBJ_FORT_FN( - void *data, - int *num_gid_entries, + void *data, + int *num_gid_entries, int *num_lid_entries, ZOLTAN_ID_PTR global_id, - ZOLTAN_ID_PTR local_id, + ZOLTAN_ID_PTR local_id, int *nbor_proc, ZOLTAN_ID_PTR next_global_id, - ZOLTAN_ID_PTR next_local_id, - int *wdim, + ZOLTAN_ID_PTR next_local_id, + int *wdim, float *next_obj_wgt, int *ierr ); @@ -2159,7 +2121,7 @@ typedef int ZOLTAN_NEXT_BORDER_OBJ_FORT_FN( /* * Function to return, for the calling processor, the number of levels * of hierarchy for hierarchical load balancing - * Input: + * Input: * data -- pointer to user defined data structure * Output: * ierr -- error code @@ -2172,7 +2134,7 @@ typedef int ZOLTAN_HIER_NUM_LEVELS_FN( ); typedef int ZOLTAN_HIER_NUM_LEVELS_FORT_FN( - void *data, + void *data, int *ierr ); @@ -2181,7 +2143,7 @@ typedef int ZOLTAN_HIER_NUM_LEVELS_FORT_FN( * Function to return, for the calling processor, the part * in which the processor is to be computing for hierarchical * balancing at the given level in the hierarchy - * Input: + * Input: * data -- pointer to user defined data structure * level -- level in the hierarchy being considered * Output: @@ -2212,7 +2174,7 @@ typedef int ZOLTAN_HIER_PART_FORT_FN( * given level in the hierarchy. This Zoltan_Struct can be passed to * Zoltan_Set_Param to set load balancing parameters for this level * in the hierarchical balancing - * Input: + * Input: * data -- pointer to user defined data structure * level -- level in the hierarchy being considered * zz -- Zoltan_Struct to use to set parameters @@ -2307,7 +2269,7 @@ extern struct Zoltan_Struct *Zoltan_Copy(struct Zoltan_Struct const *from); * successfully copied to the first, 1 otherwise. */ -extern int Zoltan_Copy_To(struct Zoltan_Struct *to, +extern int Zoltan_Copy_To(struct Zoltan_Struct *to, struct Zoltan_Struct const *from); /*****************************************************************************/ @@ -2329,7 +2291,7 @@ extern void Zoltan_Destroy( * zz -- Pointer to a Zoltan structure. * fn_type -- Enum type indicating the function to be * set. - * fn_ptr -- Pointer to the function to be used in the + * fn_ptr -- Pointer to the function to be used in the * assignment. * data_ptr -- Pointer to data that Zoltan will * pass as an argument to fn(). May be NULL. @@ -2373,7 +2335,7 @@ extern int Zoltan_Get_Fn( * callback function types. * Input: * zz -- Pointer to a Zoltan structure. - * fn_ptr -- Pointer to the function to be used in the + * fn_ptr -- Pointer to the function to be used in the * assignment, where FN is one of the * callback function typedef'ed above. * data_ptr -- Pointer to data that Zoltan will @@ -2384,271 +2346,271 @@ extern int Zoltan_Get_Fn( */ extern int Zoltan_Set_Part_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PART_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PART_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Part_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PART_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PART_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Edges_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_EDGES_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_EDGES_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Edges_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_EDGES_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_EDGES_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Edge_List_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_EDGE_LIST_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_EDGE_LIST_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Edge_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_EDGE_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_EDGE_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Geom_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_GEOM_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_GEOM_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Geom_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_GEOM_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_GEOM_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Geom_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_GEOM_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_GEOM_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Obj_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_OBJ_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_OBJ_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_First_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_FIRST_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_FIRST_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Next_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NEXT_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NEXT_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Border_Obj_Fn( - struct Zoltan_Struct *zz, + struct Zoltan_Struct *zz, ZOLTAN_NUM_BORDER_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Border_Obj_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_BORDER_OBJ_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_BORDER_OBJ_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_First_Border_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_FIRST_BORDER_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_FIRST_BORDER_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Next_Border_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NEXT_BORDER_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NEXT_BORDER_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Pre_Migrate_PP_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PRE_MIGRATE_PP_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PRE_MIGRATE_PP_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Mid_Migrate_PP_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_MID_MIGRATE_PP_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_MID_MIGRATE_PP_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Post_Migrate_PP_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_POST_MIGRATE_PP_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_POST_MIGRATE_PP_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Pre_Migrate_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PRE_MIGRATE_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PRE_MIGRATE_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Mid_Migrate_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_MID_MIGRATE_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_MID_MIGRATE_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Post_Migrate_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_POST_MIGRATE_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_POST_MIGRATE_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Obj_Size_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_OBJ_SIZE_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_OBJ_SIZE_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Obj_Size_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_OBJ_SIZE_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_OBJ_SIZE_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Pack_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PACK_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PACK_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Pack_Obj_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_PACK_OBJ_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_PACK_OBJ_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Unpack_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_UNPACK_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_UNPACK_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Unpack_Obj_Multi_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_UNPACK_OBJ_MULTI_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_UNPACK_OBJ_MULTI_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Coarse_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_COARSE_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_COARSE_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Coarse_Obj_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_COARSE_OBJ_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_COARSE_OBJ_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_First_Coarse_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_FIRST_COARSE_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_FIRST_COARSE_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Next_Coarse_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NEXT_COARSE_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NEXT_COARSE_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Child_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_CHILD_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_CHILD_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Child_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_CHILD_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_CHILD_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Child_Weight_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_CHILD_WEIGHT_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_CHILD_WEIGHT_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_HG_Size_CS_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HG_SIZE_CS_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HG_SIZE_CS_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_HG_CS_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HG_CS_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HG_CS_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_HG_Size_Edge_Wts_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HG_SIZE_EDGE_WTS_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HG_SIZE_EDGE_WTS_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_HG_Edge_Wts_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HG_EDGE_WTS_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HG_EDGE_WTS_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Num_Fixed_Obj_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_NUM_FIXED_OBJ_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_NUM_FIXED_OBJ_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Fixed_Obj_List_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_FIXED_OBJ_LIST_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_FIXED_OBJ_LIST_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Hier_Num_Levels_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HIER_NUM_LEVELS_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HIER_NUM_LEVELS_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Hier_Part_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HIER_PART_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HIER_PART_FN *fn_ptr, void *data_ptr ); extern int Zoltan_Set_Hier_Method_Fn( - struct Zoltan_Struct *zz, - ZOLTAN_HIER_METHOD_FN *fn_ptr, + struct Zoltan_Struct *zz, + ZOLTAN_HIER_METHOD_FN *fn_ptr, void *data_ptr ); @@ -2674,8 +2636,8 @@ extern int Zoltan_Set_Hier_Method_Fn( */ extern int Zoltan_Set_Param( - struct Zoltan_Struct *zz, - const char *name, + struct Zoltan_Struct *zz, + const char *name, const char *val ); @@ -2699,8 +2661,8 @@ extern int Zoltan_Set_Param( */ extern int Zoltan_Set_Param_Vec( - struct Zoltan_Struct *zz, - const char *name, + struct Zoltan_Struct *zz, + const char *name, const char *val, int index ); @@ -2712,8 +2674,8 @@ extern int Zoltan_Set_Param_Vec( * Input: * zz -- The Zoltan structure returned by Zoltan_Create. * Output: - * changes -- This value tells whether the new - * decomposition computed by Zoltan differs + * changes -- This value tells whether the new + * decomposition computed by Zoltan differs * from the one given as input to Zoltan. * It can be either a one or a zero: * zero - No changes to the decomposition @@ -2727,18 +2689,18 @@ extern int Zoltan_Set_Param_Vec( * in a global ID * num_lid_entries -- number of entries of type ZOLTAN_ID_TYPE * in a local ID - * num_import -- The number of non-local objects in the + * num_import -- The number of non-local objects in the * processor's new decomposition (i.e., * number of objects to be imported). * import_global_ids -- Pointer to array of Global IDs for the * objects to be imported. - * import_local_ids -- Pointer to array of Local IDs for the + * import_local_ids -- Pointer to array of Local IDs for the * objects to be imported (local to the * exporting processor). * import_procs -- Pointer to array of Processor IDs for the * objects to be imported (processor IDs of * source processor). - * import_to_part -- Pointer to array of partition numbers to + * import_to_part -- Pointer to array of partition numbers to * which the imported objects should be assigned. * num_export -- The number of local objects that must be * exported from the processor to establish @@ -2752,7 +2714,7 @@ extern int Zoltan_Set_Param_Vec( * export_procs -- Pointer to array of Processor IDs for the * objects to be exported (processor IDs of * destination processors). - * export_to_part -- Pointer to array of partition numbers to + * export_to_part -- Pointer to array of partition numbers to * which the exported objects should be assigned. * Returned value: -- Error code */ @@ -2771,7 +2733,7 @@ extern int Zoltan_LB_Partition( ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_procs, - int **export_to_part + int **export_to_part ); /*****************************************************************************/ /* @@ -2815,7 +2777,7 @@ extern int Zoltan_LB_Balance( * zmin -- lower z extent of box * xmax -- upper x extent of box * ymax -- upper y extent of box - * zmax -- upper z extent of box + * zmax -- upper z extent of box * Returned value: -- Error code */ @@ -2944,7 +2906,7 @@ extern int Zoltan_Order_Get_Num_Leaves(struct Zoltan_Struct *zz); * Ouput: * leaves -- List of block indices that are leaves in the * elimination tree. -1 marks the end of the list. - * The array must be of size num_leaves+1, known by + * The array must be of size num_leaves+1, known by * calling Zoltan_Order_Get_Num_Leaves. */ @@ -2956,16 +2918,16 @@ extern void Zoltan_Order_Get_Block_Leaves( /**********************************************************/ /* Interface routine for Graph Coloring */ -/**********************************************************/ +/**********************************************************/ int Zoltan_Color( struct Zoltan_Struct *zz, /* Zoltan structure */ int num_gid_entries, /* # of entries for a global id */ int num_obj, /* Input: number of objects */ ZOLTAN_ID_PTR global_ids, /* Input: global ids of the vertices */ - /* The application must allocate enough space */ + /* The application must allocate enough space */ int *color_exp /* Output: Colors assigned to local vertices */ /* The application must allocate enough space */ - ); + ); /* Interface routine for Zoltan_Color_Test */ int Zoltan_Color_Test( @@ -2974,31 +2936,31 @@ int Zoltan_Color_Test( int *num_lid_entries, /* # of entries for a local id */ int num_obj, /* Input: number of objects */ ZOLTAN_ID_PTR global_ids, /* Input: global ids of the vertices */ - /* The application must allocate enough space */ + /* The application must allocate enough space */ ZOLTAN_ID_PTR local_ids, /* Input: local ids of the vertices */ /* The application must allocate enough space */ int *color_exp /* Input: Colors assigned to local vertices */ - ); - + ); + /*****************************************************************************/ /* * Routine to compute the inverse map: Given, for each processor, a list * of objects to be received by a processor, compute the list of objects - * that processor needs to send to other processors to complete a - * remapping. Conversely, given a list of objects to be sent to other + * that processor needs to send to other processors to complete a + * remapping. Conversely, given a list of objects to be sent to other * processors, compute the list of objects to be received. * * Input: - * zz -- Zoltan structure for current + * zz -- Zoltan structure for current * balance. - * num_input -- Number of objects known to be + * num_input -- Number of objects known to be * sent/received. * input_global_ids -- Array of global IDs for known objects. * input_local_ids -- Array of local IDs for known objects. * input_procs -- Array of IDs of processors to/from whom the * known objects will be sent/received. - * input_to_part -- Array of partition numbers to + * input_to_part -- Array of partition numbers to * which the known objects should be assigned. * Output: * num_output -- The number of objects will be received/sent. @@ -3006,10 +2968,10 @@ int Zoltan_Color_Test( * objects to be received/sent. * output_local_ids -- Pointer to array of Local IDs for the * objects to be received/sent. - * output_procs -- Pointer to array of Processor IDs + * output_procs -- Pointer to array of Processor IDs * from/to which the output_global_ids will be * received/sent. - * output_to_part -- Pointer to array of partition numbers to + * output_to_part -- Pointer to array of partition numbers to * which the output_global_ids should be assigned. * Returned value: -- Error code */ @@ -3017,12 +2979,12 @@ int Zoltan_Color_Test( extern int Zoltan_Invert_Lists( struct Zoltan_Struct *zz, - int num_input, + int num_input, ZOLTAN_ID_PTR input_global_ids, - ZOLTAN_ID_PTR input_local_ids, - int *input_procs, - int *input_to_part, - int *num_output, + ZOLTAN_ID_PTR input_local_ids, + int *input_procs, + int *input_to_part, + int *num_output, ZOLTAN_ID_PTR *output_global_ids, ZOLTAN_ID_PTR *output_local_ids, int **output_procs, @@ -3030,24 +2992,24 @@ extern int Zoltan_Invert_Lists( ); /*****************************************************************************/ /* - * Wrapper around Zoltan_Invert_Lists, appropriate only when + * Wrapper around Zoltan_Invert_Lists, appropriate only when * number of partitions == number of processors (or when partition information * is not desired). * * Input and Output: * Arguments are analogous to Zoltan_Invert_Lists. Arrays import_to_part - * and export_to_part are not included, as Zoltan_Compute_Destinations + * and export_to_part are not included, as Zoltan_Compute_Destinations * assumes partitions and processors are equivalent. * Returned value: -- Error code */ extern int Zoltan_Compute_Destinations( struct Zoltan_Struct *zz, - int num_input, + int num_input, ZOLTAN_ID_PTR input_global_ids, - ZOLTAN_ID_PTR input_local_ids, - int *input_procs, - int *num_output, + ZOLTAN_ID_PTR input_local_ids, + int *input_procs, + int *num_output, ZOLTAN_ID_PTR *output_global_ids, ZOLTAN_ID_PTR *output_local_ids, int **output_procs @@ -3057,22 +3019,22 @@ extern int Zoltan_Compute_Destinations( /* * Routine to help perform migration. Zoltan_Migrate performs the following * operations: - * - Call migration pre-processing routine (ZOLTAN_PRE_MIGRATE_PP_FN), if + * - Call migration pre-processing routine (ZOLTAN_PRE_MIGRATE_PP_FN), if * specified. * - Call a ZOLTAN_OBJ_SIZE_FN to obtain the size of the migrating objects. * - Call the application-specified object packing routine (ZOLTAN_PACK_OBJ_FN) - * for each object to be exported. - * - Develop the communication map to move the objects to other processors. - * - Perform the communication according to the map. - * - Call mid-migration processing routine (ZOLTAN_MID_MIGRATE_PP_FN), if + * for each object to be exported. + * - Develop the communication map to move the objects to other processors. + * - Perform the communication according to the map. + * - Call mid-migration processing routine (ZOLTAN_MID_MIGRATE_PP_FN), if * specified. - * - Call the application-specified object unpacking routine - * (ZOLTAN_UNPACK_OBJ_FN) for each object imported. - * - Call post-migration processing routine (ZOLTAN_POST_MIGRATE_PP_FN), if + * - Call the application-specified object unpacking routine + * (ZOLTAN_UNPACK_OBJ_FN) for each object imported. + * - Call post-migration processing routine (ZOLTAN_POST_MIGRATE_PP_FN), if * specified. * * Input: - * zz -- Zoltan structure for current + * zz -- Zoltan structure for current * balance. * num_import -- Number of non-local objects assigned to the * processor in the new decomposition. @@ -3085,19 +3047,19 @@ extern int Zoltan_Compute_Destinations( * import_procs -- Array of processor IDs of processors owning * the non-local objects that are assigned to * this processor in the new decomposition. - * import_to_part -- Pointer to array of partition numbers to + * import_to_part -- Pointer to array of partition numbers to * which the imported objects should be assigned. * num_export -- The number of local objects that need to be * exported from the processor to establish * the new decomposition. * export_global_ids -- Array of Global IDs for the objects to be * exported from the current processor. - * export_local_ids -- Array of Local IDs for the objects to be + * export_local_ids -- Array of Local IDs for the objects to be * exported (local to the current processor). * export_procs -- Array of Processor IDs for the objects to * be exported (processor IDs of destination * processor). - * export_to_part -- Pointer to array of partition numbers to + * export_to_part -- Pointer to array of partition numbers to * which the exported objects should be assigned. * Output: * none -- The objects are migrated to their new @@ -3107,7 +3069,7 @@ extern int Zoltan_Compute_Destinations( */ extern int Zoltan_Migrate( - struct Zoltan_Struct *zz, + struct Zoltan_Struct *zz, int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, @@ -3116,25 +3078,25 @@ extern int Zoltan_Migrate( int num_export, ZOLTAN_ID_PTR export_global_ids, ZOLTAN_ID_PTR export_local_ids, - int *export_procs, + int *export_procs, int *export_to_part); /*****************************************************************************/ /* * Routine to help perform migration. Can be used instead of Zoltan_Migrate * if the number of partitions is equal to the number of processors. - * Calls ZOLTAN_PRE_MIGRATE_FN, ZOLTAN_MID_MIGRATE_FN, and + * Calls ZOLTAN_PRE_MIGRATE_FN, ZOLTAN_MID_MIGRATE_FN, and * ZOLTAN_POST_MIGRATE_FN. * * Input and Output: * Arguments are analogous to Zoltan_Migrate. Arrays import_to_part - * and export_to_part are not included, as Zoltan_Help_Migrate + * and export_to_part are not included, as Zoltan_Help_Migrate * assumes partitions and processors are equivalent. * Returned value: -- Error code */ extern int Zoltan_Help_Migrate( - struct Zoltan_Struct *zz, + struct Zoltan_Struct *zz, int num_import, ZOLTAN_ID_PTR import_global_ids, ZOLTAN_ID_PTR import_local_ids, @@ -3146,20 +3108,20 @@ extern int Zoltan_Help_Migrate( /*****************************************************************************/ /* - * Routine to free the data arrays returned by Zoltan_LB_Partition, - * Zoltan_LB_Balance, Zoltan_Invert_Lists, and + * Routine to free the data arrays returned by Zoltan_LB_Partition, + * Zoltan_LB_Balance, Zoltan_Invert_Lists, and * Zoltan_Compute_Destinations. The arrays * are freed and the pointers are set to NULL. * * Input: - * global_ids -- Pointer to array of global IDs - * local_ids -- Pointer to array of local IDs - * procs -- Pointer to array of processor IDs + * global_ids -- Pointer to array of global IDs + * local_ids -- Pointer to array of local IDs + * procs -- Pointer to array of processor IDs * to_proc -- Pointer to array of partition assignments * Returned value: -- Error code */ extern int Zoltan_LB_Free_Part( - ZOLTAN_ID_PTR *global_ids, + ZOLTAN_ID_PTR *global_ids, ZOLTAN_ID_PTR *local_ids, int **procs, int **to_part @@ -3171,25 +3133,25 @@ extern int Zoltan_LB_Free_Part( * are freed and the pointers are set to NULL. * * Input: - * import_global_ids -- Pointer to array of global IDs for + * import_global_ids -- Pointer to array of global IDs for * imported objects. - * import_local_ids -- Pointer to array of local IDs for + * import_local_ids -- Pointer to array of local IDs for * imported objects. - * import_procs -- Pointer to array of processor IDs of + * import_procs -- Pointer to array of processor IDs of * imported objects. - * export_global_ids -- Pointer to array of global IDs for + * export_global_ids -- Pointer to array of global IDs for * exported objects. - * export_local_ids -- Pointer to array of local IDs for + * export_local_ids -- Pointer to array of local IDs for * exported objects. * export_procs -- Pointer to array of destination processor * IDs of exported objects. * Returned value: -- Error code */ extern int Zoltan_LB_Free_Data( - ZOLTAN_ID_PTR *import_global_ids, + ZOLTAN_ID_PTR *import_global_ids, ZOLTAN_ID_PTR *import_local_ids, int **import_procs, - ZOLTAN_ID_PTR *export_global_ids, + ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_procs ); @@ -3197,12 +3159,12 @@ extern int Zoltan_LB_Free_Data( /*****************************************************************************/ /*****************************************************************************/ -/* - * Routine to determine which processor and partition a new point should be +/* + * Routine to determine which processor and partition a new point should be * assigned to. * Note that this only works of the current partition was produced via a * geometric algorithm - currently RCB, RIB, HSFC. - * + * * Input: * zz -- pointer to Zoltan structure * coords -- vector of coordinates of new point @@ -3222,15 +3184,15 @@ extern int Zoltan_LB_Point_PP_Assign( ); /*****************************************************************************/ -/* +/* * Routine to determine which processor a new point should be assigned to. - * Can be used instead of Zoltan_LB_Point_PP_Assign when the number of + * Can be used instead of Zoltan_LB_Point_PP_Assign when the number of * partitions equals the number of processors. * Note that this only works of the current partition was produced via a * geometric algorithm - currently RCB, RIB, HSFC. - * + * * Input: - * Arguments are analogous to Zoltan_LB_Point_PP_Assign. + * Arguments are analogous to Zoltan_LB_Point_PP_Assign. * Variable part is not included, as Zoltan_LB_Point_Assign * assumes partitions and processors are equivalent. * @@ -3247,23 +3209,23 @@ extern int Zoltan_LB_Point_Assign( ); /*****************************************************************************/ -/* - * Routine to determine which partitions and processors +/* + * Routine to determine which partitions and processors * a bounding box intersects. * Note that this only works of the current partition was produced via a * geometric algorithm - currently RCB, RIB, HSFC. - * + * * Input: * zz -- pointer to Zoltan structure * xmin, ymin, zmin -- lower left corner of bounding box * xmax, ymax, zmax -- upper right corner of bounding box * * Output: - * procs -- list of processors that box intersects. + * procs -- list of processors that box intersects. * Note: application is * responsible for ensuring sufficient memory. * numprocs -- number of processors box intersects - * parts -- list of partitions that box intersects. + * parts -- list of partitions that box intersects. * Note: application is * responsible for ensuring sufficient memory. * numparts -- number of partitions box intersects (may differ @@ -3287,18 +3249,18 @@ extern int Zoltan_LB_Box_PP_Assign( ); /*****************************************************************************/ -/* +/* * Routine to determine which processors a bounding box intersects. * Note that this only works of the current partition was produced via a * geometric algorithm - currently RCB, RIB, HSFC. - * + * * Input: * zz -- pointer to Zoltan structure * xmin, ymin, zmin -- lower left corner of bounding box * xmax, ymax, zmax -- upper right corner of bounding box * * Output: - * procs -- list of processors that box intersects. + * procs -- list of processors that box intersects. * Note: application is * responsible for ensuring sufficient memory. * numprocs -- number of processors box intersects @@ -3319,7 +3281,7 @@ extern int Zoltan_LB_Box_Assign( ); /* - * Function to set the desired partition sizes. + * Function to set the desired partition sizes. * * Input: * zz -- The Zoltan structure to which this method @@ -3328,21 +3290,21 @@ extern int Zoltan_LB_Box_Assign( * len -- Length of arrays wgt_idx, part_idx, part_sizes * part_ids -- Array of partition ids (local or global) * wgt_idx -- Array of indices between 0 and Obj_Wgt_Dim-1 - * part_sizes -- Array of floats that gives the desired partition - * size for each weight and each partition, i.e., + * part_sizes -- Array of floats that gives the desired partition + * size for each weight and each partition, i.e., * part_sizes[i] corresponds to wgt_idx[i] and part_id[i] * * Output: * Return value -- Error code. */ -extern int Zoltan_LB_Set_Part_Sizes(struct Zoltan_Struct *zz, int global_num, +extern int Zoltan_LB_Set_Part_Sizes(struct Zoltan_Struct *zz, int global_num, int len, int *part_ids, int *wgt_idx, float *part_sizes); /* * Function to generate data files. * * Input: - * zz -- The current Zoltan structure + * zz -- The current Zoltan structure * fname -- Basename for files to be generated * base_index -- Start numbering of nodes and edges at 0 or 1? * gen_geom -- Write geometry file? @@ -3354,12 +3316,12 @@ extern int Zoltan_LB_Set_Part_Sizes(struct Zoltan_Struct *zz, int global_num, */ extern int Zoltan_Generate_Files(struct Zoltan_Struct *zz, char *fname, int base_index, int gen_geom, int gen_graph, int gen_hg); -/* - * Returns sizeof(ZOLTAN_ID_TYPE) for the ZOLTAN_ID_TYPE used in building +/* + * Returns sizeof(ZOLTAN_ID_TYPE) for the ZOLTAN_ID_TYPE used in building * the library. (Allows applications to check that their Zoltan include * files are consistent with the linked-in Zoltan libraries.) * Input/Output: - * name -- if non-null on input, *name is set to a + * name -- if non-null on input, *name is set to a * string describing ZOLTAN_ID_TYPE (e.g., "unsigned int") * Output: * Return value -- sizeof(ZOLTAN_ID_TYPE) @@ -3367,17 +3329,17 @@ extern int Zoltan_Generate_Files(struct Zoltan_Struct *zz, char *fname, int base extern int Zoltan_get_global_id_type(char **name); /*****************************************************************************/ -/* +/* * Routine specifying the number of bytes needed to serialize a Zoltan_Struct. * This value can be used to allocate a serialization buffer. * * This is an expert function; its implementation may be incomplete for all - * partitioning methods. + * partitioning methods. * Currently supported for partitioning method RCB. - * + * * Input: * zz -- Zoltan_Struct to be serialized - * + * * Returned value: -- Number of bytes needed to allocate a buffer */ @@ -3386,19 +3348,19 @@ extern size_t Zoltan_Serialize_Size( ); /*****************************************************************************/ -/* +/* * Routine to serialize a Zoltan_Struct into a buffer for communication. * * This is an expert function; its implementation may be incomplete for all - * partitioning methods. + * partitioning methods. * Currently supported for partitioning method RCB. - * + * * Input: * zz -- Zoltan_Struct to be serialized - * bufsize -- size (number of bytes allocated) of the buffer + * bufsize -- size (number of bytes allocated) of the buffer * buf -- buffer into which zz should be serialized; * the user must allocate and own this memory - * + * * Returned value: -- Error code */ @@ -3409,16 +3371,16 @@ extern int Zoltan_Serialize( ); /*****************************************************************************/ -/* +/* * Routine to deserialize a buffer into a Zoltan_Struct. * * This is an expert function; its implementation may be incomplete for all - * partitioning methods. + * partitioning methods. * Currently supported for partitioning method RCB. - * + * * Input: * zz -- Zoltan_Struct into which buf is serialized - * bufsize -- size (number of bytes allocated) of the buffer + * bufsize -- size (number of bytes allocated) of the buffer * buf -- buffer with data to be deserialized * * Returned value: -- Error code @@ -3432,7 +3394,6 @@ extern int Zoltan_Deserialize( #ifdef __cplusplus } /* closing bracket for extern "C" */ - // NOLINTEND #endif #endif /* !__ZOLTAN_H */ diff --git a/packages/zoltan/src/include/zoltan_align.h b/packages/zoltan/src/include/zoltan_align.h index fd7ee466a2..2e6874e558 100644 --- a/packages/zoltan/src/include/zoltan_align.h +++ b/packages/zoltan/src/include/zoltan_align.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_ALIGN_H #define __ZOLTAN_ALIGN_H @@ -52,7 +15,7 @@ extern "C" { #endif -/* +/* * Plauger alignment algorithm, The Standard C Library. * Forces malloc'ed variable size struct alignment. * ZOLTAN_ALIGN_VAL is defined in Zoltan/include/zoltan_align.h; diff --git a/packages/zoltan/src/include/zoltan_comm.h b/packages/zoltan/src/include/zoltan_comm.h index baaf62d73a..5e4e3f7011 100644 --- a/packages/zoltan/src/include/zoltan_comm.h +++ b/packages/zoltan/src/include/zoltan_comm.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __COMM_CONST_H @@ -64,6 +27,8 @@ typedef struct Zoltan_Comm_Obj ZOLTAN_COMM_OBJ; /* function prototypes */ +MPI_Comm zoltan_get_global_comm(void); + int Zoltan_Comm_Create(ZOLTAN_COMM_OBJ**, int, int*, MPI_Comm, int, int*); int Zoltan_Comm_Copy_To(ZOLTAN_COMM_OBJ **toptr, ZOLTAN_COMM_OBJ *from); diff --git a/packages/zoltan/src/include/zoltan_comm_cpp.h b/packages/zoltan/src/include/zoltan_comm_cpp.h index 1a72cd2524..f78aeebc9f 100644 --- a/packages/zoltan/src/include/zoltan_comm_cpp.h +++ b/packages/zoltan/src/include/zoltan_comm_cpp.h @@ -1,60 +1,23 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring // -// ************************************************************************ +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER // -// C++ wrappers for Zoltan communication library. +// ************************************************************************ +// +// C++ wrappers for Zoltan communication library. // -// Two styles of initialization: +// Two styles of initialization: // // C++ style: Zoltan_Comm comm(nvals, assign, comm, tag, pnvals_recv); // // C style: Zoltan_Comm comm; // comm.Create(nvals, assign, comm, tag, pnvals_recv); -// +// // ************************************************************************ #ifndef ZOLTAN_COMM_CPP_H_ @@ -65,8 +28,8 @@ class Zoltan_Comm { public: - - Zoltan_Comm(const int &nvals, int *assign, const MPI_Comm &comm, + + Zoltan_Comm(const int &nvals, int *assign, const MPI_Comm &comm, const int &tag, int *pnvals_recv) { // Assumption: MPI has been initialized prior to this call. @@ -79,7 +42,7 @@ class Zoltan_Comm { // Caller will have to call Create to finish initialization of object } - int Create(const int &nvals, int *assign, const MPI_Comm &comm, + int Create(const int &nvals, int *assign, const MPI_Comm &comm, const int &tag, int *pnvals_recv) { if (this->Plan) @@ -109,12 +72,12 @@ class Zoltan_Comm { return *this; } - + int Resize(int *sizes, const int &tag, int *sum_recv_sizes) { return Zoltan_Comm_Resize( this->Plan, sizes, tag, sum_recv_sizes); } - + int Do(const int &tag, char *send_data, const int &nbytes, char *recv_data) { return Zoltan_Comm_Do(this->Plan, tag, send_data, nbytes, recv_data); @@ -129,37 +92,37 @@ class Zoltan_Comm { { return Zoltan_Comm_Do_Wait(this->Plan, tag, send_data, nbytes, recv_data); } - + int Do_Reverse(const int &tag, char *send_data, const int &nbytes, int *sizes, char *recv_data) { - return Zoltan_Comm_Do_Reverse(this->Plan, tag, send_data, nbytes, sizes, + return Zoltan_Comm_Do_Reverse(this->Plan, tag, send_data, nbytes, sizes, recv_data); } - int Do_Reverse_Post(const int &tag, char *send_data, const int &nbytes, int *sizes, + int Do_Reverse_Post(const int &tag, char *send_data, const int &nbytes, int *sizes, char *recv_data) { - return Zoltan_Comm_Do_Reverse_Post(this->Plan, tag, send_data, nbytes, sizes, + return Zoltan_Comm_Do_Reverse_Post(this->Plan, tag, send_data, nbytes, sizes, recv_data); } - int Do_Reverse_Wait(const int &tag, char *send_data, const int &nbytes, int *sizes, + int Do_Reverse_Wait(const int &tag, char *send_data, const int &nbytes, int *sizes, char *recv_data) { - return Zoltan_Comm_Do_Reverse_Wait(this->Plan, tag, send_data, nbytes, sizes, + return Zoltan_Comm_Do_Reverse_Wait(this->Plan, tag, send_data, nbytes, sizes, recv_data); } - + int Info( int *nsends, int *send_procs, int *send_lengths, int *send_nvals, int *send_max_size, int *send_list, int *nrecvs, int *recv_procs, int *recv_lengths, int *recv_nvals, int *recv_total_size, int *recv_list, int *self_msg) const { - return Zoltan_Comm_Info( this->Plan, nsends, send_procs, send_lengths, - send_nvals, send_max_size, send_list, nrecvs, recv_procs, recv_lengths, + return Zoltan_Comm_Info( this->Plan, nsends, send_procs, send_lengths, + send_nvals, send_max_size, send_list, nrecvs, recv_procs, recv_lengths, recv_nvals, recv_total_size, recv_list, self_msg); } - + int Invert_Plan() { return Zoltan_Comm_Invert_Plan(&this->Plan); @@ -167,24 +130,24 @@ class Zoltan_Comm { // Static methods - static int Invert_Map( int *lengths_to, int *procs_to, + static int Invert_Map( int *lengths_to, int *procs_to, const int &nsends, const int &self_msg, - int * &plengths_from, int * &pprocs_from, int &pnrecvs, - const int &my_proc, const int &nprocs, const int &out_of_mem, - const int &tag, const MPI_Comm &comm) + int * &plengths_from, int * &pprocs_from, int &pnrecvs, + const int &my_proc, const int &nprocs, const int &out_of_mem, + const int &tag, const MPI_Comm &comm) { return Zoltan_Comm_Invert_Map( lengths_to, procs_to, nsends, self_msg, - &plengths_from, &pprocs_from, &pnrecvs, my_proc, nprocs, out_of_mem, + &plengths_from, &pprocs_from, &pnrecvs, my_proc, nprocs, out_of_mem, tag, comm); } - - static int Exchange_Sizes( int *sizes_to, int *procs_to, + + static int Exchange_Sizes( int *sizes_to, int *procs_to, const int &nsends, const int &self_msg, int *sizes_from, int *procs_from, const int &nrecvs, int *total_recv_size, - const int &my_proc, const int &tag, const MPI_Comm &comm) + const int &my_proc, const int &tag, const MPI_Comm &comm) { return Zoltan_Comm_Exchange_Sizes(sizes_to, procs_to, nsends, self_msg, - sizes_from, procs_from, nrecvs, total_recv_size, my_proc, tag, + sizes_from, procs_from, nrecvs, total_recv_size, my_proc, tag, comm); } diff --git a/packages/zoltan/src/include/zoltan_cpp.h b/packages/zoltan/src/include/zoltan_cpp.h index 74a65e9f63..bcb1f7dc41 100644 --- a/packages/zoltan/src/include/zoltan_cpp.h +++ b/packages/zoltan/src/include/zoltan_cpp.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012, 2023 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER // ************************************************************************ // C++ class representing a Zoltan_Struct object. @@ -60,8 +23,8 @@ #include /* F90 names must be less than 31 characters, support old name */ -#define Set_HG_Size_Edge_Weights_Fn Set_HG_Size_Edge_Wts_Fn -#define Set_HG_Edge_Weights_Fn Set_HG_Edge_Wts_Fn +#define Set_HG_Size_Edge_Weights_Fn Set_HG_Size_Edge_Wts_Fn +#define Set_HG_Edge_Weights_Fn Set_HG_Edge_Wts_Fn #ifdef TFLOP #include @@ -75,11 +38,11 @@ class Zoltan { // Constructor - Zoltan (const MPI_Comm &communicator = MPI_COMM_WORLD) + Zoltan (const MPI_Comm &communicator = zoltan_get_global_comm()) { - this->ZZ_Ptr = Zoltan_Create(communicator); + this->ZZ_Ptr = Zoltan_Create(communicator); - // int fail = (this->ZZ_Ptr == NULL); should catch this exception + // int fail = (this->ZZ_Ptr == NULL); should catch this exception } // Copy constructor @@ -93,9 +56,9 @@ class Zoltan { ~Zoltan() { - // Warning: Zoltan_Destroy calls MPI. - // Do not call MPI_Finalize() before this destructor gets called. - // Ensure that ZoltanObject's created on the stack are deleted + // Warning: Zoltan_Destroy calls MPI. + // Do not call MPI_Finalize() before this destructor gets called. + // Ensure that ZoltanObject's created on the stack are deleted // before MPI_Finalize(). // Alternatively, you can allocate and destroy Zoltans explicitly: // @@ -134,7 +97,7 @@ class Zoltan { } //! Replaces Zoltan_Set_Param_Vec - int Set_Param_Vec( const std::string & param, const std::string & value, + int Set_Param_Vec( const std::string & param, const std::string & value, const int &index ) { return Zoltan_Set_Param_Vec( ZZ_Ptr, param.c_str(), value.c_str(), index); @@ -255,19 +218,19 @@ class Zoltan { return Zoltan_LB_Eval_HG(ZZ_Ptr, print_stats, hg); } - int LB_Eval( const int &print_stats, ZOLTAN_BALANCE_EVAL *eval, + int LB_Eval( const int &print_stats, ZOLTAN_BALANCE_EVAL *eval, ZOLTAN_GRAPH_EVAL *graph, ZOLTAN_HG_EVAL *hg) { - return Zoltan_LB_Eval( ZZ_Ptr, print_stats, eval, graph, hg); + return Zoltan_LB_Eval( ZZ_Ptr, print_stats, eval, graph, hg); } int RCB_Box( const int &part, - int &ndim, - double &xmin, - double &ymin, - double &zmin, - double &xmax, - double &ymax, + int &ndim, + double &xmin, + double &ymin, + double &zmin, + double &xmax, + double &ymax, double &zmax ) { return Zoltan_RCB_Box( ZZ_Ptr,part,&ndim,&xmin,&ymin,&zmin,&xmax,&ymax,&zmax); @@ -275,7 +238,7 @@ class Zoltan { int Set_Fn ( const ZOLTAN_FN_TYPE &fn_type, void (*fn_ptr)(), - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Fn( ZZ_Ptr, fn_type, fn_ptr, data ); } @@ -284,257 +247,257 @@ class Zoltan { ///-------------------------- int Set_Part_Multi_Fn ( ZOLTAN_PART_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Part_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Part_Fn ( ZOLTAN_PART_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Part_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Edges_Multi_Fn ( ZOLTAN_NUM_EDGES_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Edges_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Edges_Fn ( ZOLTAN_NUM_EDGES_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Edges_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Edge_List_Multi_Fn ( ZOLTAN_EDGE_LIST_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Edge_List_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Edge_List_Fn ( ZOLTAN_EDGE_LIST_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Edge_List_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Geom_Fn ( ZOLTAN_NUM_GEOM_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Geom_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Geom_Multi_Fn ( ZOLTAN_GEOM_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Geom_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Geom_Fn ( ZOLTAN_GEOM_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Geom_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Obj_Fn ( ZOLTAN_NUM_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Obj_List_Fn ( ZOLTAN_OBJ_LIST_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Obj_List_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_First_Obj_Fn ( ZOLTAN_FIRST_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_First_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Next_Obj_Fn ( ZOLTAN_NEXT_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Next_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Coarse_Obj_Fn ( ZOLTAN_NUM_COARSE_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Coarse_Obj_List_Fn ( ZOLTAN_COARSE_OBJ_LIST_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Coarse_Obj_List_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_First_Coarse_Obj_Fn( ZOLTAN_FIRST_COARSE_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_First_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Next_Coarse_Obj_Fn ( ZOLTAN_NEXT_COARSE_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Next_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Child_Fn ( ZOLTAN_NUM_CHILD_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Child_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Child_List_Fn ( ZOLTAN_CHILD_LIST_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Child_List_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Child_Weight_Fn ( ZOLTAN_CHILD_WEIGHT_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Child_Weight_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_HG_Size_CS_Fn ( ZOLTAN_HG_SIZE_CS_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_HG_Size_CS_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_HG_CS_Fn ( ZOLTAN_HG_CS_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_HG_CS_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_HG_Size_Edge_Wts_Fn ( ZOLTAN_HG_SIZE_EDGE_WTS_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_HG_Size_Edge_Wts_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_HG_Edge_Wts_Fn ( ZOLTAN_HG_EDGE_WTS_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_HG_Edge_Wts_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Hier_Num_Levels_Fn( ZOLTAN_HIER_NUM_LEVELS_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Hier_Num_Levels_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Hier_Part_Fn( ZOLTAN_HIER_PART_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Hier_Part_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Hier_Method_Fn( ZOLTAN_HIER_METHOD_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Hier_Method_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Num_Fixed_Obj_Fn ( ZOLTAN_NUM_FIXED_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Num_Fixed_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Fixed_Obj_List_Fn ( ZOLTAN_FIXED_OBJ_LIST_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Fixed_Obj_List_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Pre_Migrate_PP_Fn ( ZOLTAN_PRE_MIGRATE_PP_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Pre_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Mid_Migrate_PP_Fn ( ZOLTAN_MID_MIGRATE_PP_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Mid_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Post_Migrate_PP_Fn ( ZOLTAN_POST_MIGRATE_PP_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Post_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Obj_Size_Multi_Fn ( ZOLTAN_OBJ_SIZE_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Obj_Size_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Obj_Size_Fn ( ZOLTAN_OBJ_SIZE_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Obj_Size_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Pack_Obj_Multi_Fn ( ZOLTAN_PACK_OBJ_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Pack_Obj_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Pack_Obj_Fn ( ZOLTAN_PACK_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Pack_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Unpack_Obj_Multi_Fn( ZOLTAN_UNPACK_OBJ_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Unpack_Obj_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Unpack_Obj_Fn ( ZOLTAN_UNPACK_OBJ_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Unpack_Obj_Fn( ZZ_Ptr, fn_ptr, data ); } @@ -542,21 +505,21 @@ class Zoltan { /// Backward compatibility with v3.0 ///-------------------------- int Set_Partition_Multi_Fn ( ZOLTAN_PART_MULTI_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Part_Multi_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Partition_Fn ( ZOLTAN_PART_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Part_Fn( ZZ_Ptr, fn_ptr, data ); } ///-------------------------- int Set_Hier_Partition_Fn( ZOLTAN_HIER_PART_FN * fn_ptr, - void * data = nullptr ) + void * data = 0 ) { return Zoltan_Set_Hier_Part_Fn( ZZ_Ptr, fn_ptr, data ); } @@ -628,9 +591,9 @@ class Zoltan { int * const export_to_part ) { return Zoltan_Migrate( ZZ_Ptr, - num_import, import_global_ids, import_local_ids, + num_import, import_global_ids, import_local_ids, import_procs, import_to_part, - num_export, export_global_ids, export_local_ids, + num_export, export_global_ids, export_local_ids, export_procs, export_to_part ); } @@ -686,9 +649,8 @@ class Zoltan { private: - Zoltan_Struct * ZZ_Ptr; + Zoltan_Struct * ZZ_Ptr; }; #endif - diff --git a/packages/zoltan/src/include/zoltan_dd.h b/packages/zoltan/src/include/zoltan_dd.h index 09e8d46981..100f38c985 100644 --- a/packages/zoltan/src/include/zoltan_dd.h +++ b/packages/zoltan/src/include/zoltan_dd.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_DD_DDIRECTORY_H #define ZOLTAN_DD_DDIRECTORY_H @@ -68,7 +31,7 @@ typedef struct Zoltan_DD_Struct Zoltan_DD_Directory; /*********** Distributed Directory Function Prototypes ************/ -int Zoltan_DD_Create(Zoltan_DD_Directory **dd, MPI_Comm comm, +int Zoltan_DD_Create(Zoltan_DD_Directory **dd, MPI_Comm comm, int num_gid, int num_lid, int user_length, int table_length, int debug_level); @@ -101,7 +64,7 @@ int Zoltan_DD_Set_Neighbor_Hash_Fn3(Zoltan_DD_Directory *dd, int total); int Zoltan_DD_Print(Zoltan_DD_Directory *dd); -int Zoltan_DD_GetLocalKeys(Zoltan_DD_Directory *dd, ZOLTAN_ID_PTR* gid, +int Zoltan_DD_GetLocalKeys(Zoltan_DD_Directory *dd, ZOLTAN_ID_PTR* gid, int* size); diff --git a/packages/zoltan/src/include/zoltan_dd_cpp.h b/packages/zoltan/src/include/zoltan_dd_cpp.h index 9a7263ee30..2df604d942 100644 --- a/packages/zoltan/src/include/zoltan_dd_cpp.h +++ b/packages/zoltan/src/include/zoltan_dd_cpp.h @@ -1,54 +1,17 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER // ************************************************************************ -// +// // C++ wrappers for Zoltan's Distributed Directory utility // -// Two styles of initialization: +// Two styles of initialization: // // C++ style: Zoltan_DD dd(comm, num_gid, num_lid, len1, len2, debug); // @@ -66,10 +29,10 @@ class Zoltan_DD { public: - Zoltan_DD(const MPI_Comm &comm, const int &num_gid, const int &num_lid, - const int &user_length, const int &table_length, const int &debug_level) + Zoltan_DD(const MPI_Comm &comm, const int &num_gid, const int &num_lid, + const int &user_length, const int &table_length, const int &debug_level) { - Zoltan_DD_Create (&this->DD, comm, num_gid, + Zoltan_DD_Create (&this->DD, comm, num_gid, num_lid, user_length, table_length, debug_level); } @@ -81,8 +44,8 @@ class Zoltan_DD { // initialization. } - int Create(const MPI_Comm &comm, const int &num_gid, const int &num_lid, - const int &user_length_in_chars, const int &table_length, const int &debug_level) + int Create(const MPI_Comm &comm, const int &num_gid, const int &num_lid, + const int &user_length_in_chars, const int &table_length, const int &debug_level) { if (this->DD) { @@ -90,7 +53,7 @@ class Zoltan_DD { this->DD = NULL; } - int rc = Zoltan_DD_Create (&this->DD, comm, num_gid, + int rc = Zoltan_DD_Create (&this->DD, comm, num_gid, num_lid, user_length_in_chars, table_length, debug_level); return rc; @@ -112,34 +75,34 @@ class Zoltan_DD { return *this; } - - int Update (ZOLTAN_ID_PTR gid, ZOLTAN_ID_PTR lid, - char *user, int *partition, const int &count) + + int Update (ZOLTAN_ID_PTR gid, ZOLTAN_ID_PTR lid, + char *user, int *partition, const int &count) { return Zoltan_DD_Update (this->DD, gid, lid, user, partition, count) ; } - - int Find (ZOLTAN_ID_PTR gid, ZOLTAN_ID_PTR lid, char *data, + + int Find (ZOLTAN_ID_PTR gid, ZOLTAN_ID_PTR lid, char *data, int *partition, const int &count, int *owner) const { return Zoltan_DD_Find (this->DD, gid, lid, data, partition, count, owner); } - + int Remove (ZOLTAN_ID_PTR gid, const int &count) { return Zoltan_DD_Remove (this->DD, gid, count); } - + int Set_Hash_Fn (unsigned int (*hash) (ZOLTAN_ID_PTR, int, unsigned int)) { return Zoltan_DD_Set_Hash_Fn (this->DD, hash); - } + } void Stats () const { Zoltan_DD_Stats (this->DD) ; } - + int Print () const { return Zoltan_DD_Print (this->DD) ; diff --git a/packages/zoltan/src/include/zoltan_eval.h b/packages/zoltan/src/include/zoltan_eval.h index 36ab9b227b..452816accc 100644 --- a/packages/zoltan/src/include/zoltan_eval.h +++ b/packages/zoltan/src/include/zoltan_eval.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_EVAL_H #define __ZOLTAN_EVAL_H @@ -88,7 +51,7 @@ struct _eval_graph_struct{ float nobj[EVAL_SIZE]; /* number of partition vertices */ float obj_wgt[EVAL_SIZE]; /* partition vertex weights */ float num_boundary[EVAL_SIZE];/* the number of objects with a remote neighbor */ - + float xtra_imbalance[EVAL_MAX_XTRA_VWGTS]; float xtra_obj_wgt[EVAL_MAX_XTRA_VWGTS][EVAL_SIZE]; @@ -102,7 +65,7 @@ struct _eval_balance_struct{ float imbalance; /* vertex weight imbalance */ float nobj[EVAL_SIZE]; /* number of partition vertices */ float obj_wgt[EVAL_SIZE]; /* partition vertex weights */ - + float xtra_imbalance[EVAL_MAX_XTRA_VWGTS]; float xtra_obj_wgt[EVAL_MAX_XTRA_VWGTS][EVAL_SIZE]; }; @@ -115,7 +78,7 @@ int Zoltan_LB_Eval_Graph(struct Zoltan_Struct *zz, int print_stats, ZOLTAN_GRAP int Zoltan_LB_Eval_HG(struct Zoltan_Struct *zz, int print_stats, ZOLTAN_HG_EVAL *hg); -int Zoltan_LB_Eval(struct Zoltan_Struct *zz, int print_stats, +int Zoltan_LB_Eval(struct Zoltan_Struct *zz, int print_stats, ZOLTAN_BALANCE_EVAL *obj, ZOLTAN_GRAPH_EVAL *graph, ZOLTAN_HG_EVAL *hg); void Zoltan_LB_Eval_Print_Graph(ZOLTAN_GRAPH_EVAL *graph); diff --git a/packages/zoltan/src/include/zoltan_mem.h b/packages/zoltan/src/include/zoltan_mem.h index 79d8970c94..e400476e70 100644 --- a/packages/zoltan/src/include/zoltan_mem.h +++ b/packages/zoltan/src/include/zoltan_mem.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __MEM_CONST_H #define __MEM_CONST_H @@ -83,7 +46,7 @@ extern "C" { #ifdef __STDC__ extern double *Zoltan_Array_Alloc(char *file, int lineno, int numdim, ...); #else -extern double *Zoltan_Array_Alloc(); +extern double *Zoltan_Array_Alloc(void); #endif extern void Zoltan_Memory_Debug(int); @@ -99,7 +62,7 @@ extern void Zoltan_Memory_Reset(int); #ifdef __STDC__ extern void Zoltan_Multifree(char *, int, int n, ...); #else -extern void Zoltan_Multifree(); +extern void Zoltan_Multifree(void); #endif #ifdef __cplusplus diff --git a/packages/zoltan/src/include/zoltan_partition_tree.h b/packages/zoltan/src/include/zoltan_partition_tree.h index 5680fcc78a..3c558421eb 100644 --- a/packages/zoltan/src/include/zoltan_partition_tree.h +++ b/packages/zoltan/src/include/zoltan_partition_tree.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_PARTITION_TREE_H #define ZOLTAN_PARTITION_TREE_H diff --git a/packages/zoltan/src/include/zoltan_timer.h b/packages/zoltan/src/include/zoltan_timer.h index 44ee5a8871..a2d3a2e747 100644 --- a/packages/zoltan/src/include/zoltan_timer.h +++ b/packages/zoltan/src/include/zoltan_timer.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTANTIMER_H #define __ZOLTANTIMER_H diff --git a/packages/zoltan/src/include/zoltan_timer_cpp.h b/packages/zoltan/src/include/zoltan_timer_cpp.h index 2c6ef82129..536daeb15a 100644 --- a/packages/zoltan/src/include/zoltan_timer_cpp.h +++ b/packages/zoltan/src/include/zoltan_timer_cpp.h @@ -1,52 +1,15 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring // -// ************************************************************************ +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER // -// C++ wrappers for Zoltan Timer library. +// ************************************************************************ +// +// C++ wrappers for Zoltan Timer library. // // ************************************************************************ @@ -94,7 +57,7 @@ class Zoltan_Timer_Object { return Zoltan_Timer_Init(this->ZTStruct, use_barrier, name.c_str()); } - int Reset(const int &ts_idx, const int &use_barrier, + int Reset(const int &ts_idx, const int &use_barrier, const std::string & name) { return Zoltan_Timer_Reset(this->ZTStruct, ts_idx, use_barrier, name.c_str()); } @@ -105,11 +68,11 @@ class Zoltan_Timer_Object { } int Stop(const int &ts_idx, const MPI_Comm &comm) { - return Zoltan_Timer_Stop(this->ZTStruct, ts_idx, comm, + return Zoltan_Timer_Stop(this->ZTStruct, ts_idx, comm, (char *) __FILE__, __LINE__); } - int Print(const int &ts_idx, const int &proc, + int Print(const int &ts_idx, const int &proc, const MPI_Comm &comm, FILE *os) const { return Zoltan_Timer_Print(this->ZTStruct, ts_idx, proc, comm, os); } diff --git a/packages/zoltan/src/include/zoltan_types.h b/packages/zoltan/src/include/zoltan_types.h index 0b9ea08dac..fbbec89eee 100644 --- a/packages/zoltan/src/include/zoltan_types.h +++ b/packages/zoltan/src/include/zoltan_types.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_TYPES_H #define __ZOLTAN_TYPES_H diff --git a/packages/zoltan/src/lb/README b/packages/zoltan/src/lb/README index a1b4ab968c..bd7a2cfa25 100644 --- a/packages/zoltan/src/lb/README +++ b/packages/zoltan/src/lb/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER LB DIRECTORY -- Zoltan load-balancing tools. diff --git a/packages/zoltan/src/lb/lb_balance.c b/packages/zoltan/src/lb/lb_balance.c index 4663ab066f..c6a7b93688 100644 --- a/packages/zoltan/src/lb/lb_balance.c +++ b/packages/zoltan/src/lb/lb_balance.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -66,7 +29,7 @@ extern "C" { /*****************************************************************************/ /* * This file contains routines for performing load balancing with Zoltan. - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ @@ -89,19 +52,13 @@ static int search_hash_table(ZZ *, ZOLTAN_ID_PTR gid, struct Hash_Node **ht, int tableSize); static void free_hash_table(struct Hash_Node **ht, int tableSize); -static void Zoltan_PartDist_MPIOp( - void *in, - void *inout, - int *len, - MPI_Datatype *dptr); - /****************************************************************************/ /****************************************************************************/ /****************************************************************************/ int Zoltan_LB_Partition( - ZZ *zz, + ZZ *zz, int *changes, int *num_gid_entries, int *num_lid_entries, @@ -129,8 +86,8 @@ int ierr = ZOLTAN_OK; /* Error code */ ierr = Zoltan_LB(zz, 1, changes, num_gid_entries, num_lid_entries, num_import_objs, import_global_ids, import_local_ids, - import_procs, import_to_part, - num_export_objs, export_global_ids, + import_procs, import_to_part, + num_export_objs, export_global_ids, export_local_ids, export_procs, export_to_part); ZOLTAN_TRACE_EXIT(zz, yo); @@ -142,7 +99,7 @@ int ierr = ZOLTAN_OK; /* Error code */ /*****************************************************************************/ int Zoltan_LB_Balance( - ZZ *zz, + ZZ *zz, int *changes, int *num_gid_entries, int *num_lid_entries, @@ -158,7 +115,7 @@ int Zoltan_LB_Balance( { /* * Wrapper around Zoltan_LB for backward compatibility with - * previous Zoltan versions. + * previous Zoltan versions. * Appropriate only when (# requested parts == # processors), uniformly * distributed. * Arguments correspond directly with arguments of Zoltan_LB. @@ -177,11 +134,11 @@ struct OVIS_parameters ovisParameters; /* Determine whether part parameters were set. Report error if * values are unreasonable. */ - if ((zz->LB.Num_Global_Parts_Param != -1 && + if ((zz->LB.Num_Global_Parts_Param != -1 && zz->LB.Num_Global_Parts_Param != zz->Num_Proc) || (zz->LB.Num_Local_Parts_Param != -1 && zz->LB.Num_Local_Parts_Param != 1)) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Non-uniform distribution of parts over processors is specified; " "use Zoltan_LB_Partition."); ierr = ZOLTAN_FATAL; @@ -196,12 +153,12 @@ struct OVIS_parameters ovisParameters; int acg_num_obj = zz->Get_Num_Obj(zz->Get_Num_Obj_Data, &error); printf ("Entering Proc %d num_objs %d\n", zz->Proc, acg_num_obj); } -#endif - +#endif + ierr = Zoltan_LB(zz, 0, changes, num_gid_entries, num_lid_entries, num_import_objs, import_global_ids, import_local_ids, - import_procs, &import_to_part, - num_export_objs, export_global_ids, + import_procs, &import_to_part, + num_export_objs, export_global_ids, export_local_ids, export_procs, &export_to_part); @@ -211,14 +168,14 @@ struct OVIS_parameters ovisParameters; if (ovisParameters.outputLevel > 5){ printf ("Exiting Proc %d num_import_objs %d num_export_objs %d\n", zz->Proc, *num_import_objs, *num_export_objs); } -#endif +#endif /* Not returning import/export part information; free it if allocated. */ - if (import_to_part != NULL) - Zoltan_Special_Free(zz, (void **)(void*) &import_to_part, + if (import_to_part != NULL) + Zoltan_Special_Free(zz, (void **)(void*) &import_to_part, ZOLTAN_SPECIAL_MALLOC_INT); - if (export_to_part != NULL) - Zoltan_Special_Free(zz, (void **)(void*) &export_to_part, + if (export_to_part != NULL) + Zoltan_Special_Free(zz, (void **)(void*) &export_to_part, ZOLTAN_SPECIAL_MALLOC_INT); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -230,12 +187,12 @@ struct OVIS_parameters ovisParameters; /*****************************************************************************/ static int Zoltan_LB( - ZZ *zz, + ZZ *zz, int include_parts, /* Flag indicating whether to generate part informtion; 0 if called by Zoltan_LB_Balance, 1 if called by Zoltan_LB_Partition. */ - int *changes, /* Set to zero or one depending on if + int *changes, /* Set to zero or one depending on if Zoltan determines a new decomposition or not: zero - No changes to the decomposition @@ -261,7 +218,7 @@ static int Zoltan_LB( ZOLTAN_ID_PTR *import_local_ids, /* Array of local IDs for non-local objects (i.e., objs to be imported) in the processor's new decomposition. */ - int **import_procs, /* Array of processor IDs for processors + int **import_procs, /* Array of processor IDs for processors currently owning non-local objects (i.e., objs to be imported) in this processor's new decomposition. */ @@ -272,23 +229,23 @@ static int Zoltan_LB( the new decomposition. */ ZOLTAN_ID_PTR *export_global_ids,/* Array of global IDs for objects that need to be exported (assigned and sent to other - processors) to establish the new + processors) to establish the new decomposition. */ ZOLTAN_ID_PTR *export_local_ids, /* Array of local IDs for objects that need to be exported (assigned and sent to other - processors) to establish the new + processors) to establish the new decomposition. */ int **export_procs, /* Array of destination processor IDs for - objects that need to be exported + objects that need to be exported to establish the new decomposition. */ - int **export_to_part /* Partition to which objects should be + int **export_to_part /* Partition to which objects should be exported. */ ) { /* * Main load-balancing routine. * Input: a Zoltan structure with appropriate function pointers set. - * Output: + * Output: * changes * num_import_objs * import_global_ids @@ -310,7 +267,7 @@ int error = ZOLTAN_OK; /* Error code */ double start_time, end_time; double lb_time[2] = {0.0,0.0}; char msg[256]; -int comm[3],gcomm[3]; +int comm[3],gcomm[3]; float *part_sizes = NULL, *fdummy = NULL; int wgt_dim = zz->Obj_Weight_Dim; int part_dim; @@ -331,17 +288,17 @@ struct OVIS_parameters ovisParameters; #ifdef ZOLTAN_OVIS Zoltan_OVIS_Setup(zz, &ovisParameters); if (zz->Proc == 0) - printf("OVIS PARAMETERS %s %s %d %f\n", - ovisParameters.hello, - ovisParameters.dll, - ovisParameters.outputLevel, + printf("OVIS PARAMETERS %s %s %d %f\n", + ovisParameters.hello, + ovisParameters.dll, + ovisParameters.outputLevel, ovisParameters.minVersion); ovis_enabled(zz->Proc, ovisParameters.dll); #endif - /* + /* * Compute Max number of array entries per ID over all processors. * Compute Max number of return arguments for Zoltan_LB_Balance. * This is a sanity-maintaining step; we don't want different @@ -373,7 +330,7 @@ struct OVIS_parameters ovisParameters; * communicator. */ - if (ZOLTAN_PROC_NOT_IN_COMMUNICATOR(zz)) + if (ZOLTAN_PROC_NOT_IN_COMMUNICATOR(zz)) goto End; if (zz->LB.Method == NONE) { @@ -404,7 +361,7 @@ struct OVIS_parameters ovisParameters; int np, fp; for (i = 0; i < zz->Num_Proc; i++) { Zoltan_LB_Proc_To_Part(zz, i, &np, &fp); - printf("%d Proc_To_Part Proc %d NParts %d FPart %d\n", + printf("%d Proc_To_Part Proc %d NParts %d FPart %d\n", zz->Proc, i, np, fp); } } @@ -418,10 +375,10 @@ struct OVIS_parameters ovisParameters; { float part_sizes[1]; int part_ids[1], wgt_idx[1]; - + wgt_idx[0] = 0; part_ids[0] = 0; - ovis_getPartsize(&(part_sizes[0])); + ovis_getPartsize(&(part_sizes[0])); printf("Rank %d ps %f\n",zz->Proc, part_sizes[0]); /* clear out old part size info first */ Zoltan_LB_Set_Part_Sizes(zz, 0, -1, NULL, NULL, NULL); @@ -431,7 +388,7 @@ struct OVIS_parameters ovisParameters; part_dim = ((wgt_dim > 0) ? wgt_dim : 1); - part_sizes = (float *) ZOLTAN_MALLOC(sizeof(float) * part_dim + part_sizes = (float *) ZOLTAN_MALLOC(sizeof(float) * part_dim * zz->LB.Num_Global_Parts); if (part_sizes == NULL) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); @@ -468,8 +425,8 @@ struct OVIS_parameters ovisParameters; error = zz->LB.LB_Fn(zz, part_sizes, num_import_objs, import_global_ids, import_local_ids, - import_procs, import_to_part, - num_export_objs, export_global_ids, export_local_ids, + import_procs, import_to_part, + num_export_objs, export_global_ids, export_local_ids, export_procs, export_to_part); ZOLTAN_FREE(&part_sizes); @@ -492,14 +449,14 @@ struct OVIS_parameters ovisParameters; ZOLTAN_PRINT_WARN(zz->Proc, yo, msg); } } - + ZOLTAN_TRACE_DETAIL(zz, yo, "Done partitioning"); - + if (*num_import_objs >= 0) - MPI_Allreduce(num_import_objs, &gmax, 1, MPI_INT, MPI_MAX, + MPI_Allreduce(num_import_objs, &gmax, 1, MPI_INT, MPI_MAX, zz->Communicator); else /* use export data */ - MPI_Allreduce(num_export_objs, &gmax, 1, MPI_INT, MPI_MAX, + MPI_Allreduce(num_export_objs, &gmax, 1, MPI_INT, MPI_MAX, zz->Communicator); } @@ -526,7 +483,7 @@ struct OVIS_parameters ovisParameters; * This parameter setting requires that all local objects * and their assignments appear in the export list. */ - error= Zoltan_Get_Obj_List_Special_Malloc(zz, num_export_objs, + error= Zoltan_Get_Obj_List_Special_Malloc(zz, num_export_objs, export_global_ids, export_local_ids, wgt_dim, &fdummy, export_to_part); @@ -557,11 +514,11 @@ struct OVIS_parameters ovisParameters; * Unless we were given both maps, compute the inverse map. */ if (zz->LB.Return_Lists == ZOLTAN_LB_NO_LISTS) { - if (*num_import_objs >= 0) - Zoltan_LB_Special_Free_Part(zz, import_global_ids, import_local_ids, + if (*num_import_objs >= 0) + Zoltan_LB_Special_Free_Part(zz, import_global_ids, import_local_ids, import_procs, import_to_part); - if (*num_export_objs >= 0) - Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, + if (*num_export_objs >= 0) + Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, export_procs, export_to_part); *num_import_objs = *num_export_objs = -1; } @@ -570,11 +527,11 @@ struct OVIS_parameters ovisParameters; if (*num_export_objs >= 0) { /* Both maps already available; nothing to do. */; } - else if (zz->LB.Return_Lists == ZOLTAN_LB_ALL_LISTS || + else if (zz->LB.Return_Lists == ZOLTAN_LB_ALL_LISTS || zz->LB.Return_Lists == ZOLTAN_LB_EXPORT_LISTS || zz->LB.Return_Lists == ZOLTAN_LB_COMPLETE_EXPORT_LISTS) { /* Export lists are requested; compute export map */ - error = Zoltan_Invert_Lists(zz, *num_import_objs, *import_global_ids, + error = Zoltan_Invert_Lists(zz, *num_import_objs, *import_global_ids, *import_local_ids, *import_procs, *import_to_part, num_export_objs, export_global_ids, @@ -591,7 +548,7 @@ struct OVIS_parameters ovisParameters; /* Method returned import lists, but only export lists were desired. */ /* Import lists not needed; free them. */ *num_import_objs = -1; - Zoltan_LB_Special_Free_Part(zz, import_global_ids, import_local_ids, + Zoltan_LB_Special_Free_Part(zz, import_global_ids, import_local_ids, import_procs, import_to_part); } } @@ -599,14 +556,14 @@ struct OVIS_parameters ovisParameters; else { /* (*num_import_objs < 0) */ if (*num_export_objs >= 0) { /* Only export lists have been returned. */ - if (zz->LB.Return_Lists == ZOLTAN_LB_ALL_LISTS || + if (zz->LB.Return_Lists == ZOLTAN_LB_ALL_LISTS || zz->LB.Return_Lists == ZOLTAN_LB_IMPORT_LISTS) { /* Compute import map */ - error = Zoltan_Invert_Lists(zz, *num_export_objs, *export_global_ids, + error = Zoltan_Invert_Lists(zz, *num_export_objs, *export_global_ids, *export_local_ids, *export_procs, *export_to_part, num_import_objs, import_global_ids, - import_local_ids, import_procs, + import_local_ids, import_procs, import_to_part); if (error != ZOLTAN_OK && error != ZOLTAN_WARN) { @@ -619,7 +576,7 @@ struct OVIS_parameters ovisParameters; /* Method returned export lists, but only import lists are desired. */ /* Export lists not needed; free them. */ *num_export_objs = -1; - Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, + Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, export_procs, export_to_part); } } @@ -675,15 +632,15 @@ struct OVIS_parameters ovisParameters; ZOLTAN_ID_PTR gid; if (*num_export_objs < all_num_obj){ - + /* Create a lookup table for exported IDs */ - + ts = Zoltan_Recommended_Hash_Size(*num_export_objs); ht = create_hash_table(zz, *export_global_ids, *num_export_objs, ts); - + /* Create a list of all gids, lids and parts */ - - error = Zoltan_Get_Obj_List(zz, &all_num_obj, + + error = Zoltan_Get_Obj_List(zz, &all_num_obj, &all_global_ids, &all_local_ids, wgt_dim, &fdummy, &all_export_to_part); @@ -693,20 +650,20 @@ struct OVIS_parameters ovisParameters; if (all_num_obj && !all_export_procs) error = ZOLTAN_MEMERR; } - + if ((error != ZOLTAN_OK) && (error != ZOLTAN_WARN)){ sprintf(msg, "Error building complete export list; " "%d returned by Zoltan_Get_Obj_List\n", error); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); goto End; } - + gid = all_global_ids; - + for (i=0; i < all_num_obj; i++, gid += zz->Num_GID){ - + int idIdx = search_hash_table(zz, gid, ht, ts); - + if (idIdx >= 0){ all_export_procs[i] = (*export_procs)[idIdx]; @@ -717,25 +674,25 @@ struct OVIS_parameters ovisParameters; /* No change in all_export_to_part[i] so no assignment needed */ } } - + free_hash_table(ht, ts); - Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, + Zoltan_LB_Special_Free_Part(zz, export_global_ids, export_local_ids, export_procs, export_to_part); - if (!Zoltan_Special_Malloc(zz, (void **)export_global_ids, + if (!Zoltan_Special_Malloc(zz, (void **)export_global_ids, all_num_obj, ZOLTAN_SPECIAL_MALLOC_GID) - || (zz->Num_LID && - !Zoltan_Special_Malloc(zz, (void **)export_local_ids, + || (zz->Num_LID && + !Zoltan_Special_Malloc(zz, (void **)export_local_ids, all_num_obj, ZOLTAN_SPECIAL_MALLOC_LID)) - || !Zoltan_Special_Malloc(zz, (void **)export_procs, + || !Zoltan_Special_Malloc(zz, (void **)export_procs, all_num_obj, ZOLTAN_SPECIAL_MALLOC_INT) - || !Zoltan_Special_Malloc(zz, (void **)export_to_part, + || !Zoltan_Special_Malloc(zz, (void **)export_to_part, all_num_obj, ZOLTAN_SPECIAL_MALLOC_INT)) { error = ZOLTAN_MEMERR; goto End; } - + *num_export_objs = all_num_obj; { @@ -776,8 +733,8 @@ struct OVIS_parameters ovisParameters; for (i = 0; i < *num_import_objs; i++) { printf(" Obj: "); ZOLTAN_PRINT_GID(zz, &((*import_global_ids)[i*zz->Num_GID])); - printf(" To part: %4d", - (*import_to_part != NULL ? (*import_to_part)[i] + printf(" To part: %4d", + (*import_to_part != NULL ? (*import_to_part)[i] : zz->Proc)); printf(" From processor: %4d\n", (*import_procs)[i]); } @@ -787,7 +744,7 @@ struct OVIS_parameters ovisParameters; printf(" Obj: "); ZOLTAN_PRINT_GID(zz, &((*export_global_ids)[i*zz->Num_GID])); printf(" To part: %4d", - (*export_to_part != NULL ? (*export_to_part)[i] + (*export_to_part != NULL ? (*export_to_part)[i] : (*export_procs)[i])); printf(" To processor: %4d\n", (*export_procs)[i]); } @@ -818,16 +775,16 @@ struct OVIS_parameters ovisParameters; ZOLTAN_TRACE_DETAIL(zz, yo, "Done auto-migration"); } - + /* Print timing info */ if (zz->Debug_Level >= ZOLTAN_DEBUG_ZTIME) { if (zz->Proc == zz->Debug_Proc) { printf("ZOLTAN Times: \n"); } - Zoltan_Print_Stats (zz->Communicator, zz->Debug_Proc, lb_time[0], + Zoltan_Print_Stats (zz->Communicator, zz->Debug_Proc, lb_time[0], "ZOLTAN Partition: "); if (zz->Migrate.Auto_Migrate) - Zoltan_Print_Stats (zz->Communicator, zz->Debug_Proc, lb_time[1], + Zoltan_Print_Stats (zz->Communicator, zz->Debug_Proc, lb_time[1], "ZOLTAN Migrate: "); } @@ -847,11 +804,11 @@ int Zoltan_LB_Build_PartDist(ZZ *zz) char *yo = "Zoltan_LB_Build_PartDist"; int ierr = ZOLTAN_OK; int inflag[6], outflag[6] = {0,0,-1,0,0,0}; -int global_parts_set = 0; /* number of procs on which NUM_GLOBAL_PARTS +int global_parts_set = 0; /* number of procs on which NUM_GLOBAL_PARTS parameter was set. */ int local_parts_set = 0; /* number of procs on which NUM_LOCAL_PARTS parameter was set. */ -int max_global_parts = 0; /* Max value of Num_Global_Parts_Param on all +int max_global_parts = 0; /* Max value of Num_Global_Parts_Param on all procs. */ int sum_local_parts = 0; /* Sum of Num_Local_Parts over all procs. Procs on which NUM_LOCAL_PARTS was not @@ -871,10 +828,10 @@ MPI_User_function Zoltan_PartDist_MPIOp; MPI_Op_create(&Zoltan_PartDist_MPIOp,1,&op); /* Check whether global parts or local parts parameters were used. */ - inflag[0] = (zz->LB.Num_Global_Parts_Param != -1); - inflag[1] = (zz->LB.Num_Local_Parts_Param != -1); + inflag[0] = (zz->LB.Num_Global_Parts_Param != -1); + inflag[1] = (zz->LB.Num_Local_Parts_Param != -1); inflag[2] = zz->LB.Num_Global_Parts_Param; - inflag[3] = ((zz->LB.Num_Local_Parts_Param == -1) + inflag[3] = ((zz->LB.Num_Local_Parts_Param == -1) ? 0 : zz->LB.Num_Local_Parts_Param); inflag[4] = (zz->LB.Num_Global_Parts_Param != zz->LB.Prev_Global_Parts_Param); inflag[5] = (zz->LB.Num_Local_Parts_Param != zz->LB.Prev_Local_Parts_Param); @@ -889,7 +846,7 @@ MPI_User_function Zoltan_PartDist_MPIOp; } /* Since PartDist is changing, can't reuse old parts. - * Free LB.Data_Structure to prevent reuse. + * Free LB.Data_Structure to prevent reuse. * Also free LB.PartDist and LB.ProcDist. */ if (zz->LB.Free_Structure != NULL) @@ -906,7 +863,7 @@ MPI_User_function Zoltan_PartDist_MPIOp; sum_local_parts = outflag[3]; /* Sum of inflag[3] */ /* Check whether any parameters were set; - * No need to build the PartDist array if not. + * No need to build the PartDist array if not. */ if ((!global_parts_set || (max_global_parts==num_proc)) && !local_parts_set) { /* Number of parts == number of procs, uniformly distributed; */ @@ -916,28 +873,28 @@ MPI_User_function Zoltan_PartDist_MPIOp; else { /* Either NUM_GLOBAL_PARTS is set != num_proc or NUM_LOCAL_PARTS - * is set. Build PartDist, distributing parts to processors as - * specified. + * is set. Build PartDist, distributing parts to processors as + * specified. */ /* error checking. */ if (local_parts_set) { - if (!global_parts_set) + if (!global_parts_set) max_global_parts = sum_local_parts; else if (sum_local_parts > max_global_parts) { char emsg[256]; - sprintf(emsg, - "Sum of NUM_LOCAL_PARTS %d > NUM_GLOBAL_PARTS %d", + sprintf(emsg, + "Sum of NUM_LOCAL_PARTS %d > NUM_GLOBAL_PARTS %d", sum_local_parts, max_global_parts); ZOLTAN_PRINT_ERROR(zz->Proc, yo, emsg); ierr = ZOLTAN_FATAL; goto End; } - else if (sum_local_parts < max_global_parts && + else if (sum_local_parts < max_global_parts && local_parts_set == num_proc) { char emsg[256]; - sprintf(emsg, - "Sum of NUM_LOCAL_PARTS %d < NUM_GLOBAL_PARTS %d", + sprintf(emsg, + "Sum of NUM_LOCAL_PARTS %d < NUM_GLOBAL_PARTS %d", sum_local_parts, max_global_parts); ZOLTAN_PRINT_ERROR(zz->Proc, yo, emsg); ierr = ZOLTAN_FATAL; @@ -959,7 +916,7 @@ MPI_User_function Zoltan_PartDist_MPIOp; } pdist = zz->LB.PartDist; - + /* Compute the PartDist array. */ if (!local_parts_set) { @@ -993,14 +950,14 @@ MPI_User_function Zoltan_PartDist_MPIOp; /* NUM_LOCAL_PARTS is set on at least some processors. */ /* Distribute parts to processors to match NUM_LOCAL_PARTS - where specified; distribute remaining parts + where specified; distribute remaining parts to processors that didn't specify NUM_LOCAL_PARTS */ zz->LB.Single_Proc_Per_Part = 1; /* Gather the parameter values from all processors. */ local_parts_params = (int *) ZOLTAN_MALLOC((num_proc+1)* sizeof(int)); - MPI_Allgather(&(zz->LB.Num_Local_Parts_Param), 1, MPI_INT, + MPI_Allgather(&(zz->LB.Num_Local_Parts_Param), 1, MPI_INT, local_parts_params, 1, MPI_INT, zz->Communicator); /* Compute number of parts not specified by NUM_LOCAL_PARTS */ @@ -1027,7 +984,7 @@ MPI_User_function Zoltan_PartDist_MPIOp; pdist[cnt++] = i; pcnt++; } - + pdist[cnt] = num_proc; ZOLTAN_FREE(&local_parts_params); } @@ -1039,7 +996,7 @@ MPI_User_function Zoltan_PartDist_MPIOp; printf("[%1d] Debug: LB.PartDist = ", zz->Proc); for (i=0; i<=zz->LB.Num_Global_Parts; i++) printf("%d ", zz->LB.PartDist[i]); - + } } @@ -1049,9 +1006,9 @@ MPI_User_function Zoltan_PartDist_MPIOp; /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -static struct Hash_Node **create_hash_table(ZZ *zz, +static struct Hash_Node **create_hash_table(ZZ *zz, ZOLTAN_ID_PTR gids, int numIds, - int tableSize) + int tableSize) { struct Hash_Node **ht=NULL; struct Hash_Node *hnodes=NULL; @@ -1063,7 +1020,7 @@ int i, j; ht[tableSize] = hnodes; for (i=0; iNum_GID, tableSize); + j = Zoltan_Hash(gids, zz->Num_GID, tableSize); hnodes[i].next = ht[j]; hnodes[i].gid = gids; @@ -1085,7 +1042,7 @@ struct Hash_Node *hn; found = -1; j = Zoltan_Hash(gid, zz->Num_GID, tableSize); - + hn = ht[j]; while (hn){ @@ -1096,7 +1053,7 @@ struct Hash_Node *hn; } hn = hn->next; } - return found; + return found; } static void free_hash_table(struct Hash_Node **ht, int tableSize) { @@ -1107,9 +1064,9 @@ static void free_hash_table(struct Hash_Node **ht, int tableSize) /*****************************************************************************/ /*****************************************************************************/ void Zoltan_PartDist_MPIOp( - void *in, - void *inout, - int *len, + void *in, + void *inout, + int *len, MPI_Datatype *dptr) { int *int_in = (int *) in; diff --git a/packages/zoltan/src/lb/lb_box_assign.c b/packages/zoltan/src/lb/lb_box_assign.c index 01f7f7070d..73e506bac3 100644 --- a/packages/zoltan/src/lb/lb_box_assign.c +++ b/packages/zoltan/src/lb/lb_box_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -70,9 +33,9 @@ int Zoltan_LB_Box_Assign ( if (zz->LB.Box_Assign == NULL) { /* function not supported by current decomposition method */ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Box_Assign not supported by chosen partitioning method."); - return ZOLTAN_FATAL; + return ZOLTAN_FATAL; } if (zz->LB.PartDist != NULL) { @@ -84,7 +47,7 @@ int Zoltan_LB_Box_Assign ( /* Call appropriate method. Pass procs and count in partition arguments * for greater efficiency in LB.Box_Assign (Zoltan is partition-based.) */ - return zz->LB.Box_Assign(zz, xlo, ylo, zlo, xhi, yhi, zhi, NULL, &tmp, + return zz->LB.Box_Assign(zz, xlo, ylo, zlo, xhi, yhi, zhi, NULL, &tmp, procs, count); } @@ -106,9 +69,9 @@ int Zoltan_LB_Box_PP_Assign ( if (zz->LB.Box_Assign == NULL) { /* function not supported by current decomposition method */ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Box_Assign not supported by chosen partitioning method."); - return ZOLTAN_FATAL; + return ZOLTAN_FATAL; } /* Call appropriate method. Pass procs and count in partition arguments diff --git a/packages/zoltan/src/lb/lb_const.h b/packages/zoltan/src/lb/lb_const.h index 79fed69b7f..7e811d934a 100644 --- a/packages/zoltan/src/lb/lb_const.h +++ b/packages/zoltan/src/lb/lb_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __LB_CONST_H @@ -60,15 +23,15 @@ extern "C" { /* - * Type definitions for functions that depend on + * Type definitions for functions that depend on * load-balancing method. */ struct Zoltan_Struct; -typedef int ZOLTAN_LB_FN(struct Zoltan_Struct *, float *, int *, +typedef int ZOLTAN_LB_FN(struct Zoltan_Struct *, float *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **, - int *, ZOLTAN_ID_PTR *, + int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **); typedef void ZOLTAN_LB_FREE_DATA_FN(struct Zoltan_Struct *); @@ -79,10 +42,10 @@ typedef size_t ZOLTAN_LB_SERIALIZE_DATA_SIZE_FN(struct Zoltan_Struct const *); typedef void ZOLTAN_LB_SERIALIZE_DATA_FN(struct Zoltan_Struct const *, char **); typedef void ZOLTAN_LB_DESERIALIZE_DATA_FN(struct Zoltan_Struct *, char **); -typedef int ZOLTAN_LB_POINT_ASSIGN_FN(struct Zoltan_Struct *, double *, int *, +typedef int ZOLTAN_LB_POINT_ASSIGN_FN(struct Zoltan_Struct *, double *, int *, int *); -typedef int ZOLTAN_LB_BOX_ASSIGN_FN(struct Zoltan_Struct *, +typedef int ZOLTAN_LB_BOX_ASSIGN_FN(struct Zoltan_Struct *, double, double, double, double, double, double, int*, int*, int *, int *); @@ -92,9 +55,9 @@ typedef int ZOLTAN_LB_BOX_ASSIGN_FN(struct Zoltan_Struct *, */ typedef enum Zoltan_LB_Method { NONE = -1, - BLOCK, - CYCLIC, - RANDOM, + BLOCK, + CYCLIC, + RANDOM, RCB, PARMETIS, JOSTLE, @@ -110,7 +73,7 @@ typedef enum Zoltan_LB_Method { /* * Values indicating which lists (import, export, export including * exports "to myself", both, or none) should - * be returned by Zoltan_LB_Balance. ZOLTAN_LB_NO_LISTS must always be zero; + * be returned by Zoltan_LB_Balance. ZOLTAN_LB_NO_LISTS must always be zero; * other values should always be greater than zero. */ #define ZOLTAN_LB_NO_LISTS 0 @@ -148,20 +111,20 @@ struct Zoltan_LB_Struct { int Num_Global_Parts; /* The total number of parts. Set in Zoltan_LB_Build_PartDist. */ int Num_Global_Parts_Param; /* The number of global parts specified. - If parameter NUM_LOCAL_PARTS or + If parameter NUM_LOCAL_PARTS or NUM_GLOBAL_PARTS is not set, Num_Global_Parts_Param == Num_Proc. */ int Num_Local_Parts_Param; /* The number of local parts specified. - If parameter NUM_LOCAL_PARTS or + If parameter NUM_LOCAL_PARTS or NUM_GLOBAL_PARTS is not set, Num_Local_Parts_Param == -1. */ int Prev_Global_Parts_Param; /* The previous values of - Num_Global_Parts_Param. Stored to - prevent unnecessary re-creations of + Num_Global_Parts_Param. Stored to + prevent unnecessary re-creations of PartDist. */ int Prev_Local_Parts_Param; /* The previous values of - Num_Local_Parts_Param. Stored to - prevent unnecessary re-creations of + Num_Local_Parts_Param. Stored to + prevent unnecessary re-creations of PartDist. */ int Single_Proc_Per_Part; /* Flag indicating whether a part can be spread across multiple processors. @@ -169,7 +132,7 @@ struct Zoltan_LB_Struct { is set to be < zz->Num_Proc. */ int Remap_Flag; /* Flag indicating whether parts should be remapped to reduce data mvmt. */ - int *Remap; /* Remapping array; relabels computed + int *Remap; /* Remapping array; relabels computed parts to decrease data mvmt. */ int *OldRemap; /* Remapping array computed in previous invocation of partitioning. */ @@ -177,30 +140,30 @@ struct Zoltan_LB_Struct { should be returned by Zoltan_LB_Balance.*/ int Uniform_Parts; /* Flag indicating whether parts are uniformly sized. */ - int *PartDist; /* Array describing distribution of - parts to processors. + int *PartDist; /* Array describing distribution of + parts to processors. If Single_Proc_Per_Part, part i is located on processor PartDist[i]. If !Single_Proc_Per_Part, part i is located on processors PartDist[i] to PartDist[i+1]-1. */ - int *ProcDist; /* Array describing distribution of - processors to parts. + int *ProcDist; /* Array describing distribution of + processors to parts. If processor i has zero parts, ProcDist[i] = -1. Otherwise, ProcDist[i] has the lowest part number of parts on processor i. */ - ZOLTAN_LB_METHOD Method; /* Method to be used for load balancing. */ - char Method_Name[MAX_PARAM_STRING_LEN]; - /* String for method to be used. */ + ZOLTAN_LB_METHOD Method; /* Method to be used for load balancing. */ + char Method_Name[MAX_PARAM_STRING_LEN]; + /* String for method to be used. */ ZOLTAN_LB_FN *LB_Fn; /* Pointer to the function that performs the load balancing; this ptr is set based on the method used. */ - char Approach[MAX_PARAM_STRING_LEN]; + char Approach[MAX_PARAM_STRING_LEN]; /* String describing load balance approach. */ float *Imbalance_Tol; /* Tolerance to which to load balance; Imbalance_Tol = 1.1 implies 10% imbalance - is acceptable, i.e. max/avg = 1.1. + is acceptable, i.e. max/avg = 1.1. Imbalance_Tol may be an array of dimension Obj_Weight_Dim. */ int Imb_Tol_Len; /* Length of Imbalance_Tol array. */ @@ -214,7 +177,7 @@ struct Zoltan_LB_Struct { /* Pointer to function that copies the Data_Structure */ ZOLTAN_LB_SERIALIZE_DATA_SIZE_FN *Serialize_Structure_Size; - /* Pointer to function that returns the + /* Pointer to function that returns the buffer size to serialize the LB data */ ZOLTAN_LB_SERIALIZE_DATA_FN *Serialize_Structure; /* Pointer to function that copies LB data @@ -224,11 +187,11 @@ struct Zoltan_LB_Struct { a buffer to initialize the LB struct */ ZOLTAN_LB_POINT_ASSIGN_FN *Point_Assign; /* Pointer to the function that performs - Point_Assign; this ptr is set based on + Point_Assign; this ptr is set based on the method used. */ ZOLTAN_LB_BOX_ASSIGN_FN *Box_Assign; /* Pointer to the function that performs - Box_Assign; this ptr is set based on + Box_Assign; this ptr is set based on the method used. */ }; @@ -268,7 +231,7 @@ struct Zoltan_Migrate_Struct { passed to Mid_Migrate_PP() */ ZOLTAN_POST_MIGRATE_PP_FN *Post_Migrate_PP; /* Function that performs application - specific post-processing (including + specific post-processing (including part lists). Optional for migration. */ ZOLTAN_POST_MIGRATE_PP_FORT_FN *Post_Migrate_PP_Fort; @@ -315,7 +278,7 @@ extern size_t Zoltan_LB_Serialize_Size(struct Zoltan_Struct const *); extern void Zoltan_LB_Serialize(struct Zoltan_Struct const *, char **); extern void Zoltan_LB_Deserialize(struct Zoltan_Struct *, char **); -extern int Zoltan_LB_Copy_Struct(struct Zoltan_Struct *to, +extern int Zoltan_LB_Copy_Struct(struct Zoltan_Struct *to, struct Zoltan_Struct const *from); extern int Zoltan_LB_Special_Free_Part(struct Zoltan_Struct *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **); diff --git a/packages/zoltan/src/lb/lb_copy.c b/packages/zoltan/src/lb/lb_copy.c index aa40fd78e9..b0cc26f165 100644 --- a/packages/zoltan/src/lb/lb_copy.c +++ b/packages/zoltan/src/lb/lb_copy.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -108,7 +71,7 @@ int proc = fromZZ->Proc; to->Data_Structure = NULL; if (!from->Copy_Structure) { - /* + /* * Some Zoltan codes don't save their Data_Structure after * partitioning. However if they do, they must define a * copy function. @@ -117,7 +80,7 @@ int proc = fromZZ->Proc; return ZOLTAN_WARN; } from->Copy_Structure(toZZ, fromZZ); - } + } return ZOLTAN_OK; } diff --git a/packages/zoltan/src/lb/lb_eval.c b/packages/zoltan/src/lb/lb_eval.c index 1671b28e4e..68d187332c 100644 --- a/packages/zoltan/src/lb/lb_eval.c +++ b/packages/zoltan/src/lb/lb_eval.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -62,7 +25,7 @@ static void iget_strided_stats(int *v, int stride, int offset, int len, static void fget_strided_stats(float *v, int stride, int offset, int len, float *min, float *max, float *sum); -static int get_nbor_parts(ZZ *zz, int nobj, ZOLTAN_ID_PTR global_ids, +static int get_nbor_parts(ZZ *zz, int nobj, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *part, int nnbors, ZOLTAN_ID_PTR nbors_global, int *nbors_part); @@ -70,13 +33,13 @@ static int *objects_by_part(ZZ *zz, int num_obj, int *part, int *nparts, int *nonempty); static int object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, - int req_nparts, float *vwgts, int wgt_dim, - int *nparts, int *nonempty, float *obj_imbalance, - float *imbalance, float *nobj, float *obj_wgt, - float *xtra_imbalance, + int req_nparts, float *vwgts, int wgt_dim, + int *nparts, int *nonempty, float *obj_imbalance, + float *imbalance, float *nobj, float *obj_wgt, + float *xtra_imbalance, float (*xtra_obj_wgt)[EVAL_SIZE]); -static int add_graph_extra_weight(ZZ *zz, int num_obj, int *edges_per_obj, +static int add_graph_extra_weight(ZZ *zz, int num_obj, int *edges_per_obj, int *vwgt_dim, float **vwgts); extern int zoltan_lb_eval_sort_increasing(const void *a, const void *b); @@ -86,7 +49,7 @@ extern int zoltan_lb_eval_sort_increasing(const void *a, const void *b); int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) { /***************************************************************************/ - /* Return performance metrics in ZOLTAN_BALANCE_EVAL structure. */ + /* Return performance metrics in ZOLTAN_BALANCE_EVAL structure. */ /* Also print them out if print_stats is true. */ /***************************************************************************/ @@ -126,7 +89,7 @@ int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) /* Get object weights and parts */ - ierr = Zoltan_Get_Obj_List(zz, &num_obj, &global_ids, &local_ids, + ierr = Zoltan_Get_Obj_List(zz, &num_obj, &global_ids, &local_ids, vwgt_dim, &vwgts, &parts); if (ierr != ZOLTAN_OK) @@ -143,7 +106,7 @@ int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) for (i=0; i < num_obj; i++){ eval->obj_wgt[EVAL_LOCAL_SUM] += vwgts[i*vwgt_dim]; for (j=1; j <= EVAL_MAX_XTRA_VWGTS; j++){ - if (j == vwgt_dim) break; + if (j == vwgt_dim) break; eval->xtra_obj_wgt[j-1][EVAL_LOCAL_SUM] += vwgts[i*vwgt_dim + j]; } } @@ -178,22 +141,22 @@ int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) goto End; ZOLTAN_FREE(&part_sizes); - + /************************************************************************ * Print results */ if (print_stats && (zz->Proc == zz->Debug_Proc)){ - printf("\n%s Part count: %1d requested, %1d actual , %1d non-empty\n", + printf("\n%s Part count: %1d requested, %1d actual , %1d non-empty\n", yo, req_nparts, nparts, nonempty_nparts); printf("%s Statistics with respect to %1d parts: \n", yo, nparts); printf("%s Min Max Sum Imbalance\n", yo); - printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, - eval->nobj[EVAL_GLOBAL_MIN], eval->nobj[EVAL_GLOBAL_MAX], + printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, + eval->nobj[EVAL_GLOBAL_MIN], eval->nobj[EVAL_GLOBAL_MAX], eval->nobj[EVAL_GLOBAL_SUM]); if (eval->obj_imbalance >= 0){ @@ -204,8 +167,8 @@ int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) } if (vwgt_dim > 0){ - printf("%s Object weight : %8.3g %8.3g %8.3g", yo, - eval->obj_wgt[EVAL_GLOBAL_MIN], eval->obj_wgt[EVAL_GLOBAL_MAX], + printf("%s Object weight : %8.3g %8.3g %8.3g", yo, + eval->obj_wgt[EVAL_GLOBAL_MIN], eval->obj_wgt[EVAL_GLOBAL_MAX], eval->obj_wgt[EVAL_GLOBAL_SUM]); if (eval->imbalance >= 0){ @@ -220,8 +183,8 @@ int Zoltan_LB_Eval_Balance(ZZ *zzin, int print_stats, ZOLTAN_BALANCE_EVAL *eval) break; } printf("%s Object weight %d : %8.3g %8.3g %8.3g", yo, i+2, - eval->xtra_obj_wgt[i][EVAL_GLOBAL_MIN], - eval->xtra_obj_wgt[i][EVAL_GLOBAL_MAX], + eval->xtra_obj_wgt[i][EVAL_GLOBAL_MIN], + eval->xtra_obj_wgt[i][EVAL_GLOBAL_MAX], eval->xtra_obj_wgt[i][EVAL_GLOBAL_SUM]); if (eval->xtra_imbalance[i] >= 0){ @@ -311,7 +274,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) if ((zz->Get_Num_Edges == NULL && zz->Get_Num_Edges_Multi == NULL) || (zz->Get_Edge_List == NULL && zz->Get_Edge_List_Multi == NULL)) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "This function requires caller-defined graph query functions.\n"); return ZOLTAN_FATAL; } @@ -340,7 +303,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) */ ierr = Zoltan_Graph_Queries(zz, num_obj, global_ids, local_ids, - &num_edges, &edges_per_obj, + &num_edges, &edges_per_obj, &nbors_global, &nbors_proc, &ewgts); if (ierr != ZOLTAN_OK) @@ -362,7 +325,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) /***************************************************************** * Get the user defined partition sizes for each weight. Create - * partition sizes for the additional (ADD_OBJ_WEIGHT) weight, if any. + * partition sizes for the additional (ADD_OBJ_WEIGHT) weight, if any. */ part_dim = ((orig_vwgt_dim > 0) ? orig_vwgt_dim : 1); @@ -394,7 +357,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) } /***************************************************************** - * Local stats + * Local stats */ graph->nobj[EVAL_LOCAL_SUM] = num_obj; @@ -410,10 +373,10 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) } /***************************************************************** - * Get metrics based on number of objects and object weights + * Get metrics based on number of objects and object weights */ - ierr = object_metrics(zz, num_obj, parts, part_sizes, req_nparts, + ierr = object_metrics(zz, num_obj, parts, part_sizes, req_nparts, vwgts, vwgt_dim, &nparts, /* actual number of parts */ &nonempty_nparts, /* number of non-empty parts */ @@ -439,7 +402,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) goto End; } - ierr = get_nbor_parts(zz, num_obj, global_ids, local_ids, parts, + ierr = get_nbor_parts(zz, num_obj, global_ids, local_ids, parts, num_edges, nbors_global, nbors_part); if (ierr != ZOLTAN_OK) @@ -453,7 +416,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) hashTableSize = Zoltan_Recommended_Hash_Size(num_edges); - /* + /* * For calculation of each part's number of neighbors, * initialize a set of part number pairs using Zoltan_Hash. * Alternative is a nparts*nparts array, which uses too much memory. @@ -506,7 +469,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) if (ewgt_dim > 0){ /* "hypergraph" edge weight is max of the relevant graph edge weights */ if (ewgts[k * ewgt_dim] > obj_edge_weights) - obj_edge_weights = ewgts[k * ewgt_dim]; + obj_edge_weights = ewgts[k * ewgt_dim]; } else{ obj_edge_weights = 1.0; @@ -514,11 +477,11 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) if (nbor_part != obj_part){ - /* - * number of edges that have nbor in a different part + /* + * number of edges that have nbor in a different part */ - cuts[obj_part]++; + cuts[obj_part]++; for (e=0; e < ewgt_dim; e++){ /* @@ -578,7 +541,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) partNbors = (int *)ZOLTAN_MALLOC(sizeof(int) * num_pairs * 2); if (!partNbors){ - ierr = ZOLTAN_MEMERR; + ierr = ZOLTAN_MEMERR; goto End; } @@ -597,12 +560,12 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) partNbors[num_parts++] = key[1]; ierr = Zoltan_Map_Next(zz, map, (char **) (void *) &key, &keyValue); - + if (ierr != ZOLTAN_OK){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error in Zoltan_Map_Next\n"); goto End; } - } + } if (num_parts != num_pairs * 2){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error in Zoltan_Map_First/Next\n"); @@ -632,7 +595,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) ZOLTAN_FREE(&partNbors); count++; count >>= 1; - } + } } /************************************************************************ @@ -678,7 +641,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) graph->nnborparts + EVAL_GLOBAL_MAX, graph->nnborparts + EVAL_GLOBAL_SUM); - graph->nnborparts[EVAL_GLOBAL_AVG] = + graph->nnborparts[EVAL_GLOBAL_AVG] = graph->nnborparts[EVAL_GLOBAL_SUM] / nparts; /* @@ -721,7 +684,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) if (i == EVAL_MAX_XTRA_EWGTS){ break; } - + wgt = graph->xtra_cut_wgt[i]; fget_strided_stats(globalVals, ewgt_dim, i+1, num_weights, @@ -745,7 +708,7 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) graph->num_boundary + EVAL_GLOBAL_MAX, graph->num_boundary + EVAL_GLOBAL_SUM); - graph->num_boundary[EVAL_GLOBAL_AVG] = + graph->num_boundary[EVAL_GLOBAL_AVG] = graph->num_boundary[EVAL_GLOBAL_SUM] / nparts; ZOLTAN_FREE(&num_boundary); @@ -757,14 +720,14 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) if (print_stats && (zz->Proc == zz->Debug_Proc)){ - printf("\n%s Part count: %1d requested, %1d actual, %1d non-empty\n", + printf("\n%s Part count: %1d requested, %1d actual, %1d non-empty\n", yo, req_nparts, nparts, nonempty_nparts); printf("%s Statistics with respect to %1d parts: \n", yo, nparts); printf("%s Min Max Sum Imbalance\n", yo); - printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, + printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, graph->nobj[EVAL_GLOBAL_MIN], graph->nobj[EVAL_GLOBAL_MAX], graph->nobj[EVAL_GLOBAL_SUM]); @@ -776,8 +739,8 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) } if (vwgt_dim > 0){ - printf("%s Object weight : %8.3g %8.3g %8.3g", yo, - graph->obj_wgt[EVAL_GLOBAL_MIN], graph->obj_wgt[EVAL_GLOBAL_MAX], + printf("%s Object weight : %8.3g %8.3g %8.3g", yo, + graph->obj_wgt[EVAL_GLOBAL_MIN], graph->obj_wgt[EVAL_GLOBAL_MAX], graph->obj_wgt[EVAL_GLOBAL_SUM]); if (graph->imbalance >= 0){ @@ -786,14 +749,14 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) else{ printf(" ----\n"); } - + for (i=0; i < vwgt_dim-1; i++){ if (i == EVAL_MAX_XTRA_VWGTS){ break; } printf("%s Object weight %d : %8.3g %8.3g %8.3g", yo, i+2, - graph->xtra_obj_wgt[i][EVAL_GLOBAL_MIN], - graph->xtra_obj_wgt[i][EVAL_GLOBAL_MAX], + graph->xtra_obj_wgt[i][EVAL_GLOBAL_MIN], + graph->xtra_obj_wgt[i][EVAL_GLOBAL_MAX], graph->xtra_obj_wgt[i][EVAL_GLOBAL_SUM]); if (graph->xtra_imbalance[i] >= 0){ @@ -816,31 +779,31 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) printf("%s " "Min Max Average Sum\n", yo); - printf("%s Num boundary objects : %8.3g %8.3g %8.3g %8.3g\n", yo, - graph->num_boundary[EVAL_GLOBAL_MIN], - graph->num_boundary[EVAL_GLOBAL_MAX], - graph->num_boundary[EVAL_GLOBAL_AVG], + printf("%s Num boundary objects : %8.3g %8.3g %8.3g %8.3g\n", yo, + graph->num_boundary[EVAL_GLOBAL_MIN], + graph->num_boundary[EVAL_GLOBAL_MAX], + graph->num_boundary[EVAL_GLOBAL_AVG], graph->num_boundary[EVAL_GLOBAL_SUM]); - printf("%s Number of cut edges : %8.3g %8.3g %8.3g %8.3g\n", yo, - graph->cuts[EVAL_GLOBAL_MIN], graph->cuts[EVAL_GLOBAL_MAX], + printf("%s Number of cut edges : %8.3g %8.3g %8.3g %8.3g\n", yo, + graph->cuts[EVAL_GLOBAL_MIN], graph->cuts[EVAL_GLOBAL_MAX], graph->cuts[EVAL_GLOBAL_AVG], graph->cuts[EVAL_GLOBAL_SUM]); if (ewgt_dim) - printf("%s Weight of cut edges (CUTE): %8.3g %8.3g %8.3g %8.3g\n", yo, - graph->cut_wgt[EVAL_GLOBAL_MIN], graph->cut_wgt[EVAL_GLOBAL_MAX], + printf("%s Weight of cut edges (CUTE): %8.3g %8.3g %8.3g %8.3g\n", yo, + graph->cut_wgt[EVAL_GLOBAL_MIN], graph->cut_wgt[EVAL_GLOBAL_MAX], graph->cut_wgt[EVAL_GLOBAL_AVG], graph->cut_wgt[EVAL_GLOBAL_SUM]); for (i=0; i < ewgt_dim-1; i++){ if (i == EVAL_MAX_XTRA_EWGTS){ break; } - printf("%s Weight %d : %8.3g %8.3g %8.3g %8.3g\n", + printf("%s Weight %d : %8.3g %8.3g %8.3g %8.3g\n", yo, i+2, - graph->xtra_cut_wgt[i][EVAL_GLOBAL_MIN], - graph->xtra_cut_wgt[i][EVAL_GLOBAL_MAX], - graph->xtra_cut_wgt[i][EVAL_GLOBAL_AVG], + graph->xtra_cut_wgt[i][EVAL_GLOBAL_MIN], + graph->xtra_cut_wgt[i][EVAL_GLOBAL_MAX], + graph->xtra_cut_wgt[i][EVAL_GLOBAL_AVG], graph->xtra_cut_wgt[i][EVAL_GLOBAL_SUM]); } if (ewgt_dim-1 > EVAL_MAX_XTRA_EWGTS){ @@ -849,10 +812,10 @@ int Zoltan_LB_Eval_Graph(ZZ *zzin, int print_stats, ZOLTAN_GRAPH_EVAL *graph) EVAL_MAX_XTRA_EWGTS); } - printf("%s Num Nbor Parts : %8.3g %8.3g %8.3g %8.3g\n", yo, - graph->nnborparts[EVAL_GLOBAL_MIN], - graph->nnborparts[EVAL_GLOBAL_MAX], - graph->nnborparts[EVAL_GLOBAL_AVG], + printf("%s Num Nbor Parts : %8.3g %8.3g %8.3g %8.3g\n", yo, + graph->nnborparts[EVAL_GLOBAL_MIN], + graph->nnborparts[EVAL_GLOBAL_MAX], + graph->nnborparts[EVAL_GLOBAL_AVG], graph->nnborparts[EVAL_GLOBAL_SUM]); printf("\n\n"); @@ -917,7 +880,7 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) ZHG* zhg=NULL; ZOLTAN_HG_EVAL localEval; - + ZOLTAN_TRACE_ENTER(zz, yo); /* Set default error code */ ierr = ZOLTAN_OK; @@ -930,12 +893,12 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) if ((zz->Get_HG_Size_CS==NULL) && (zz->Get_HG_CS==NULL) && (zz->Get_Num_Edges==NULL) && (zz->Get_Num_Edges_Multi==NULL) && (zz->Get_Edge_List==NULL) && (zz->Get_Edge_List_Multi==NULL)) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "This function requires graph or hypergraph query functions.\n"); return ZOLTAN_FATAL; } - /* get the requested number of parts */ + /* get the requested number of parts */ ierr = Zoltan_LB_Build_PartDist(zz); if (ierr != ZOLTAN_OK){ @@ -1001,7 +964,7 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) goto End; /***************************************************************** - * Local stats + * Local stats */ hg->nobj[EVAL_LOCAL_SUM] = zhg->nObj; @@ -1013,7 +976,7 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) } /************************************************************************ - * Compute the cutn and cutl + * Compute the cutn and cutl */ if (!zhg->Output_Parts) @@ -1042,22 +1005,22 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) hg->cutl[EVAL_GLOBAL_AVG] = hg->cutl[EVAL_GLOBAL_SUM] / nparts; hg->cutn[EVAL_GLOBAL_AVG] = hg->cutn[EVAL_GLOBAL_SUM] / nparts; - + /************************************************************************ * Print results */ if (print_stats && (zz->Proc == zz->Debug_Proc)){ - printf("\n%s Part count: %1d requested, %1d actual, %1d non-empty\n", + printf("\n%s Part count: %1d requested, %1d actual, %1d non-empty\n", yo, req_nparts, nparts, nonempty_nparts); printf("%s Statistics with respect to %1d parts: \n", yo, nparts); - printf("%s Min Max Sum Imbalance\n", + printf("%s Min Max Sum Imbalance\n", yo); - printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, - hg->nobj[EVAL_GLOBAL_MIN], hg->nobj[EVAL_GLOBAL_MAX], + printf("%s Number of objects : %8.3g %8.3g %8.3g", yo, + hg->nobj[EVAL_GLOBAL_MIN], hg->nobj[EVAL_GLOBAL_MAX], hg->nobj[EVAL_GLOBAL_SUM]); if (hg->obj_imbalance >= 0){ @@ -1068,8 +1031,8 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) } if (zhg->objWeightDim > 0){ - printf("%s Object weight : %8.3g %8.3g %8.3g", yo, - hg->obj_wgt[EVAL_GLOBAL_MIN], hg->obj_wgt[EVAL_GLOBAL_MAX], + printf("%s Object weight : %8.3g %8.3g %8.3g", yo, + hg->obj_wgt[EVAL_GLOBAL_MIN], hg->obj_wgt[EVAL_GLOBAL_MAX], hg->obj_wgt[EVAL_GLOBAL_SUM]); if (hg->imbalance >= 0){ @@ -1083,7 +1046,7 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) if (i == EVAL_MAX_XTRA_VWGTS){ break; } - printf("%s Object weight %d : %8.3g %8.3g %8.3g", + printf("%s Object weight %d : %8.3g %8.3g %8.3g", yo, i+2, hg->xtra_obj_wgt[i][EVAL_GLOBAL_MIN], hg->xtra_obj_wgt[i][EVAL_GLOBAL_MAX], @@ -1104,11 +1067,11 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) } printf("\n"); - printf("%s CUTN (Sum_edges( (#parts(edge)>1)*ewgt )): %8.3f\n", + printf("%s CUTN (Sum_edges( (#parts(edge)>1)*ewgt )): %8.3f\n", yo, hg->cutn[EVAL_GLOBAL_SUM]); - printf("%s CUTL (Sum_edges( (#parts(edge)-1)*ewgt )): %8.3f\n", + printf("%s CUTL (Sum_edges( (#parts(edge)-1)*ewgt )): %8.3f\n", yo, hg->cutl[EVAL_GLOBAL_SUM]); - printf("%s CUTL-MAX (Max_procs( comm. volume ): %8.3f\n", + printf("%s CUTL-MAX (Max_procs( comm. volume ): %8.3f\n", yo, hg->cutl[EVAL_GLOBAL_MAX]); @@ -1142,9 +1105,9 @@ int Zoltan_LB_Eval_HG(ZZ *zzin, int print_stats, ZOLTAN_HG_EVAL *hg) /************************************************************************/ /************************************************************************/ /************************************************************************/ -int Zoltan_LB_Eval(ZZ *zz, int print_stats, - ZOLTAN_BALANCE_EVAL *obj, - ZOLTAN_GRAPH_EVAL *graph, +int Zoltan_LB_Eval(ZZ *zz, int print_stats, + ZOLTAN_BALANCE_EVAL *obj, + ZOLTAN_GRAPH_EVAL *graph, ZOLTAN_HG_EVAL *hg ) /* @@ -1157,14 +1120,14 @@ int Zoltan_LB_Eval(ZZ *zz, int print_stats, * obj - pointer to a ZOLTAN_BALANCE_EVAL structure, * if non-NULL partitioning * metrics will be written to the structure - * graph - pointer to a ZOLTAN_GRAPH_EVAL structure, + * graph - pointer to a ZOLTAN_GRAPH_EVAL structure, * if non_null and graph query * functions are defined by the application, graph partitioning * quality metrics will be written to the structure - * hg - pointer to an ZOLTAN_HG_EVAL structure, + * hg - pointer to an ZOLTAN_HG_EVAL structure, * if non_null and graph or * hypergraph query functions are defined by the application, - * hypergraph partitioning quality metrics will be written to + * hypergraph partitioning quality metrics will be written to * the structure * */ @@ -1301,7 +1264,7 @@ int i, start, size, i_am_done, alldone; const int MAXSIZE = 200000; for (i=0; i < nnbors; i++){ - /* + /* * a check on validity of data supplied by query functions */ nbors_part[i] = -1; @@ -1427,7 +1390,7 @@ objects_by_part(ZZ *zz, int num_obj, int *part, int *nparts, int *nonempty) /************************************************************************/ static int -object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_nparts, +object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_nparts, float *vwgts, int vwgt_dim, int *nparts, /* return actual number of parts */ int *nonempty, /* return number of those that are non-empty*/ @@ -1441,8 +1404,8 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart MPI_Comm comm = zz->Communicator; int i, j, idx, ierr, part_dim; - int num_weights; - int num_parts = zz->LB.Num_Global_Parts; + int num_weights; + int num_parts = zz->LB.Num_Global_Parts; int num_nonempty_parts = zz->LB.Num_Global_Parts; int *globalCount = NULL; @@ -1481,9 +1444,9 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart if (req_nparts >= num_parts){ imbal = 0.0; - + if (nobj[EVAL_GLOBAL_SUM] > 0) { - + for (i=0, idx=0; i < num_parts; i++, idx+=part_dim){ if (part_sizes[idx] > 0){ tmp = globalCount[i] / (nobj[EVAL_GLOBAL_SUM] * part_sizes[idx]); @@ -1494,8 +1457,8 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart *obj_imbalance = (imbal > 0 ? imbal : 1.0); } else{ - /* - * flag that imbalance is infinite (part_size is 0 for non-empty part) + /* + * flag that imbalance is infinite (part_size is 0 for non-empty part) */ *obj_imbalance = -1; } @@ -1507,38 +1470,38 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart /* if vwgt_dim > 0, then part_dim is the same as vwgt_dim */ num_weights = num_parts * vwgt_dim; - + localVals = (float *)ZOLTAN_CALLOC(num_weights*2, sizeof(float)); - + if (num_weights && !localVals){ ierr = ZOLTAN_MEMERR; goto End; } - + globalVals = localVals + num_weights; - + for (i=0; i= num_parts){ imbal = 0.0; - + if (obj_wgt[EVAL_GLOBAL_SUM] > 0){ - + for (i=0, idx = 0; i < num_parts; i++, idx += vwgt_dim){ if (part_sizes[idx] > 0){ tmp = globalVals[idx] / (obj_wgt[EVAL_GLOBAL_SUM] * part_sizes[idx]); @@ -1546,7 +1509,7 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart } } } - + *imbalance = (imbal > 0 ? imbal : 1.0); } else{ @@ -1554,29 +1517,29 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart } /* calculations for multiple vertex weights */ - + for (i=0; i < vwgt_dim-1; i++){ if (i == EVAL_MAX_XTRA_VWGTS){ break; } - + wgt = xtra_obj_wgt[i]; - + fget_strided_stats(globalVals, vwgt_dim, i+1, num_weights, wgt + EVAL_GLOBAL_MIN, wgt + EVAL_GLOBAL_MAX, wgt + EVAL_GLOBAL_SUM); - + wgt[EVAL_GLOBAL_AVG] = wgt[EVAL_GLOBAL_SUM]/(float)num_parts; - + /* imbalance scaled by user specified part_sizes */ if (req_nparts >= num_parts){ imbal = 0.0; - + if (wgt[EVAL_GLOBAL_SUM] > 0){ - + for (j=0; j < num_parts; j++){ idx = (j * vwgt_dim) + i + 1; if (part_sizes[idx] > 0){ @@ -1611,11 +1574,11 @@ object_metrics(ZZ *zz, int num_obj, int *parts, float *part_sizes, int req_npart /************************************************************************/ -static int +static int add_graph_extra_weight(ZZ *zz, int num_obj, int *edges_per_obj, int *vwgt_dim, float **vwgts) { char *yo = "add_graph_extra_weight"; - PARAM_VARS params[2] = + PARAM_VARS params[2] = {{ "ADD_OBJ_WEIGHT", NULL, "STRING", 0}, { NULL, NULL, NULL, 0 } }; char add_obj_weight[64]; @@ -1656,7 +1619,7 @@ add_graph_extra_weight(ZZ *zz, int num_obj, int *edges_per_obj, int *vwgt_dim, f ierr = ZOLTAN_MEMERR; goto End; } - + tmpnew = weights; tmpold = *vwgts; diff --git a/packages/zoltan/src/lb/lb_free.c b/packages/zoltan/src/lb/lb_free.c index d901bac7a7..04d78d0a99 100644 --- a/packages/zoltan/src/lb/lb_free.c +++ b/packages/zoltan/src/lb/lb_free.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -57,8 +20,8 @@ extern "C" { /*****************************************************************************/ /* * This file contains routines for freeing arrays allocated by Zoltan and - * returned to the application; these functions are all callable by the - * application. + * returned to the application; these functions are all callable by the + * application. * * Also includes routine for freeing memory in zz->LB (LB_Struct). * This routine should be called only by Zoltan. @@ -82,7 +45,7 @@ int Zoltan_LB_Free_Part( ZOLTAN_FREE(local_ids); ZOLTAN_FREE(procs); ZOLTAN_FREE(to_part); - + return (ZOLTAN_OK); } @@ -98,13 +61,13 @@ int Zoltan_LB_Special_Free_Part( /* * Routine to free the arrays returning the results of the load balancing. * This routine should be used within Zoltan to ensure that F90-allocated - * arrays are freed correctly. + * arrays are freed correctly. * For example, Zoltan SPECIAL_MALLOCs return arrays, but then needs to * free them while changing the return list format. Zoltan should call * Zoltan_LB_Special_Free Part (not Zoltan_LB_Free_Part) to SPECIAL_FREE * the memory that was SPECIAL_MALLOCed. - * - * External applications do not need to use this routine, + * + * External applications do not need to use this routine, * as the correct malloc/free protocal for their language will be observed. */ @@ -121,7 +84,7 @@ int Zoltan_LB_Special_Free_Part( /*****************************************************************************/ int Zoltan_LB_Free_Data( - ZOLTAN_ID_PTR *import_global_ids, /* Array of global IDs for non-local objects + ZOLTAN_ID_PTR *import_global_ids, /* Array of global IDs for non-local objects assigned to this processor in the new decomposition. */ ZOLTAN_ID_PTR *import_local_ids, /* Array of local IDs for non-local objects diff --git a/packages/zoltan/src/lb/lb_init.c b/packages/zoltan/src/lb/lb_init.c index 5264830d8a..fd394926ad 100644 --- a/packages/zoltan/src/lb/lb_init.c +++ b/packages/zoltan/src/lb/lb_init.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -122,10 +85,10 @@ void Zoltan_LB_Init(struct Zoltan_LB_Struct *lb, int num_proc) /*****************************************************************************/ /*****************************************************************************/ -size_t Zoltan_LB_Serialize_Size(struct Zoltan_Struct const *zz) +size_t Zoltan_LB_Serialize_Size(struct Zoltan_Struct const *zz) { size_t bufSize = 0; - struct Zoltan_LB_Struct const *lb = &(zz->LB); + const struct Zoltan_LB_Struct *lb = &(zz->LB); /* Copy 12 integers from zz->LB */ bufSize += 12 * sizeof(int); @@ -148,7 +111,7 @@ size_t Zoltan_LB_Serialize_Size(struct Zoltan_Struct const *zz) bufSize += lb->Num_Global_Parts * sizeof(int); /* Method specific data */ - if (lb->Serialize_Structure_Size != NULL) + if (lb->Serialize_Structure_Size != NULL) bufSize += lb->Serialize_Structure_Size(zz); return bufSize; @@ -158,30 +121,30 @@ size_t Zoltan_LB_Serialize_Size(struct Zoltan_Struct const *zz) void Zoltan_LB_Serialize(struct Zoltan_Struct const *zz, char **buf) { char *bufptr = *buf; - struct Zoltan_LB_Struct const *lb = &(zz->LB); + const struct Zoltan_LB_Struct *lb = &(zz->LB); /* Copy 12 integers; if add more, update Zoltan_LB_Serialize_Size */ { - int *intptr = (int *) bufptr; - *intptr = lb->Num_Global_Parts; intptr++; - *intptr = lb->Num_Global_Parts_Param; intptr++; - *intptr = lb->Num_Local_Parts_Param; intptr++; - *intptr = lb->Prev_Global_Parts_Param; intptr++; - *intptr = lb->Prev_Local_Parts_Param; intptr++; - *intptr = lb->Single_Proc_Per_Part; intptr++; - *intptr = lb->Part_Info_Max_Len; intptr++; - *intptr = lb->Part_Info_Len; intptr++; - *intptr = lb->Remap_Flag; intptr++; - *intptr = lb->Return_Lists; intptr++; - *intptr = lb->Uniform_Parts; intptr++; - *intptr = lb->Imb_Tol_Len; intptr++; - bufptr = (char *) intptr; + int *intptr = (int *) bufptr; + *intptr = lb->Num_Global_Parts; intptr++; + *intptr = lb->Num_Global_Parts_Param; intptr++; + *intptr = lb->Num_Local_Parts_Param; intptr++; + *intptr = lb->Prev_Global_Parts_Param; intptr++; + *intptr = lb->Prev_Local_Parts_Param; intptr++; + *intptr = lb->Single_Proc_Per_Part; intptr++; + *intptr = lb->Part_Info_Max_Len; intptr++; + *intptr = lb->Part_Info_Len; intptr++; + *intptr = lb->Remap_Flag; intptr++; + *intptr = lb->Return_Lists; intptr++; + *intptr = lb->Uniform_Parts; intptr++; + *intptr = lb->Imb_Tol_Len; intptr++; + bufptr = (char *) intptr; } /* Copy LB_Method name */ strcpy(bufptr, lb->Method_Name); bufptr += MAX_PARAM_STRING_LEN; - + /* Copy Part_Info */ if (lb->Part_Info_Len) { size_t tmpSize = lb->Part_Info_Len * sizeof(struct Zoltan_part_info); @@ -199,7 +162,7 @@ void Zoltan_LB_Serialize(struct Zoltan_Struct const *zz, char **buf) /* Copy lb->Approach */ strcpy(bufptr, lb->Approach); bufptr += MAX_PARAM_STRING_LEN; - + /* Copy Remap array; needed by Point_Assign */ if (lb->Remap != NULL) { int *intptr = (int *)bufptr; @@ -230,22 +193,20 @@ void Zoltan_LB_Deserialize(struct Zoltan_Struct *zz, char **buf) int orig_Imb_Tol_Len = lb->Imb_Tol_Len; /* Copy 12 integers into zz->LB */ - { - int *intptr = (int *) bufptr; - lb->Num_Global_Parts = *intptr; intptr++; - lb->Num_Global_Parts_Param = *intptr; intptr++; - lb->Num_Local_Parts_Param = *intptr; intptr++; - lb->Prev_Global_Parts_Param = *intptr; intptr++; - lb->Prev_Local_Parts_Param = *intptr; intptr++; - lb->Single_Proc_Per_Part = *intptr; intptr++; - lb->Part_Info_Max_Len = *intptr; intptr++; - lb->Part_Info_Len = *intptr; intptr++; - lb->Remap_Flag = *intptr; intptr++; - lb->Return_Lists = *intptr; intptr++; - lb->Uniform_Parts = *intptr; intptr++; - lb->Imb_Tol_Len = *intptr; intptr++; - bufptr = (char *) intptr; - } + int *intptr = (int *) bufptr; + lb->Num_Global_Parts = *intptr; intptr++; + lb->Num_Global_Parts_Param = *intptr; intptr++; + lb->Num_Local_Parts_Param = *intptr; intptr++; + lb->Prev_Global_Parts_Param = *intptr; intptr++; + lb->Prev_Local_Parts_Param = *intptr; intptr++; + lb->Single_Proc_Per_Part = *intptr; intptr++; + lb->Part_Info_Max_Len = *intptr; intptr++; + lb->Part_Info_Len = *intptr; intptr++; + lb->Remap_Flag = *intptr; intptr++; + lb->Return_Lists = *intptr; intptr++; + lb->Uniform_Parts = *intptr; intptr++; + lb->Imb_Tol_Len = *intptr; intptr++; + bufptr = (char *) intptr; /* Reset the functions (Point_Assign, etc.) associated with the LB_Method */ strcpy(lb->Method_Name, bufptr); @@ -274,10 +235,10 @@ void Zoltan_LB_Deserialize(struct Zoltan_Struct *zz, char **buf) /* Copy lb->Approach */ strcpy(lb->Approach, bufptr); bufptr += MAX_PARAM_STRING_LEN; - + /* Copy Remap array; needed by Point_Assign */ int nbytes = lb->Num_Global_Parts * sizeof(int); - int *intptr = (int *) bufptr; + intptr = (int *) bufptr; bufptr += sizeof(int); if (*intptr) { // Remap data was sent lb->Remap = (int *) ZOLTAN_MALLOC(nbytes); @@ -322,7 +283,7 @@ void Zoltan_Deserialize_Structure_Not_Implemented(ZZ *zz, char **buf) "no data will be copied.\n" "Contact Zoltan developers to request serialization of this " "method", zz->LB.Method_Name); - ZOLTAN_PRINT_WARN(zz->Proc, + ZOLTAN_PRINT_WARN(zz->Proc, "Zoltan_Deserialize_Structure_Not_Implemented", msg); } diff --git a/packages/zoltan/src/lb/lb_init_const.h b/packages/zoltan/src/lb/lb_init_const.h index f8d331f3f2..b57e539088 100644 --- a/packages/zoltan/src/lb/lb_init_const.h +++ b/packages/zoltan/src/lb/lb_init_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __LB_INIT_CONST_H diff --git a/packages/zoltan/src/lb/lb_invert.c b/packages/zoltan/src/lb/lb_invert.c index a8f59ea8f1..4fcdd21ba6 100644 --- a/packages/zoltan/src/lb/lb_invert.c +++ b/packages/zoltan/src/lb/lb_invert.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -60,7 +23,7 @@ extern "C" { /* * This file contains routines implementing the list inverting tools * Zoltan_Invert_Lists and Zoltan_Compute_Destinations. - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ @@ -75,12 +38,12 @@ static int check_invert_input(ZZ *, int, int *, int *, int *, int *, int *); int Zoltan_Invert_Lists( ZZ *zz, /* Zoltan structure. */ - int num_in, /* Number of objects in the input lists. */ + int num_in, /* Number of objects in the input lists. */ ZOLTAN_ID_PTR in_global_ids, /* Array of input global IDs. */ ZOLTAN_ID_PTR in_local_ids, /* Array of input local IDs. */ int *in_procs, /* Array of processor IDs of processors owning the input objects. */ - int *in_to_part, /* Optional: Array of partition numbers to + int *in_to_part, /* Optional: Array of partition numbers to which input objects should be assigned. */ int *num_out, /* Returned value: Number of output objs. */ ZOLTAN_ID_PTR *out_global_ids,/* Returned value: Array of global IDs of @@ -89,17 +52,17 @@ int Zoltan_Invert_Lists( output objects. */ int **out_procs, /* Returned value: Array of processor IDs to which output objects are assigned. */ - int **out_to_part /* Optional: Returned value: Array of + int **out_to_part /* Optional: Returned value: Array of partition numbers to which output objects should be assigned. */ ) { /* * Routine to compute the inverse map. Can be used in two ways: - * 1. Given, for each processor, a list of objects to be received by the - * processor, compute the list of objects that the processor needs to send + * 1. Given, for each processor, a list of objects to be received by the + * processor, compute the list of objects that the processor needs to send * to other processors to satisfy their needs. - * 2. Given, for each processor, a list of objects to be sent to other + * 2. Given, for each processor, a list of objects to be sent to other * processors, compute the list of objects that the processor needs to receive * to satisfy its needs. */ @@ -129,7 +92,7 @@ int ierr, ret_ierr = ZOLTAN_OK; * Check that all procs use the same id types. */ - ierr = check_invert_input(zz, num_in, in_procs, in_to_part, + ierr = check_invert_input(zz, num_in, in_procs, in_to_part, &num_gid_entries, &num_lid_entries, &include_parts); if (ierr != ZOLTAN_OK) { ZOLTAN_TRACE_EXIT(zz, yo); @@ -149,7 +112,7 @@ int ierr, ret_ierr = ZOLTAN_OK; */ msgtag = 32767; - ierr = Zoltan_Comm_Create(&comm_plan, num_in, in_procs, zz->Communicator, + ierr = Zoltan_Comm_Create(&comm_plan, num_in, in_procs, zz->Communicator, msgtag, num_out); if (ierr != ZOLTAN_OK) { sprintf(msg, "Error %s returned from Zoltan_Comm_Create.", @@ -158,7 +121,7 @@ int ierr, ret_ierr = ZOLTAN_OK; ret_ierr = ierr; goto End; } - + ZOLTAN_TRACE_DETAIL(zz, yo, "Done comm create"); @@ -202,11 +165,11 @@ int ierr, ret_ierr = ZOLTAN_OK; */ msgtag2 = 32766; - ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_global_ids, - (int) (sizeof(ZOLTAN_ID_TYPE)*(num_gid_entries)), + ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_global_ids, + (int) (sizeof(ZOLTAN_ID_TYPE)*(num_gid_entries)), (char *) *out_global_ids); if (ierr != ZOLTAN_OK) { - sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", + sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", (ierr == ZOLTAN_MEMERR ? "ZOLTAN_MEMERR" : "ZOLTAN_FATAL")); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); ret_ierr = ierr; @@ -214,11 +177,11 @@ int ierr, ret_ierr = ZOLTAN_OK; if (num_lid_entries) { msgtag2--; - ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_local_ids, - (int) (sizeof(ZOLTAN_ID_TYPE)*num_lid_entries), + ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_local_ids, + (int) (sizeof(ZOLTAN_ID_TYPE)*num_lid_entries), (char *) *out_local_ids); if (ierr != ZOLTAN_OK) { - sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", + sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", (ierr == ZOLTAN_MEMERR ? "ZOLTAN_MEMERR" : "ZOLTAN_FATAL")); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); ret_ierr = ierr; @@ -227,13 +190,13 @@ int ierr, ret_ierr = ZOLTAN_OK; Zoltan_Comm_Info(comm_plan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, *out_procs, NULL); - + if (include_parts) { msgtag2--; - ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_to_part, + ierr = Zoltan_Comm_Do(comm_plan, msgtag2, (char *) in_to_part, (int) sizeof(int), (char *) *out_to_part); if (ierr != ZOLTAN_OK) { - sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", + sprintf(msg, "Error %s returned from Zoltan_Comm_Do.", (ierr == ZOLTAN_MEMERR ? "ZOLTAN_MEMERR" : "ZOLTAN_FATAL")); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); ret_ierr = ierr; @@ -263,10 +226,10 @@ int ierr, ret_ierr = ZOLTAN_OK; /*****************************************************************************/ static int check_invert_input( - ZZ *zz, + ZZ *zz, int in_num, - int *in_procs, - int *in_to_part, + int *in_procs, + int *in_to_part, int *num_gid_entries, int *num_lid_entries, int *include_parts @@ -296,7 +259,7 @@ int ierr = ZOLTAN_OK; MPI_Allreduce(loc_tmp, glob_min, 2, MPI_INT, MPI_MIN, zz->Communicator); - /* + /* * For MPI_MAX operation: * include_parts == if any proc has in_num > 0 and specifies in_to_part. * do_not_include_parts == if any proc has in_num > 0 and does not specify @@ -335,8 +298,8 @@ int ierr = ZOLTAN_OK; if (glob_max[2]) { ierr = ZOLTAN_FATAL; if (loc_tmp[2] == glob_max[2]) { - sprintf(msg, - "Inconsistent input: # objects = %d but proc array is NULL\n", + sprintf(msg, + "Inconsistent input: # objects = %d but proc array is NULL\n", in_num); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); } @@ -369,7 +332,7 @@ int Zoltan_Compute_Destinations( int **out_procs ) { -/* +/* * Wrapper around Zoltan_Invert_Lists, with NULL for excluded partition arrays. * Maintained for backward compatibility. * Arguments are analogous to Zoltan_Invert_Lists. @@ -381,7 +344,7 @@ int ierr; ZOLTAN_TRACE_ENTER(zz, yo); - ierr = Zoltan_Invert_Lists(zz, num_in, + ierr = Zoltan_Invert_Lists(zz, num_in, in_global_ids, in_local_ids, in_procs, NULL, num_out, out_global_ids, out_local_ids, out_procs, NULL); @@ -394,3 +357,4 @@ int ierr; #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/lb/lb_migrate.c b/packages/zoltan/src/lb/lb_migrate.c index 833123ea26..d4102ec3e8 100644 --- a/packages/zoltan/src/lb/lb_migrate.c +++ b/packages/zoltan/src/lb/lb_migrate.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -58,7 +21,7 @@ extern "C" { /*****************************************************************************/ /* * This file contains routines implementing the migration-help tools. - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ @@ -74,15 +37,15 @@ static int actual_arrays(ZZ *, int, int, int, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, int Zoltan_Migrate( ZZ *zz, /* Zoltan structure. */ - int num_import, /* Number of non-local objects assigned to the + int num_import, /* Number of non-local objects assigned to the processor in the new decomposition. */ - ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects + ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects assigned to this processor in the new - decomposition; this field can be NULL if + decomposition; this field can be NULL if the application doesn't provide import IDs.*/ ZOLTAN_ID_PTR import_local_ids, /* Array of local IDs for non-local objects assigned to the processor in the new - decomposition; this field can be NULL if the + decomposition; this field can be NULL if the application does not provide import IDs. */ int *import_procs, /* Array of processor IDs of processors owning the non-local objects that are assigned to @@ -101,7 +64,7 @@ int Zoltan_Migrate( objects to be exported to other processors to establish the new decomposition. */ int *export_procs, /* Array of processor IDs - to which objects will be exported + to which objects will be exported to establish the new decomposition. */ int *export_to_part /* Array of partition numbers to which exported objects should be assigned. */ @@ -122,9 +85,9 @@ int Zoltan_Migrate( char *yo = "Zoltan_Migrate"; int num_gid_entries, num_lid_entries; /* lengths of global & local ids */ int *sizes = NULL; /* sizes (in bytes) of the object data for export. */ -int id_size; /* size (in bytes) of ZOLTAN_GID + padding for +int id_size; /* size (in bytes) of ZOLTAN_GID + padding for alignment */ -int tag_size; /* size (in bytes) of ZOLTAN_GID + one int +int tag_size; /* size (in bytes) of ZOLTAN_GID + one int (for message size) */ char *export_buf = NULL; /* buffer for packing export data. */ char *import_buf = NULL; /* buffer for receiving imported data. */ @@ -133,7 +96,7 @@ int i; /* loop counter. */ int tmp_size; /* size of a single object's data. */ int *idx = NULL; /* index used for multi-fn packs and unpacks. */ int idx_cnt = 0; /* index counter for idx array. */ -ZOLTAN_ID_PTR tmp_id = NULL; /* pointer to storage for a global ID in comm +ZOLTAN_ID_PTR tmp_id = NULL; /* pointer to storage for a global ID in comm buf */ ZOLTAN_ID_PTR lid; /* temporary pointer to a local ID; used to pass NULL to query functions when NUM_LID_ENTRIES=0. */ @@ -175,11 +138,11 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ * Check that all procs use the same id types. */ - ierr = check_input(zz, - ((num_export >= 0 && export_to_part) || + ierr = check_input(zz, + ((num_export >= 0 && export_to_part) || (num_import >= 0 && import_to_part)), &include_parts); - if (ierr != ZOLTAN_OK) + if (ierr != ZOLTAN_OK) goto End; num_gid_entries = zz->Num_GID; @@ -218,12 +181,12 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* Build the actual export arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_export, export_global_ids, export_local_ids, - export_procs, export_to_part, + num_export, export_global_ids, export_local_ids, + export_procs, export_to_part, &actual_num_exp, &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part, &actual_exp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; /* Compute communication map based on actual exports. */ @@ -241,14 +204,14 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* Build the actual import arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_import, import_global_ids, import_local_ids, - import_procs, import_to_part, + num_import, import_global_ids, import_local_ids, + import_procs, import_to_part, &actual_num_imp, &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part, &actual_imp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; - + /* Compute communication map based on imports. */ msgtag = 32767; ierr = Zoltan_Comm_Create(&imp_plan, actual_num_imp, actual_imp_procs, @@ -268,10 +231,10 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ actual_exp_to_part = (int *) ZOLTAN_MALLOC(sizeof(int)*actual_num_exp); if (actual_exp_gids == NULL || (num_lid_entries && actual_exp_lids == NULL) || - actual_exp_procs == NULL || + actual_exp_procs == NULL || (import_to_part != NULL && actual_exp_to_part == NULL)) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); ierr = ZOLTAN_MEMERR; goto End; @@ -300,7 +263,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ Zoltan_Comm_Info(imp_plan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, actual_exp_procs, NULL); - + if (include_parts) { msgtag2--; ierr = Zoltan_Comm_Do(imp_plan, msgtag2, (char *) actual_imp_to_part, @@ -310,10 +273,10 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ goto End; } } - - /* Create inverse plan (i.e., plan based on exports) so can set - * variable sizes. - * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable + + /* Create inverse plan (i.e., plan based on exports) so can set + * variable sizes. + * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable * but does not tell how large to allocate receive buffer. */ ierr = Zoltan_Comm_Invert_Plan(&imp_plan); @@ -345,7 +308,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ zz->Migrate.Pre_Migrate(zz->Migrate.Pre_Migrate_Data, num_gid_entries, num_lid_entries, num_import, import_global_ids, - import_local_ids, import_procs, + import_local_ids, import_procs, num_export, export_global_ids, export_local_ids, export_procs, &ierr); @@ -359,17 +322,17 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ ZOLTAN_TRACE_DETAIL(zz, yo, "Done pre-migration processing"); id_size = Zoltan_Align(num_gid_entries * sizeof(ZOLTAN_ID_TYPE)); - /* Note that alignment is not strictly necessary + /* Note that alignment is not strictly necessary when ZOLTAN_ID_TYPE is int or unsigned int. */ aligned_int = Zoltan_Align(sizeof(int)); tag_size = id_size + aligned_int; /* - * For each object, allow space for its global ID and its data plus + * For each object, allow space for its global ID and its data plus * one int (for the object data size). * Zoltan will pack the global IDs; the application must pack the data * through the pack routine. Zoltan needs the global IDs for unpacking, - * as the order of the data received during communication is not + * as the order of the data received during communication is not * necessarily the same order as import_global_ids[]. * Zoltan also needs to communicate the sizes of the objects because * only the sender knows the size of each object. @@ -383,7 +346,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ } if (zz->Get_Obj_Size_Multi != NULL) { - zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, + zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, num_gid_entries, num_lid_entries, actual_num_exp, actual_exp_gids, actual_exp_lids, sizes, &ierr); if (ierr < 0) { @@ -395,9 +358,9 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ else { for (i = 0; i < actual_num_exp; i++){ lid = (num_lid_entries ? &(actual_exp_lids[i*num_lid_entries]) : NULL); - sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, + sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, num_gid_entries, num_lid_entries, - &(actual_exp_gids[i*num_gid_entries]), + &(actual_exp_gids[i*num_gid_entries]), lid, &ierr); if (ierr < 0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from " @@ -433,7 +396,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* * Pack the objects for export. */ - + idx_cnt = 0; tmp = export_buf; for (i = 0; i < actual_num_exp; i++) { @@ -442,7 +405,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ tmp_id = (ZOLTAN_ID_PTR) tmp; ZOLTAN_SET_GID(zz, tmp_id, &(actual_exp_gids[i*num_gid_entries])); tmp += id_size; - + /* Pack the object's size */ *((int *)tmp) = sizes[i]; tmp += aligned_int; @@ -458,13 +421,13 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ if (zz->Pack_Obj_Multi != NULL) { if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", + printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", zz->Proc, yo); } zz->Pack_Obj_Multi(zz->Pack_Obj_Multi_Data, num_gid_entries, num_lid_entries, actual_num_exp, - actual_exp_gids, actual_exp_lids, - (actual_exp_to_part!=NULL ? actual_exp_to_part + actual_exp_gids, actual_exp_lids, + (actual_exp_to_part!=NULL ? actual_exp_to_part : actual_exp_procs), sizes, idx, export_buf, &ierr); if (ierr < 0) { @@ -479,14 +442,14 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ printf("[%1d] DEBUG in %s: Packing object with gid ", zz->Proc, yo); ZOLTAN_PRINT_GID(zz, &(actual_exp_gids[i*num_gid_entries])); - printf("size = %d bytes\n", sizes[i]); + printf("size = %d bytes\n", sizes[i]); } /* Pack the object's data */ lid = (num_lid_entries ? &(actual_exp_lids[i*num_lid_entries]) : NULL); - dest = (actual_exp_to_part != NULL ? actual_exp_to_part[i] + dest = (actual_exp_to_part != NULL ? actual_exp_to_part[i] : actual_exp_procs[i]); - zz->Pack_Obj(zz->Pack_Obj_Data, + zz->Pack_Obj(zz->Pack_Obj_Data, num_gid_entries, num_lid_entries, &(actual_exp_gids[i*num_gid_entries]), lid, dest, sizes[i], tmp, &ierr); @@ -547,7 +510,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ ZOLTAN_TRACE_DETAIL(zz, yo, "Done communication"); - /* + /* * Perform application-specified processing before unpacking the data. */ if (zz->Migrate.Mid_Migrate_PP != NULL) { @@ -647,7 +610,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ } /* Unpack the object's data */ - + zz->Unpack_Obj(zz->Unpack_Obj_Data, num_gid_entries, (ZOLTAN_ID_PTR) tmp, tmp_size, tmp + tag_size, &ierr); @@ -697,13 +660,13 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ End: if (actual_exp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); } if (actual_imp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_imp_gids, &actual_imp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part); } @@ -726,8 +689,8 @@ static int check_input( int *include_parts ) { -/* - * Routine to ensure that all processors have the same values of +/* + * Routine to ensure that all processors have the same values of * zz->Num_GID and zz->Num_LID. * Also, check whether partitions are included on any processors; if so, * set include_parts to true. @@ -746,9 +709,9 @@ int ierr = ZOLTAN_OK; loc_tmp[4] = -(zz->Num_LID); loc_tmp[5] = -(parts); - /* - * Check both max and min values of IDs so that all processors can - * return the same error code. + /* + * Check both max and min values of IDs so that all processors can + * return the same error code. */ MPI_Allreduce(loc_tmp, glob, 6, @@ -809,9 +772,9 @@ int ierr; goto End; } - if (zz->Migrate.Pre_Migrate_PP || zz->Migrate.Mid_Migrate_PP || + if (zz->Migrate.Pre_Migrate_PP || zz->Migrate.Mid_Migrate_PP || zz->Migrate.Post_Migrate_PP) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Partition information not available in Zoltan_Help_Migrate for " "ZOLTAN_*_MIGRATE_PP_FNs; use ZOLTAN_*_MIGRATE_FNs instead."); ierr = ZOLTAN_FATAL; @@ -835,7 +798,7 @@ int ierr; /****************************************************************************/ static int actual_arrays( ZZ *zz, - int num_gid_entries, + int num_gid_entries, int num_lid_entries, int num, ZOLTAN_ID_PTR gids, @@ -847,7 +810,7 @@ static int actual_arrays( ZOLTAN_ID_PTR *actual_lids, int **actual_procs, int **actual_to_part, - int *actual_allocated + int *actual_allocated ) { char *yo = "actual_arrays"; @@ -855,7 +818,7 @@ int i, j; /* * Test whether to pack objects that have changed partition - * but not changed processor. + * but not changed processor. * If packing them, the actual objects == objects passed to this function. * If not packing them, build arrays with them stripped out. */ @@ -872,7 +835,7 @@ int i, j; else { /* zz->Migrate.Only_Proc_Changes */ /* Pack only objects that are actually changing processor. */ *actual_num = 0; - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) if (procs[i] != zz->Proc) (*actual_num)++; @@ -894,22 +857,22 @@ int i, j; if (to_part != NULL) *actual_to_part = (int *) ZOLTAN_MALLOC(sizeof(int)*(*actual_num)); if (*actual_gids == NULL || (num_lid_entries && *actual_lids == NULL) || - *actual_procs == NULL || + *actual_procs == NULL || (to_part != NULL && *actual_to_part == NULL)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory Error."); - Zoltan_Multifree(__FILE__, __LINE__, 4, - actual_gids, actual_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + actual_gids, actual_lids, actual_procs, actual_to_part); return (ZOLTAN_MEMERR); } - + for (j = 0, i = 0; i < num; i++) { if (procs[i] != zz->Proc) { - ZOLTAN_SET_GID(zz, + ZOLTAN_SET_GID(zz, *actual_gids + j*num_gid_entries, gids + i*num_gid_entries); if (num_lid_entries) - ZOLTAN_SET_LID(zz, + ZOLTAN_SET_LID(zz, *actual_lids + j*num_lid_entries, lids + i*num_lid_entries); (*actual_procs)[j] = procs[i]; @@ -926,3 +889,4 @@ int i, j; #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/lb/lb_part2proc.c b/packages/zoltan/src/lb/lb_part2proc.c index 0abc4349d5..80f1cdbfd9 100644 --- a/packages/zoltan/src/lb/lb_part2proc.c +++ b/packages/zoltan/src/lb/lb_part2proc.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -69,14 +32,14 @@ int Zoltan_LB_Part_To_Proc(ZZ *zz, int part, ZOLTAN_ID_PTR gid) * If a part is entirely within a processor, that processor's rank is * returned. * If a part is spread across several processors, find the range of its - * processors. + * processors. * If a gid is not given (gid == NULL) return the lowest-numbered processor * in the range. (RCB and RIB depend upon this feature.) - * If a gid is given and zz->Proc is in the range, return zz->Proc. - * If a gid is given and zz->Proc is not in the range, + * If a gid is given and zz->Proc is in the range, return zz->Proc. + * If a gid is given and zz->Proc is not in the range, * hash the input gid to a processor within the range of processors. - * NOTE: The special case of returning zz->Proc when it is within range - * reduces data movement, but can result in different processor assignments + * NOTE: The special case of returning zz->Proc when it is within range + * reduces data movement, but can result in different processor assignments * for the same gid on different processors. * If all processors must map a gid to the same processor, this special * case must be removed. @@ -92,12 +55,12 @@ char msg[256]; ZOLTAN_TRACE_ENTER(zz, yo); if (zz->LB.PartDist == NULL) { - /* number of parts == number of procs, uniformly distributed. + /* number of parts == number of procs, uniformly distributed. * return input part. */ proc = part; } else if (part >= 0 && part < zz->LB.Num_Global_Parts) { - /* number of parts != number of procs or + /* number of parts != number of procs or * non-uniform distribution of parts */ num_procs_for_part = pdist[part+1] - pdist[part]; if (zz->LB.Single_Proc_Per_Part || num_procs_for_part <= 1) @@ -110,7 +73,7 @@ char msg[256]; /* Map the gid to a processor within range for the part. * Use Zoltan_Hash to attempt to evenly distribute the gids to * processors holding the part. */ - if (gid != NULL) + if (gid != NULL) hash_value = Zoltan_Hash(gid, zz->Num_GID, num_procs_for_part); else { hash_value = 0; @@ -134,7 +97,7 @@ char msg[256]; /*****************************************************************************/ int Zoltan_LB_Proc_To_Part( - ZZ *zz, + ZZ *zz, int proc, /* Input: processor number */ int *nparts, /* Output: Number of parts on processor proc (>= 0) */ int *fpart /* Output: Part number of first part on proc. */ @@ -149,7 +112,7 @@ int *partdist = zz->LB.PartDist; int *procdist; int ierr = ZOLTAN_OK; int tmp; - + if (proc < 0 || proc >= zz->Num_Proc) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Input proc is out of range."); ierr = ZOLTAN_FATAL; @@ -198,7 +161,7 @@ static int Zoltan_LB_Build_ProcDist( { /* Routine that computes the inverse of array LB.PartDist. * Builds array LB.ProcDist that maps processors to parts. - * Entry i of LB.ProcDist is the lowest part number on processor i. + * Entry i of LB.ProcDist is the lowest part number on processor i. * If processor i has no parts, ProcDist[i] = -1. */ char *yo = "Zoltan_LB_Build_ProcDist"; @@ -206,9 +169,9 @@ int ierr = ZOLTAN_OK; int *partdist = zz->LB.PartDist; int *procdist; int i, j; - + if (partdist != NULL) { - procdist = zz->LB.ProcDist + procdist = zz->LB.ProcDist = (int *) ZOLTAN_MALLOC((zz->Num_Proc+1) * sizeof(int)); if (procdist == NULL) { ierr = ZOLTAN_MEMERR; diff --git a/packages/zoltan/src/lb/lb_point_assign.c b/packages/zoltan/src/lb/lb_point_assign.c index 67341b7857..059e60f4ed 100644 --- a/packages/zoltan/src/lb/lb_point_assign.c +++ b/packages/zoltan/src/lb/lb_point_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -64,13 +27,13 @@ int Zoltan_LB_Point_Assign ( char *yo = "Zoltan_LB_Point_Assign"; if (zz->LB.Point_Assign == NULL) { /* function not supported by current decomposition method */ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Point_Assign not supported by chosen partitioning method."); - return ZOLTAN_FATAL; + return ZOLTAN_FATAL; } if (zz->LB.PartDist != NULL) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Non-uniform distribution of partitions over processors is specified; " "use Zoltan_LB_Point_PP_Assign."); return ZOLTAN_FATAL; @@ -78,7 +41,7 @@ int Zoltan_LB_Point_Assign ( /* call appropriate method; pass proc in partition argument for greater * efficiency within LB.Point_Assign (Zoltan is partition-based). */ - return zz->LB.Point_Assign(zz, x, NULL, proc); + return zz->LB.Point_Assign(zz, x, NULL, proc); } /****************************************************************************/ @@ -92,9 +55,9 @@ int Zoltan_LB_Point_PP_Assign ( char *yo = "Zoltan_LB_Point_PP_Assign"; if (zz->LB.Point_Assign == NULL) { /* function not supported by current decomposition method */ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Point_Assign not supported by chosen partitioning method."); - return ZOLTAN_FATAL ; + return ZOLTAN_FATAL ; } return zz->LB.Point_Assign(zz, x, proc, part); /* call appropriate method */ diff --git a/packages/zoltan/src/lb/lb_remap.c b/packages/zoltan/src/lb/lb_remap.c index ccb5397eb4..5cc5fd79cc 100644 --- a/packages/zoltan/src/lb/lb_remap.c +++ b/packages/zoltan/src/lb/lb_remap.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -82,12 +45,12 @@ int Zoltan_LB_Remap( int *new_map, /* Upon return, flag indicating whether part or proc assignments actually changed due to remapping. */ int nobj, /* # objs the processor knows about after partitioning */ - int *proc, /* processors for the objs; - if export_list_flag == 1, + int *proc, /* processors for the objs; + if export_list_flag == 1, proc contains new proc assignment else proc contains old proc assignment - Upon return, proc contains remapped new proc + Upon return, proc contains remapped new proc assignment regardless of export_list_flag's value. */ int *old_part, /* old part assignments for the objs */ int *new_part, /* new part assignments for the objs. @@ -95,17 +58,17 @@ int Zoltan_LB_Remap( part assignments */ int export_list_flag /* Flag indicating whether the algorithm computes export lists or import lists. The HG for matching - is built differently depending on whether + is built differently depending on whether the algorithm knows export or import info. */ ) { char *yo = "Zoltan_LB_Remap"; int ierr = ZOLTAN_OK; int i; -int remap_type; /* Type of remapping to be done: +int remap_type; /* Type of remapping to be done: Procs, Parts, or None */ int HEcnt = 0; /* Number of local hyperedges */ -int *HEinfo = NULL; /* Array of HE info; for each HE, two pins and +int *HEinfo = NULL; /* Array of HE info; for each HE, two pins and one edge weight. Stored as a single vector to minimize communication calls. */ @@ -116,11 +79,11 @@ int *HEinfo = NULL; /* Array of HE info; for each HE, two pins and if (remap_type != ZOLTAN_LB_REMAP_NONE) { /* Build local hyperedges */ - if (export_list_flag) + if (export_list_flag) ierr = local_HEs_from_export_lists(zz, remap_type, nobj, proc, old_part, new_part, &HEcnt, &HEinfo); - else + else ierr = local_HEs_from_import_lists(zz, remap_type, nobj, proc, old_part, new_part, &HEcnt, &HEinfo); @@ -137,7 +100,7 @@ int *HEinfo = NULL; /* Array of HE info; for each HE, two pins and "Error returned from gather_and_build_remap."); goto End; } - + if (*new_map) { /* Update part and processor information for algorithms */ for (i = 0; i < nobj; i++) { @@ -158,14 +121,14 @@ static int local_HEs_from_import_lists( ZZ *zz, int remap_type, /* type of remapping to do: parts, procs, or none. */ int nobj, /* # objs the processor knows about (keep + imports) */ - int *proc, /* On input, old processor assignment for each obj; + int *proc, /* On input, old processor assignment for each obj; Upon return, remapped new proc assignment for each obj. */ int *old_part, /* old part assignments for each objs */ int *new_part, /* On input, new part assignments for each objs. Upon return, remapped new part assignments */ int *HEcnt, /* # of HEs allocated. */ - int **HEinfo /* Array of HE info; for each HE, two pins and + int **HEinfo /* Array of HE info; for each HE, two pins and one edge weight. Stored as a single vector to minimize communication calls. */ ) @@ -182,7 +145,7 @@ int i, cnt, tmp; int *tmp_HEinfo; int old_size; /* # of old entries to remap to. If remapping parts to processors, old_size = Num_Procs; - if renumbering parts, old_size = old + if renumbering parts, old_size = old num parts. */ int fp; /* First part on this processor in new decomposition. */ @@ -210,15 +173,15 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes goto End; } - for (i = 0; i < nobj; i++) + for (i = 0; i < nobj; i++) HEwgt[proc[i]]++; /* At this point, proc has old proc assignments */ *HEcnt = 0; for (i = 0; i < HEwgt_size; i++) if (HEwgt[i] != 0) (*HEcnt)++; - + ierr = malloc_HEinfo(zz, *HEcnt, HEinfo); - if (ierr < 0) + if (ierr < 0) goto End; tmp_HEinfo = *HEinfo; @@ -243,16 +206,16 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes if (old_part[i] > maxp) maxp = old_part[i]; } - /* Don't include old part numbers that are greater than - * zz->LB.Num_Global_Parts - 1; they are not valid values for - * remapping of new part numbers. + /* Don't include old part numbers that are greater than + * zz->LB.Num_Global_Parts - 1; they are not valid values for + * remapping of new part numbers. */ if (minp >= zz->LB.Num_Global_Parts) minp = zz->LB.Num_Global_Parts-1; if (maxp >= zz->LB.Num_Global_Parts) maxp = zz->LB.Num_Global_Parts-1; - old_size = maxp - minp + 1; + old_size = maxp - minp + 1; Zoltan_LB_Proc_To_Part(zz, my_proc, &np, &fp); HEwgt_size = np * old_size; @@ -266,8 +229,8 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes } for (i = 0; i < nobj; i++) { - if (old_part[i] < zz->LB.Num_Global_Parts) { - /* Include only HEs to old parts numbered + if (old_part[i] < zz->LB.Num_Global_Parts) { + /* Include only HEs to old parts numbered * 0 to zz->LB.Num_Global_Parts-1; these are the only valid * remapping values for the new part numbers. */ @@ -279,9 +242,9 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes *HEcnt = 0; for (i = 0; i < HEwgt_size; i++) if (HEwgt[i] != 0) (*HEcnt)++; - + ierr = malloc_HEinfo(zz, *HEcnt, HEinfo); - if (ierr < 0) + if (ierr < 0) goto End; tmp_HEinfo = *HEinfo; @@ -298,28 +261,28 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes } End: - + if (HEwgt) ZOLTAN_FREE(&HEwgt); return ierr; -} +} /******************************************************************************/ static int local_HEs_from_export_lists( ZZ *zz, int remap_type, /* type of remapping to do: parts, procs, or none. */ int nobj, /* # objs the processor knows about (keep + exports) */ - int *new_proc, /* On input, new processor assignment for each obj; + int *new_proc, /* On input, new processor assignment for each obj; Upon return, remapped new proc assignment for each obj. */ int *old_part, /* old part assignments for each objs */ int *new_part, /* On input, new part assignments for each objs. Upon return, remapped new part assignments */ int *HEcnt, /* # of HEs allocated. */ - int **HEinfo /* Array of HE info; for each HE, two pins and + int **HEinfo /* Array of HE info; for each HE, two pins and one edge weight. Stored as a single vector to minimize communication calls. */ -) +) { /* Routine to remap parts (to new processors or new part numbers) * to reduce data movement. @@ -348,7 +311,7 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes * export objects -- it is my_proc! * We also know the new processor number for all objects initially on * my_proc (since we built export lists.) - * This case is a special case of part remapping; it is easy to + * This case is a special case of part remapping; it is easy to * build the hyperedges in this special case. */ @@ -360,15 +323,15 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes goto End; } - for (i = 0; i < nobj; i++) + for (i = 0; i < nobj; i++) HEwgt[new_proc[i]]++; *HEcnt = 0; for (i = 0; i < HEwgt_size; i++) if (HEwgt[i] != 0) (*HEcnt)++; - + ierr = malloc_HEinfo(zz, *HEcnt, HEinfo); - if (ierr < 0) + if (ierr < 0) goto End; tmp_HEinfo = *HEinfo; @@ -386,8 +349,8 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes else { /* ZOLTAN_LB_REMAP_PARTS */ /* Cannot renumber parts given export lists without summing HE weights - * across processors. This summation is not straightforward. Also, a - * potentially large number of HEs may exist + * across processors. This summation is not straightforward. Also, a + * potentially large number of HEs may exist * (max_old_part_number * zz->Num_Global_Parts). Rather than build * this large matrix, just compute import lists from the export lists * and run the import-list algorithm. @@ -409,7 +372,7 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes } } - ierr = Zoltan_Comm_Info(plan, NULL, NULL, NULL, NULL, NULL, NULL, + ierr = Zoltan_Comm_Info(plan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, imp_proc, NULL); msg_tag++; @@ -437,7 +400,7 @@ int *HEwgt = NULL; /* Array of HE weights. Initially includes /******************************************************************************/ static int set_remap_type( - ZZ *zz, + ZZ *zz, int *remap_type ) { @@ -483,7 +446,7 @@ static int do_match( /* Temporary function; will be replace by a real matching function later. */ int ierr = ZOLTAN_OK; int i; - + /* Default initialization -- no change in mapping */ for (i = 0; i < hg->nVtx; i++) match[i] = i; @@ -497,7 +460,7 @@ int i; static int malloc_HEinfo( ZZ *zz, int HEcnt, /* Number of HEs to allocate */ - int **HEinfo /* Array of HE info; for each HE, two pins and + int **HEinfo /* Array of HE info; for each HE, two pins and one edge weight. Stored as a single vector to minimize communication calls. */ ) @@ -513,7 +476,7 @@ int ierr = ZOLTAN_OK; ierr = ZOLTAN_MEMERR; } } - else + else *HEinfo = NULL; return ierr; @@ -521,11 +484,11 @@ int ierr = ZOLTAN_OK; /******************************************************************************/ static int gather_and_build_remap( - ZZ *zz, + ZZ *zz, int *new_map, /* Upon return, flag indicating whether parts assignments were changed due to remap. */ int HEcnt, /* # of HEs allocated. */ - int *HEinfo /* Array of HE info; for each HE, two pins and + int *HEinfo /* Array of HE info; for each HE, two pins and one edge weight. Stored as a single vector to minimize communication calls. */ ) @@ -540,15 +503,15 @@ int send_size; /* Local # HEs * HEINFO_ENTRIES */ int total_size; /* Total # ints in gatherv */ int total_HEcnt; /* Total (across all procs) number of HEs. */ int max0, max1; /* Max values of pin 0 and pin 1 for each HE. */ -int *match = NULL; /* Vector describing the matching. - match[i] = j ==> match[j] = i ==> +int *match = NULL; /* Vector describing the matching. + match[i] = j ==> match[j] = i ==> vertices i and j are matched. */ int *used = NULL; /* Vector indicating which parts are used in the matching. */ int limit; /* Maximum number of matches that are allowed */ HGraph hg; /* Hypergraph for matching */ float before_remap = 0, /* Amount of data that overlaps between old and */ - after_remap = 0; /* new decomposition before and after remapping, + after_remap = 0; /* new decomposition before and after remapping, respectively. */ float with_oldremap = 0; /* Amount of data that overlaps between old and new decomposition using the OldRemap vector @@ -583,7 +546,7 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and for (i = 1; i < zz->Num_Proc; i++) displs[i] = displs[i-1] + each_size[i-1]; - MPI_Allgatherv(HEinfo, send_size, MPI_INT, + MPI_Allgatherv(HEinfo, send_size, MPI_INT, recvbuf, each_size, displs, MPI_INT, zz->Communicator); total_HEcnt = total_size / HEINFO_ENTRIES; @@ -596,21 +559,21 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and pin values for pin0 and pin1 respectively; i.e., allow pin value == 0. */ max0++; max1++; - + /* Sanity check */ /* Ideally, max1 should equal LB.Num_Global_Parts, but ParMETIS3 sometimes * does not return the correct number of non-empty parts, allowing - * max1 to be less than LB.Num_Global_Parts. + * max1 to be less than LB.Num_Global_Parts. * (e.g., ewgt.adaptive-partlocal1-v3.4.?). */ - if (max1 > zz->LB.Num_Global_Parts) + if (max1 > zz->LB.Num_Global_Parts) ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unexpected value for max1."); /* Set up global HG */ Zoltan_HG_HGraph_Init(&hg); if (total_HEcnt) { - hg.nVtx = max0 + zz->LB.Num_Global_Parts; + hg.nVtx = max0 + zz->LB.Num_Global_Parts; hg.nEdge = total_HEcnt; hg.nPins = total_HEcnt * 2; /* two pins per HE */ hg.EdgeWeightDim = 1; @@ -625,7 +588,7 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and for (i = 0; i < total_HEcnt; i++) { tmp = i * HEINFO_ENTRIES; - hg.hindex[i] = i+i; + hg.hindex[i] = i+i; hg.hvertex[i+i] = recvbuf[tmp]; hg.hvertex[i+i+1] = (int)recvbuf[tmp+1]+max0; hg.ewgt[i] = recvbuf[tmp+2]; @@ -653,14 +616,14 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and } /* Max # matches allowed */ - limit = (max0 < zz->LB.Num_Global_Parts ? max0 : zz->LB.Num_Global_Parts); + limit = (max0 < zz->LB.Num_Global_Parts ? max0 : zz->LB.Num_Global_Parts); do_match(zz, &hg, match, limit); - + /* Build remapping vector, if non-trivial matching was returned. */ *new_map = 0; - for (i = 0; i < zz->LB.Num_Global_Parts; i++) + for (i = 0; i < zz->LB.Num_Global_Parts; i++) if (match[i+max0] != i+max0) { *new_map = 1; break; @@ -679,7 +642,7 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and /* First, process all parts that were matched. Mark matched parts as used.*/ for (i = 0; i < zz->LB.Num_Global_Parts; i++) { - zz->LB.Remap[i] = -1; + zz->LB.Remap[i] = -1; tmp = match[i+max0]; if (tmp != i+max0) { zz->LB.Remap[i] = tmp; @@ -697,10 +660,10 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and used[i] = 1; } } - - /* Third, process remaining unmatched parts; assign them to + + /* Third, process remaining unmatched parts; assign them to unused parts.*/ - + for (uidx = 0, i = 0; i < zz->LB.Num_Global_Parts; i++) { if (zz->LB.Remap[i] > -1) continue; /* Already processed part i */ /* match[i+max0] == i+max0 */ @@ -710,7 +673,7 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and } } - if (*new_map) + if (*new_map) after_remap = measure_stays(zz, &hg, max0, zz->LB.Remap, "AFTER "); if ((before_remap >= after_remap) && (before_remap >= with_oldremap)) { @@ -732,8 +695,8 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and } if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL && zz->Proc == zz->Debug_Proc && - zz->LB.Remap) - for (i = 0; i < zz->LB.Num_Global_Parts; i++) + zz->LB.Remap) + for (i = 0; i < zz->LB.Num_Global_Parts; i++) printf("%d REMAP Part %d to Part %d\n", zz->Proc, i, zz->LB.Remap[i]); End: @@ -747,14 +710,14 @@ float with_oldremap = 0; /* Amount of data that overlaps between old and /******************************************************************************/ static float measure_stays( ZZ *zz, - HGraph *hg, + HGraph *hg, int max0, int *remapvec, char *when ) { /* Routine that measures and prints the amount of data that doesn't move - * as described by the hypergraph. + * as described by the hypergraph. */ float stay = 0.; @@ -763,7 +726,7 @@ int tmp, i; for (i = 0; i < hg->nEdge; i++) { tmp = i + i; if (remapvec) { - if (hg->hvertex[tmp] == (int)remapvec[hg->hvertex[tmp+1]-max0]) + if (hg->hvertex[tmp] == (int)remapvec[hg->hvertex[tmp+1]-max0]) stay += hg->ewgt[i]; } else { @@ -819,7 +782,7 @@ char *yo = "matching_pgm"; weight *= hg->ewgt[edge]; for (k = hg->hindex[edge]; k < hg->hindex[edge+1]; k++) { neighbor = hg->hvertex[k]; - if (neighbor != vertex && Match[0][neighbor] == neighbor && + if (neighbor != vertex && Match[0][neighbor] == neighbor && Match[1][neighbor]==neighbor) sims[neighbor] += weight; } diff --git a/packages/zoltan/src/lb/lb_set_fn.c b/packages/zoltan/src/lb/lb_set_fn.c index 4b7c21879c..1947e702fb 100644 --- a/packages/zoltan/src/lb/lb_set_fn.c +++ b/packages/zoltan/src/lb/lb_set_fn.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/lb/lb_set_method.c b/packages/zoltan/src/lb/lb_set_method.c index 58547ec0a9..c66ee87db5 100644 --- a/packages/zoltan/src/lb/lb_set_method.c +++ b/packages/zoltan/src/lb/lb_set_method.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -98,7 +61,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) error = Zoltan_Clean_String(method_name, &method_upper); if (error) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_Clean_String; No method set."); goto End; } @@ -109,7 +72,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_Block; zz->LB.Free_Structure = NULL; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; } @@ -118,7 +81,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_Cyclic; zz->LB.Free_Structure = NULL; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; } @@ -127,7 +90,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_Random; zz->LB.Free_Structure = NULL; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; } @@ -143,7 +106,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.Box_Assign = Zoltan_RB_Box_Assign; } else if (strcmp(method_upper, "OCTPART") == 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "OCTPART method is no longer supported in Zoltan; " "Try LB_METHOD=HSFC for similar results."); error = ZOLTAN_FATAL; @@ -155,11 +118,11 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) /* Next two are useful only when using PHG */ zz->LB.Free_Structure = Zoltan_PHG_Free_Structure; zz->LB.Copy_Structure = Zoltan_PHG_Copy_Structure; - zz->LB.Serialize_Structure_Size = + zz->LB.Serialize_Structure_Size = Zoltan_Serialize_Structure_Size_Not_Implemented; /* TODO */ - zz->LB.Serialize_Structure = + zz->LB.Serialize_Structure = Zoltan_Serialize_Structure_Not_Implemented; /* TODO */ - zz->LB.Deserialize_Structure = + zz->LB.Deserialize_Structure = Zoltan_Deserialize_Structure_Not_Implemented; /* TODO */ zz->LB.Point_Assign = NULL; zz->LB.Box_Assign = NULL; @@ -174,13 +137,13 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_ParMetis; zz->LB.Free_Structure = NULL; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; zz->LB.Point_Assign = NULL; zz->LB.Box_Assign = NULL; #else - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "ParMETIS method selected but " "ParMETIS not compiled into Zoltan."); error = ZOLTAN_FATAL; @@ -192,7 +155,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_Reftree_Part; zz->LB.Free_Structure = Zoltan_Reftree_Free_Structure; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; zz->LB.Point_Assign = NULL; @@ -203,11 +166,11 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_RIB; zz->LB.Free_Structure = Zoltan_RIB_Free_Structure; zz->LB.Copy_Structure = Zoltan_RIB_Copy_Structure; - zz->LB.Serialize_Structure_Size = + zz->LB.Serialize_Structure_Size = Zoltan_Serialize_Structure_Size_Not_Implemented; /* TODO */ - zz->LB.Serialize_Structure = + zz->LB.Serialize_Structure = Zoltan_Serialize_Structure_Not_Implemented; /* TODO */ - zz->LB.Deserialize_Structure = + zz->LB.Deserialize_Structure = Zoltan_Deserialize_Structure_Not_Implemented; /* TODO */ zz->LB.Point_Assign = Zoltan_RB_Point_Assign; zz->LB.Box_Assign = Zoltan_RB_Box_Assign; @@ -217,16 +180,16 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_HSFC; zz->LB.Free_Structure = Zoltan_HSFC_Free_Structure; zz->LB.Copy_Structure = Zoltan_HSFC_Copy_Structure; - zz->LB.Serialize_Structure_Size = + zz->LB.Serialize_Structure_Size = Zoltan_Serialize_Structure_Size_Not_Implemented; /* TODO */ - zz->LB.Serialize_Structure = + zz->LB.Serialize_Structure = Zoltan_Serialize_Structure_Not_Implemented; /* TODO */ - zz->LB.Deserialize_Structure = + zz->LB.Deserialize_Structure = Zoltan_Deserialize_Structure_Not_Implemented; /* TODO */ zz->LB.Point_Assign = Zoltan_HSFC_Point_Assign; zz->LB.Box_Assign = Zoltan_HSFC_Box_Assign; } - else if ((strcmp(method_upper, "HYPERGRAPH") == 0) + else if ((strcmp(method_upper, "HYPERGRAPH") == 0) || (strcmp(method_upper, "PHG") == 0)){ /* HYPERGRAPH is a family of methods. */ @@ -235,11 +198,11 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_PHG; zz->LB.Free_Structure = Zoltan_PHG_Free_Structure; zz->LB.Copy_Structure = Zoltan_PHG_Copy_Structure; - zz->LB.Serialize_Structure_Size = + zz->LB.Serialize_Structure_Size = Zoltan_Serialize_Structure_Size_Not_Implemented; /* TODO */ - zz->LB.Serialize_Structure = + zz->LB.Serialize_Structure = Zoltan_Serialize_Structure_Not_Implemented; /* TODO */ - zz->LB.Deserialize_Structure = + zz->LB.Deserialize_Structure = Zoltan_Deserialize_Structure_Not_Implemented; /* TODO */ zz->LB.Point_Assign = NULL; zz->LB.Box_Assign = NULL; @@ -249,11 +212,11 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = Zoltan_Hier; zz->LB.Free_Structure = Zoltan_Hier_Free_Structure; zz->LB.Copy_Structure = Zoltan_Hier_Copy_Structure; - zz->LB.Serialize_Structure_Size = + zz->LB.Serialize_Structure_Size = Zoltan_Serialize_Structure_Size_Not_Implemented; /* TODO */ - zz->LB.Serialize_Structure = + zz->LB.Serialize_Structure = Zoltan_Serialize_Structure_Not_Implemented; /* TODO */ - zz->LB.Deserialize_Structure = + zz->LB.Deserialize_Structure = Zoltan_Deserialize_Structure_Not_Implemented; /* TODO */ zz->LB.Point_Assign = NULL; zz->LB.Box_Assign = NULL; @@ -263,19 +226,19 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) zz->LB.LB_Fn = NULL; zz->LB.Free_Structure = NULL; zz->LB.Copy_Structure = NULL; - zz->LB.Serialize_Structure_Size = NULL; + zz->LB.Serialize_Structure_Size = NULL; zz->LB.Serialize_Structure = NULL; /* Nothing to serialize in this method */ zz->LB.Deserialize_Structure = NULL; zz->LB.Point_Assign = NULL; zz->LB.Box_Assign = NULL; } - + /* * SET OTHER METHODS HERE!! */ - else { + else { sprintf(msg, "Invalid LB method specified: %s\n", method_name); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); error = ZOLTAN_FATAL; @@ -283,7 +246,7 @@ int Zoltan_LB_Set_LB_Method(ZZ *zz, char *method_name) } if (zz->Proc == zz->Debug_Proc && zz->Debug_Level >= ZOLTAN_DEBUG_PARAMS) { - printf("ZOLTAN Load balancing method = %d (%s)\n", + printf("ZOLTAN Load balancing method = %d (%s)\n", zz->LB.Method, method_name); } diff --git a/packages/zoltan/src/lb/lb_set_part_sizes.c b/packages/zoltan/src/lb/lb_set_part_sizes.c index 8a67a3d5ba..6e2477e11e 100644 --- a/packages/zoltan/src/lb/lb_set_part_sizes.c +++ b/packages/zoltan/src/lb/lb_set_part_sizes.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -79,8 +42,8 @@ int Zoltan_LB_Set_Part_Sizes(ZZ *zz, int global_num, * len -- Length of arrays wgt_idx, part_idx, part_sizes * part_ids -- Array of part ids (local or global) * wgt_idx -- Array of indices between 0 and Obj_Wgt_Dim-1 - * part_sizes -- Array of floats that gives the desired part - * size for each weight and each part, i.e., + * part_sizes -- Array of floats that gives the desired part + * size for each weight and each part, i.e., * part_sizes[i] corresponds to wgt_idx[i] and part_id[i] * * Output: @@ -116,7 +79,7 @@ int Zoltan_LB_Set_Part_Sizes(ZZ *zz, int global_num, } if (zz->LB.Part_Info_Len + len > zz->LB.Part_Info_Max_Len){ maxlen = 2*(zz->LB.Part_Info_Len + len); /* Double the length */ - zz->LB.Part_Info = (struct Zoltan_part_info *) ZOLTAN_REALLOC( zz->LB.Part_Info, + zz->LB.Part_Info = (struct Zoltan_part_info *) ZOLTAN_REALLOC( zz->LB.Part_Info, maxlen * sizeof(struct Zoltan_part_info)); } @@ -129,8 +92,8 @@ int Zoltan_LB_Set_Part_Sizes(ZZ *zz, int global_num, /* Add new data to part info array. */ for (i=0,j=zz->LB.Part_Info_Len; iLB.Part_Info[j].Size = part_sizes[i]; - zz->LB.Part_Info[j].Part_id = part_ids[i]; - zz->LB.Part_Info[j].Idx = (wgt_idx ? wgt_idx[i] : 0); + zz->LB.Part_Info[j].Part_id = part_ids[i]; + zz->LB.Part_Info[j].Idx = (wgt_idx ? wgt_idx[i] : 0); zz->LB.Part_Info[j].Global_num = global_num; } @@ -158,7 +121,7 @@ int Zoltan_LB_Get_Part_Sizes(ZZ *zz, int part_dim, float *part_sizes) * (This usually equals lb->Obj_Wgt_Dim.) * * Output: - * part_sizes -- Array of floats that gives the set part + * part_sizes -- Array of floats that gives the set part * sizes, scaled such that they sum to one. */ int i, j, nparts, fpart; @@ -185,7 +148,7 @@ int Zoltan_LB_Get_Part_Sizes(ZZ *zz, int part_dim, float *part_sizes) } /* Find max Part_Info_Len over all procs to see if they are all zero. */ - MPI_Allreduce((void*) &(zz->LB.Part_Info_Len), (void*) &j, + MPI_Allreduce((void*) &(zz->LB.Part_Info_Len), (void*) &j, 1, MPI_INT, MPI_MAX, zz->Communicator); if (j == 0){ @@ -230,17 +193,17 @@ int Zoltan_LB_Get_Part_Sizes(ZZ *zz, int part_dim, float *part_sizes) error = ZOLTAN_WARN; } else - temp_part_sizes[j*part_dim + zz->LB.Part_Info[i].Idx] + temp_part_sizes[j*part_dim + zz->LB.Part_Info[i].Idx] = zz->LB.Part_Info[i].Size; } } /* Reduce over all procs */ - MPI_Allreduce((void*) temp_part_sizes, (void*) part_sizes, + MPI_Allreduce((void*) temp_part_sizes, (void*) part_sizes, num_global_parts*part_dim, MPI_FLOAT, MPI_MAX, zz->Communicator); - + /* Check for errors. Scale the sizes so they sum to one for each weight. */ - for (j = 0; j < part_dim; j++) + for (j = 0; j < part_dim; j++) sum[j] = 0.0; for (i = 0; i < num_global_parts; i++){ @@ -251,7 +214,7 @@ int Zoltan_LB_Get_Part_Sizes(ZZ *zz, int part_dim, float *part_sizes) } if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] In %s: Part size %1d (before scaling) = ", + printf("[%1d] In %s: Part size %1d (before scaling) = ", zz->Proc, yo, i); for (j = 0; j < part_dim; j++) printf("%f, ", part_sizes[i*part_dim+j]); @@ -275,7 +238,7 @@ int Zoltan_LB_Get_Part_Sizes(ZZ *zz, int part_dim, float *part_sizes) part_sizes[i*part_dim+j] /= sum[j]; } - + End: if (temp_part_sizes) ZOLTAN_FREE(&temp_part_sizes); if (sum) ZOLTAN_FREE(&sum); diff --git a/packages/zoltan/src/lb/low_mem_lb_migrate.c b/packages/zoltan/src/lb/low_mem_lb_migrate.c index 3a20e23090..972d4375df 100644 --- a/packages/zoltan/src/lb/low_mem_lb_migrate.c +++ b/packages/zoltan/src/lb/low_mem_lb_migrate.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -59,13 +22,13 @@ extern "C" { /*****************************************************************************/ /* * This file contains routines implementing the migration-help tools. - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -static void printobj(int me, int nprocs, +static void printobj(int me, int nprocs, int num_import, unsigned int *import_global_ids, unsigned int *import_local_ids, int *import_procs, int *import_to_part, int num_export, unsigned int *export_global_ids, @@ -89,8 +52,8 @@ int i, j; fprintf(stderr,"\n"); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); } } @@ -158,15 +121,15 @@ static MPI_Request _request; int Zoltan_Low_Mem_Migrate( ZZ *zz, /* Zoltan structure. */ - int num_import, /* Number of non-local objects assigned to the + int num_import, /* Number of non-local objects assigned to the processor in the new decomposition. */ - ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects + ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects assigned to this processor in the new - decomposition; this field can be NULL if + decomposition; this field can be NULL if the application doesn't provide import IDs.*/ ZOLTAN_ID_PTR import_local_ids, /* Array of local IDs for non-local objects assigned to the processor in the new - decomposition; this field can be NULL if the + decomposition; this field can be NULL if the application does not provide import IDs. */ int *import_procs, /* Array of processor IDs of processors owning the non-local objects that are assigned to @@ -185,7 +148,7 @@ int Zoltan_Low_Mem_Migrate( objects to be exported to other processors to establish the new decomposition. */ int *export_procs, /* Array of processor IDs - to which objects will be exported + to which objects will be exported to establish the new decomposition. */ int *export_to_part /* Array of partition numbers to which exported objects should be assigned. */ @@ -218,9 +181,9 @@ int ierr = ZOLTAN_OK; int num_gid_entries, num_lid_entries; /* lengths of global & local ids */ int *sizes = NULL; /* sizes (in bytes) of the object data for export. */ -int id_size; /* size (in bytes) of ZOLTAN_GID + padding for +int id_size; /* size (in bytes) of ZOLTAN_GID + padding for alignment */ -int tag_size; /* size (in bytes) of ZOLTAN_GID + one int +int tag_size; /* size (in bytes) of ZOLTAN_GID + one int (for message size) */ int aligned_int; /* size of an int padded for alignment */ ZOLTAN_COMM_OBJ *imp_plan = NULL; /* Comm obj built from import lists. */ @@ -253,13 +216,13 @@ MPI_Request request; MPI_Status status; int need_import_lists = 0; int need_export_lists = 0; -ZOLTAN_ID_PTR mid_migrate_export_gids = NULL; +ZOLTAN_ID_PTR mid_migrate_export_gids = NULL; ZOLTAN_ID_PTR mid_migrate_export_lids = NULL; -int *mid_migrate_export_procs = NULL; +int *mid_migrate_export_procs = NULL; int *mid_migrate_export_parts = NULL; -ZOLTAN_ID_PTR mid_migrate_import_gids = NULL; +ZOLTAN_ID_PTR mid_migrate_import_gids = NULL; ZOLTAN_ID_PTR mid_migrate_import_lids = NULL; -int *mid_migrate_import_procs = NULL; +int *mid_migrate_import_procs = NULL; int *mid_migrate_import_parts = NULL; int inBytes, outBytes, inCount, outCount; char *inBuf=NULL, *outBuf=NULL, *tmp; @@ -282,11 +245,11 @@ intptr_t dummyVal; * Check that all procs use the same id types. */ - ierr = check_input(zz, - ((num_export >= 0 && export_to_part) || + ierr = check_input(zz, + ((num_export >= 0 && export_to_part) || (num_import >= 0 && import_to_part)), &include_parts); - if (ierr != ZOLTAN_OK) + if (ierr != ZOLTAN_OK) goto End; num_gid_entries = zz->Num_GID; @@ -330,12 +293,12 @@ intptr_t dummyVal; /* Build the actual export arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_export, export_global_ids, export_local_ids, - export_procs, export_to_part, + num_export, export_global_ids, export_local_ids, + export_procs, export_to_part, &actual_num_exp, &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part, &actual_exp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; } @@ -348,14 +311,14 @@ intptr_t dummyVal; /* Build the actual import arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_import, import_global_ids, import_local_ids, - import_procs, import_to_part, + num_import, import_global_ids, import_local_ids, + import_procs, import_to_part, &actual_num_imp, &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part, &actual_imp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; - + /* Compute communication map based on imports. */ msgtag = 32767; ierr = Zoltan_Comm_Create(&imp_plan, actual_num_imp, actual_imp_procs, @@ -375,10 +338,10 @@ intptr_t dummyVal; actual_exp_to_part = (int *) ZOLTAN_MALLOC(sizeof(int)*actual_num_exp); if (actual_exp_gids == NULL || (num_lid_entries && actual_exp_lids == NULL) || - actual_exp_procs == NULL || + actual_exp_procs == NULL || (import_to_part != NULL && actual_exp_to_part == NULL)) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); ierr = ZOLTAN_MEMERR; goto End; @@ -408,7 +371,7 @@ intptr_t dummyVal; Zoltan_Comm_Info(imp_plan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, actual_exp_procs, NULL); - + if (include_parts) { msgtag2--; ierr = Zoltan_Comm_Do(imp_plan, msgtag2, (char *) actual_imp_to_part, @@ -418,10 +381,10 @@ intptr_t dummyVal; goto End; } } - - /* Create inverse plan (i.e., plan based on exports) so can set - * variable sizes. - * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable + + /* Create inverse plan (i.e., plan based on exports) so can set + * variable sizes. + * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable * but does not tell how large to allocate receive buffer. */ ierr = Zoltan_Comm_Invert_Plan(&imp_plan); @@ -445,7 +408,7 @@ intptr_t dummyVal; if (destProcMap < 0){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unable to create first map."); - ierr = ZOLTAN_FATAL; + ierr = ZOLTAN_FATAL; goto End; } @@ -470,14 +433,14 @@ intptr_t dummyVal; printf("%s (%d) will send objects to %d processes\n", yo, zz->Proc, numDestProcs); } - /* Now create searchable map from process rank to number of GIDs + /* Now create searchable map from process rank to number of GIDs */ destProcMap = Zoltan_Map_Create(zz, nprocs, 1, sizeof(int), 1, 0); if (destProcMap < 0){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unable to create second map."); - ierr = ZOLTAN_FATAL; + ierr = ZOLTAN_FATAL; goto End; } @@ -495,7 +458,7 @@ intptr_t dummyVal; ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unable to search for proc in second map."); goto End; } - + if (dummyPtr != ZOLTAN_NOT_FOUND){ dummyPtr++; } @@ -526,7 +489,7 @@ intptr_t dummyVal; goto End; } if (zz->Debug_Level >= ZOLTAN_DEBUG_TRACE_DETAIL){ - printf("%s (%d) pre migrate complete num_import %d num_export %d\n", yo, zz->Proc, + printf("%s (%d) pre migrate complete num_import %d num_export %d\n", yo, zz->Proc, num_import, num_export); } } @@ -538,7 +501,7 @@ intptr_t dummyVal; /* * Bucket brigade - at each step, a process receives data from its * left and sends data to its right, from and to a different process - * each time. + * each time. */ start_offset = 1; @@ -553,14 +516,14 @@ intptr_t dummyVal; } if (*dummyPtr != ZOLTAN_NOT_FOUND) { - /* - * send myself objects that are going to a different partition on my process + /* + * send myself objects that are going to a different partition on my process */ start_offset = 0; } } - for (i=start_offset; i < nprocs; i++){ + for (i=start_offset; i < nprocs; i++){ right = (rank + i) % nprocs; left = (nprocs + rank - i) % nprocs; @@ -568,7 +531,7 @@ intptr_t dummyVal; inCount = outCount = 0; /* number of objects */ inBytes = outBytes = 0; /* number of bytes */ inBuf = outBuf = NULL; - mid_migrate_export_gids = mid_migrate_import_gids = NULL; + mid_migrate_export_gids = mid_migrate_import_gids = NULL; mid_migrate_export_lids = mid_migrate_import_lids = NULL; mid_migrate_export_procs = mid_migrate_import_procs = NULL; mid_migrate_export_parts = mid_migrate_import_parts = NULL; @@ -590,17 +553,17 @@ intptr_t dummyVal; outCount = dummyPtr; /* number of objects I send to "right" */ if (need_export_lists){ - ierr = pack_message_for_proc(zz, right, outCount, - num_export, export_global_ids, export_local_ids, + ierr = pack_message_for_proc(zz, right, outCount, + num_export, export_global_ids, export_local_ids, export_procs, export_to_part, tag_size, id_size, aligned_int, &outBuf, &outBytes, - &mid_migrate_export_gids, &mid_migrate_export_lids, + &mid_migrate_export_gids, &mid_migrate_export_lids, &mid_migrate_export_procs, &mid_migrate_export_parts); } else{ - ierr = pack_message_for_proc(zz, right, outCount, - num_export, export_global_ids, export_local_ids, + ierr = pack_message_for_proc(zz, right, outCount, + num_export, export_global_ids, export_local_ids, export_procs, export_to_part, tag_size, id_size, aligned_int, &outBuf, &outBytes, @@ -620,7 +583,7 @@ intptr_t dummyVal; if (inBytes > 0){ ierr = get_char_array(zz, inBytes, &_import_buf, &_import_buf_len); if (ierr != ZOLTAN_OK){ - goto End; + goto End; } inBuf = _import_buf; } @@ -633,10 +596,10 @@ intptr_t dummyVal; message_send(comm, right, outBuf, outBytes); /* ready send */ } else { - /* + /* * only happens if nprocs < 3, or if proc sends-to/receives-from self */ - if (rank < left){ + if (rank < left){ message_send(comm, right, outBuf, outBytes); message_receive(comm, left, inBuf, inBytes); } @@ -647,20 +610,20 @@ intptr_t dummyVal; } if (zz->Debug_Level >= ZOLTAN_DEBUG_TRACE_DETAIL){ - printf("%s (%d) send %d to %d, got %d from %d\n", yo, zz->Proc, + printf("%s (%d) send %d to %d, got %d from %d\n", yo, zz->Proc, outBytes, right, inBytes, left); } - /* - * We have posted the receive from the left. We don't need the objects from - * the left in order to create the import lists. So we do this computation + /* + * We have posted the receive from the left. We don't need the objects from + * the left in order to create the import lists. So we do this computation * before waiting for the objects. */ if (need_import_lists){ ierr = create_import_lists(zz, inBytes, left, num_import, import_global_ids, import_local_ids, import_procs, import_to_part, &inCount, - &mid_migrate_import_gids, &mid_migrate_import_lids, + &mid_migrate_import_gids, &mid_migrate_import_lids, (import_procs ? &mid_migrate_import_procs : NULL), (import_to_part ? &mid_migrate_import_parts : NULL)); @@ -678,17 +641,17 @@ intptr_t dummyVal; message_wait(inBytes); /* wait for objects from the left */ - /* + /* * Perform application-specified processing before unpacking the data. */ if (zz->Migrate.Mid_Migrate_PP != NULL) { zz->Migrate.Mid_Migrate_PP(zz->Migrate.Mid_Migrate_PP_Data, num_gid_entries, num_lid_entries, inCount, - mid_migrate_import_gids, mid_migrate_import_lids, + mid_migrate_import_gids, mid_migrate_import_lids, mid_migrate_import_procs, mid_migrate_import_parts, outCount, - mid_migrate_export_gids, mid_migrate_export_lids, + mid_migrate_export_gids, mid_migrate_export_lids, mid_migrate_export_procs, mid_migrate_export_parts, &ierr); if (ierr < 0) { @@ -701,11 +664,11 @@ intptr_t dummyVal; /* * Unpack the object data. */ - + if (inBytes > 0) { - + if (zz->Unpack_Obj_Multi != NULL) { - + /* Allocate and fill input arrays for Unpack_Obj_Multi. */ ierr = get_int_array(zz, inCount, &_sizes, &_sizes_len); @@ -728,32 +691,32 @@ intptr_t dummyVal; tmp = inBuf; idx_cnt = 0; for (k = 0; k < inCount; k++) { - + /* Unpack the object's global ID */ ZOLTAN_SET_GID(zz, &(tmp_id[k*num_gid_entries]), (ZOLTAN_ID_PTR) tmp); tmp += id_size; - + /* Unpack the object's size */ sizes[k] = *((int *)tmp); tmp += aligned_int; - + /* If using ZOLTAN_UNPACK_OBJ_MULTI_FN, build the index array. */ idx_cnt += tag_size; if (idx != NULL) { idx[k] = idx_cnt; } - + tmp += sizes[k]; idx_cnt += sizes[k]; } - + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ printf("[%1d] DEBUG in %s: Unpacking objects with multi-fn\n", zz->Proc,yo); } zz->Unpack_Obj_Multi(zz->Unpack_Obj_Multi_Data, num_gid_entries, inCount, tmp_id, sizes, idx, inBuf, &ierr); - + if (ierr < 0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from " "ZOLTAN_UNPACK_OBJ_MULTI_FN."); @@ -769,9 +732,9 @@ intptr_t dummyVal; ZOLTAN_PRINT_GID(zz, (ZOLTAN_ID_PTR)tmp); printf("size = %d bytes\n", tmp_size); } - + /* Unpack the object's data */ - + zz->Unpack_Obj(zz->Unpack_Obj_Data, num_gid_entries, (ZOLTAN_ID_PTR) tmp, tmp_size, tmp + tag_size, &ierr); @@ -801,7 +764,7 @@ intptr_t dummyVal; } if (zz->Debug_Level >= ZOLTAN_DEBUG_TRACE_DETAIL){ - printf("%s (%d) post migrate complete num_import %d num_export %d\n", yo, zz->Proc, + printf("%s (%d) post migrate complete num_import %d num_export %d\n", yo, zz->Proc, num_import, num_export); } } @@ -813,13 +776,13 @@ intptr_t dummyVal; reset_arrays(); if (actual_exp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); } if (actual_imp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_imp_gids, &actual_imp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part); } @@ -834,15 +797,15 @@ intptr_t dummyVal; int Zoltan_Migrate( ZZ *zz, /* Zoltan structure. */ - int num_import, /* Number of non-local objects assigned to the + int num_import, /* Number of non-local objects assigned to the processor in the new decomposition. */ - ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects + ZOLTAN_ID_PTR import_global_ids, /* Array of global IDs for non-local objects assigned to this processor in the new - decomposition; this field can be NULL if + decomposition; this field can be NULL if the application doesn't provide import IDs.*/ ZOLTAN_ID_PTR import_local_ids, /* Array of local IDs for non-local objects assigned to the processor in the new - decomposition; this field can be NULL if the + decomposition; this field can be NULL if the application does not provide import IDs. */ int *import_procs, /* Array of processor IDs of processors owning the non-local objects that are assigned to @@ -861,7 +824,7 @@ int Zoltan_Migrate( objects to be exported to other processors to establish the new decomposition. */ int *export_procs, /* Array of processor IDs - to which objects will be exported + to which objects will be exported to establish the new decomposition. */ int *export_to_part /* Array of partition numbers to which exported objects should be assigned. */ @@ -882,9 +845,9 @@ int Zoltan_Migrate( char *yo = "Zoltan_Migrate"; int num_gid_entries, num_lid_entries; /* lengths of global & local ids */ int *sizes = NULL; /* sizes (in bytes) of the object data for export. */ -int id_size; /* size (in bytes) of ZOLTAN_GID + padding for +int id_size; /* size (in bytes) of ZOLTAN_GID + padding for alignment */ -int tag_size; /* size (in bytes) of ZOLTAN_GID + one int +int tag_size; /* size (in bytes) of ZOLTAN_GID + one int (for message size) */ char *export_buf = NULL; /* buffer for packing export data. */ char *import_buf = NULL; /* buffer for receiving imported data. */ @@ -893,7 +856,7 @@ int i; /* loop counter. */ int tmp_size; /* size of a single object's data. */ int *idx = NULL; /* index used for multi-fn packs and unpacks. */ int idx_cnt = 0; /* index counter for idx array. */ -ZOLTAN_ID_PTR tmp_id = NULL; /* pointer to storage for a global ID in comm +ZOLTAN_ID_PTR tmp_id = NULL; /* pointer to storage for a global ID in comm buf */ ZOLTAN_ID_PTR lid; /* temporary pointer to a local ID; used to pass NULL to query functions when NUM_LID_ENTRIES=0. */ @@ -936,11 +899,11 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ * Check that all procs use the same id types. */ - ierr = check_input(zz, - ((num_export >= 0 && export_to_part) || + ierr = check_input(zz, + ((num_export >= 0 && export_to_part) || (num_import >= 0 && import_to_part)), &include_parts); - if (ierr != ZOLTAN_OK) + if (ierr != ZOLTAN_OK) goto End; num_gid_entries = zz->Num_GID; @@ -979,12 +942,12 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* Build the actual export arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_export, export_global_ids, export_local_ids, - export_procs, export_to_part, + num_export, export_global_ids, export_local_ids, + export_procs, export_to_part, &actual_num_exp, &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part, &actual_exp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; /* Compute communication map based on actual exports. */ @@ -1002,14 +965,14 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* Build the actual import arrays */ ierr = actual_arrays(zz, num_gid_entries, num_lid_entries, - num_import, import_global_ids, import_local_ids, - import_procs, import_to_part, + num_import, import_global_ids, import_local_ids, + import_procs, import_to_part, &actual_num_imp, &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part, &actual_imp_allocated); - if (ierr < 0) + if (ierr < 0) goto End; - + /* Compute communication map based on imports. */ msgtag = 32767; ierr = Zoltan_Comm_Create(&imp_plan, actual_num_imp, actual_imp_procs, @@ -1029,10 +992,10 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ actual_exp_to_part = (int *) ZOLTAN_MALLOC(sizeof(int)*actual_num_exp); if (actual_exp_gids == NULL || (num_lid_entries && actual_exp_lids == NULL) || - actual_exp_procs == NULL || + actual_exp_procs == NULL || (import_to_part != NULL && actual_exp_to_part == NULL)) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); ierr = ZOLTAN_MEMERR; goto End; @@ -1061,7 +1024,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ Zoltan_Comm_Info(imp_plan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, actual_exp_procs, NULL); - + if (include_parts) { msgtag2--; ierr = Zoltan_Comm_Do(imp_plan, msgtag2, (char *) actual_imp_to_part, @@ -1071,10 +1034,10 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ goto End; } } - - /* Create inverse plan (i.e., plan based on exports) so can set - * variable sizes. - * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable + + /* Create inverse plan (i.e., plan based on exports) so can set + * variable sizes. + * (Zoltan_Comm_Do_Reverse(imp_plan, ...) allows sending variable * but does not tell how large to allocate receive buffer. */ ierr = Zoltan_Comm_Invert_Plan(&imp_plan); @@ -1122,17 +1085,17 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ ZOLTAN_TRACE_DETAIL(zz, yo, "Done pre-migration processing"); id_size = Zoltan_Align(num_gid_entries * sizeof(ZOLTAN_ID_TYPE)); - /* Note that alignment is not strictly necessary + /* Note that alignment is not strictly necessary when ZOLTAN_ID_TYPE is int or unsigned int. */ aligned_int = Zoltan_Align(sizeof(int)); tag_size = id_size + aligned_int; /* - * For each object, allow space for its global ID and its data plus + * For each object, allow space for its global ID and its data plus * one int (for the object data size). * Zoltan will pack the global IDs; the application must pack the data * through the pack routine. Zoltan needs the global IDs for unpacking, - * as the order of the data received during communication is not + * as the order of the data received during communication is not * necessarily the same order as import_global_ids[]. * Zoltan also needs to communicate the sizes of the objects because * only the sender knows the size of each object. @@ -1146,7 +1109,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ } if (zz->Get_Obj_Size_Multi != NULL) { - zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, + zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, num_gid_entries, num_lid_entries, actual_num_exp, actual_exp_gids, actual_exp_lids, sizes, &ierr); if (ierr < 0) { @@ -1158,9 +1121,9 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ else { for (i = 0; i < actual_num_exp; i++){ lid = (num_lid_entries ? &(actual_exp_lids[i*num_lid_entries]) : NULL); - sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, + sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, num_gid_entries, num_lid_entries, - &(actual_exp_gids[i*num_gid_entries]), + &(actual_exp_gids[i*num_gid_entries]), lid, &ierr); if (ierr < 0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from " @@ -1196,7 +1159,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ /* * Pack the objects for export. */ - + idx_cnt = 0; tmp = export_buf; for (i = 0; i < actual_num_exp; i++) { @@ -1205,7 +1168,7 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ tmp_id = (ZOLTAN_ID_PTR) tmp; ZOLTAN_SET_GID(zz, tmp_id, &(actual_exp_gids[i*num_gid_entries])); tmp += id_size; - + /* Pack the object's size */ *((int *)tmp) = sizes[i]; tmp += aligned_int; @@ -1221,13 +1184,13 @@ int *actual_imp_to_part = NULL; /* processor may not be included. */ if (zz->Pack_Obj_Multi != NULL) { if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", + printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", zz->Proc, yo); } zz->Pack_Obj_Multi(zz->Pack_Obj_Multi_Data, num_gid_entries, num_lid_entries, actual_num_exp, - actual_exp_gids, actual_exp_lids, - (actual_exp_to_part!=NULL ? actual_exp_to_part + actual_exp_gids, actual_exp_lids, + (actual_exp_to_part!=NULL ? actual_exp_to_part : actual_exp_procs), sizes, idx, export_buf, &ierr); if (ierr < 0) { @@ -1245,15 +1208,15 @@ if (ierr != 0){ if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ printf("[%1d] DEBUG in %s: Packing object with gid ", zz->Proc, yo); ZOLTAN_PRINT_GID(zz, &(actual_exp_gids[i*num_gid_entries])); - printf("size = %d bytes\n", sizes[i]); + printf("size = %d bytes\n", sizes[i]); } /* Pack the object's data */ lid = (num_lid_entries ? &(actual_exp_lids[i*num_lid_entries]) : NULL); - dest = (actual_exp_to_part != NULL ? actual_exp_to_part[i] + dest = (actual_exp_to_part != NULL ? actual_exp_to_part[i] : actual_exp_procs[i]); - zz->Pack_Obj(zz->Pack_Obj_Data, + zz->Pack_Obj(zz->Pack_Obj_Data, num_gid_entries, num_lid_entries, &(actual_exp_gids[i*num_gid_entries]), lid, dest, sizes[i], tmp, &ierr); @@ -1317,7 +1280,7 @@ if (ierr != 0){ ZOLTAN_TRACE_DETAIL(zz, yo, "Done communication"); - /* + /* * Perform application-specified processing before unpacking the data. */ if (zz->Migrate.Mid_Migrate_PP != NULL) { @@ -1467,13 +1430,13 @@ if (ierr != 0){ End: if (actual_exp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_exp_gids, &actual_exp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_exp_gids, &actual_exp_lids, &actual_exp_procs, &actual_exp_to_part); } if (actual_imp_allocated) { - Zoltan_Multifree(__FILE__, __LINE__, 4, - &actual_imp_gids, &actual_imp_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + &actual_imp_gids, &actual_imp_lids, &actual_imp_procs, &actual_imp_to_part); } @@ -1496,8 +1459,8 @@ static int check_input( int *include_parts ) { -/* - * Routine to ensure that all processors have the same values of +/* + * Routine to ensure that all processors have the same values of * zz->Num_GID and zz->Num_LID. * Also, check whether partitions are included on any processors; if so, * set include_parts to true. @@ -1516,9 +1479,9 @@ int ierr = ZOLTAN_OK; loc_tmp[4] = -(zz->Num_LID); loc_tmp[5] = -(parts); - /* - * Check both max and min values of IDs so that all processors can - * return the same error code. + /* + * Check both max and min values of IDs so that all processors can + * return the same error code. */ MPI_Allreduce(loc_tmp, glob, 6, @@ -1579,9 +1542,9 @@ int ierr; goto End; } - if (zz->Migrate.Pre_Migrate_PP || zz->Migrate.Mid_Migrate_PP || + if (zz->Migrate.Pre_Migrate_PP || zz->Migrate.Mid_Migrate_PP || zz->Migrate.Post_Migrate_PP) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Partition information not available in Zoltan_Help_Migrate for " "ZOLTAN_*_MIGRATE_PP_FNs; use ZOLTAN_*_MIGRATE_FNs instead."); ierr = ZOLTAN_FATAL; @@ -1605,7 +1568,7 @@ int ierr; /****************************************************************************/ static int actual_arrays( ZZ *zz, - int num_gid_entries, + int num_gid_entries, int num_lid_entries, int num, ZOLTAN_ID_PTR gids, @@ -1617,7 +1580,7 @@ static int actual_arrays( ZOLTAN_ID_PTR *actual_lids, int **actual_procs, int **actual_to_part, - int *actual_allocated + int *actual_allocated ) { char *yo = "actual_arrays"; @@ -1625,7 +1588,7 @@ int i, j; /* * Test whether to pack objects that have changed partition - * but not changed processor. + * but not changed processor. * If packing them, the actual objects == objects passed to this function. * If not packing them, build arrays with them stripped out. */ @@ -1642,7 +1605,7 @@ int i, j; else { /* zz->Migrate.Only_Proc_Changes */ /* Pack only objects that are actually changing processor. */ *actual_num = 0; - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) if (procs[i] != zz->Proc) (*actual_num)++; @@ -1664,22 +1627,22 @@ int i, j; if (to_part != NULL) *actual_to_part = (int *) ZOLTAN_MALLOC(sizeof(int)*(*actual_num)); if (*actual_gids == NULL || (num_lid_entries && *actual_lids == NULL) || - *actual_procs == NULL || + *actual_procs == NULL || (to_part != NULL && *actual_to_part == NULL)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory Error."); - Zoltan_Multifree(__FILE__, __LINE__, 4, - actual_gids, actual_lids, + Zoltan_Multifree(__FILE__, __LINE__, 4, + actual_gids, actual_lids, actual_procs, actual_to_part); return (ZOLTAN_MEMERR); } - + for (j = 0, i = 0; i < num; i++) { if (procs[i] != zz->Proc) { - ZOLTAN_SET_GID(zz, + ZOLTAN_SET_GID(zz, *actual_gids + j*num_gid_entries, gids + i*num_gid_entries); if (num_lid_entries) - ZOLTAN_SET_LID(zz, + ZOLTAN_SET_LID(zz, *actual_lids + j*num_lid_entries, lids + i*num_lid_entries); (*actual_procs)[j] = procs[i]; @@ -1802,19 +1765,19 @@ static void reset_arrays() } static int pack_message_for_proc(ZZ *zz, int dest_proc, int num, - int num_export, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, - int *to_proc, int *to_part, + int num_export, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, + int *to_proc, int *to_part, int tag_size, int id_size, int aligned_int, char **send_buf, int *send_size, ZOLTAN_ID_PTR *export_gids, ZOLTAN_ID_PTR *export_lids, int **export_procs, - int **export_parts) + int **export_parts) { /* - * For each object, allow space for its global ID and its data plus + * For each object, allow space for its global ID and its data plus * one int (for the object data size). * Zoltan will pack the global IDs; the application must pack the data * through the pack routine. Zoltan needs the global IDs for unpacking, - * as the order of the data received during communication is not + * as the order of the data received during communication is not * necessarily the same order as import_global_ids[]. * Zoltan also needs to communicate the sizes of the objects because * only the sender knows the size of each object. @@ -1831,7 +1794,7 @@ ZOLTAN_ID_PTR tmp_id=NULL, send_gids=NULL, send_lids=NULL; int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; *send_buf = NULL; - *send_size = 0; + *send_size = 0; if (export_gids){ *export_gids = *export_lids = NULL; @@ -1905,16 +1868,16 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; sizes = _sizes; if (zz->Get_Obj_Size_Multi != NULL) { - zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, + zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, num_gid_entries, num_lid_entries, num, - send_gids, (send_lids ? send_lids : NULL), + send_gids, (send_lids ? send_lids : NULL), sizes, &ierr); } else { for (i = 0; i < num; i++){ - sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, + sizes[i] = zz->Get_Obj_Size(zz->Get_Obj_Size_Data, num_gid_entries, num_lid_entries, - &(send_gids[i*num_gid_entries]), + &(send_gids[i*num_gid_entries]), (send_lids ? &(send_lids[i*num_lid_entries]) : NULL), &ierr); if (ierr != 0) break; @@ -1953,7 +1916,7 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; /* * Pack the objects for export. */ - + idx_cnt = 0; tmp = export_buf; for (i = 0; i < num; i++) { @@ -1962,7 +1925,7 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; tmp_id = (ZOLTAN_ID_PTR) tmp; ZOLTAN_SET_GID(zz, tmp_id, &(send_gids[i*num_gid_entries])); tmp += id_size; - + /* Pack the object's size */ *((int *)tmp) = sizes[i]; tmp += aligned_int; @@ -1978,12 +1941,12 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; if (zz->Pack_Obj_Multi != NULL) { if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", + printf("[%1d] DEBUG in %s: Packing objects with multi-pack\n", zz->Proc, yo); } zz->Pack_Obj_Multi(zz->Pack_Obj_Multi_Data, num_gid_entries, num_lid_entries, num, - send_gids, (send_lids ? send_lids : NULL), + send_gids, (send_lids ? send_lids : NULL), (send_parts ? send_parts : send_procs), sizes, idx, export_buf, &ierr); } @@ -1993,16 +1956,16 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ printf("[%1d] DEBUG in %s: Packing object with gid ", zz->Proc, yo); ZOLTAN_PRINT_GID(zz, &(send_gids[i*num_gid_entries])); - printf("size = %d bytes\n", sizes[i]); + printf("size = %d bytes\n", sizes[i]); } /* Pack the object's data */ dest = (send_parts != NULL ? send_parts[i] : send_procs[i]); - zz->Pack_Obj(zz->Pack_Obj_Data, + zz->Pack_Obj(zz->Pack_Obj_Data, num_gid_entries, num_lid_entries, &(send_gids[i*num_gid_entries]), - (send_lids ? &(send_lids[i*num_lid_entries]) : NULL), + (send_lids ? &(send_lids[i*num_lid_entries]) : NULL), dest, sizes[i], tmp, &ierr); if (ierr < 0) @@ -2023,7 +1986,7 @@ int *idx=NULL, *sizes=NULL, *send_parts=NULL, *send_procs=NULL; ZOLTAN_TRACE_DETAIL(zz, yo, "Done packing objects"); *send_buf = export_buf; - *send_size = total_send_size; + *send_size = total_send_size; End: return ierr; @@ -2055,7 +2018,7 @@ static int create_import_lists(ZZ *zz, int msglen, int src, int num, if (procs[i] == src){ numObj++; } - } + } ierr = get_gid_array(zz, numObj, &_import_gids, &_import_gids_len); if (ierr != ZOLTAN_OK){ diff --git a/packages/zoltan/src/matlab/README b/packages/zoltan/src/matlab/README index 26bb1191ca..4db76a2318 100644 --- a/packages/zoltan/src/matlab/README +++ b/packages/zoltan/src/matlab/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER This directory contains a crude Matlab interface to Zoltan for partitioning sparse matrices (by rows or columns). This is not a finished product, but work in progress that you diff --git a/packages/zoltan/src/matrix/matrix_build.c b/packages/zoltan/src/matrix/matrix_build.c index efb02bc1f0..7a978be789 100644 --- a/packages/zoltan/src/matrix/matrix_build.c +++ b/packages/zoltan/src/matrix/matrix_build.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -72,17 +35,17 @@ extern int Zoltan_Get_Num_Edges_Per_Obj( int Zoltan_Matrix_Build (ZZ* zz, Zoltan_matrix_options *opt, Zoltan_matrix* matrix, - int request_GNOs, /* Input: Flag indicating calling code + int request_GNOs, /* Input: Flag indicating calling code needs translation of extra GIDs to GNOs; partial 2D coloring needs this feature. */ - int num_requested, /* Input: Local # of GIDs needing + int num_requested, /* Input: Local # of GIDs needing translation to GNOs. */ - ZOLTAN_ID_PTR requested_GIDs, /* Input: Calling code requests the + ZOLTAN_ID_PTR requested_GIDs, /* Input: Calling code requests the GNOs for these GIDs */ - ZOLTAN_GNO_TYPE *requested_GNOs /* Output: Return GNOs of + ZOLTAN_GNO_TYPE *requested_GNOs /* Output: Return GNOs of the requested GIDs. */ -) +) { static char *yo = "Zoltan_Matrix_Build"; int ierr = ZOLTAN_OK; @@ -103,13 +66,13 @@ Zoltan_Matrix_Build (ZZ* zz, Zoltan_matrix_options *opt, Zoltan_matrix* matrix, MPI_Datatype zoltan_gno_mpi_type; int use_full_dd = (opt->speed == MATRIX_FULL_DD); int fast_build_base = opt->fast_build_base; - matrix->opts.speed = opt->speed; + matrix->opts.speed = opt->speed; matrix->opts.fast_build_base = opt->fast_build_base; ZOLTAN_TRACE_ENTER(zz, yo); if (num_requested && (!requested_GIDs || !requested_GNOs)) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error in requested input; needed arrays are NULL.\n"); } @@ -189,8 +152,8 @@ Zoltan_Matrix_Build (ZZ* zz, Zoltan_matrix_options *opt, Zoltan_matrix* matrix, for (i = 0; i < num_requested; i++) requested_GNOs[i] = (ZOLTAN_GNO_TYPE)requested_GIDs[i] - fast_build_base; - - tmp = (ZOLTAN_GNO_TYPE)nX; + + tmp = (ZOLTAN_GNO_TYPE)nX; MPI_Allreduce(&tmp, &matrix->globalX, 1, zoltan_gno_mpi_type, MPI_SUM, zz->Communicator); } @@ -246,7 +209,7 @@ Zoltan_Matrix_Build (ZZ* zz, Zoltan_matrix_options *opt, Zoltan_matrix* matrix, if (matrix->opts.local) { /* keep only local edges */ proclist = (int*) ZOLTAN_MALLOC(matrix->nPins*sizeof(int)); - if (matrix->nPins && proclist == NULL) { + if (matrix->nPins && proclist == NULL) { ZOLTAN_FREE(&pinID); MEMORY_ERROR; } @@ -282,7 +245,7 @@ Zoltan_Matrix_Build (ZZ* zz, Zoltan_matrix_options *opt, Zoltan_matrix* matrix, } for (i=0; i < matrix->nPins; i++) matrix->pinGNO[i] = (ZOLTAN_GNO_TYPE)pinID[i] - fast_build_base; - + ZOLTAN_FREE(&pinID); } else{ @@ -394,7 +357,7 @@ Zoltan_Matrix_Vertex_Info(ZZ* zz, const Zoltan_matrix * const m, zz->Obj_Weight_Dim, &l_xwgt, &l_input_part); - ierr = Zoltan_DD_Create (&dd, zz->Communicator, zz->Num_GID, zz->Num_LID, + ierr = Zoltan_DD_Create (&dd, zz->Communicator, zz->Num_GID, zz->Num_LID, sizeof(float) * zz->Obj_Weight_Dim, nX, 0); CHECK_IERR; @@ -451,7 +414,7 @@ matrix_get_edges(ZZ *zz, Zoltan_matrix *matrix, ZOLTAN_ID_PTR *yGID, ZOLTAN_ID_P /* TEMPORARY FIX */ if (!graph_callbacks){ fprintf(stderr,"Bug #5470: matrix_get_edges fails for hypergraph queries\n"); - return ZOLTAN_FATAL; + return ZOLTAN_FATAL; } hypergraph_callbacks=0; /* TEMPORARY FIX */ diff --git a/packages/zoltan/src/matrix/matrix_distribute.c b/packages/zoltan/src/matrix/matrix_distribute.c index 750b06453a..e87a940c04 100644 --- a/packages/zoltan/src/matrix/matrix_distribute.c +++ b/packages/zoltan/src/matrix/matrix_distribute.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/matrix/matrix_operations.c b/packages/zoltan/src/matrix/matrix_operations.c index 0a45530e52..85fd1da9cf 100644 --- a/packages/zoltan/src/matrix/matrix_operations.c +++ b/packages/zoltan/src/matrix/matrix_operations.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/matrix/matrix_sym.c b/packages/zoltan/src/matrix/matrix_sym.c index 0e1e3a8e9b..097ff5cc99 100644 --- a/packages/zoltan/src/matrix/matrix_sym.c +++ b/packages/zoltan/src/matrix/matrix_sym.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/matrix/matrix_utils.c b/packages/zoltan/src/matrix/matrix_utils.c index 5c93638bb3..9fab2cd795 100644 --- a/packages/zoltan/src/matrix/matrix_utils.c +++ b/packages/zoltan/src/matrix/matrix_utils.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -99,7 +62,7 @@ Zoltan_Matrix2d_Free(Zoltan_matrix_2d *m) Zoltan_PHGComm_Destroy(m->comm); - ZOLTAN_FREE(&m->comm); + ZOLTAN_FREE(&m->comm); memset (m, 0, sizeof(Zoltan_matrix_2d)); } diff --git a/packages/zoltan/src/matrix/zoltan_matrix.h b/packages/zoltan/src/matrix/zoltan_matrix.h index 94afc0e862..6c15be73ea 100644 --- a/packages/zoltan/src/matrix/zoltan_matrix.h +++ b/packages/zoltan/src/matrix/zoltan_matrix.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /***************************************************************************** * This module wants to be an "abstract" view of user data before being * "specialized" into real Zoltan datastructure like HyperGraph or Graph. @@ -158,7 +121,7 @@ typedef struct Zoltan_matrix_2d_ { ZOLTAN_GNO_TYPE *dist_y; /* Distribution on y axis */ distFnct *hashDistFct; /* How to distribute nnz */ void *hashDistData;/* Used by hashDist */ - int delete_flag; /* 0x001: dist_y, 0x010: ystart, + int delete_flag; /* 0x001: dist_y, 0x010: ystart, * 0x100: pinGNO, 0x1000: yGID */ } Zoltan_matrix_2d; diff --git a/packages/zoltan/src/order/README b/packages/zoltan/src/order/README index 39ef47ba49..efc069405b 100644 --- a/packages/zoltan/src/order/README +++ b/packages/zoltan/src/order/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER ORDER DIRECTORY -- Zoltan ordering tools. diff --git a/packages/zoltan/src/order/hsfcOrder.c b/packages/zoltan/src/order/hsfcOrder.c index cd01f47dec..6998d0acfd 100644 --- a/packages/zoltan/src/order/hsfcOrder.c +++ b/packages/zoltan/src/order/hsfcOrder.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -52,7 +15,6 @@ extern "C" { #include "zz_const.h" #include "zz_sort.h" #include "hsfc_hilbert_const.h" -#include "hsfcOrder.h" int Zoltan_LocalHSFC_Order( @@ -76,7 +38,7 @@ int Zoltan_LocalHSFC_Order( double (*fhsfc)(ZZ*, double*); /* space filling curve function */ - int wgt_dim=0; + int wgt_dim=0; float *obj_wgts=0; int *parts=0; @@ -99,11 +61,11 @@ int Zoltan_LocalHSFC_Order( ZOLTAN_ID_TYPE tmp, offset=0; int myrank; - MPI_Comm_rank(MPI_COMM_WORLD,&myrank); + MPI_Comm_rank(zoltan_get_global_comm(),&myrank); ZOLTAN_TRACE_ENTER(zz, yo); -#if 0 /* KDD 2/3/15 Trusting that order_opt should never be NULL, +#if 0 /* KDD 2/3/15 Trusting that order_opt should never be NULL, * KDD 2/3/15 I am commenting out this code. */ /******************************************************************/ /* If for some reason order_opt is NULL, allocate a new ZOOS here. */ @@ -118,7 +80,7 @@ int Zoltan_LocalHSFC_Order( /******************************************************************/ /* local HSFC only computes the rank vector */ - order_opt->return_args = RETURN_RANK; + order_opt->return_args = RETURN_RANK; /******************************************************************/ @@ -196,7 +158,7 @@ int Zoltan_LocalHSFC_Order( for(dimNum=0; dimNumProc, yo, "Error in Get_Num_Obj."); return (ierr); } - + *vtxdist = (int *) ZOLTAN_MALLOC((zz->Num_Proc+1)*sizeof(int)); if (num_obj>0){ if (!(*vtxdist)){ @@ -100,15 +63,15 @@ int Zoltan_Get_Distribution(ZZ *zz, int **vtxdist) return ZOLTAN_MEMERR; } } - + /* Construct *vtxdist[i] = the number of objects on all procs < i. */ /* Scan to compute partial sums of the number of objs */ MPI_Scan (&num_obj, *vtxdist, 1, MPI_INT, MPI_SUM, zz->Communicator); /* Gather data from all procs */ - MPI_Allgather (&((*vtxdist)[0]), 1, MPI_INT, + MPI_Allgather (&((*vtxdist)[0]), 1, MPI_INT, &((*vtxdist)[1]), 1, MPI_INT, zz->Communicator); (*vtxdist)[0] = 0; - + return ZOLTAN_OK; } @@ -162,7 +125,7 @@ int Zoltan_Inverse_Perm( sendlist[2*i+1] = perm[i]; proclist[i] = Zoltan_Get_Processor_Graph(vtxdist, zz->Num_Proc, perm[i]); } - ierr = Zoltan_Comm_Create(&comm_plan, num_obj, proclist, + ierr = Zoltan_Comm_Create(&comm_plan, num_obj, proclist, zz->Communicator, TAG1, &nrecv); if (ierr != ZOLTAN_OK){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error in Zoltan_Comm_Create"); @@ -170,7 +133,7 @@ int Zoltan_Inverse_Perm( } if (nrecv != num_obj){ /* This should never happen. */ - sprintf(msg, "Internal error: nrecv (%3d) != num_obj (%3d). Invalid permutation.\n", nrecv, num_obj); + sprintf(msg, "Internal error: nrecv (%3d) != num_obj (%3d). Invalid permutation.\n", nrecv, num_obj); ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); ierr = ZOLTAN_FATAL; goto error; diff --git a/packages/zoltan/src/par/README b/packages/zoltan/src/par/README index e76794cc81..09a536858b 100644 --- a/packages/zoltan/src/par/README +++ b/packages/zoltan/src/par/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER PAR DIRECTORY -- Parallel computing utilities diff --git a/packages/zoltan/src/par/par_average.c b/packages/zoltan/src/par/par_average.c index a8df8956bf..70b1b1047c 100644 --- a/packages/zoltan/src/par/par_average.c +++ b/packages/zoltan/src/par/par_average.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -53,10 +16,11 @@ extern "C" { #include #include #include -#include "par_average_const.h" #include "par_median_const.h" #include "zz_const.h" +#define TINY 1.0e-6 + /* prototypes for TFLOPS_SPECIAL */ static void Zoltan_average_cuts_reduce(int, int, int, double *, double *, int, MPI_Datatype, MPI_Comm); @@ -82,7 +46,7 @@ double Zoltan_RB_Average_Cut( double oldvaluehalf /* Cut computed before averaging is done. */ ) { -/* Compute a median value that is exactly between two closest dots. +/* Compute a median value that is exactly between two closest dots. * Routine is called when parameter AVERAGE_CUTS == 1. */ double val[2] = {-DBL_MAX, DBL_MAX}; @@ -90,7 +54,7 @@ double gval[2]; double valuehalf = oldvaluehalf; int i; - if (!Tflops_Special || num_procs > 1) { + if (!Tflops_Special || num_procs > 1) { /* Don't include dot info if going thru loop only due to Tflops_Special */ for (i = 0; i < dotnum; i++) { /* @@ -98,7 +62,7 @@ printf("KDDDDD %d proclower=%d num_parts=%d numlist=%d i=%d dotmark[i]=%d dots[i */ if (dotmark[i] == 0) { /* in lower part */ if (dots[i] > val[0]) val[0] = dots[i]; - } + } else { /* in upper part */ if (dots[i] < val[1]) val[1] = dots[i]; } @@ -108,7 +72,7 @@ printf("KDDDDD %d proclower=%d num_parts=%d numlist=%d i=%d dotmark[i]=%d dots[i MPI_Allreduce(&val[1], &gval[1], 1, MPI_DOUBLE, MPI_MIN, local_comm); } else - Zoltan_average_cuts_reduce(num_procs, rank, proc, val, gval, 2, + Zoltan_average_cuts_reduce(num_procs, rank, proc, val, gval, 2, MPI_DOUBLE, local_comm); valuehalf = 0.5 * (gval[0] + gval[1]); diff --git a/packages/zoltan/src/par/par_average_const.h b/packages/zoltan/src/par/par_average_const.h index f846b197a6..358e542bdd 100644 --- a/packages/zoltan/src/par/par_average_const.h +++ b/packages/zoltan/src/par/par_average_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PAR_AVERAGE_CONST_H diff --git a/packages/zoltan/src/par/par_bisect.c b/packages/zoltan/src/par/par_bisect.c index fdffac6486..188cf1cc20 100644 --- a/packages/zoltan/src/par/par_bisect.c +++ b/packages/zoltan/src/par/par_bisect.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -106,8 +69,6 @@ static double eval_cut_quality(int, double *, double *, double *, double *, int); static void compute_weight_sums( int, int *, int, double *, double, double *, double *, MPI_Comm, int, int, int, int); -static void Zoltan_bisector_merge(void *in, void *inout, int *len, MPI_Datatype *dptr); - #endif /* RB_MAX_WGTS > 1 */ /*****************************************************************************/ @@ -351,10 +312,10 @@ int Zoltan_RB_find_bisector( MPI_Get_address(&(med->totallo[0]), &(ind[3])); #else /* MPI 1.x */ /* MPI_Address is deprecated in MPI 2.0 */ - MPI_Address(med, &offset); - MPI_Address(&(med->countlo), &(ind[1])); - MPI_Address(&(med->proclo), &(ind[2])); - MPI_Address(&(med->totallo[0]), &(ind[3])); + MPI_Address(med, &offset); + MPI_Address(&(med->countlo), &(ind[1])); + MPI_Address(&(med->proclo), &(ind[2])); + MPI_Address(&(med->totallo[0]), &(ind[3])); #endif /* MPI_VERSION >= 2 */ ind[0] = 0; @@ -540,7 +501,7 @@ int Zoltan_RB_find_bisector( tmp_half = 0.5 * (valuemin + valuemax); #ifdef DEBUG_BISECT - printf("[%2d] Debug: Iteration %d, tmp_half = %f\n", + printf("[%2d] Debug: Iteration %d, tmp_half = %f\n", proc, iteration, tmp_half); #endif @@ -687,7 +648,7 @@ int Zoltan_RB_find_bisector( proc, medme->totallo[0], medme->totallo[1], medme->totalhi[0], medme->totalhi[1]); printf("[%2d] Debug: med->totallo = (%f, %f), med->totalhi = (%f, %f)\n", - proc, med->totallo[0], med->totallo[1], + proc, med->totallo[0], med->totallo[1], med->totalhi[0], med->totalhi[1]); printf("[%2d] Debug: med->wtlo = (%f, %f), med->wthi = (%f, %f)\n", proc, med->wtlo[0], med->wtlo[1], med->wthi[0], med->wthi[1]); @@ -821,8 +782,8 @@ int Zoltan_RB_find_bisector( #ifdef DEBUG_BISECT printf("[%2d] Debug: moving dot %d to other half, " - "norm(tmplo) = %g, norm(tmphi) = %g\n", - proc, i, Zoltan_norm(mcnorm, nwgts, tmplo, scalelo), + "norm(tmplo) = %g, norm(tmphi) = %g\n", + proc, i, Zoltan_norm(mcnorm, nwgts, tmplo, scalelo), Zoltan_norm(mcnorm, nwgts, tmphi, scalehi)); #endif } @@ -839,7 +800,7 @@ int Zoltan_RB_find_bisector( } #ifdef DEBUG_BISECT - printf("[%2d] Debug: bisect value too small, breakflag = %d\n", + printf("[%2d] Debug: bisect value too small, breakflag = %d\n", proc, breakflag); #endif @@ -987,7 +948,7 @@ int Zoltan_RB_find_bisector( Zoltan_daxpy(nwgts, 1., &uniformWeight, tmphi, tmphi); #ifdef DEBUG_BISECT printf("[%2d] Examining dot %2d = %f, norm= %f, oldnorm= %f\n", - proc, i, dots[i], + proc, i, dots[i], Zoltan_norm(mcnorm, nwgts, tmphi, scalehi), oldnorm); printf("[%2d] tmplo = (%f, %f)\n", proc, tmplo[0], tmplo[1]); printf("[%2d] tmphi = (%f, %f)\n", proc, tmphi[0], tmphi[1]); @@ -1017,7 +978,7 @@ int Zoltan_RB_find_bisector( } } #ifdef DEBUG_BISECT - printf("[%2d] Debug: bisect value too big, breakflag = %d\n", + printf("[%2d] Debug: bisect value too big, breakflag = %d\n", proc, breakflag); #endif if (breakflag){ /* done if moved enough */ @@ -1253,7 +1214,7 @@ static double eval_cut_quality( */ -static void Zoltan_bisector_merge(void *in, void *inout, int *len, MPI_Datatype *dptr) +void Zoltan_bisector_merge(void *in, void *inout, int *len, MPI_Datatype *dptr) { struct bisector *med1, *med2; int i, nwgts; @@ -1265,7 +1226,7 @@ static void Zoltan_bisector_merge(void *in, void *inout, int *len, MPI_Datatype /* make sure both bisectors use the same # of weights */ nwgts = med1->nwgts; if (med2->nwgts != nwgts){ - ZOLTAN_PRINT_ERROR(-1, yo, + ZOLTAN_PRINT_ERROR(-1, yo, "Inconsistent number of weights in bisector structs!"); return; } @@ -1414,3 +1375,4 @@ static void Zoltan_daxpy(int n, double alpha, double *x, double *y, double *z) #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/par/par_bisect_const.h b/packages/zoltan/src/par/par_bisect_const.h index 43619446d8..f672f6a00b 100644 --- a/packages/zoltan/src/par/par_bisect_const.h +++ b/packages/zoltan/src/par/par_bisect_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PAR_BISECT_CONST_H @@ -58,7 +21,7 @@ extern "C" { extern int Zoltan_RB_find_bisector(ZZ *, int, double *, double *, double, int *, int, int, int, double *, MPI_Comm, - double *, int, int, int, int, double, double, + double *, int, int, int, int, double, double, double *, double *, double *, double *, int *, int, int); /* Note: MAX_BISECT_WGTS should be >= RB_MAX_WEIGHTS in RCB. */ diff --git a/packages/zoltan/src/par/par_const.h b/packages/zoltan/src/par/par_const.h index b791184151..73ccd2743d 100644 --- a/packages/zoltan/src/par/par_const.h +++ b/packages/zoltan/src/par/par_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PAR_CONST_H diff --git a/packages/zoltan/src/par/par_median.c b/packages/zoltan/src/par/par_median.c index 3a5366b7d4..1103829783 100644 --- a/packages/zoltan/src/par/par_median.c +++ b/packages/zoltan/src/par/par_median.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -91,12 +54,12 @@ struct median { /* median cut info */ int Zoltan_RB_find_median( - int Tflops_Special, /* Flag indicating whether Tflops_Special handling + int Tflops_Special, /* Flag indicating whether Tflops_Special handling of communicators should be done (to avoid memory leaks in tflops' Comm_Dup and Comm_Split). */ double *dots, /* array of coordinates */ double *wgts, /* array of weights associated with dots, or NULL */ - double uniformWeight, /* weight of every dot, or 0.0 if wgts != NULL */ + double uniformWeight, /* weight of every dot, or 0.0 if wgts != NULL */ int *dotmark, /* returned list of which side of the median each dot is on: 0 - dot is < valuehalf @@ -202,7 +165,7 @@ int Zoltan_RB_find_median( tolerance = wtmax; Zoltan_RB_max_double(&tolerance, 1, proclower, rank, num_procs, local_comm); } - else + else tolerance = 1.0; /* if user did not supply weights, all are 1.0 */ } else { @@ -241,15 +204,15 @@ int Zoltan_RB_find_median( all dots >= valuehalf are marked with 1 in dotmark */ if (!Tflops_Special || num_procs > 1) { /* don't need to go thru if only - one proc with Tflops_Special. - Input argument Tflops_Special + one proc with Tflops_Special. + Input argument Tflops_Special should be 0 for serial partitioning. */ while (1) { /* choose bisector value */ /* use old value on 1st iteration if old cut dimension is the same */ - /* on 2nd option: could push valuehalf towards geometric center + /* on 2nd option: could push valuehalf towards geometric center with "1.0-factor" to force overshoot */ @@ -260,12 +223,12 @@ int Zoltan_RB_find_median( } else if (weight) { /* Note, since zoltan provides artificial weights of 1 for non-weighted - * problems, this computation of tmp_half is always used. - * + * problems, this computation of tmp_half is always used. + * * Some problems with many zero-weighted dots do not behave well - * with this computation of tmp_half. + * with this computation of tmp_half. * Removing it, however, increases the number of iterations needed for - * many Zoltan tests. + * many Zoltan tests. * KDD 2/2016 */ tmp_half = valuemin + (targetlo - weightlo) / @@ -333,7 +296,7 @@ int Zoltan_RB_find_median( if (Tflops_Special) { i = 1; Zoltan_RB_reduce(num_procs, rank, proc, (void *) &medme, (void *) &med, - sizeof(medme), &i, med_type, local_comm, + sizeof(medme), &i, med_type, local_comm, Zoltan_RB_median_merge); } else { @@ -371,7 +334,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f wtok = 0.0; moveSome = 0; if (medme.valuehi == med.valuehi) { - wtok = medme.wthi; + wtok = medme.wthi; moveSome = 1; } if (weightlo + med.wthi >= targetlo) { /* all done */ @@ -383,7 +346,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f } } else { if (Tflops_Special) - Zoltan_RB_scan_double(&wtok, &wtupto, 1, local_comm, + Zoltan_RB_scan_double(&wtok, &wtupto, 1, local_comm, proc, rank, num_procs); else MPI_Scan(&wtok,&wtupto,1,MPI_DOUBLE,MPI_SUM,local_comm); @@ -393,7 +356,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f breakflag = 1; } /* wtok = most I can move */ wtsum = 0.0; - if (moveSome) + if (moveSome) for (j = 0; j < numlist; j++) { i = dotlist[j]; @@ -411,7 +374,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f if (breakflag) { /* done if moved enough */ if (Tflops_Special) { wtok = wtsum; - Zoltan_RB_sum_double(&wtok, 1, proclower, rank, num_procs, + Zoltan_RB_sum_double(&wtok, 1, proclower, rank, num_procs, local_comm); } else @@ -455,7 +418,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f wtok = 0.0; moveSome = 0; if (medme.valuelo == med.valuelo) { - wtok = medme.wtlo; + wtok = medme.wtlo; moveSome = 1; } if (weighthi + med.wtlo >= targethi) { /* all done */ @@ -467,7 +430,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f } } else { if (Tflops_Special) - Zoltan_RB_scan_double(&wtok, &wtupto, 1, local_comm, + Zoltan_RB_scan_double(&wtok, &wtupto, 1, local_comm, proc, rank, num_procs); else MPI_Scan(&wtok,&wtupto,1,MPI_DOUBLE,MPI_SUM,local_comm); @@ -477,7 +440,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f breakflag = 1; } /* wtok = most I can move */ wtsum = 0.0; - if (moveSome) + if (moveSome) for (j = 0; j < numlist; j++) { i = dotlist[j]; @@ -522,7 +485,7 @@ if (proc==0) printf("%d tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.20f } /* shrink the active list */ - + k = 0; for (j = 0; j < numlist; j++) { i = dotlist[j]; @@ -545,7 +508,7 @@ if (proc==0) printf("FINAL tmp_half %.20f weightlo/hi %.0f %.0f valuemin/max %.2 /* found median */ *valuehalf = tmp_half; - if (average_cuts) + if (average_cuts) *valuehalf = Zoltan_RB_Average_Cut(Tflops_Special, dots, dotmark, dotnum, num_procs, rank, proc, local_comm, *valuehalf); @@ -591,7 +554,7 @@ void Zoltan_RB_median_merge(void *in, void *inout, int *len, MPI_Datatype *dptr) med1 = (struct median *) in; med2 = (struct median *) inout; - + med2->totallo += med1->totallo; if (med1->valuelo > med2->valuelo) { med2->valuelo = med1->valuelo; @@ -629,7 +592,7 @@ void Zoltan_RB_reduce( int *len, /* length to pass to fn */ MPI_Datatype datatype, /* MPI datatype for operation */ MPI_Comm comm, /* MPI communicator */ - MPI_User_function *fn /* Function to be applied in reduction */ + MPI_User_function *fn /* Function to be applied in reduction */ ) { void *tmp = NULL; /* temporary to receive information */ diff --git a/packages/zoltan/src/par/par_median_const.h b/packages/zoltan/src/par/par_median_const.h index f92d9b1762..ddadcefdca 100644 --- a/packages/zoltan/src/par/par_median_const.h +++ b/packages/zoltan/src/par/par_median_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PAR_MEDIAN_CONST_H @@ -69,7 +32,7 @@ extern int Zoltan_RB_find_median_randomized(int, double *, double *, double, int /* Prototype for function used with TFLOPS_SPECIAL */ extern void Zoltan_RB_reduce(int, int, int, void*, void*, - int, int*, MPI_Datatype, MPI_Comm, + int, int*, MPI_Datatype, MPI_Comm, MPI_User_function); extern void par_median_accumulate_counts(int nprocs, int num_procs, int rank, int count); diff --git a/packages/zoltan/src/par/par_median_randomized.c b/packages/zoltan/src/par/par_median_randomized.c index 220ff67e9e..1f90cc3783 100644 --- a/packages/zoltan/src/par/par_median_randomized.c +++ b/packages/zoltan/src/par/par_median_randomized.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012, 2023 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -77,12 +40,12 @@ typedef struct _commStruct{ MPI_Comm comm; }commStruct; -static int rb_sort_doubles_increasing(const void *a, const void *b) +int rb_sort_doubles_increasing(const void *a, const void *b) { double v1, v2; - v1 = *(const double *)a; - v2 = *(const double *)b; + v1 = *(double *)a; + v2 = *(double *)b; if (v1 < v2) return -1; else if (v1 > v2) return 1; @@ -94,10 +57,10 @@ static int mark_median(int *, int *, int, int, double *, double, int); static int reorder_list(double *, int, int* , int *); static void sample_partition(int, int *, double *, double, int, double *); -static int test_candidate(int *, int *, double *, int *, double *, int, double, double, int, +static int test_candidate(int *, int *, double *, int *, double *, int, double, double, int, double, double, double, commStruct *, double *, double *, int *, int *); -static void mark_lo_and_hi(double, double, double *, double *, int *, int *, +static void mark_lo_and_hi(double, double, double *, double *, int *, int *, double *, double *, int, double, int *, commStruct *); static int get_median_candidates(double *, int, double *, int, double, commStruct *); static int get_3plus_candidates(int, int *, double *, double, commStruct *, double *); @@ -118,7 +81,7 @@ static double *msgBuf=NULL; /*****************************************************************************/ int Zoltan_RB_find_median_randomized( - int Tflops_Special, /* Flag indicating whether Tflops_Special handling + int Tflops_Special, /* Flag indicating whether Tflops_Special handling of communicators should be done (to avoid memory leaks in tflops' Comm_Dup and Comm_Split). */ double *dots, /* array of coordinates */ @@ -178,7 +141,7 @@ int Zoltan_RB_find_median_randomized( else sprintf(debugText,"(%d - %d) ",proclower,proclower+num_procs-1); #endif - + loopCount=0; msgBuf = NULL; ierr = return_ok; @@ -229,7 +192,7 @@ int Zoltan_RB_find_median_randomized( tolerance = wtmax; Zoltan_RB_max_double(&tolerance, 1, proclower, rank, num_procs, local_comm); } - else + else tolerance = 1.0; /* if user did not supply weights, all are 1.0 */ } else { @@ -260,8 +223,8 @@ int Zoltan_RB_find_median_randomized( medians = (double *)ZOLTAN_MALLOC((num_procs+2) * sizeof(double)); if (!Tflops_Special || num_procs > 1) { /* don't need to go thru if only - one proc with Tflops_Special. - Input argument Tflops_Special + one proc with Tflops_Special. + Input argument Tflops_Special should be 0 for serial partitioning. */ @@ -279,8 +242,8 @@ int Zoltan_RB_find_median_randomized( /* We'll generate random candidates and continue search in while loop below */ /* TODO - if we have a first guess, we should generate candidates close - * to the first guess and do a binary search of those. Otherwise, - * unless first guess is median, we're not really using this info. + * to the first guess and do a binary search of those. Otherwise, + * unless first guess is median, we're not really using this info. */ medians[0] = valuemin; medians[1] = valuemax; @@ -298,23 +261,23 @@ int Zoltan_RB_find_median_randomized( else{ tmp_half = invalidDot; } - - /* Create sorted array of unique local median values. True global median is - * between the minimum and maximum of these local medians. + + /* Create sorted array of unique local median values. True global median is + * between the minimum and maximum of these local medians. */ - + ndots = get_median_candidates(&tmp_half, 1, medians, num_procs, validMax, &comm); - + left = 0; right = ndots-1; if (ndots == 1){ /* If only one dot - it must be median */ - + /* Write dotmark array, compute weightlo, weighthi */ test_candidate(&numlist, dotlist, dots, dotmark, wgts, wgtflag, uniformWeight, weight, rectilinear_blocks, tolerance, targetlo, medians[0], &comm, &weightlo, &weighthi, &markactive, &loopCount); - + found_median = 1; tmp_half = medians[0]; } @@ -322,22 +285,22 @@ int Zoltan_RB_find_median_randomized( /* Median is between medians[0] and medians[1], or it's one * or the other. Call test_candidate to mark dots, pare active list. */ - - found_median = test_candidate(&numlist, dotlist, dots, dotmark, - wgts, wgtflag, uniformWeight, weight, rectilinear_blocks, + + found_median = test_candidate(&numlist, dotlist, dots, dotmark, + wgts, wgtflag, uniformWeight, weight, rectilinear_blocks, tolerance, targetlo, medians[0], &comm, &weightlo, &weighthi, &markactive, &loopCount); - + if (found_median){ tmp_half = medians[0]; } else{ - found_median = test_candidate(&numlist, dotlist, dots, dotmark, - wgts, wgtflag, uniformWeight, weight, rectilinear_blocks, + found_median = test_candidate(&numlist, dotlist, dots, dotmark, + wgts, wgtflag, uniformWeight, weight, rectilinear_blocks, tolerance, targetlo, medians[1], &comm, &weightlo, &weighthi, &markactive, &loopCount); - - /* If candidate was not the median, we'll search between medians[0] and + + /* If candidate was not the median, we'll search between medians[0] and * medians[1] in while loop below */ if (found_median){ @@ -354,7 +317,7 @@ int Zoltan_RB_find_median_randomized( } } - /* Begin with a binary search through candidate medians if we have them. + /* Begin with a binary search through candidate medians if we have them. * Then select random candidates after this search narrows down the range. */ @@ -437,7 +400,7 @@ int Zoltan_RB_find_median_randomized( /* found median */ *valuehalf = tmp_half; - if (average_cuts) + if (average_cuts) *valuehalf = Zoltan_RB_Average_Cut(Tflops_Special, dots, dotmark, dotnum, num_procs, rank, proc, local_comm, *valuehalf); @@ -482,7 +445,7 @@ double v3 = v[c]; return c; } } -static int mark_median(int *dotlist, int *dotmark, +static int mark_median(int *dotlist, int *dotmark, int start, int nmeds, double *dots, double med, int mark) { int i, j; @@ -490,7 +453,7 @@ int count=0; for (j = start; ; j++) { i = dotlist[j]; - if (dots[i] == med) { + if (dots[i] == med) { dotmark[i] = mark; if (++count == nmeds) break; } @@ -541,7 +504,7 @@ int i, next_p; * Set pivotIdx to "j", the first value equal to p. * Return count, the number of values equal to p. */ - + static int reorder_list(double *vals, int len, int *pivotIdx, int *idxList) { int i, j, right; @@ -592,7 +555,7 @@ double p; /* Dots are sorted increasing. */ /* If forceUnique=1, will try to find three unique if possible. */ -static void sample_partition(int numlist, int *dotlist, double *dots, +static void sample_partition(int numlist, int *dotlist, double *dots, double invalidDot, int forceUnique, double *samples) { @@ -634,7 +597,7 @@ int mid = numlist >> 1; qsort(samples, 3, sizeof(double), rb_sort_doubles_increasing); } } -} +} /* * Given a candidate median value, sum up weights to left and right of it. @@ -649,7 +612,7 @@ int mid = numlist >> 1; * * Write dotmark array with LOPART and HIPART markers. */ -static int test_candidate(int *numlist, int *dotlist, double *dots, int *dotmark, +static int test_candidate(int *numlist, int *dotlist, double *dots, int *dotmark, double *wgts, int wgtflag, double uniformWeight, double totalweight, int rectilinear_blocks, double tolerance, double targetlo, double candidate, commStruct *comm, @@ -843,7 +806,7 @@ int countmed=0, indexmed=-1; return found_median; } -/* Mark dots below loBound as LOPART and dots above hiBound as HIPART +/* Mark dots below loBound as LOPART and dots above hiBound as HIPART * and remove them from the active list, and accumulate their weights * in weightlo and weighthi. */ @@ -869,7 +832,7 @@ MPI_Comm local_comm = comm->comm; for (j=0; j < *numlist; j++){ i = dotlist[j]; tmpwgt = (wgts ? wgts[i*wgtflag] : uniformWeight); - + if (dots[i] < loBound){ wlo += tmpwgt; dotmark[i] = LOPART; @@ -909,7 +872,7 @@ MPI_Comm local_comm = comm->comm; /* For now we assume "nmymed" is 3 or less. Can change this. */ -static int get_median_candidates(double *mymed, int nmymed, +static int get_median_candidates(double *mymed, int nmymed, double *medians, int nmedians, double validmax, commStruct *comm) { @@ -1103,7 +1066,7 @@ double *dotCopy = NULL; /* MAXLENGTH is 2^(DEPTHMAX-1) */ #define DEPTHMAX 5 -#define MAXLENGTH 16 +#define MAXLENGTH 16 static int depthCount = 0; static int serialIterations=0; @@ -1145,7 +1108,7 @@ int i; levelCount[DEPTHMAX] += count; } } - depthCount++; + depthCount++; } } @@ -1187,7 +1150,7 @@ MPI_Status status; MPI_Reduce(¶llelIterations, &parMax, 1, MPI_INT, MPI_MAX, print_proc, comm); MPI_Reduce(¶llelIterations, &parSum, 1, MPI_INT, MPI_SUM, print_proc, comm); - /* Get the iteration count from the rank 0 process of each parallel median find + /* Get the iteration count from the rank 0 process of each parallel median find * calculation. */ if (print_proc == rank){ diff --git a/packages/zoltan/src/par/par_stats.c b/packages/zoltan/src/par/par_stats.c index 3056f5282e..af5b3bb731 100644 --- a/packages/zoltan/src/par/par_stats.c +++ b/packages/zoltan/src/par/par_stats.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -80,10 +43,10 @@ void Zoltan_Print_Stats (MPI_Comm communicator, int debug_proc, double x, char * MPI_Comm_rank(communicator, &proc); MPI_Comm_size(communicator, &num_proc); - MPI_Reduce((void *)&x, (void *)&sum, 1, MPI_DOUBLE, MPI_SUM, debug_proc, + MPI_Reduce((void *)&x, (void *)&sum, 1, MPI_DOUBLE, MPI_SUM, debug_proc, communicator); - MPI_Reduce((void *)&x, (void *)&max, 1, MPI_DOUBLE, MPI_MAX, debug_proc, + MPI_Reduce((void *)&x, (void *)&max, 1, MPI_DOUBLE, MPI_MAX, debug_proc, communicator); if (proc == debug_proc) { diff --git a/packages/zoltan/src/par/par_sync.c b/packages/zoltan/src/par/par_sync.c index 4a04d2b5fb..e9ef5f19c1 100644 --- a/packages/zoltan/src/par/par_sync.c +++ b/packages/zoltan/src/par/par_sync.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -75,13 +38,13 @@ extern "C" { void Zoltan_Print_Sync_Start(MPI_Comm communicator, int do_print_line) { -/* - * Routine to allow I/O between Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End to be +/* + * Routine to allow I/O between Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End to be * printed by each processor in the communicator entirely before the next * processor begins its I/O. The printing sequence is from proc = 0 to the * last processor, where the last processor is num_proc - 1. * - * The do_print_line argument is a boolean variable. If true, a line of # + * The do_print_line argument is a boolean variable. If true, a line of # * is printed to indicate the start of a Print_Sync I/O block. * * NOTE: THERE CAN BE NO COMMUNICATION BETWEEN THESE CALLS. @@ -98,7 +61,7 @@ int proc; MPI_Comm_rank(communicator, &proc); - /* This strategy for computing the type assumes that all calls to + /* This strategy for computing the type assumes that all calls to * Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End are made with * the same sized communicator. */ @@ -132,12 +95,12 @@ int proc; void Zoltan_Print_Sync_End(MPI_Comm communicator, int do_print_line) { /* - * Routine to allow I/O between Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End to be + * Routine to allow I/O between Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End to be * printed by each processor in the communicator entirely before the next * processor begins its I/O. The printing sequence is from proc = 0 to the * last processor, where the last processor is num_proc - 1. * - * The do_print_line argument is a boolean variable. If true, a line of # + * The do_print_line argument is a boolean variable. If true, a line of # * is printed to indicate the start of a Print_Sync I/O block. * * NOTE: THERE CAN BE NO COMMUNICATION BETWEEN THESE CALLS. @@ -156,7 +119,7 @@ char msg[256]; fflush(stdout); - /* This strategy for computing the type assumes that all calls to + /* This strategy for computing the type assumes that all calls to * Zoltan_Print_Sync_Start and Zoltan_Print_Sync_End are made with * the same sized communicator. */ @@ -165,7 +128,7 @@ char msg[256]; if (proc < num_proc -1) { to = proc + 1; - if (MPI_Send((void *) &flag, 1, MPI_INT, to, type, communicator) + if (MPI_Send((void *) &flag, 1, MPI_INT, to, type, communicator) != MPI_SUCCESS ) { sprintf(msg, "MPI_Send failed, message type %d.", type); ZOLTAN_PRINT_ERROR(proc, yo, msg); diff --git a/packages/zoltan/src/par/par_tflops_special.c b/packages/zoltan/src/par/par_tflops_special.c index 231cad1a51..1423e92411 100644 --- a/packages/zoltan/src/par/par_tflops_special.c +++ b/packages/zoltan/src/par/par_tflops_special.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include @@ -56,7 +19,7 @@ extern "C" { #endif -/* Generic Tflops_special routines to avoid certain types of +/* Generic Tflops_special routines to avoid certain types of collective communication routines. */ void Zoltan_RB_scan_double( @@ -112,7 +75,7 @@ void Zoltan_RB_scan_double( MPI_Recv(tmpin, count, MPI_DOUBLE, to, tag, local_comm, &status); for (i=0; i> hbit) != 1; hbit++); - + nprocs_small = 1 << hbit; if (nprocs_small * 2 == nprocs) { nprocs_small *= 2; hbit++; } - + to = proclower + (rank ^ nprocs_small); if (rank & nprocs_small) { /* processors greater than largest power of 2 */ MPI_Send(x, count, MPI_DOUBLE, to, tag, comm); @@ -172,7 +135,7 @@ void Zoltan_RB_sum_double( MPI_Recv(tmp, count, MPI_DOUBLE, to, tag, comm, &status); for (i=0; i> 1; mask; mask >>= 1) { /* binary exchange */ tag++; partner = proclower + (rank ^ mask); @@ -180,7 +143,7 @@ void Zoltan_RB_sum_double( MPI_Recv(tmp, count, MPI_DOUBLE, partner, tag, comm, &status); for (i=0; i> hbit) != 1; hbit++); - + nprocs_small = 1 << hbit; if (nprocs_small * 2 == nprocs) { nprocs_small *= 2; hbit++; } - + to = proclower + (rank ^ nprocs_small); if (rank & nprocs_small) { /* processors greater than largest power of 2 */ MPI_Send(x, count, MPI_DOUBLE, to, tag, comm); @@ -270,7 +233,7 @@ void Zoltan_RB_bcast_doubles( MPI_Comm comm ) { - int tag = 32280; + int tag = 32280; int i; MPI_Status status; @@ -299,7 +262,7 @@ void Zoltan_RB_gather_double( MPI_Comm comm ) { - int tag = 32180; + int tag = 32180; int i; MPI_Status status; diff --git a/packages/zoltan/src/par/par_tflops_special_const.h b/packages/zoltan/src/par/par_tflops_special_const.h index 9d809f91fd..0fb3a8c7aa 100644 --- a/packages/zoltan/src/par/par_tflops_special_const.h +++ b/packages/zoltan/src/par/par_tflops_special_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PAR_TFLOPS_SPECIAL_H diff --git a/packages/zoltan/src/params/README b/packages/zoltan/src/params/README index 02599a4c03..1e0bc06fba 100644 --- a/packages/zoltan/src/params/README +++ b/packages/zoltan/src/params/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER PARAMS DIRECTORY -- Routines for setting parameter values diff --git a/packages/zoltan/src/params/assign_param_vals.c b/packages/zoltan/src/params/assign_param_vals.c index 1821c8e86d..1c5866f838 100644 --- a/packages/zoltan/src/params/assign_param_vals.c +++ b/packages/zoltan/src/params/assign_param_vals.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -83,7 +46,7 @@ int debug_level, /* level for output of debugging info */ int proc, /* processor # (controls debug printing) */ int print_proc /* processor that should perform printing */ ) -{ +{ char *yo = "Zoltan_Assign_Param_Vals"; char msg[256]; char *name; /* name of parameter being reset */ @@ -119,7 +82,7 @@ int print_proc /* processor that should perform printing */ ierr = ZOLTAN_WARN; if (debug_level > 0 && proc == print_proc) { sprintf(msg, "Parameter %s is not bound " - "to any variable. Parameter ignored.\n", + "to any variable. Parameter ignored.\n", param_ptr->name); ZOLTAN_PRINT_WARN(proc, yo, msg); } @@ -130,7 +93,7 @@ int print_proc /* processor that should perform printing */ ierr = ZOLTAN_WARN; if (debug_level > 0 && proc == print_proc) { sprintf(msg, "Invalid index %d for parameter %s. " - "Parameter entry ignored.\n", + "Parameter entry ignored.\n", index, param_ptr->name); ZOLTAN_PRINT_WARN(proc, yo, msg); } @@ -140,7 +103,7 @@ int print_proc /* processor that should perform printing */ if (index == -1){ /* Set all entries in a param vector. */ lo = 0; - hi = param_ptr->length; + hi = param_ptr->length; if (hi == 0) hi = 1; /* Special case for scalar parameters. */ } else { /* Set just one entry in the param vector. */ @@ -149,7 +112,7 @@ int print_proc /* processor that should perform printing */ } /* Figure out what type it is and read value. */ - if (!strcmp(param_ptr->type, "INT") || + if (!strcmp(param_ptr->type, "INT") || !strcmp(param_ptr->type, "INTEGER")) { /* First special case if True or False */ if (*val == 'T') @@ -215,55 +178,55 @@ int i; while (param_ptr->name != NULL) { if (param_ptr->ptr != NULL) { - if (!strcmp(param_ptr->type, "INT") || + if (!strcmp(param_ptr->type, "INT") || !strcmp(param_ptr->type, "INTEGER")) { - - if (param_ptr->length < 1) - printf("ZOLTAN Parameter %s = %d\n", + + if (param_ptr->length < 1) + printf("ZOLTAN Parameter %s = %d\n", param_ptr->name, *((int *) param_ptr->ptr)); else for (i=0; ilength; i++) - printf("ZOLTAN Parameter %s = %d\n", + printf("ZOLTAN Parameter %s = %d\n", param_ptr->name, ((int *) param_ptr->ptr)[i]); - + } else if (!strcmp(param_ptr->type, "FLOAT") || !strcmp(param_ptr->type, "REAL")) { - if (param_ptr->length < 1) - printf("ZOLTAN Parameter %s = %f\n", + if (param_ptr->length < 1) + printf("ZOLTAN Parameter %s = %f\n", param_ptr->name, *((float *) param_ptr->ptr)); else for (i=0; ilength; i++) - printf("ZOLTAN Parameter %s = %f\n", + printf("ZOLTAN Parameter %s = %f\n", param_ptr->name, ((float *) param_ptr->ptr)[i]); - + } else if (!strcmp(param_ptr->type, "DOUBLE")) { - if (param_ptr->length < 1) - printf("ZOLTAN Parameter %s = %f\n", + if (param_ptr->length < 1) + printf("ZOLTAN Parameter %s = %f\n", param_ptr->name, *((double *) param_ptr->ptr)); else for (i=0; ilength; i++) - printf("ZOLTAN Parameter %s = %f\n", + printf("ZOLTAN Parameter %s = %f\n", param_ptr->name, ((double *) param_ptr->ptr)[i]); - + } else if (!strcmp(param_ptr->type, "LONG")) { - if (param_ptr->length < 1) - printf("ZOLTAN Parameter %s = %ld\n", + if (param_ptr->length < 1) + printf("ZOLTAN Parameter %s = %ld\n", param_ptr->name, *((long *) param_ptr->ptr)); else for (i=0; ilength; i++) - printf("ZOLTAN Parameter %s = %ld\n", + printf("ZOLTAN Parameter %s = %ld\n", param_ptr->name, ((long *) param_ptr->ptr)[i]); - + } else if (!strcmp(param_ptr->type, "STRING")) { - printf("ZOLTAN Parameter %s = %s\n", + printf("ZOLTAN Parameter %s = %s\n", param_ptr->name, (char *) param_ptr->ptr); } else if (!strcmp(param_ptr->type, "CHAR")) { - printf("ZOLTAN Parameter %s = %c\n", + printf("ZOLTAN Parameter %s = %c\n", param_ptr->name, *((char *) param_ptr->ptr)); } } diff --git a/packages/zoltan/src/params/bind_param.c b/packages/zoltan/src/params/bind_param.c index 8bc7d51bcf..71f8b7bca8 100644 --- a/packages/zoltan/src/params/bind_param.c +++ b/packages/zoltan/src/params/bind_param.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -63,7 +26,7 @@ extern "C" { int Zoltan_Bind_Param( PARAM_VARS *params, /* parameter structure */ char *name, /* parameter name */ -void *var /* pointer to variable to be associated +void *var /* pointer to variable to be associated with the parameter name */ ) { @@ -73,7 +36,7 @@ void *var /* pointer to variable to be associated int Zoltan_Bind_Param_Vec( PARAM_VARS *params, /* parameter structure */ char *name, /* parameter name */ -void *var, /* pointer to variable to be associated +void *var, /* pointer to variable to be associated with the parameter name */ int dim /* dimension of parameter vector */ ) diff --git a/packages/zoltan/src/params/check_param.c b/packages/zoltan/src/params/check_param.c index 7884b3e8b3..30f25506fb 100644 --- a/packages/zoltan/src/params/check_param.c +++ b/packages/zoltan/src/params/check_param.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -66,7 +29,7 @@ const char *val, /* new value for parameter */ PARAM_VARS * params, /* structure describing parameters */ PARAM_UTYPE *result, /* pointer to return value */ int *matched_index) /* where in struct the match occurs */ -{ +{ char *yo = "Zoltan_Check_Param"; char msg[256]; int i; /* loop counter */ @@ -156,7 +119,7 @@ int *matched_index) /* where in struct the match occurs */ } else { - sprintf(msg, "Bad type for parameter `%s'", + sprintf(msg, "Bad type for parameter `%s'", params->name); ZOLTAN_PRINT_WARN(-1, yo, msg); status = 2; diff --git a/packages/zoltan/src/params/free_params.c b/packages/zoltan/src/params/free_params.c index 7244ab3595..3f01cd7b93 100644 --- a/packages/zoltan/src/params/free_params.c +++ b/packages/zoltan/src/params/free_params.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -81,8 +44,8 @@ PARAM_LIST **params) /* parameters structure */ *params = NULL; } - -size_t Zoltan_Serialize_Params_Size(struct Zoltan_Struct const *from) + +size_t Zoltan_Serialize_Params_Size(struct Zoltan_Struct const *from) { /* Count the number of parameters */ PARAM_LIST const *param = from->Params; @@ -155,7 +118,7 @@ int Zoltan_Copy_Params(PARAM_LIST **to, PARAM_LIST const *from) prev = NULL; while (from) { - + param = (PARAM_LIST *) ZOLTAN_MALLOC(sizeof(PARAM_LIST)); if (param == NULL) { Zoltan_Free_Params(to); diff --git a/packages/zoltan/src/params/key_params.c b/packages/zoltan/src/params/key_params.c index efafed5f31..9f0d059d97 100644 --- a/packages/zoltan/src/params/key_params.c +++ b/packages/zoltan/src/params/key_params.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -90,7 +53,7 @@ static PARAM_VARS Key_params[] = { /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -/* +/* * Handle parameter changes for variables stored in Zoltan structure. */ @@ -116,7 +79,7 @@ int idx /* index of vector param, -1 if scalar */ switch (index) { case 0: /* Imbalance_Tol */ - if (result.def) + if (result.def) result.fval = ZOLTAN_LB_IMBALANCE_TOL_DEF; if (result.fval < 1.0) { sprintf(msg, "Invalid Imbalance_Tol value (%g) " @@ -207,7 +170,7 @@ int idx /* index of vector param, -1 if scalar */ zz->Debug_Proc = result.ival; status = 3; /* Don't add to Params field of ZZ */ break; - + case 6: /* Deterministic flag */ if (result.def) result.ival = ZOLTAN_DETERMINISTIC_DEF; @@ -272,7 +235,7 @@ int idx /* index of vector param, -1 if scalar */ } else if (strstr(result.sval, "PART")!=NULL) { /* list of every object's part assignment */ - tmp = ZOLTAN_LB_COMPLETE_EXPORT_LISTS; + tmp = ZOLTAN_LB_COMPLETE_EXPORT_LISTS; status = 3; } else if (strcmp(result.sval, "NONE")==0) { @@ -293,7 +256,7 @@ int idx /* index of vector param, -1 if scalar */ break; case 11: /* LB_Method */ - if (result.def) + if (result.def) strcpy(result.sval, "RCB"); status = Zoltan_LB_Set_LB_Method(zz,result.sval); if (status == ZOLTAN_OK) @@ -385,21 +348,21 @@ void Zoltan_Print_Key_Params(ZZ const *zz) { int i; for (i=0; i<(zz->Obj_Weight_Dim?zz->Obj_Weight_Dim:1); i++) - printf("ZOLTAN Parameter %s[%1d] = %f\n", Key_params[0].name, + printf("ZOLTAN Parameter %s[%1d] = %f\n", Key_params[0].name, i, zz->LB.Imbalance_Tol[i]); - printf("ZOLTAN Parameter %s = %s\n", Key_params[1].name, + printf("ZOLTAN Parameter %s = %s\n", Key_params[1].name, (zz->Migrate.Auto_Migrate ? "TRUE" : "FALSE")); - printf("ZOLTAN Parameter %s = %d\n", Key_params[18].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[18].name, zz->Migrate.Only_Proc_Changes); - printf("ZOLTAN Parameter %s = %d\n", Key_params[2].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[2].name, zz->Obj_Weight_Dim); - printf("ZOLTAN Parameter %s = %d\n", Key_params[3].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[3].name, zz->Edge_Weight_Dim); - printf("ZOLTAN Parameter %s = %d\n", Key_params[4].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[4].name, zz->Debug_Level); - printf("ZOLTAN Parameter %s = %d\n", Key_params[5].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[5].name, zz->Debug_Proc); - printf("ZOLTAN Parameter %s = %s\n", Key_params[6].name, + printf("ZOLTAN Parameter %s = %s\n", Key_params[6].name, (zz->Deterministic ? "TRUE" : "FALSE")); printf("ZOLTAN Parameter %s = %d ", Key_params[7].name, zz->Timer); if (zz->Timer == ZOLTAN_TIME_WALL) @@ -407,9 +370,9 @@ void Zoltan_Print_Key_Params(ZZ const *zz) else if (zz->Timer == ZOLTAN_TIME_CPU) printf("(cpu)"); printf("\n"); - printf("ZOLTAN Parameter %s = %d\n", Key_params[8].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[8].name, zz->Num_GID); - printf("ZOLTAN Parameter %s = %d\n", Key_params[9].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[9].name, zz->Num_LID); printf("ZOLTAN Parameter %s = ", Key_params[10].name); switch (zz->LB.Return_Lists) { @@ -434,15 +397,15 @@ void Zoltan_Print_Key_Params(ZZ const *zz) } if (zz->Tflops_Special) /* print only if set */ printf("ZOLTAN Parameter %s = %s\n", Key_params[12].name, "TRUE"); - printf("ZOLTAN Parameter %s = %d\n", Key_params[14].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[14].name, zz->LB.Num_Global_Parts_Param); - printf("ZOLTAN Parameter %s = %d\n", Key_params[16].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[16].name, zz->LB.Num_Local_Parts_Param); - printf("ZOLTAN Parameter %s = %d\n", Key_params[19].name, + printf("ZOLTAN Parameter %s = %d\n", Key_params[19].name, zz->LB.Remap_Flag); - printf("ZOLTAN Parameter %s = %d (%u)\n", Key_params[20].name, + printf("ZOLTAN Parameter %s = %d (%u)\n", Key_params[20].name, Zoltan_Seed(), Zoltan_Seed()); - printf("ZOLTAN Parameter %s = %s\n", Key_params[21].name, + printf("ZOLTAN Parameter %s = %s\n", Key_params[21].name, zz->LB.Approach); } /*****************************************************************************/ @@ -463,7 +426,7 @@ void Zoltan_Print_Configuration(char *indent) indent, zoltan_gno_datatype_name, (unsigned long)(sizeof(ZOLTAN_GNO_TYPE))); printf("%sMPI_Datatype for ZOLTAN_ID_TYPE: %s\n", indent, zoltan_mpi_id_datatype_name); - printf("%sMPI_Datatype for ZOLTAN_GNO_TYPE: %s\n", indent, + printf("%sMPI_Datatype for ZOLTAN_GNO_TYPE: %s\n", indent, Zoltan_mpi_gno_name()); /* Metis and ParMetis have different version numbers. Some @@ -493,7 +456,7 @@ void Zoltan_Print_Configuration(char *indent) #ifdef ZOLTAN_PTSCOTCH printf("%sThird party library: PTScotch ", indent); #ifdef SCOTCH_VERSION - printf("version %d_%d_%d\n", + printf("version %d_%d_%d\n", SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL); #endif #endif @@ -501,7 +464,7 @@ void Zoltan_Print_Configuration(char *indent) #ifdef ZOLTAN_SCOTCH printf("%sThird party library: Scotch ", indent); #ifdef SCOTCH_VERSION - printf("version %d_%d_%d\n", + printf("version %d_%d_%d\n", SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL); #endif #endif diff --git a/packages/zoltan/src/params/key_params.h b/packages/zoltan/src/params/key_params.h index 43954a8974..4ecc6b76c7 100644 --- a/packages/zoltan/src/params/key_params.h +++ b/packages/zoltan/src/params/key_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __KEY_PARAMS_H diff --git a/packages/zoltan/src/params/params_const.h b/packages/zoltan/src/params/params_const.h index 787d158014..919589f045 100644 --- a/packages/zoltan/src/params/params_const.h +++ b/packages/zoltan/src/params/params_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include @@ -106,7 +69,7 @@ typedef struct Param_List { } PARAM_LIST; /* API for general parameter setting functions */ -typedef int ZOLTAN_SET_PARAM_FN(char *, char *); +typedef int ZOLTAN_SET_PARAM_FN(char *, char *); typedef int ZOLTAN_SET_PARAM_VEC_FN(char *, int, char *); /* function declarations for parameter modification routines */ diff --git a/packages/zoltan/src/params/print_params.c b/packages/zoltan/src/params/print_params.c index b3d4c1c587..8e49691ec5 100644 --- a/packages/zoltan/src/params/print_params.c +++ b/packages/zoltan/src/params/print_params.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/params/set_param.c b/packages/zoltan/src/params/set_param.c index 71f6c7171a..47da457a0a 100644 --- a/packages/zoltan/src/params/set_param.c +++ b/packages/zoltan/src/params/set_param.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -83,7 +46,7 @@ static ZOLTAN_SET_PARAM_FN * Param_func[] = { Zoltan_Third_Set_Param, #if defined(ZOLTAN_PARMETIS) Zoltan_ParMetis_Set_Param, -#endif +#endif #if defined(ZOLTAN_SCOTCH) || defined(ZOLTAN_PTSCOTCH) Zoltan_Scotch_Set_Param, #endif @@ -138,9 +101,9 @@ int index /* index of vector parameter; -1 if scalar */ ZOLTAN_SET_PARAM_FN **func; /* pointer to parameter setting functions */ /* Status flag is used as follows: - * 0 -> matched and value passed all checks. - * 1 -> not matched. - * 2 -> matched, but failed checks. + * 0 -> matched and value passed all checks. + * 1 -> not matched. + * 2 -> matched, but failed checks. * 3 -> matched and OK, but don't add it to params list. * other -> more serious error (Zoltan return codes) */ @@ -168,7 +131,7 @@ int index /* index of vector parameter; -1 if scalar */ /* All parameter setting routines have been called, now finish up. */ if (status == 1) { /* Parameter name never found */ - sprintf(msg, "Parameter `%s' not found; not reset to `%s'.\n", + sprintf(msg, "Parameter `%s' not found; not reset to `%s'.\n", name, val); ZOLTAN_PRINT_WARN(zz->Proc, yo, msg); ZOLTAN_FREE(&name); @@ -180,7 +143,6 @@ int index /* index of vector parameter; -1 if scalar */ ZOLTAN_PRINT_WARN(zz->Proc, yo, msg); ZOLTAN_FREE(&name); ZOLTAN_FREE(&val); - } else { if (!strcmp(val, "DEFAULT")){ @@ -229,7 +191,7 @@ int index /* index of vector parameter; -1 if scalar */ ptr = zz->Params; while (ptr != NULL) { - if ((!strcmp(*name, ptr->name)) && (index == ptr->index)){ + if ((!strcmp(*name, ptr->name)) && (index == ptr->index)){ /* string and index match */ ZOLTAN_FREE(name); ZOLTAN_FREE(&(ptr->new_val)); @@ -271,7 +233,7 @@ int index /* index for vector param; -1 for scalars */ oldptr = NULL; ptr = zz->Params; while (ptr != NULL) { - if ((!strcmp(name, ptr->name)) && + if ((!strcmp(name, ptr->name)) && ((index == ptr->index) || (index == -1))){ /* String and index match. (Index -1 matches anything.) */ /* Remove parameter from list */ @@ -302,7 +264,7 @@ int debug_level, /* level for output of debugging info */ int proc, /* processor # (controls debug printing) */ int print_proc /* processor that should perform printing */ ) -{ +{ char *name; /* name of parameter being reset */ char *val; /* new value for parameter */ int index; /* index of parameter entry */ diff --git a/packages/zoltan/src/phg/README b/packages/zoltan/src/phg/README index ff38e36f90..2628ef6d9c 100644 --- a/packages/zoltan/src/phg/README +++ b/packages/zoltan/src/phg/README @@ -1,44 +1 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Source files for parallel hypergraph partitioning. diff --git a/packages/zoltan/src/phg/phg.c b/packages/zoltan/src/phg/phg.c index 94d912e563..a4df761c60 100644 --- a/packages/zoltan/src/phg/phg.c +++ b/packages/zoltan/src/phg/phg.c @@ -1,50 +1,13 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ - - +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER + + #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -62,22 +25,22 @@ extern "C" { /* #define CHECK_LEFTALONE_VERTICES */ - + /* - * Main routine for Zoltan interface to hypergraph partitioning. + * Main routine for Zoltan interface to hypergraph partitioning. * Also routines that build input data structures, set parameters, etc. */ /* prototypes for static functions: */ static int Zoltan_PHG_Output_Parts(ZZ*, ZHG*, Partition); -static int Zoltan_PHG_Return_Lists(ZZ*, ZHG*, int*, ZOLTAN_ID_PTR*, +static int Zoltan_PHG_Return_Lists(ZZ*, ZHG*, int*, ZOLTAN_ID_PTR*, ZOLTAN_ID_PTR*, int**, int**); -#ifdef CHECK_LEFTALONE_VERTICES -static int findAndSaveLeftAloneVertices(ZZ *zz, HGraph *hg, int p, +#ifdef CHECK_LEFTALONE_VERTICES +static int findAndSaveLeftAloneVertices(ZZ *zz, HGraph *hg, int p, Partition parts, - PHGPartParams *hgp) + PHGPartParams *hgp) { char *yo="findAndSaveLeftAloneVertices"; int *lneigh[2]={NULL, NULL}, *neigh[2]={NULL, NULL}, i, j, ierr=ZOLTAN_OK; @@ -92,12 +55,12 @@ static int findAndSaveLeftAloneVertices(ZZ *zz, HGraph *hg, int p, for (j = hg->hindex[i]; j < hg->hindex[i+1]; ++j) ++lpins[i*p+parts[hg->hvertex[j]]]; if (hg->nEdge) - MPI_Allreduce(lpins, pins, p*hg->nEdge, MPI_INT, MPI_SUM, + MPI_Allreduce(lpins, pins, p*hg->nEdge, MPI_INT, MPI_SUM, hgc->row_comm); - + if (hg->nVtx && !(lneigh[0] = (int*) ZOLTAN_MALLOC(2 * hg->nVtx * sizeof(int)))) MEMORY_ERROR; - if (!hgc->myProc_y) + if (!hgc->myProc_y) if (hg->nVtx && !(neigh[0] = (int*) ZOLTAN_MALLOC(2 * hg->nVtx * sizeof(int)))) MEMORY_ERROR; @@ -115,15 +78,15 @@ static int findAndSaveLeftAloneVertices(ZZ *zz, HGraph *hg, int p, lneigh[0][i] += (pins[edge*p+pno]-1); /* exclude the vertex's itself */ for (k=0; knVtx) + + if (hg->nVtx) MPI_Reduce(lneigh[0], neigh[0], 2*hg->nVtx, MPI_INT, MPI_SUM, 0, hgc->col_comm); if (!hgc->myProc_y) { - int alone=0, galone=0; + int alone=0, galone=0; for (i=0; inVtx; ++i) if (!neigh[0] && neigh[1]) { ++alone; @@ -132,14 +95,14 @@ static int findAndSaveLeftAloneVertices(ZZ *zz, HGraph *hg, int p, } MPI_Reduce(&alone, &galone, 1, MPI_INT, MPI_SUM, 0, hgc->row_comm); if (!hgc->myProc) - uprintf(hgc, "There are %d left-alone vertices\n", galone); + uprintf(hgc, "There are %d left-alone vertices\n", galone); } End: Zoltan_Multifree(__FILE__,__LINE__, 4, &lpins, &pins, &lneigh[0], &neigh[0]); return ierr; } #endif - + /* UVCUVC DEBUG PRINT static double detailed_balance_info( @@ -155,30 +118,30 @@ static double detailed_balance_info( char *yo = "detailed_balance_info"; PHGComm *hgc=NULL; int part_dim = (hg->VtxWeightDim ? hg->VtxWeightDim : 1); - + if (!hg || !hg->comm || !hg->comm->row_comm) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unable to compute balance"); return 1.0; - } + } - hgc=hg->comm; + hgc=hg->comm; if (!(lsize_w = (double*) ZOLTAN_CALLOC (2*p, sizeof(double)))) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); return ZOLTAN_MEMERR; } size_w = lsize_w + p; - + if (hg->vwgt) for (i = 0; i < hg->nVtx; i++) lsize_w[part[i]] += hg->vwgt[i*hg->VtxWeightDim]; else for (i = 0; i < hg->nVtx; i++) lsize_w[part[i]]++; - + MPI_Allreduce(lsize_w, size_w, p, MPI_DOUBLE, MPI_SUM, hg->comm->row_comm); - + max_imbal = tot_w = 0.0; - for (i = 0; i < p; i++) + for (i = 0; i < p; i++) tot_w += size_w[i]; if (tot_w) { if (!zz->Proc) @@ -193,7 +156,7 @@ static double detailed_balance_info( if (ib>max_imbal) max_imbal = ib; } else if (!zz->Proc) - uprintf(hgc, "%d\t%.1lf\t%.1lf\tN/A\n", + uprintf(hgc, "%d\t%.1lf\t%.1lf\tN/A\n", i, size_w[i], this_part_size*tot_w); } if (!zz->Proc) @@ -213,8 +176,8 @@ static double detailed_balance_info( int Zoltan_PHG( ZZ *zz, /* The Zoltan structure */ -float *part_sizes, /* Input: Array of size zz->Num_Global_Parts - containing the percentage of work assigned +float *part_sizes, /* Input: Array of size zz->Num_Global_Parts + containing the percentage of work assigned to each partition. */ int *num_imp, /* not computed */ ZOLTAN_ID_PTR *imp_gids, /* not computed */ @@ -233,10 +196,10 @@ int **exp_to_part ) /* list of partitions to which exported objs ZHG *zoltan_hg = NULL; PHGPartParams hgp; /* Hypergraph parameters. */ HGraph *hg = NULL; /* Hypergraph itself */ - Partition parts = NULL; /* Partition assignments in + Partition parts = NULL; /* Partition assignments in 2D distribution. */ int err = ZOLTAN_OK, p=0; - struct phg_timer_indices *timer = NULL; + struct phg_timer_indices *timer = NULL; int do_timing = 0; #ifdef CEDRIC_2D_PARTITIONS @@ -254,7 +217,7 @@ int **exp_to_part ) /* list of partitions to which exported objs *imp_gids = *exp_gids = NULL; *imp_lids = *exp_lids = NULL; *imp_procs = *exp_procs = NULL; - + /* Initialize HG parameters. */ err = Zoltan_PHG_Initialize_Params(zz, part_sizes, zz->LB.Method, &hgp); if (err != ZOLTAN_OK) @@ -265,24 +228,24 @@ int **exp_to_part ) /* list of partitions to which exported objs Zoltan_PHG_Timers_init(zz); } timer = Zoltan_PHG_LB_Data_timers(zz); - if (timer->all < 0) + if (timer->all < 0) timer->all = Zoltan_Timer_Init(zz->ZTime, 1, "Zoltan_PHG"); } if (hgp.use_timers > 1) { do_timing = 1; - if (timer->build < 0) + if (timer->build < 0) timer->build = Zoltan_Timer_Init(zz->ZTime, 1, "Build"); - if (timer->setupvmap < 0) + if (timer->setupvmap < 0) timer->setupvmap = Zoltan_Timer_Init(zz->ZTime, 0, "Vmaps"); } - if (hgp.use_timers) + if (hgp.use_timers) ZOLTAN_TIMER_START(zz->ZTime, timer->all, zz->Communicator); - + if (do_timing) ZOLTAN_TIMER_START(zz->ZTime, timer->build, zz->Communicator); - + /* build initial Zoltan hypergraph from callback functions. */ err = Zoltan_PHG_Build_Hypergraph (zz, &zoltan_hg, &parts, &hgp); @@ -300,7 +263,7 @@ int **exp_to_part ) /* list of partitions to which exported objs } hg = &zoltan_hg->HG; - p = zz->LB.Num_Global_Parts; + p = zz->LB.Num_Global_Parts; zoltan_hg->HG.redl = MAX(hgp.redl, p); /* redl needs to be dynamic */ /* RTHRTH -- redl may need to be scaled by number of procs */ @@ -312,7 +275,7 @@ int **exp_to_part ) /* list of partitions to which exported objs value */ if (hgp.UsePrefPart || hgp.UseFixedVtx) { /* allocate memory for pref_part */ - if (hg->nVtx && + if (hg->nVtx && !(hg->pref_part = (int*) ZOLTAN_MALLOC (sizeof(int) * hg->nVtx))) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error building hypergraph."); goto End; @@ -322,14 +285,14 @@ int **exp_to_part ) /* list of partitions to which exported objs UVCUVC: TODO: this code (and alloc of pref_part) should go to Build_Hypergraph later */ memcpy(hg->pref_part, parts, sizeof(int) * hg->nVtx); - + if (hgp.UseFixedVtx) { int i; for (i=0; inVtx; ++i) if (hg->fixed_part[i]>=0) hg->pref_part[i] = hg->fixed_part[i]; else if (!hgp.UsePrefPart) - hg->pref_part[i] = -1; + hg->pref_part[i] = -1; } hgp.UsePrefPart |= hgp.UseFixedVtx; @@ -350,7 +313,7 @@ int **exp_to_part ) /* list of partitions to which exported objs } err = Zoltan_PHG_ParKway(zz, hg, p, parts, &hgp); - if (err != ZOLTAN_OK) + if (err != ZOLTAN_OK) goto End; if (do_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->parkway, zz->Communicator); @@ -362,11 +325,11 @@ int **exp_to_part ) /* list of partitions to which exported objs } err = Zoltan_PHG_PaToH(zz, hg, p, parts, &hgp); - if (err != ZOLTAN_OK) + if (err != ZOLTAN_OK) goto End; if (hgp.use_timers > 1) ZOLTAN_TIMER_STOP(zz->ZTime, timer->patoh, zz->Communicator); - } + } else { /* it must be PHG */ if (hgp.keep_tree) { @@ -374,7 +337,7 @@ int **exp_to_part ) /* list of partitions to which exported objs Zoltan_PHG_Tree_create(p, zz); } - /* UVC: if it is bisection anyways; no need to create vmap etc; + /* UVC: if it is bisection anyways; no need to create vmap etc; rdivide is going to call Zoltan_PHG_Partition anyways... */ if (hgp.globalcomm.Communicator != MPI_COMM_NULL) { /* This processor is part of the 2D data distribution; it should @@ -394,11 +357,11 @@ int **exp_to_part ) /* list of partitions to which exported objs } else { int i; - - if (do_timing) + + if (do_timing) ZOLTAN_TIMER_START(zz->ZTime, timer->setupvmap, zz->Communicator); /* vmap associates original vertices to sub hypergraphs */ - if (hg->nVtx && + if (hg->nVtx && !(hg->vmap = (int*) ZOLTAN_MALLOC(hg->nVtx*sizeof (int)))) { err = ZOLTAN_MEMERR; ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); @@ -406,24 +369,24 @@ int **exp_to_part ) /* list of partitions to which exported objs } for (i = 0; i < hg->nVtx; ++i) hg->vmap[i] = i; - - if (do_timing) + + if (do_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->setupvmap, zz->Communicator); /* partition hypergraph */ err = Zoltan_PHG_rdivide (0, p-1, parts, zz, hg, &hgp, 0, 1); - if (hgp.output_level >= PHG_DEBUG_LIST) + if (hgp.output_level >= PHG_DEBUG_LIST) uprintf(hg->comm, "FINAL %3d |V|=%6d |E|=%6d #pins=%6d %s/%s/%s p=%d " - "bal=%.2f cutl=%.2f\n", + "bal=%.2f cutl=%.2f\n", hg->info, hg->nVtx, hg->nEdge, hg->nPins, - hgp.redm_str, hgp.coarsepartition_str, + hgp.redm_str, hgp.coarsepartition_str, hgp.refinement_str, p, Zoltan_PHG_Compute_Balance(zz, hg, hgp.part_sizes, 0, p, parts), Zoltan_PHG_Compute_ConCut(hg->comm, hg, parts, p, &err)); - + if (err != ZOLTAN_OK) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error partitioning hypergraph."); goto End; @@ -465,7 +428,7 @@ int **exp_to_part ) /* list of partitions to which exported objs /* UVC DEBUG PRINT if (!strcasecmp(hgp->hgraph_method, "REFINE")){ - uprintf(hg->comm, + uprintf(hg->comm, "UVC ATTHEEND |V|=%6d |E|=%6d #pins=%6d p=%d bal=%.2f cutl=%.2f\n", hg->nVtx, hg->nEdge, hg->nPins, p, Zoltan_PHG_Compute_Balance(zz, hg, part_sizes, p, parts), @@ -474,20 +437,20 @@ int **exp_to_part ) /* list of partitions to which exported objs } */ - + /* Initialize these timers here so their output is near end of printout */ if (do_timing) - if (timer->retlist < 0) + if (timer->retlist < 0) timer->retlist = Zoltan_Timer_Init(zz->ZTime, 1, "Return_Lists"); if (hgp.use_timers) - if (timer->finaloutput < 0) + if (timer->finaloutput < 0) timer->finaloutput = Zoltan_Timer_Init(zz->ZTime, 1, "Final_Output"); - if (do_timing) + if (do_timing) ZOLTAN_TIMER_START(zz->ZTime, timer->retlist, zz->Communicator); - /* Build Zoltan's Output_Parts, mapped from 2D distribution + /* Build Zoltan's Output_Parts, mapped from 2D distribution to input distribution. */ Zoltan_PHG_Output_Parts(zz, zoltan_hg, parts); @@ -495,7 +458,7 @@ int **exp_to_part ) /* list of partitions to which exported objs /* Build Zoltan's return arguments. */ Zoltan_PHG_Return_Lists(zz, zoltan_hg, num_exp, exp_gids, exp_lids, exp_procs, exp_to_part); - + if (do_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->retlist, zz->Communicator); @@ -504,7 +467,7 @@ int **exp_to_part ) /* list of partitions to which exported objs ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Memory error.") else if (err != ZOLTAN_OK) ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Error partitioning hypergraph.") - + /* KDDKDD The following code prints a final quality result even when * KDDKDD phg_output_level is zero. It is useful for our tests and * KDDKDD data collection. */ @@ -513,7 +476,7 @@ int **exp_to_part ) /* list of partitions to which exported objs static double balsum = 0.0, cutlsum = 0.0, cutnsum = 0.0, movesum = 0.0, repartsum = 0.0; static double balmax = 0.0, cutlmax = 0.0, cutnmax = 0.0, movemax = 0.0, repartmax = 0.0; static double balmin = 1e100, cutlmin = 1e100, cutnmin = 1e100, movemin = 1e100, repartmin = 1e100; - double bal = 0.; + double bal = 0.; double cutl = 0.; /* Connnectivity cuts: sum_over_edges((npart-1)*ewgt) */ double cutn = 0.; /* Net cuts: sum_over_edges((nparts>1)*ewgt) */ @@ -523,7 +486,7 @@ int **exp_to_part ) /* list of partitions to which exported objs double move=0.0, gmove; /* local and global migration costs */ double repart=0.0; /* total repartitioning cost: comcost x multiplier + migration_cost */ - + if (hgp.use_timers) { /* Do not include final output time in partitioning time */ ZOLTAN_TIMER_STOP(zz->ZTime, timer->all, zz->Communicator); @@ -546,14 +509,14 @@ int **exp_to_part ) /* list of partitions to which exported objs } if (!err) { - + /* Add in cut contributions from removed edges */ MPI_Allreduce(&(zoltan_hg->nHedges), &gnremove, 1, MPI_INT, MPI_SUM, zz->Communicator); if (gnremove) { err = Zoltan_PHG_Cuts(zz, zoltan_hg, rlocal); MPI_Allreduce(rlocal, rglobal, 2, MPI_DOUBLE,MPI_SUM,zz->Communicator); - + cutl += rglobal[0]; cutn += rglobal[1]; } @@ -577,24 +540,24 @@ int **exp_to_part ) /* list of partitions to which exported objs if (bal > balmax) balmax = bal; if (bal < balmin) balmin = bal; nRuns++; - + if (zz->Proc == 0) { - uprintf(hg->comm, - "STATS Runs %d bal CURRENT %f MAX %f MIN %f AVG %f\n", + uprintf(hg->comm, + "STATS Runs %d bal CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, bal, balmax, balmin, balsum/nRuns); - uprintf(hg->comm, - "STATS Runs %d cutl CURRENT %f MAX %f MIN %f AVG %f\n", + uprintf(hg->comm, + "STATS Runs %d cutl CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, cutl, cutlmax, cutlmin, cutlsum/nRuns); - uprintf(hg->comm, - "STATS Runs %d cutn CURRENT %f MAX %f MIN %f AVG %f\n", + uprintf(hg->comm, + "STATS Runs %d cutn CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, cutn, cutnmax, cutnmin, cutnsum/nRuns); uprintf(hg->comm, "STATS Runs %d %s CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, (zoltan_hg->showMoveVol) ? "moveVol" : "moveCnt", gmove, movemax, movemin, movesum/nRuns); - if (zoltan_hg->showMoveVol) + if (zoltan_hg->showMoveVol) uprintf(hg->comm, "STATS Runs %d repart CURRENT %f MAX %f MIN %f AVG %f\n", - nRuns, repart, repartmax, repartmin, repartsum/nRuns); + nRuns, repart, repartmax, repartmin, repartsum/nRuns); } } @@ -604,7 +567,7 @@ int **exp_to_part ) /* list of partitions to which exported objs } } /* KDDKDD End of printing section. */ - + ZOLTAN_FREE(&parts); if (zoltan_hg != NULL) { Zoltan_PHG_Free_Hypergraph_Data(zoltan_hg); @@ -639,13 +602,13 @@ void Zoltan_PHG_Free_Hypergraph_Data(ZHG *zoltan_hg) Zoltan_Input_HG_Free(zoltan_hg); } } - + /*****************************************************************************/ int Zoltan_PHG_Initialize_Params( ZZ *zz, /* the Zoltan data structure */ float *part_sizes, /* preallocation assumes object weight dimension is one */ - int hgraph_model, /* GRAPH or HYPERGRAPH -- some default param values + int hgraph_model, /* GRAPH or HYPERGRAPH -- some default param values depend on the model. */ PHGPartParams *hgp ) @@ -658,19 +621,19 @@ int Zoltan_PHG_Initialize_Params( char add_obj_weight[MAX_PARAM_STRING_LEN]; char edge_weight_op[MAX_PARAM_STRING_LEN]; char cut_objective[MAX_PARAM_STRING_LEN]; - char *package = hgp->hgraph_pkg; + char *package = hgp->hgraph_pkg; char *method = hgp->hgraph_method; char buf[1024]; memset(hgp, 0, sizeof(*hgp)); /* in the future if we forget to initialize another param at least it will be 0 */ - + Zoltan_Bind_Param(PHG_params, "HYPERGRAPH_PACKAGE", &hgp->hgraph_pkg); Zoltan_Bind_Param(PHG_params, "PHG_MULTILEVEL", &hgp->useMultilevel); Zoltan_Bind_Param(PHG_params, "PHG_OUTPUT_LEVEL", &hgp->output_level); - Zoltan_Bind_Param(PHG_params, "FINAL_OUTPUT", &hgp->final_output); - Zoltan_Bind_Param(PHG_params, "CHECK_GRAPH", &hgp->check_graph); - Zoltan_Bind_Param(PHG_params, "CHECK_HYPERGRAPH", &hgp->check_graph); + Zoltan_Bind_Param(PHG_params, "FINAL_OUTPUT", &hgp->final_output); + Zoltan_Bind_Param(PHG_params, "CHECK_GRAPH", &hgp->check_graph); + Zoltan_Bind_Param(PHG_params, "CHECK_HYPERGRAPH", &hgp->check_graph); Zoltan_Bind_Param(PHG_params, "PHG_NPROC_VERTEX", &hgp->nProc_x_req); Zoltan_Bind_Param(PHG_params, "PHG_NPROC_EDGE", &hgp->nProc_y_req); Zoltan_Bind_Param(PHG_params, "PHG_COARSENING_LIMIT", &hgp->redl); @@ -684,26 +647,26 @@ int Zoltan_PHG_Initialize_Params( Zoltan_Bind_Param(PHG_params, "PHG_DIRECT_KWAY", &hgp->kway); Zoltan_Bind_Param(PHG_params, "HYBRID_REDUCTION_FACTOR", &hgp->geometric_red); Zoltan_Bind_Param(PHG_params, "HYBRID_REDUCTION_LEVELS", - &hgp->geometric_levels); + &hgp->geometric_levels); Zoltan_Bind_Param(PHG_params, "PHG_KEEP_TREE", &hgp->keep_tree); - Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_LOOP_LIMIT", + Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_LOOP_LIMIT", &hgp->fm_loop_limit); - Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_MAX_NEG_MOVE", - &hgp->fm_max_neg_move); - Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_QUALITY", - &hgp->refinement_quality); - Zoltan_Bind_Param(PHG_params, "PHG_COARSEPARTITION_METHOD", + Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_MAX_NEG_MOVE", + &hgp->fm_max_neg_move); + Zoltan_Bind_Param(PHG_params, "PHG_REFINEMENT_QUALITY", + &hgp->refinement_quality); + Zoltan_Bind_Param(PHG_params, "PHG_COARSEPARTITION_METHOD", hgp->coarsepartition_str); Zoltan_Bind_Param(PHG_params, "PHG_USE_TIMERS", - (void*) &hgp->use_timers); + (void*) &hgp->use_timers); Zoltan_Bind_Param(PHG_params, "USE_TIMERS", - (void*) &hgp->use_timers); + (void*) &hgp->use_timers); Zoltan_Bind_Param(PHG_params, "PHG_EDGE_SIZE_THRESHOLD", - (void*) &hgp->EdgeSizeThreshold); + (void*) &hgp->EdgeSizeThreshold); Zoltan_Bind_Param(PHG_params, "PHG_MATCH_EDGE_SIZE_THRESHOLD", - (void*) &hgp->MatchEdgeSizeThreshold); + (void*) &hgp->MatchEdgeSizeThreshold); Zoltan_Bind_Param(PHG_params, "PHG_BAL_TOL_ADJUSTMENT", - (void*) &hgp->bal_tol_adjustment); + (void*) &hgp->bal_tol_adjustment); Zoltan_Bind_Param(PHG_params, "PARKWAY_SERPART", (void *) hgp->parkway_serpart); Zoltan_Bind_Param(PHG_params, "PHG_CUT_OBJECTIVE", @@ -713,7 +676,7 @@ int Zoltan_PHG_Initialize_Params( Zoltan_Bind_Param(PHG_params, "PHG_EDGE_WEIGHT_OPERATION", (void *) edge_weight_op); Zoltan_Bind_Param(PHG_params, "PHG_RANDOMIZE_INPUT", - (void*) &hgp->RandomizeInitDist); + (void*) &hgp->RandomizeInitDist); Zoltan_Bind_Param(PHG_params, "PHG_PROCESSOR_REDUCTION_LIMIT", (void*) &hgp->ProRedL); Zoltan_Bind_Param(PHG_params, "PHG_REPART_MULTIPLIER", @@ -722,8 +685,8 @@ int Zoltan_PHG_Initialize_Params( (void*) &hgp->patoh_alloc_pool0); Zoltan_Bind_Param(PHG_params, "PATOH_ALLOC_POOL1", (void*) &hgp->patoh_alloc_pool1); - - + + /* Set default values */ strncpy(hgp->hgraph_pkg, "phg", MAX_PARAM_STRING_LEN); strncpy(hgp->redm_str, "agg", MAX_PARAM_STRING_LEN); @@ -737,12 +700,12 @@ int Zoltan_PHG_Initialize_Params( if (hgraph_model == GRAPH) strncpy(edge_weight_op, "sum", MAX_PARAM_STRING_LEN); - else + else strncpy(edge_weight_op, "max", MAX_PARAM_STRING_LEN); /* LB.Approach is initialized to "REPARTITION", and set in Set_Key_Params */ strncpy(hgp->hgraph_method, zz->LB.Approach, MAX_PARAM_STRING_LEN); - if (!strcasecmp(zz->LB.Approach,"REFINE")) + if (!strcasecmp(zz->LB.Approach,"REFINE")) hgp->useMultilevel = 0; else hgp->useMultilevel = 1; @@ -752,10 +715,10 @@ int Zoltan_PHG_Initialize_Params( hgp->edge_scaling = 0; hgp->vtx_scaling = 0; hgp->vtx_scal_size = 0; - hgp->vtx_scal = NULL; /* Array for storing vertex degree scale vector. + hgp->vtx_scal = NULL; /* Array for storing vertex degree scale vector. Should perhaps go in hg structure, not the param struct? */ - hgp->connectivity_cut = 1; + hgp->connectivity_cut = 1; hgp->visit_order = 0; /* Random */ hgp->check_graph = 0; hgp->bal_tol = zz->LB.Imbalance_Tol[0]; /* Make vector for multiconstraint */ @@ -770,11 +733,11 @@ int Zoltan_PHG_Initialize_Params( hgp->geometric_red = 0.1; hgp->geometric_levels = INT_MAX; hgp->fm_loop_limit = 10; - hgp->fm_max_neg_move = 250; + hgp->fm_max_neg_move = 250; hgp->refinement_quality = 1; hgp->RandomizeInitDist = 0; hgp->EdgeSizeThreshold = 0.25; - hgp->MatchEdgeSizeThreshold = 500; + hgp->MatchEdgeSizeThreshold = 500; hgp->hybrid_keep_factor = 0.; hgp->ProRedL = 0.0; /* UVCUVC: CHECK default set to 0 until we run more experiments */ hgp->RepartMultiplier = 100.; @@ -782,11 +745,11 @@ int Zoltan_PHG_Initialize_Params( hgp->patoh_alloc_pool1 = 0; hgp->UseFixedVtx = 0; hgp->UsePrefPart = 0; - + /* Get application values of parameters. */ - err = Zoltan_Assign_Param_Vals(zz->Params, PHG_params, zz->Debug_Level, + err = Zoltan_Assign_Param_Vals(zz->Params, PHG_params, zz->Debug_Level, zz->Proc, zz->Debug_Proc); - + nProc = zz->Num_Proc; usePrimeComm = 0; @@ -807,7 +770,7 @@ int Zoltan_PHG_Initialize_Params( "Only the first application supplied weight per vertex will be used."); } hgp->add_obj_weight = PHG_ADD_NO_WEIGHT; - } + } else { if (!strcasecmp(add_obj_weight, "vertices")){ hgp->add_obj_weight = PHG_ADD_UNIT_WEIGHT; @@ -865,7 +828,7 @@ int Zoltan_PHG_Initialize_Params( } /* Adjust refinement parameters using hgp->refinement_quality */ - if (hgp->refinement_quality < 0.5/hgp->fm_loop_limit) + if (hgp->refinement_quality < 0.5/hgp->fm_loop_limit) /* No refinement */ strncpy(hgp->refinement_str, "no", MAX_PARAM_STRING_LEN); else { @@ -879,8 +842,8 @@ int Zoltan_PHG_Initialize_Params( used for partitioning to make more efficient 2D decomposition */ if (hgp->nProc_x_req != 1 && hgp->nProc_y_req != 1) /* Want 2D decomp */ - if (zz->Num_Proc > SMALL_PRIME && Zoltan_PHG_isPrime(zz->Num_Proc)) - /* 2D data decomposition is requested but we have a prime + if (zz->Num_Proc > SMALL_PRIME && Zoltan_PHG_isPrime(zz->Num_Proc)) + /* 2D data decomposition is requested but we have a prime * number of processors. */ usePrimeComm = 1; @@ -893,19 +856,19 @@ int Zoltan_PHG_Initialize_Params( hgp->fm_loop_limit = 4; /* experimental evaluation showed that for repartitioning/refinement small number of passes is "good enough". These are all heuristics hence - it is possible to create a pathological cases; + it is possible to create a pathological cases; but in general this seems to be sufficient */ } - + if (!hgp->useMultilevel) { /* don't do coarsening */ strncpy(hgp->redm_str, "no", MAX_PARAM_STRING_LEN); /* we have modified all coarse partitioners to handle preferred part - if user wants to choose one she can choose; otherwise default + if user wants to choose one she can choose; otherwise default partitioner (greedy growing) does work better than previous default partitioning - for phg_refine ("no"). */ + for phg_refine ("no"). */ hgp->UsePrefPart = 1; } @@ -914,9 +877,9 @@ int Zoltan_PHG_Initialize_Params( in our experiments for IPDPS'07 and WileyChapter multilevel_refine didn't prove itself useful; it is too costly even with local matching hence it will not be be released yet (i.e. not in v3). */ - strncpy(hgp->redm_str, "l-ipm", MAX_PARAM_STRING_LEN); + strncpy(hgp->redm_str, "l-ipm", MAX_PARAM_STRING_LEN); hgp->UsePrefPart = 1; - } + } } else if (!strcasecmp(package, "PARKWAY")){ if (hgp->nProc_x_req>1) { @@ -925,7 +888,7 @@ int Zoltan_PHG_Initialize_Params( goto End; } hgp->nProc_x_req = 1; - } + } else if (!strcasecmp(package, "PATOH")){ if (zz->Num_Proc>1) { err = ZOLTAN_FATAL; @@ -946,16 +909,16 @@ int Zoltan_PHG_Initialize_Params( MPI_Group_free(&zzgrp); } - err = Zoltan_PHG_Set_2D_Proc_Distrib(zz, communicator, zz->Proc, - nProc, hgp->nProc_x_req, - hgp->nProc_y_req, + err = Zoltan_PHG_Set_2D_Proc_Distrib(zz, communicator, zz->Proc, + nProc, hgp->nProc_x_req, + hgp->nProc_y_req, &hgp->globalcomm); - if (err != ZOLTAN_OK) + if (err != ZOLTAN_OK) goto End; /* Convert strings to function pointers. */ err = Zoltan_PHG_Set_Part_Options (zz, hgp); - + End: return err; } @@ -1004,7 +967,7 @@ static int Zoltan_PHG_Output_Parts ( ) { /* Function to map the computed partition from the distribution in HGraph - * to the input distribution + * to the input distribution */ static char *yo = "Zoltan_PHG_Output_Parts"; @@ -1013,10 +976,10 @@ int msg_tag = 31000; int ierr = ZOLTAN_OK; int nObj = zhg->nObj; int *outparts = NULL; -int *sendbuf = NULL; +int *sendbuf = NULL; HGraph *phg = &(zhg->HG); - zhg->Output_Parts = outparts + zhg->Output_Parts = outparts = (int*) ZOLTAN_MALLOC (nObj * sizeof(int)); if (zhg->VtxPlan != NULL) { /* Get the partition information from the 2D decomposition back to the @@ -1060,10 +1023,10 @@ HGraph *phg = &(zhg->HG); goto End; } } - + ierr = Zoltan_LB_Remap(zz, &new_map, nObj, newproc, zhg->Input_Parts, outparts, 1); - if (ierr < 0) + if (ierr < 0) ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_LB_Remap"); ZOLTAN_FREE(&newproc); } @@ -1096,9 +1059,9 @@ int nObj = zhg->nObj; Partition input_parts = zhg->Input_Parts; ZOLTAN_ID_PTR gids = zhg->objGID; ZOLTAN_ID_PTR lids = zhg->objLID; -int *outparts = zhg->Output_Parts; +int *outparts = zhg->Output_Parts; - if (zz->LB.Return_Lists == ZOLTAN_LB_NO_LISTS) + if (zz->LB.Return_Lists == ZOLTAN_LB_NO_LISTS) goto End; else if (zz->LB.Return_Lists == ZOLTAN_LB_CANDIDATE_LISTS) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Candidate Lists not supported in PHG." @@ -1164,15 +1127,15 @@ int Zoltan_PHG_Set_2D_Proc_Distrib( uses this function with MPI_COMM_NULL to compute nProc_x and nProc_y. */ int proc, /* Input: Rank of current processor */ - int nProc, /* Input: Total # of processors */ + int nProc, /* Input: Total # of processors */ int nProc_x, /* Input: Suggested #procs in x-direction */ int nProc_y, /* Input: Suggested #procs in y-direction */ PHGComm *comm /* Ouput: filled */ - ) + ) { /* Computes the processor distribution for the 2D data distrib. * Sets nProc_x, nProc_y. - * Constraint: nProc_x * nProc_y == nProc. + * Constraint: nProc_x * nProc_y == nProc. * For 2D data distrib, default should approximate sqrt(nProc). * If nProc_x and nProc_y both equal -1 on input, compute default. * Otherwise, compute valid values and/or return error. @@ -1180,7 +1143,7 @@ int Zoltan_PHG_Set_2D_Proc_Distrib( char *yo = "Zoltan_PHG_Set_2D_Proc_Distrib"; int tmp; int ierr = ZOLTAN_OK; - + if (nProc_x == -1 && nProc_y == -1) { /* Compute default */ tmp = (int) sqrt((double)nProc+0.1); @@ -1195,9 +1158,9 @@ int ierr = ZOLTAN_OK; comm->nProc_y = nProc / comm->nProc_x; } else { comm->nProc_x = nProc_x; - comm->nProc_y = nProc_y; + comm->nProc_y = nProc_y; } - + /* Error check */ if (comm->nProc_x * comm->nProc_y != nProc) { ZOLTAN_PRINT_ERROR(proc, yo, @@ -1221,9 +1184,9 @@ int ierr = ZOLTAN_OK; comm->myProc_x = proc % comm->nProc_x; comm->myProc_y = proc / comm->nProc_x; comm->myProc = proc; - if ((MPI_Comm_split(Communicator, comm->myProc_x, comm->myProc_y, + if ((MPI_Comm_split(Communicator, comm->myProc_x, comm->myProc_y, &comm->col_comm) != MPI_SUCCESS) - || (MPI_Comm_split(Communicator, comm->myProc_y, comm->myProc_x, + || (MPI_Comm_split(Communicator, comm->myProc_y, comm->myProc_x, &comm->row_comm) != MPI_SUCCESS)) { ZOLTAN_PRINT_ERROR(proc, yo, "MPI_Comm_Split failed"); return ZOLTAN_FATAL; @@ -1234,10 +1197,10 @@ int ierr = ZOLTAN_OK; comm->col_comm); Zoltan_Srand_Sync(Zoltan_Rand(NULL), &(comm->RNGState), comm->Communicator); - } + } /* printf("(%d, %d) of [%d, %d] -> After Comm_split col_comm=%d row_comm=%d\n", hgp->myProc_x, hgp->myProc_y, hgp->nProc_x, hgp->nProc_y, (int)hgp->col_comm, (int)hgp->row_comm); */ - - + + End: return ierr; @@ -1246,3 +1209,4 @@ int ierr = ZOLTAN_OK; #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/phg/phg.h b/packages/zoltan/src/phg/phg.h index d1eb49b29b..5a0c546370 100644 --- a/packages/zoltan/src/phg/phg.h +++ b/packages/zoltan/src/phg/phg.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_H #define __ZOLTAN_PHG_H @@ -66,7 +29,7 @@ extern "C" { /* Function types for options to hypergraph partitioning */ struct PHGPartParamsStruct; /* Forward declaration */ -typedef int ZOLTAN_PHG_MATCHING_FN(ZZ*, HGraph*, ZOLTAN_GNO_TYPE *, +typedef int ZOLTAN_PHG_MATCHING_FN(ZZ*, HGraph*, ZOLTAN_GNO_TYPE *, struct PHGPartParamsStruct*); typedef int ZOLTAN_PHG_COARSEPARTITION_FN(ZZ*, HGraph*, int, float *, Partition, struct PHGPartParamsStruct*); @@ -74,7 +37,7 @@ typedef int ZOLTAN_PHG_REFINEMENT_FN(ZZ*, HGraph*, int, float *, Partition, struct PHGPartParamsStruct*, float); - + /******************************************/ /* Parameters to the hypergraph functions */ /******************************************/ @@ -88,7 +51,7 @@ struct PHGPartParamsStruct { between [0-1.0]: it is % of bal_tol > 1.0: it is a multiplier to bal_tol/log(k) */ float *part_sizes; /* Pointer to part_sizes array passed to - Zoltan_PHG; lists part_sizes (%ages) + Zoltan_PHG; lists part_sizes (%ages) for all requested partitions. */ int kway; /* 1 -> direct kway, 0->recursive bisection */ float geometric_red; /* Reduction factor using geometric matching */ @@ -103,12 +66,12 @@ struct PHGPartParamsStruct { should be restricted using pref_part and coarse partitioning should take the part preferences into account. */ - + char redm_str[MAX_PARAM_STRING_LEN]; /* Reduction method string. */ char redm_fast[MAX_PARAM_STRING_LEN]; /* Fast reduction method string. */ char redmo_str[MAX_PARAM_STRING_LEN]; /* Matching optimization string*/ - + ZOLTAN_PHG_MATCHING_FN *matching; /* Pointers to Matching function */ int match_array_type; /* interpretation of match array: assuming (u,v, w) are matched @@ -117,7 +80,7 @@ struct PHGPartParamsStruct { 1 -> all vertices point the representative match[u] = match[v] = match[w] = u; */ - + int edge_scaling; /* type of hyperedge weight scaling */ int vtx_scaling; /* type of vertex scaling for inner product */ int vtx_scal_size; /* size of vtx_scal array */ @@ -125,7 +88,7 @@ struct PHGPartParamsStruct { int LocalCoarsePartition; /* 1 -> apply coarse partitioner locally; 0 -> gather entire HG to each proc and apply coarse partitioner. */ - char coarsepartition_str[MAX_PARAM_STRING_LEN]; + char coarsepartition_str[MAX_PARAM_STRING_LEN]; /* Coarse partitioning string */ ZOLTAN_PHG_COARSEPARTITION_FN *CoarsePartition; /* pointer to coarse partitioning fn */ @@ -135,10 +98,10 @@ struct PHGPartParamsStruct { int fm_loop_limit; /* Number of FM loops (if the refinement is FM) */ int fm_max_neg_move; /* Maximum number of vertex moves with negative gain; an early stop condition. <0 means try all moves */ - float refinement_quality; /* Adjustment to refinement parameter settings; + float refinement_quality; /* Adjustment to refinement parameter settings; 1 means the defaults, higher means more ref. */ - - int check_graph; /* Flag indicating whether the input hypergraph should + + int check_graph; /* Flag indicating whether the input hypergraph should * be checked for errors. */ int output_level; /* Flag indicating amount of output from HG algorithms. * See levels PHG_DEBUG_* below. */ @@ -161,7 +124,7 @@ struct PHGPartParamsStruct { int num_coarse_iter; /* Number of coarse partitions to try on each proc. */ int visit_order; /* Vertex visit order. */ int use_timers; /* Flag indicating whether to time the PHG code. */ - float EdgeSizeThreshold; /* % of global vtxs beyond which an edge is + float EdgeSizeThreshold; /* % of global vtxs beyond which an edge is considered to be dense. */ ZOLTAN_GNO_TYPE MatchEdgeSizeThreshold; /* Edges with sizes bigger than this threshold considered to be dense for matching and ignored. */ @@ -178,19 +141,19 @@ struct PHGPartParamsStruct { vertices and edges passed as input to PHG. */ float ProRedL; /* V-cycle processor reduction limit in % of pins */ float RepartMultiplier; /* In PHG_REPART, multiply input edge weights by - RepartMultiplier, a parameter that should be - proportional to the number of times the - communication described by the hypergraph - will be done before the next repartitioning. + RepartMultiplier, a parameter that should be + proportional to the number of times the + communication described by the hypergraph + will be done before the next repartitioning. This cost allows us to consider migration cost compared to application communication cost. */ int patoh_alloc_pool0, /* to adjust patoh's memory pre-allocation amount */ - patoh_alloc_pool1; + patoh_alloc_pool1; }; typedef struct PHGPartParamsStruct PHGPartParams; - + /*****************************/ /* Hypergraph output levels: */ /*****************************/ @@ -215,18 +178,18 @@ int Zoltan_PHG_Vertex_Visit_Order (ZZ*, HGraph*, PHGPartParams*, int*); /**************/ int Zoltan_PHG_Coarsening(ZZ*, HGraph*, ZOLTAN_GNO_TYPE *, HGraph*, ZOLTAN_GNO_TYPE *, int*, int*, int**, struct Zoltan_Comm_Obj**, PHGPartParams*); - + /*********************************/ /* Coarse Partitioning functions */ /*********************************/ extern int Zoltan_PHG_Gather_To_All_Procs(ZZ*, HGraph*, PHGPartParams*, PHGComm*, HGraph**); -extern int Zoltan_PHG_CoarsePartition(ZZ*, HGraph*, int, float *, Partition, +extern int Zoltan_PHG_CoarsePartition(ZZ*, HGraph*, int, float *, Partition, PHGPartParams*); ZOLTAN_PHG_COARSEPARTITION_FN *Zoltan_PHG_Set_CoarsePartition_Fn(PHGPartParams*, int*); /************************/ -/* Refinement functions */ +/* Refinement functions */ /************************/ int Zoltan_PHG_Refinement (ZZ*, HGraph*, int, float *, Partition, PHGPartParams*); ZOLTAN_PHG_REFINEMENT_FN *Zoltan_PHG_Set_Refinement_Fn(char*); @@ -238,7 +201,7 @@ extern int Zoltan_PHG_Set_2D_Proc_Distrib(ZZ *, MPI_Comm, int, int, int, int, PHGComm *); extern int Zoltan_PHG_Gno_To_Proc_Block(ZOLTAN_GNO_TYPE gno, ZOLTAN_GNO_TYPE *, int); - + /*****************************/ /* Other Function Prototypes */ /*****************************/ @@ -252,23 +215,23 @@ extern int Zoltan_PHG_Remove_Repart_Data(ZZ*, ZHG*, HGraph*, PHGPartParams*); extern int Zoltan_PHG_rdivide (int, int, Partition, ZZ *, HGraph *, PHGPartParams *, int, int); - + extern int Zoltan_PHG_Set_Part_Options(ZZ*, PHGPartParams*); -extern int Zoltan_PHG_Partition(ZZ*, HGraph*, int, float *, Partition, +extern int Zoltan_PHG_Partition(ZZ*, HGraph*, int, float *, Partition, PHGPartParams*); extern double Zoltan_PHG_Compute_NetCut(PHGComm*, HGraph*, Partition); -extern double Zoltan_PHG_Compute_ConCut(PHGComm*, HGraph*, Partition, int, - int*); +extern double Zoltan_PHG_Compute_ConCut(PHGComm*, HGraph*, Partition, int, + int*); extern int Zoltan_PHG_Cuts(ZZ *, ZHG *, double *); -extern double Zoltan_PHG_Compute_Balance(ZZ*, HGraph*, float *, int, +extern double Zoltan_PHG_Compute_Balance(ZZ*, HGraph*, float *, int, int, Partition); extern int Zoltan_PHG_Build_Hypergraph(ZZ*, ZHG**, Partition*, PHGPartParams*); extern void Zoltan_PHG_Plot(int, int, int, int*, int *, int*, char*); extern void Zoltan_PHG_Plot_2D_Distrib(ZZ*, HGraph*); -extern int Zoltan_PHG_PaToH(ZZ *, HGraph *, int, int *, PHGPartParams*); +extern int Zoltan_PHG_PaToH(ZZ *, HGraph *, int, int *, PHGPartParams*); extern int Zoltan_PHG_ParKway(ZZ *, HGraph *, int, Partition, PHGPartParams* ); extern int Zoltan_PHG_2ways_hyperedge_partition (ZZ *, HGraph *, Partition, Zoltan_PHG_Tree *, @@ -278,7 +241,7 @@ extern int Zoltan_PHG_2ways_hyperedge_partition (ZZ *, HGraph *, Partition, Zolt -/* Functions that are used in more than one PHG source file, +/* Functions that are used in more than one PHG source file, but not called from outside PHG. */ #include "zz_heap.h" /* defines type HEAP */ @@ -288,7 +251,7 @@ int Zoltan_HG_move_vertex (HGraph *hg, int vertex, int sour, int dest, int Zoltan_PHG_GIDs_to_global_numbers(ZZ *zz, ZOLTAN_GNO_TYPE *gnos, int len, int randomize, ZOLTAN_GNO_TYPE *num); -int Zoltan_Get_Hypergraph_From_Queries(ZZ *, PHGPartParams *, int, ZHG *); +int Zoltan_Get_Hypergraph_From_Queries(ZZ *, PHGPartParams *, int, ZHG *); int Zoltan_Hypergraph_Queries(ZZ *zz, int *num_lists, int *num_pins, ZOLTAN_ID_PTR *edg_GID, int **row_ptr, ZOLTAN_ID_PTR *vtx_GID); diff --git a/packages/zoltan/src/phg/phg_Vcycle.c b/packages/zoltan/src/phg/phg_Vcycle.c index cbcb408eff..1e17459452 100644 --- a/packages/zoltan/src/phg/phg_Vcycle.c +++ b/packages/zoltan/src/phg/phg_Vcycle.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -68,33 +31,33 @@ extern "C" { typedef struct tagVCycle { HGraph *hg; /* for finer==NULL, hg and Part contains */ - Partition Part; /* original hg and Part, don't delete them */ + Partition Part; /* original hg and Part, don't delete them */ int *vdest; /* necessary to unredistribute */ /* vdest size = hg->nVtx vdest[i] is the dest proc of vtx i in the unredistributed communicators. */ - int *vlno; /* vlno size = hg->nVtx + int *vlno; /* vlno size = hg->nVtx vlno[i] is the local vertex number of vtx i on proc vdest[i]. */ ZOLTAN_GNO_TYPE *LevelMap; /* necessary to uncoarsen */ - /* LevelMap size = hg->nVtx + /* LevelMap size = hg->nVtx LevelMap[i] is the vtx number of the - coarse vertex containing fine vtx i + coarse vertex containing fine vtx i on the next level. LevelMap[i] = j >= 0 if local coarse vtx j is on the same processor as i; - LevelMap[i] = -gno -1 < 0 if + LevelMap[i] = -gno -1 < 0 if coarse vtx gno is on a different proc from i. */ int LevelCnt; /* 2 * count of external vertices matched to vertices owned by this proc. */ - /* # of negative values in LevelMap. + /* # of negative values in LevelMap. Number of external vertices being combined into coarse vertices on this processor */ int LevelSndCnt; /* number of vertices being returned by the Zoltan_comm_do_reverse(). Used to - establish the receive buffer size. + establish the receive buffer size. Number of vertices I own that are being combined into a coarse vertex on another processor. */ @@ -102,19 +65,19 @@ typedef struct tagVCycle { /* LevelData size = LevelCnt LevelCnt/2 pairs of (external_lno, my_lno) describing matches made across procs. - Proc owning my_lno will have the + Proc owning my_lno will have the coarse vtx resulting from the match and, thus, will have to send part - assignment to external_lno when + assignment to external_lno when uncoarsening. */ - struct tagVCycle *finer; - struct Zoltan_Comm_Obj *comm_plan; + struct tagVCycle *finer; + struct Zoltan_Comm_Obj *comm_plan; struct Zoltan_Timer *timer; /* timer for this level of the V-cycle */ int timer_match; /* Timers for various stages */ int timer_coarse; /* Declared static so we can accumulate */ int timer_refine; /* times over calls to Zoltan_PHG_Partition */ int timer_project; -} VCycle; +} VCycle; @@ -123,7 +86,7 @@ typedef struct tagVCycle { int Zoltan_PHG_Set_Part_Options (ZZ *zz, PHGPartParams *hgp) { int err = ZOLTAN_OK; - char *yo = "Zoltan_PHG_Set_Part_Options"; + char *yo = "Zoltan_PHG_Set_Part_Options"; if (hgp->bal_tol < 1.0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Invalid PHG_BALANCE_TOLERANCE."); @@ -161,11 +124,11 @@ static int allocVCycle(VCycle *v) { if (!v->hg || !v->hg->nVtx) return ZOLTAN_OK; - + if (!v->Part && !(v->Part = (int*) ZOLTAN_CALLOC (v->hg->nVtx, sizeof(int)))) return ZOLTAN_MEMERR; - - if (!v->LevelMap + + if (!v->LevelMap && !(v->LevelMap = (ZOLTAN_GNO_TYPE*) ZOLTAN_CALLOC (v->hg->nVtx, sizeof(ZOLTAN_GNO_TYPE)))) return ZOLTAN_MEMERR; @@ -180,10 +143,10 @@ static VCycle *newVCycle(ZZ *zz, HGraph *hg, Partition part, VCycle *finer, int vcycle_timing) { VCycle *vcycle; - - if (!(vcycle = (VCycle*) ZOLTAN_MALLOC (sizeof(VCycle)))) + + if (!(vcycle = (VCycle*) ZOLTAN_MALLOC (sizeof(VCycle)))) return NULL; - + vcycle->finer = finer; vcycle->Part = part; vcycle->vdest = NULL; @@ -225,8 +188,8 @@ int Zoltan_PHG_Partition ( int p, /* Input: number partitions to be generated */ float *part_sizes, /* Input: array of length p containing percentages of work to be assigned to each partition */ - Partition parts, /* Input: initial partition #s; aligned with vtx - arrays. + Partition parts, /* Input: initial partition #s; aligned with vtx + arrays. Output: computed partition #s */ PHGPartParams *hgp) /* Input: parameters for hgraph partitioning. */ { @@ -252,22 +215,22 @@ int Zoltan_PHG_Partition ( ZOLTAN_TRACE_ENTER(zz, yo); zoltan_gno_mpi_type = Zoltan_mpi_gno_type(); - + if (do_timing) { - if (timer->vcycle < 0) + if (timer->vcycle < 0) timer->vcycle = Zoltan_Timer_Init(zz->ZTime, 0, "Vcycle"); - if (timer->procred < 0) + if (timer->procred < 0) timer->procred = Zoltan_Timer_Init(zz->ZTime, 0, "Processor Reduction"); - if (timer->match < 0) + if (timer->match < 0) timer->match = Zoltan_Timer_Init(zz->ZTime, 1, "Matching"); - if (timer->coarse < 0) + if (timer->coarse < 0) timer->coarse = Zoltan_Timer_Init(zz->ZTime, 1, "Coarsening"); if (timer->coarsepart < 0) timer->coarsepart = Zoltan_Timer_Init(zz->ZTime, 1, "Coarse_Partition"); - if (timer->refine < 0) + if (timer->refine < 0) timer->refine = Zoltan_Timer_Init(zz->ZTime, 1, "Refinement"); - if (timer->project < 0) + if (timer->project < 0) timer->project = Zoltan_Timer_Init(zz->ZTime, 1, "Project_Up"); ZOLTAN_TIMER_START(zz->ZTime, timer->vcycle, hgc->Communicator); @@ -293,7 +256,7 @@ int Zoltan_PHG_Partition ( strcpy(reset_geometric_string, hgp->redm_str); } - /****** Coarsening ******/ + /****** Coarsening ******/ #define COARSEN_FRACTION_LIMIT 0.9 /* Stop if we don't make much progress */ while ((hg->redl>0) && (hg->dist_x[hgc->nProc_x] > (ZOLTAN_GNO_TYPE)hg->redl) && ((hg->dist_x[hgc->nProc_x] < (ZOLTAN_GNO_TYPE) (COARSEN_FRACTION_LIMIT * prevVcnt + 0.5)) /* prevVcnt initialized to 2*hg->dist_x[hgc->nProc_x] */ @@ -301,19 +264,19 @@ int Zoltan_PHG_Partition ( && hg->dist_y[hgc->nProc_y] && hgp->matching) { ZOLTAN_GNO_TYPE *match = NULL; VCycle *coarser=NULL, *redistributed=NULL; - + prevVcnt = hg->dist_x[hgc->nProc_x]; prevVedgecnt = hg->dist_y[hgc->nProc_y]; -#ifdef _DEBUG +#ifdef _DEBUG /* UVC: load balance stats */ Zoltan_PHG_LoadBalStat(zz, hg); #endif - + if (hgp->output_level >= PHG_DEBUG_LIST) { uprintf(hgc, "START %3d |V|=%6d |E|=%6d #pins=%6d %d/%s/%s/%s p=%d...\n", - hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, + hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, hgp->redm_str, hgp->coarsepartition_str, hgp->refinement_str, p); if (hgp->output_level > PHG_DEBUG_LIST) { @@ -348,7 +311,7 @@ int Zoltan_PHG_Partition ( } for (i = 0; i < hg->nVtx; i++) match[i] = i; - + /* Calculate matching (packing or grouping) */ err = Zoltan_PHG_Matching (zz, hg, match, hgp); @@ -375,7 +338,7 @@ int Zoltan_PHG_Partition ( ZOLTAN_TIMER_START(vcycle->timer, vcycle->timer_coarse, hgc->Communicator); } - + if (!(coarser = newVCycle(zz, NULL, NULL, vcycle, vcycle_timing))) { ZOLTAN_FREE (&match); ZOLTAN_PRINT_ERROR (zz->Proc, yo, "coarser is NULL."); @@ -384,16 +347,16 @@ int Zoltan_PHG_Partition ( /* Construct coarse hypergraph and LevelMap */ err = Zoltan_PHG_Coarsening (zz, hg, match, coarser->hg, vcycle->LevelMap, - &vcycle->LevelCnt, &vcycle->LevelSndCnt, &vcycle->LevelData, + &vcycle->LevelCnt, &vcycle->LevelSndCnt, &vcycle->LevelData, &vcycle->comm_plan, hgp); - if (err != ZOLTAN_OK && err != ZOLTAN_WARN) + if (err != ZOLTAN_OK && err != ZOLTAN_WARN) goto End; if (vcycle_timing) ZOLTAN_TIMER_STOP(vcycle->timer, vcycle->timer_coarse, hgc->Communicator); - + if (do_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->coarse, hgc->Communicator); ZOLTAN_TIMER_START(zz->ZTime, timer->vcycle, hgc->Communicator); @@ -488,7 +451,7 @@ int Zoltan_PHG_Partition ( if (hgp->output_level >= PHG_DEBUG_LIST) { uprintf(hgc, "START %3d |V|=%6d |E|=%6d #pins=%6d %d/%s/%s/%s p=%d...\n", - hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, + hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, hgp->redm_str, hgp->coarsepartition_str, hgp->refinement_str, p); if (hgp->output_level > PHG_DEBUG_LIST) { err = Zoltan_HG_Info(zz, hg); @@ -548,7 +511,7 @@ int Zoltan_PHG_Partition ( } err = Zoltan_PHG_Refinement (zz, hg, p, part_sizes, vcycle->Part, hgp); - + if (do_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->refine, hgc->Communicator); ZOLTAN_TIMER_START(zz->ZTime, timer->vcycle, hgc->Communicator); @@ -557,14 +520,14 @@ int Zoltan_PHG_Partition ( ZOLTAN_TIMER_STOP(vcycle->timer, vcycle->timer_refine, hgc->Communicator); - - if (hgp->output_level >= PHG_DEBUG_LIST) - uprintf(hgc, + + if (hgp->output_level >= PHG_DEBUG_LIST) + uprintf(hgc, "FINAL %3d |V|=%6d |E|=%6d #pins=%6d %d/%s/%s/%s p=%d bal=%.2f cutl=%.2f\n", - hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, + hg->info, hg->nVtx, hg->nEdge, hg->nPins, hg->redl, hgp->redm_str, hgp->coarsepartition_str, hgp->refinement_str, p, - Zoltan_PHG_Compute_Balance(zz, hg, part_sizes, 0, p, + Zoltan_PHG_Compute_Balance(zz, hg, part_sizes, 0, p, vcycle->Part), Zoltan_PHG_Compute_ConCut(hgc, hg, vcycle->Part, p, &err)); @@ -575,7 +538,7 @@ int Zoltan_PHG_Partition ( if (finer) { int *rbuffer; - + /* Project coarse partition to fine partition */ if (finer->comm_plan) { refine = 1; @@ -592,22 +555,22 @@ int Zoltan_PHG_Partition ( ZOLTAN_TIMER_START(vcycle->timer, vcycle->timer_project, hgc->Communicator); } - + /* easy to assign partitions to internal matches */ for (i = 0; i < finer->hg->nVtx; i++) if (finer->LevelMap[i] >= 0) /* if considers only the local vertices */ finer->Part[i] = vcycle->Part[finer->LevelMap[i]]; - + /* now that the course partition assignments have been propagated */ - /* upward to the finer level for the local vertices, we need to */ + /* upward to the finer level for the local vertices, we need to */ /* fill the LevelData (matched pairs of a local vertex with a */ /* off processor vertex) with the partition assignment of the */ - /* local vertex - can be done totally in the finer level! */ + /* local vertex - can be done totally in the finer level! */ for (i = 0; i < finer->LevelCnt; i++) { ++i; /* skip over off processor lno */ - finer->LevelData[i] = finer->Part[finer->LevelData[i]]; + finer->LevelData[i] = finer->Part[finer->LevelData[i]]; } - + /* allocate rec buffer to exchange LevelData information */ rbuffer = NULL; if (finer->LevelSndCnt > 0) { @@ -617,23 +580,23 @@ int Zoltan_PHG_Partition ( ZOLTAN_TRACE_EXIT(zz, yo); return ZOLTAN_MEMERR; } - } - - /* get partition assignments from owners of externally matched vtxs */ + } + + /* get partition assignments from owners of externally matched vtxs */ Zoltan_Comm_Resize (finer->comm_plan, NULL, COMM_TAG, &i); - Zoltan_Comm_Do_Reverse (finer->comm_plan, COMM_TAG+1, + Zoltan_Comm_Do_Reverse (finer->comm_plan, COMM_TAG+1, (char*) finer->LevelData, 2 * sizeof(int), NULL, (char*) rbuffer); /* process data to assign partitions to expernal matches */ for (i = 0; i < 2 * finer->LevelSndCnt;) { int lno, partition; lno = rbuffer[i++]; - partition = rbuffer[i++]; - finer->Part[lno] = partition; + partition = rbuffer[i++]; + finer->Part[lno] = partition; } - ZOLTAN_FREE (&rbuffer); - Zoltan_Comm_Destroy (&finer->comm_plan); + ZOLTAN_FREE (&rbuffer); + Zoltan_Comm_Destroy (&finer->comm_plan); if (do_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->project, hgc->Communicator); @@ -692,7 +655,7 @@ int Zoltan_PHG_Partition ( 2*sizeof(int), (char *) rbuffer); MPI_Bcast(rbuffer, 2*finer->hg->nVtx, MPI_INT, 0, hgc->col_comm); - + /* process data to assign partitions to unredistributed processors */ for (i = 0; i < 2 * finer->hg->nVtx;) { int lno, partition; @@ -711,7 +674,7 @@ int Zoltan_PHG_Partition ( vcycle = finer; } /* while (vcycle) */ - + End: vcycle = del; while (vcycle) { @@ -750,7 +713,7 @@ int Zoltan_PHG_Partition ( ZOLTAN_TRACE_EXIT(zz, yo) ; return err; } - + /****************************************************************************/ double Zoltan_PHG_Compute_NetCut( @@ -760,10 +723,10 @@ double Zoltan_PHG_Compute_NetCut( ) { /* Calculates the cutsize of a partition by summing the weight of all edges - * which span more than one part. Time O(|H|). - * Results are returned on all processors of hgc->Communicator. + * which span more than one part. Time O(|H|). + * Results are returned on all processors of hgc->Communicator. */ - int i, j, *netpart = NULL, *allparts = NULL; + int i, j, *netpart = NULL, *allparts = NULL; double cut = 0.0, totalcut=0.0; char *yo = "Zoltan_PHG_Compute_NetCut"; @@ -773,14 +736,14 @@ double Zoltan_PHG_Compute_NetCut( } if (!hgc->myProc_x) - if (hg->nEdge && + if (hg->nEdge && !(allparts = (int*) ZOLTAN_CALLOC(hgc->nProc_x*hg->nEdge,sizeof(int)))) { ZOLTAN_PRINT_ERROR (hgc->myProc, yo, "Memory error."); ZOLTAN_FREE(&netpart); return ZOLTAN_MEMERR; } - for (i = 0; i < hg->nEdge; ++i) + for (i = 0; i < hg->nEdge; ++i) if (hg->hindex[i] >= hg->hindex[i+1]) netpart[i] = -1; else { @@ -793,11 +756,11 @@ double Zoltan_PHG_Compute_NetCut( } if (hg->nEdge) - MPI_Gather(netpart, hg->nEdge, MPI_INT, allparts, hg->nEdge, MPI_INT, 0, + MPI_Gather(netpart, hg->nEdge, MPI_INT, allparts, hg->nEdge, MPI_INT, 0, hgc->row_comm); ZOLTAN_FREE (&netpart); - if (!hgc->myProc_x) { + if (!hgc->myProc_x) { for (i = 0; i < hg->nEdge; ++i) { int p=-1; for (j = 0; j < hgc->nProc_x; ++j) @@ -808,17 +771,17 @@ double Zoltan_PHG_Compute_NetCut( p = allparts[j*hg->nEdge+i]; else if (p != allparts[j*hg->nEdge+i]) break; - } + } if (j < hgc->nProc_x) cut += (hg->ewgt ? hg->ewgt[i] : 1.0); } - + ZOLTAN_FREE (&allparts); MPI_Reduce (&cut, &totalcut, 1, MPI_DOUBLE, MPI_SUM, 0, hgc->col_comm); } MPI_Bcast (&totalcut, 1, MPI_DOUBLE, 0, hgc->Communicator); - return totalcut; + return totalcut; } /****************************************************************************/ @@ -829,29 +792,29 @@ double Zoltan_PHG_Compute_NetCut( double Zoltan_PHG_Compute_ConCut( PHGComm *hgc, HGraph *hg, - Partition part, + Partition part, int p, int *ierr) { /* Calculates the cutsize of a partition. For each edge it calculates the number * of parts it spans across. This value minus one is the cutsize of this edge - * and the total cutsize is the sum of the single cutsizes. Time O(|H|). + * and the total cutsize is the sum of the single cutsizes. Time O(|H|). * NOTE: non-zero result is returned ONLY on processor (0,0) of the 2D * decomposition (i.e., processor zero overall). */ double cut = 0.0, totalcut=0.0; char *yo = "Zoltan_PHG_Compute_ConCut"; - + if (hg->nEdge) { int i, j, *cuts=NULL, *rescuts=NULL, *parts, nEdge, start; - + nEdge = MIN((int)MAXMEMORYALLOC / (2*(int)sizeof(int)*p), hg->nEdge); if (!(cuts = (int*) ZOLTAN_MALLOC (p * nEdge * sizeof(int)))) { ZOLTAN_PRINT_ERROR(hgc->myProc, yo, "Memory error."); *ierr = ZOLTAN_MEMERR; goto End; - } + } if (!hgc->myProc_x) if (!(rescuts = (int*) ZOLTAN_MALLOC (p * nEdge * sizeof(int)))) { ZOLTAN_PRINT_ERROR(hgc->myProc, yo, "Memory error."); @@ -866,13 +829,13 @@ double Zoltan_PHG_Compute_ConCut( memset(cuts, 0, sizeof(int)*p*(end-start)); for (i = start; i < end; ++i) { parts = &cuts[(i-start)*p]; - for (j = hg->hindex[i]; j < hg->hindex[i+1]; ++j) + for (j = hg->hindex[i]; j < hg->hindex[i+1]; ++j) ++parts[part[hg->hvertex[j]]]; } - MPI_Reduce(cuts, rescuts, p*(end-start), MPI_INT, MPI_SUM, 0, + MPI_Reduce(cuts, rescuts, p*(end-start), MPI_INT, MPI_SUM, 0, hgc->row_comm); - + if (!hgc->myProc_x) { for (i = start; i < end; ++i) { parts = &rescuts[(i-start)*p]; @@ -888,18 +851,18 @@ double Zoltan_PHG_Compute_ConCut( *ierr = ZOLTAN_FATAL; goto End; } - } + } } - start += nEdge; + start += nEdge; } while (startnEdge); - + End: ZOLTAN_FREE (&cuts); ZOLTAN_FREE (&rescuts); } - - if (!hgc->myProc_x) + + if (!hgc->myProc_x) MPI_Reduce (&cut, &totalcut, 1, MPI_DOUBLE, MPI_SUM, 0, hgc->col_comm); MPI_Bcast (&totalcut, 1, MPI_DOUBLE, 0, hgc->Communicator); @@ -922,29 +885,29 @@ double Zoltan_PHG_Compute_Balance ( double *lsize_w, *size_w, max_imbal, tot_w; char *yo = "Zoltan_PHG_Compute_Balance"; int part_dim = (hg->VtxWeightDim ? hg->VtxWeightDim : 1); - + if (!hg->comm || !hg->comm->row_comm) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Unable to compute balance"); return 1.0; - } - + } + if (!(lsize_w = (double*) ZOLTAN_CALLOC (2*p, sizeof(double)))) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); return ZOLTAN_MEMERR; } size_w = lsize_w + p; - + if (hg->vwgt) for (i = 0; i < hg->nVtx; i++) lsize_w[part[i]] += hg->vwgt[i*hg->VtxWeightDim+wgtidx]; else for (i = 0; i < hg->nVtx; i++) lsize_w[part[i]]++; - + MPI_Allreduce(lsize_w, size_w, p, MPI_DOUBLE, MPI_SUM, hg->comm->row_comm); - + max_imbal = tot_w = 0.0; - for (i = 0; i < p; i++) + for (i = 0; i < p; i++) tot_w += size_w[i]; if (tot_w) { for (i = 0; i < p; i++) { diff --git a/packages/zoltan/src/phg/phg_build.c b/packages/zoltan/src/phg/phg_build.c index b1b6937630..9496a352fa 100644 --- a/packages/zoltan/src/phg/phg_build.c +++ b/packages/zoltan/src/phg/phg_build.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER @@ -60,19 +23,19 @@ extern "C" { /*#define REPART_FASTER_METHOD*/ /*#define DEBUG_FILL_HYPERGRAPH 1*/ - -/* Macro returning the global number of the first repartition vertex or + +/* Macro returning the global number of the first repartition vertex or * repartition edge to be added to a processor row or column, respectively. */ #define FirstRepart(myProc, nProc, Gn) \ ((myProc) * (int)((Gn) / (nProc)) + MIN((myProc), (Gn) % (nProc))) -/* Macro returning the number of repartition vertices or repartition edges +/* Macro returning the number of repartition vertices or repartition edges * to be added to a processor row or column, respectively. */ #define NumRepart(myProc, nProc, Gn) \ ((myProc >= 0) ? (int)((Gn) / (nProc)) + ((myProc) < ((Gn) % (nProc))) \ : 0) -/* Macro returning the processor row or column storing a given +/* Macro returning the processor row or column storing a given * repartition vertex or edge, respectively. */ #define ProcForRepart(i, repart_dist, nProc) \ Zoltan_PHG_Gno_To_Proc_Block(i, repart_dist, nProc) @@ -82,7 +45,7 @@ extern "C" { static int Zoltan_PHG_Add_Repart_Data(ZZ *, ZHG *, HGraph *, PHGPartParams *, Partition); -static int calculate_cuts(ZZ *zz, ZHG *zhg, +static int calculate_cuts(ZZ *zz, ZHG *zhg, int max_parts, int *pin_parts, double *loccuts); static int getObjectSizes(ZZ *zz, ZHG *zhg); @@ -96,12 +59,12 @@ int Zoltan_PHG_Build_Hypergraph( ZZ *zz, /* Input : Zoltan data structure */ ZHG **zoltan_hg, /* Output: Hypergraph to be allocated and built.*/ Partition *input_parts, /* Output: Initial partition assignments for - vtxs (in 2D distribution); length = + vtxs (in 2D distribution); length = zoltan_hg->HG->nVtx. */ PHGPartParams *hgp /* Input : Parameters for PHG partitioning.*/ ) { -/* allocates and builds hypergraph data structure using callback routines */ +/* allocates and builds hypergraph data structure using callback routines */ ZHG *zhg; /* Temporary pointer to Zoltan_HGraph. */ HGraph *phgraph; /* Temporary pointer to HG field */ int ierr = ZOLTAN_OK; @@ -112,7 +75,7 @@ char msg[128]; ZOLTAN_TRACE_ENTER(zz, yo); /************************************************************** - * Get the hypergraph specified by the queries and parameters + * Get the hypergraph specified by the queries and parameters ***************************************************************/ zhg = (ZHG*) ZOLTAN_MALLOC (sizeof(ZHG)); @@ -136,7 +99,7 @@ char msg[128]; phgraph = &(zhg->HG); Zoltan_HG_HGraph_Init(phgraph); phgraph->comm = &hgp->globalcomm; - + /* Obtain the coordinates with 2D distribution. */ if (zz->Get_Num_Geom != NULL && (zz->Get_Geom != NULL || zz->Get_Geom_Multi != NULL)) { @@ -167,7 +130,7 @@ char msg[128]; } else if (ierr != ZOLTAN_OK) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_HG_Check"); - goto End; + goto End; } } @@ -185,7 +148,7 @@ char msg[128]; ZOLTAN_FREE(&zhg); *zoltan_hg = NULL; } - + ZOLTAN_TRACE_EXIT(zz, yo); return ierr; } @@ -199,11 +162,11 @@ int Zoltan_PHG_Fill_Hypergraph( ZHG *zhg, /* Input: Description of hypergraph provided by the application */ /* Output: zhg->HG, hypergraph for Zoltan_PHG */ PHGPartParams *hgp, /* Input : Parameters for PHG partitioning.*/ - Partition *input_parts /* Output: Initial partition assignment of vtxs in + Partition *input_parts /* Output: Initial partition assignment of vtxs in 2D data distribution; length = zhg->HG->nVtx. */ ) { -/* +/* * Create a fully functioning parallel hypergraph with 2D distribution of pins (non-zeros). */ @@ -224,11 +187,11 @@ ZOLTAN_GNO_TYPE *sendbuf = NULL; int *tmparray = NULL; int *hindex = NULL; ZOLTAN_GNO_TYPE *dist_x = NULL, *dist_y = NULL; -ZOLTAN_GNO_TYPE *nonzeros = NULL; +ZOLTAN_GNO_TYPE *nonzeros = NULL; int *hvertex=NULL; int nEdge, nVtx, nwgt = 0; -int nrecv = 0; -ZOLTAN_GNO_TYPE *recv_gno = NULL; +int nrecv = 0; +ZOLTAN_GNO_TYPE *recv_gno = NULL; int *tmpparts = NULL; int num_gid_entries = zz->Num_GID; ZOLTAN_GNO_TYPE totalNumEdges, nGlobalEdges; @@ -242,7 +205,7 @@ int proc_offset; char msg[250]; float frac_x, frac_y; -float *tmpwgts=NULL; +float *tmpwgts=NULL; float edgeSizeThreshold; int randomizeInitDist; @@ -250,10 +213,10 @@ int final_output; int nCoords=0; double *tmpcoords = NULL; - + phg_GID_lookup *lookup_myObjs = NULL; -int GnFixed=0, nFixed=0; -int *tmpfixed = NULL, *fixedPart = NULL; +int GnFixed=0, nFixed=0; +int *tmpfixed = NULL, *fixedPart = NULL; ZOLTAN_ID_PTR fixedGIDs = NULL; int nRepartEdge = 0, nRepartVtx = 0; @@ -271,7 +234,7 @@ int nRepartEdge = 0, nRepartVtx = 0; /**************************************************/ /* Note any fixed vertices */ /**************************************************/ - + if (zz->Get_Num_Fixed_Obj) { /* If registered query fixed objects/vertices */ nFixed = zz->Get_Num_Fixed_Obj (zz->Get_Num_Fixed_Obj_Data, &ierr); if (ierr != ZOLTAN_OK) { @@ -279,15 +242,15 @@ int nRepartEdge = 0, nRepartVtx = 0; goto End; } MPI_Allreduce (&nFixed, &GnFixed, 1, MPI_INT, MPI_SUM, zz->Communicator); - hgp->UseFixedVtx = GnFixed; - + hgp->UseFixedVtx = GnFixed; + if (GnFixed && zhg->nObj) { zhg->fixed = (int*) ZOLTAN_MALLOC (sizeof(int) * zhg->nObj); if (!zhg->fixed) MEMORY_ERROR; for (i = 0; i < zhg->nObj; i++) zhg->fixed[i] = -1; /* default - no fixed assignment */ } - + if (GnFixed && nFixed && zhg->nObj) { lookup_myObjs = phg_create_GID_lookup_table(zhg->objGID, zhg->nObj, num_gid_entries); @@ -295,18 +258,18 @@ int nRepartEdge = 0, nRepartVtx = 0; fixedPart = (int*) ZOLTAN_MALLOC (sizeof(int) * nFixed); fixedGIDs = ZOLTAN_MALLOC_GID_ARRAY (zz, nFixed); - + if (!fixedPart || !fixedGIDs) MEMORY_ERROR; - + if (zz->Get_Fixed_Obj_List) { zz->Get_Fixed_Obj_List (zz->Get_Fixed_Obj_List_Data, nFixed, num_gid_entries, fixedGIDs, fixedPart, &ierr); if (ierr != ZOLTAN_OK) { ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Error getting Fixed Obj List"); goto End; - } - + } + for (i = 0; i < nFixed; i++) { j = phg_lookup_GID (lookup_myObjs, fixedGIDs + (i * num_gid_entries)); if (j < 0) @@ -322,13 +285,13 @@ int nRepartEdge = 0, nRepartVtx = 0; /**************************************************************************************** * If it is desired to remove dense edges, divide the list of edges into - * two lists. The ZHG structure will contain the removed edges (if final_output is true), + * two lists. The ZHG structure will contain the removed edges (if final_output is true), * and the kept edges will be returned. ****************************************************************************************/ totalNumEdges = zhg->globalHedges; - ierr = remove_dense_edges(zz, zhg, edgeSizeThreshold, final_output, + ierr = remove_dense_edges(zz, zhg, edgeSizeThreshold, final_output, &nLocalEdges, &nGlobalEdges, &nPins, &edgeGNO, &edgeSize, &edgeWeight, &pinGNO, &pinProcs); @@ -336,7 +299,7 @@ int nRepartEdge = 0, nRepartVtx = 0; /* re-assign edge global numbers if any edges were removed */ - ierr = Zoltan_PHG_GIDs_to_global_numbers(zz, edgeGNO, nLocalEdges, + ierr = Zoltan_PHG_GIDs_to_global_numbers(zz, edgeGNO, nLocalEdges, randomizeInitDist, &totalNumEdges); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { @@ -346,9 +309,9 @@ int nRepartEdge = 0, nRepartVtx = 0; } /**************************************************************************************** - * Compute the distribution of vertices and edges to the 2D data distribution's processor - * columns and rows. For now, these distributions are described by arrays dist_x and dist_y; - * in the future, we may prefer a hashing function mapping GIDs to processor columns and rows. + * Compute the distribution of vertices and edges to the 2D data distribution's processor + * columns and rows. For now, these distributions are described by arrays dist_x and dist_y; + * in the future, we may prefer a hashing function mapping GIDs to processor columns and rows. ****************************************************************************************/ nProc_x = phg->comm->nProc_x; @@ -367,7 +330,7 @@ int nRepartEdge = 0, nRepartVtx = 0; for (i = 1; i < nProc_x; i++) dist_x[i] = (ZOLTAN_GNO_TYPE) (i * frac_x); dist_x[nProc_x] = (ZOLTAN_GNO_TYPE)zhg->globalObj; - + frac_y = (float)nGlobalEdges / (float)nProc_y; for (i = 1; i < nProc_y; i++) dist_y[i] = (ZOLTAN_GNO_TYPE) (i * frac_y); @@ -396,8 +359,8 @@ int nRepartEdge = 0, nRepartVtx = 0; nVtx = (myProc_x >= 0 ? (int)(dist_x[myProc_x+1] - dist_x[myProc_x]) : 0); if (method_repart){ - /* For REPARTITION, we add one vertex per part and one edge - * per object in a repartition part (connecting the object with + /* For REPARTITION, we add one vertex per part and one edge + * per object in a repartition part (connecting the object with * its input partition vertex). * Compute the number of these per processor within the 2D distribution * now so we can allocate relevant arrays to be large enough to include @@ -420,15 +383,15 @@ int nRepartEdge = 0, nRepartVtx = 0; zz->Communicator); nRepartVtx = NumRepart(myProc_x, nProc_x, zhg->GnRepartVtx); - /* For memory allocation and easy mapping of repartition edges to - * processor rows, compute maximum number of repart edges possible; + /* For memory allocation and easy mapping of repartition edges to + * processor rows, compute maximum number of repart edges possible; * will reduce later. */ nRepartEdge = NumRepart(myProc_y, nProc_y, zhg->globalObj); } /* * Build comm plan for sending non-zeros to their target processors in - * 2D data distribution. + * 2D data distribution. */ proclist = (int *)ZOLTAN_MALLOC(MAX(nPins, zhg->nObj)*sizeof(int)); sendbuf = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nPins * 2 * sizeof(ZOLTAN_GNO_TYPE)); @@ -437,7 +400,7 @@ int nRepartEdge = 0, nRepartVtx = 0; MEMORY_ERROR; } - cnt = 0; + cnt = 0; for (i = 0; i < nLocalEdges; i++) { /* processor row for the edge */ edge_gno = edgeGNO[i]; @@ -452,7 +415,7 @@ int nRepartEdge = 0, nRepartVtx = 0; sendbuf[2*cnt] = edge_gno; sendbuf[2*cnt+1] = vtx_gno; cnt++; - } + } } /* @@ -477,7 +440,7 @@ int nRepartEdge = 0, nRepartVtx = 0; tmparray = (int *) ZOLTAN_CALLOC(nEdge + 1, sizeof(int)); hindex = (int *) ZOLTAN_CALLOC(nEdge + 1 + nRepartEdge, sizeof(int)); - hvertex = (int *) ZOLTAN_MALLOC((nnz + 2 * nRepartEdge) * sizeof(int)); + hvertex = (int *) ZOLTAN_MALLOC((nnz + 2 * nRepartEdge) * sizeof(int)); /* worst case size */ if (!tmparray || !hindex || ((nnz || nRepartEdge) && !hvertex)){ @@ -488,7 +451,7 @@ int nRepartEdge = 0, nRepartVtx = 0; /* Count the number of nonzeros per hyperedge */ for (i = 0; i < nnz; i++) { - idx = EDGE_GNO_TO_LNO(phg, nonzeros[2*i]); + idx = EDGE_GNO_TO_LNO(phg, nonzeros[2*i]); tmparray[idx]++; } @@ -497,7 +460,7 @@ int nRepartEdge = 0, nRepartVtx = 0; hindex[i+1] = hindex[i] + tmparray[i]; tmparray[i] = 0; } - + for (i = 0; i < nnz; i++) { idx = EDGE_GNO_TO_LNO(phg, nonzeros[2*i]); hvertex[hindex[idx]+tmparray[idx]] = VTX_GNO_TO_LNO(phg, nonzeros[2*i+1]); @@ -517,7 +480,7 @@ int nRepartEdge = 0, nRepartVtx = 0; /* Need a communication plan mapping GIDs to their GNOs processors * within a row communicator. The plan is used to send vertex weights - * and partition assignments to the 2D distribution and/or + * and partition assignments to the 2D distribution and/or * to create return lists after partitioning * * Since for 2D decomposition and prime nProc we exclude a processor, @@ -528,9 +491,9 @@ int nRepartEdge = 0, nRepartVtx = 0; proc_offset = (myProc_y >= 0 ? myProc_y : 0) * nProc_x; for (i = 0; i < zhg->nObj; i++) proclist[i] = proc_offset + VTX_TO_PROC_X(phg, zhg->objGNO[i]); - + msg_tag++; - ierr = Zoltan_Comm_Create(&(zhg->VtxPlan), zhg->nObj, proclist, + ierr = Zoltan_Comm_Create(&(zhg->VtxPlan), zhg->nObj, proclist, zz->Communicator, msg_tag, &nrecv); if (ierr != ZOLTAN_OK){ @@ -556,7 +519,7 @@ int nRepartEdge = 0, nRepartVtx = 0; zhg->Recv_GNOs = recv_gno = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nrecv * sizeof(ZOLTAN_GNO_TYPE)); if (nrecv && !recv_gno) MEMORY_ERROR; - + memcpy(zhg->Recv_GNOs, zhg->objGNO, nrecv * sizeof(ZOLTAN_GNO_TYPE)); } @@ -582,8 +545,8 @@ int nRepartEdge = 0, nRepartVtx = 0; phg->coor = (double *)ZOLTAN_MALLOC(sizeof(double) * nCoords); if (nCoords && (!tmpcoords || !phg->coor)) MEMORY_ERROR; } - - if (GnFixed) { + + if (GnFixed) { tmpfixed = (int*) ZOLTAN_MALLOC(phg->nVtx * sizeof(int)); if (phg->nVtx && !tmpfixed) MEMORY_ERROR; @@ -591,8 +554,8 @@ int nRepartEdge = 0, nRepartVtx = 0; if ((phg->nVtx || nRepartVtx) && !phg->fixed_part) MEMORY_ERROR; for (i = 0 ; i < phg->nVtx; i++) - tmpfixed[i] = -2; - } + tmpfixed[i] = -2; + } if (phg->comm->nProc_x == 1) { for (i = 0; i < zhg->nObj; i++) { @@ -605,7 +568,7 @@ int nRepartEdge = 0, nRepartVtx = 0; tmpcoords[idx*phg->nDim + j] = zhg->coor[i*phg->nDim + j]; phg->coor[i*phg->nDim + j] = -DBL_MAX; /* defined in float.h */ } - if (GnFixed) + if (GnFixed) tmpfixed[idx] = zhg->fixed[i]; } } @@ -635,22 +598,22 @@ int nRepartEdge = 0, nRepartVtx = 0; goto End; } } - - if (GnFixed) { + + if (GnFixed) { msg_tag++; ierr = Zoltan_Comm_Do (zhg->VtxPlan, msg_tag, (char*) zhg->fixed, sizeof(int), (char*) phg->fixed_part); if (ierr != ZOLTAN_OK) - goto End; + goto End; } - + for (i = 0; i < nrecv; i++) { idx = VTX_GNO_TO_LNO(phg, recv_gno[i]); tmpparts[idx] = (*input_parts)[i]; for (j=0; jvwgt[i*dim + j]; - if (GnFixed) - tmpfixed[idx] = phg->fixed_part[i]; + tmpwgts[idx*dim + j] = phg->vwgt[i*dim + j]; + if (GnFixed) + tmpfixed[idx] = phg->fixed_part[i]; if (phg->nDim > 0) { for (j = 0; j < phg->nDim; j++){ tmpcoords[idx*phg->nDim + j] = phg->coor[i*phg->nDim + j]; @@ -665,7 +628,7 @@ int nRepartEdge = 0, nRepartVtx = 0; */ if (phg->comm->col_comm != MPI_COMM_NULL){ - rc = MPI_Allreduce(tmpparts, *input_parts, phg->nVtx, MPI_INT, MPI_MAX, + rc = MPI_Allreduce(tmpparts, *input_parts, phg->nVtx, MPI_INT, MPI_MAX, phg->comm->col_comm); CHECK_FOR_MPI_ERROR(rc); @@ -678,19 +641,19 @@ int nRepartEdge = 0, nRepartVtx = 0; phg->comm->col_comm); CHECK_FOR_MPI_ERROR(rc); } - - if (GnFixed) { + + if (GnFixed) { rc = MPI_Allreduce(tmpfixed, phg->fixed_part, phg->nVtx, MPI_INT, MPI_MAX, phg->comm->col_comm); CHECK_FOR_MPI_ERROR(rc); } } - + ZOLTAN_FREE(&tmpcoords); ZOLTAN_FREE(&tmpfixed); ZOLTAN_FREE(&tmpparts); ZOLTAN_FREE(&tmpwgts); - + /* Send edge weights, if any */ dim = zhg->edgeWeightDim; @@ -705,8 +668,8 @@ int nRepartEdge = 0, nRepartVtx = 0; if (nwgt && (!phg->ewgt || !tmpwgts)) MEMORY_ERROR; - if (zhg->edgeWeightDim) { - /* + if (zhg->edgeWeightDim) { + /* * Edge weights provided by application or set in Zoltan_Get_Hypergraph_From_Queries */ if (phg->comm->nProc_y == 1) { @@ -717,77 +680,77 @@ int nRepartEdge = 0, nRepartVtx = 0; } } else { - /* + /* * Since for 2D decomposition and prime nProc we exclude a processor, * we cannot use col_comm for this operation. We'll simulate it, * allowing the excluded processor to send its data to col 0. */ proc_offset = (myProc_x >= 0 ? myProc_x : 0); for (i = 0; i < nLocalEdges; i++) - proclist[i] = proc_offset + proclist[i] = proc_offset + EDGE_TO_PROC_Y(phg, edgeGNO[i]) * nProc_x; - + msg_tag++; - - ierr = Zoltan_Comm_Create(&plan, nLocalEdges, proclist, - zz->Communicator, msg_tag, &nrecv); - + + ierr = Zoltan_Comm_Create(&plan, nLocalEdges, proclist, + zz->Communicator, msg_tag, &nrecv); + if (ierr != ZOLTAN_OK){ goto End; } - + /* Multiple processes may have weights for the same edge */ - + recv_gno = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nrecv * sizeof(ZOLTAN_GNO_TYPE)); - + gid_weights = (float *) ZOLTAN_CALLOC(nrecv*dim, sizeof(float)); - + have_wgt = (char *)ZOLTAN_CALLOC(phg->nEdge, sizeof(char)); - + if ((nrecv && (!recv_gno || !gid_weights)) || (phg->nEdge && !have_wgt)){ - + ZOLTAN_FREE(&recv_gno); MEMORY_ERROR; } - + msg_tag++; ierr = Zoltan_Comm_Do(plan, msg_tag, (char *) edgeGNO, sizeof(ZOLTAN_GNO_TYPE), (char *) recv_gno); - + if (ierr != ZOLTAN_OK){ goto End; } - + msg_tag++; - ierr = Zoltan_Comm_Do(plan, msg_tag, (char *) edgeWeight, + ierr = Zoltan_Comm_Do(plan, msg_tag, (char *) edgeWeight, dim*sizeof(float), (char *) gid_weights); - + if (ierr != ZOLTAN_OK){ goto End; } - + Zoltan_Comm_Destroy(&plan); - + for (i = 0; i < nrecv; i++) { idx = EDGE_GNO_TO_LNO(phg, recv_gno[i]); if (have_wgt[idx]) continue; - for (j = 0; j < dim; j++) + for (j = 0; j < dim; j++) tmpwgts[idx * dim + j] = gid_weights[i * dim + j]; have_wgt[idx] = 1; } - ZOLTAN_FREE(&recv_gno); - ZOLTAN_FREE(&have_wgt); - ZOLTAN_FREE(&gid_weights); + ZOLTAN_FREE(&recv_gno); + ZOLTAN_FREE(&have_wgt); + ZOLTAN_FREE(&gid_weights); } - /* Need to gather weights for all edges within row + /* Need to gather weights for all edges within row * to all processors within row. */ - + if (phg->comm->row_comm != MPI_COMM_NULL && nwgt > 0){ /* error here if numprocs < numrows */ - rc = MPI_Allreduce(tmpwgts, phg->ewgt, nwgt, MPI_FLOAT, MPI_MAX, + rc = MPI_Allreduce(tmpwgts, phg->ewgt, nwgt, MPI_FLOAT, MPI_MAX, phg->comm->row_comm); CHECK_FOR_MPI_ERROR(rc); } @@ -824,7 +787,7 @@ int nRepartEdge = 0, nRepartVtx = 0; if (!zz->LB.Remap_Flag && zz->LB.Return_Lists == ZOLTAN_LB_NO_LISTS) { int gnremove; - rc = MPI_Allreduce(&(zhg->nHedges), &gnremove, 1, MPI_INT, MPI_SUM, + rc = MPI_Allreduce(&(zhg->nHedges), &gnremove, 1, MPI_INT, MPI_SUM, zz->Communicator); CHECK_FOR_MPI_ERROR(rc); if (!final_output || !gnremove) { @@ -835,7 +798,7 @@ int nRepartEdge = 0, nRepartVtx = 0; } } - + ierr = Zoltan_HG_Create_Mirror(zz, phg); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error from Zoltan_HG_Create_Mirror"); @@ -849,7 +812,7 @@ int nRepartEdge = 0, nRepartVtx = 0; Zoltan_Comm_Destroy(&plan); - Zoltan_Multifree(__FILE__, __LINE__, 17, + Zoltan_Multifree(__FILE__, __LINE__, 17, &edgeSize, &edgeGNO, &edgeWeight, @@ -873,7 +836,7 @@ int nRepartEdge = 0, nRepartVtx = 0; if (i == zz->Proc){ printf("HYPERGRAPH on process %d\n",i); - if (hgp->add_obj_weight == PHG_ADD_PINS_WEIGHT) + if (hgp->add_obj_weight == PHG_ADD_PINS_WEIGHT) /* print sum of pin weights */ print_hypergraph(zz, zhg, zz->Obj_Weight_Dim); else @@ -882,12 +845,12 @@ int nRepartEdge = 0, nRepartVtx = 0; printf("\n"); fflush(stdout); } - - rc = MPI_Barrier(MPI_COMM_WORLD); + + rc = MPI_Barrier(zoltan_get_global_comm()); } #endif - + ZOLTAN_TRACE_EXIT(zz, yo); return ierr; } @@ -953,7 +916,7 @@ intptr_t iptr; /* an int the size of a pointer */ ierr = Zoltan_Map_Add(zz, map, (char *)(myObjGNO + iptr), iptr + 1); if (ierr != ZOLTAN_OK) goto End; } - + for (i = 0; i < nrecv; i++) { ierr = Zoltan_Map_Find(zz, map, (char *)(recvpins + i), &iptr); if (ierr != ZOLTAN_OK) goto End; @@ -1009,7 +972,7 @@ intptr_t iptr; /* an int the size of a pointer */ /*****************************************************************************/ -static int calculate_cuts(ZZ *zz, ZHG *zhg, +static int calculate_cuts(ZZ *zz, ZHG *zhg, int max_parts, int *pin_parts, double *loccuts) { char *yo = "calculate_cuts"; @@ -1053,7 +1016,7 @@ static int getObjectSizes(ZZ *zz, ZHG *zhg) zhg->showMoveVol = 1; if (zhg->nObj) { - if (!(zhg->AppObjSizes = (int *) ZOLTAN_MALLOC(zhg->nObj * sizeof(int)))) + if (!(zhg->AppObjSizes = (int *) ZOLTAN_MALLOC(zhg->nObj * sizeof(int)))) MEMORY_ERROR; if (zz->Get_Obj_Size_Multi) { zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, @@ -1092,11 +1055,11 @@ static int Zoltan_PHG_Add_Repart_Data( ZZ *zz, ZHG *zhg, HGraph *phg, /* Input/Output: Input hypergraph in 2D layout; - changed by this routine to include repartition + changed by this routine to include repartition vertices and repartition edges. */ PHGPartParams *hgp, /* Input/Output: Partitioning parameters; need to turn on UseFixedVtx. */ - Partition input_parts /* Input/Output: Input partition assignments for + Partition input_parts /* Input/Output: Input partition assignments for vtxs in 2D distribution; entries for repartition vertices are added at the end. */ ) @@ -1104,7 +1067,7 @@ static int Zoltan_PHG_Add_Repart_Data( /* Function to add repartition vertices and edges to the hypergraph. * Repartition vertices and edges are distributed among the processor columns * and rows. - * One repartition vertex is added for each part to be included in the + * One repartition vertex is added for each part to be included in the * partition (i.e., the target number of parts in the new partition). * One repartition edge is added for each vertex in one of the target parts. * Initially, edge memory is allocated large enough to hold the maximum @@ -1114,7 +1077,7 @@ static int Zoltan_PHG_Add_Repart_Data( * Then we remove zero-length edges resulting from vertices that are in parts * that will not be in the new partition (i.e., vertex v in part q with q > k. * We then readjust the nRepartEdges variables to represent the actual number - * of repartition edges added to a processor and use the actual numbers to + * of repartition edges added to a processor and use the actual numbers to * adjust phg->dist_y. */ char *yo = "Zoltan_PHG_Add_Repart_Data"; @@ -1126,7 +1089,7 @@ int myProc_x = hgc->myProc_x; int myProc_y = hgc->myProc_y; int nProc_x = hgc->nProc_x; int nProc_y = hgc->nProc_y; -int nRepartVtx = 0, nRepartEdge; /* # of repartition vertices & edges +int nRepartVtx = 0, nRepartEdge; /* # of repartition vertices & edges to add to this processor. */ int nRepartPin = 0; /* # of repartition pins to add to this processor. */ @@ -1160,8 +1123,8 @@ int *recvsize = NULL; #endif int nrecv = 0; - -int *tmp_hindex; /* Pointers into phg->hindex and + +int *tmp_hindex; /* Pointers into phg->hindex and phg->hvertex; set to start of entries for repartition edges. */ int *tmp_hvertex; @@ -1207,12 +1170,12 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges firstRepartVtx = (int)repart_dist_x[myProc_x]; /* Compute maximum number of repartition edges to add to this proc row */ - phg->nRepartEdge = nRepartEdge + phg->nRepartEdge = nRepartEdge = (int)(repart_dist_y[myProc_y+1] - repart_dist_y[myProc_y]); firstRepartEdge = repart_dist_y[myProc_y]; - /* If application did not fix any vertices, allocate fixed array for - * repartition vertices. + /* If application did not fix any vertices, allocate fixed array for + * repartition vertices. * Initialized application vertices' fixed value to -1 (not fixed). */ hgp->UseFixedVtx = 1; @@ -1231,9 +1194,9 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges cnt = firstRepartVtx; /* Also the part that the first repart Vertex is associated with */ dim = phg->VtxWeightDim; /* since repartition vertex global numbers begin at 0 */ for (i = phg->nVtx; i < (phg->nVtx + nRepartVtx); i++) { - phg->fixed_part[i] = cnt; + phg->fixed_part[i] = cnt; input_parts[i] = cnt++; - if (phg->vwgt) + if (phg->vwgt) for (j = 0; j < dim; j++) phg->vwgt[i*dim+j] = 0.; } @@ -1242,11 +1205,11 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges /***** Repartition edges are distributed linearly. *****/ dim = phg->EdgeWeightDim; for (i = phg->nEdge; i < (phg->nEdge + nRepartEdge); i++) { - phg->hindex[i] = 0; + phg->hindex[i] = 0; for (j = 0; j < dim; j++) phg->ewgt[i*dim+j] = 0.; } - } + } /***** Get object sizes to weight the repartition edges *****/ /***** with migration costs. *****/ @@ -1266,7 +1229,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges if (phg->comm->nProc_x > 1) { /* Send obj_size data to the 2D distribution */ /* Use zhg->VtxPlan */ - ierr = Zoltan_Comm_Do(zhg->VtxPlan, 25232, (char *) zhg->AppObjSizes, + ierr = Zoltan_Comm_Do(zhg->VtxPlan, 25232, (char *) zhg->AppObjSizes, sizeof(int), (char *) objsize); if (ierr != ZOLTAN_OK){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_Comm_Do."); @@ -1298,10 +1261,10 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges /***** Create repartition edges in this processor row. *****/ - + /* Send objects' input partitions to processor owning corresponding - * repartition edge and repartition vertex. - * Each proc in column sends data for a subset of the column's + * repartition edge and repartition vertex. + * Each proc in column sends data for a subset of the column's * vertices. */ @@ -1332,7 +1295,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges if (!sendsize) MEMORY_ERROR; } #endif - + for (i = 0; i < cnt; i++){ int vtxproc_x; /* Processor column for actual vtx. */ int proc_x; /* Processor column for repartition vtx. */ @@ -1349,9 +1312,9 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges /* Determine proc row for repartition edge associated with vtx i */ proc_y = ProcForRepart(vgno, repart_dist_y, nProc_y); - + /* Fill message buffers */ - + /* Send message to processor owning repartition vertex and edge */ proclist[tmp] = proc_y * nProc_x + proc_x; @@ -1400,7 +1363,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges #ifdef REPART_FASTER_METHOD if (nrecv && !(recvgno = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(NSEND*nrecv*sizeof(ZOLTAN_GNO_TYPE)))) MEMORY_ERROR; - + ierr = Zoltan_Comm_Do(plan, 24556, (char *) sendgno, NSEND * sizeof(ZOLTAN_GNO_TYPE), (char *) recvgno); @@ -1409,14 +1372,14 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges if (nrecv && !(recvgno = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nrecv*sizeof(ZOLTAN_GNO_TYPE)))) MEMORY_ERROR; - + ierr = Zoltan_Comm_Do(plan, 24556, (char *) sendgno, sizeof(ZOLTAN_GNO_TYPE), (char *) recvgno); ZOLTAN_FREE(&sendgno); if (nrecv && !(recvpart = (int *) ZOLTAN_MALLOC(nrecv*sizeof(int)))) MEMORY_ERROR; - + ierr = Zoltan_Comm_Do(plan, 24557, (char *) sendpart, sizeof(int), (char *) recvpart); ZOLTAN_FREE(&sendpart); @@ -1440,13 +1403,13 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges tmp_hindex = &(phg->hindex[phg->nEdge]); tmp_hvertex = phg->hvertex; - + /* Loop to build hindex array */ for (i = 0; i < nrecv; i++) { ZOLTAN_GNO_TYPE vtx_gno; /* Global vtx number of vtx in received repartition edge.*/ int rEdge_lno; /* local index of repartition edge */ ZOLTAN_GNO_TYPE rVtx_gno; /* global repartition vertex number */ - + #ifdef REPART_FASTER_METHOD vtx_gno = recvgno[NSEND*i]; rEdge_lno = (int)(vtx_gno - firstRepartEdge); @@ -1462,7 +1425,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges tmp_hindex[rEdge_lno]++; nRepartPin++; } - + if (myProc_x == VTX_TO_PROC_X(phg, vtx_gno)) { /* Add pin for application vertex */ tmp_hindex[rEdge_lno]++; @@ -1472,7 +1435,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges phg->nRepartPin = nRepartPin; if (nRepartEdge && - !(pins_per_edge = (int *) ZOLTAN_MALLOC(nRepartEdge * sizeof(int)))) + !(pins_per_edge = (int *) ZOLTAN_MALLOC(nRepartEdge * sizeof(int)))) MEMORY_ERROR; MPI_Allreduce(tmp_hindex, pins_per_edge, nRepartEdge, MPI_INT, MPI_SUM, phg->comm->row_comm); @@ -1485,7 +1448,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges tmp_hindex[i] = tmp_hindex[i-1] + prev; prev = cnt; } - + /* Loop to build hvertex array and set edge weights */ if (nRepartEdge && !(tmp_ewgt = (float *) ZOLTAN_CALLOC(nRepartEdge * phg->EdgeWeightDim, @@ -1497,7 +1460,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges int rEdge_lno; /* local index of repartition edge */ ZOLTAN_GNO_TYPE rVtx_gno; /* global repartition vertex number */ int rVtx_lno; /* local index of repartition vertex */ - + #ifdef REPART_FASTER_METHOD vtx_gno = recvgno[NSEND*i]; rEdge_lno = (int)(vtx_gno - firstRepartEdge); @@ -1509,22 +1472,22 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges rVtx_gno = recvpart[i]; rVtx_lno = (int)(rVtx_gno - firstRepartVtx); #endif - + cnt = 0; if (rVtx_gno >= firstRepartVtx && rVtx_gno < firstRepartVtx+nRepartVtx) { /* Add pin for repartition vertex */ tmp_hvertex[tmp_hindex[rEdge_lno]] = phg->nVtx + rVtx_lno; cnt++; #ifdef REPART_FASTER_METHOD - for (j = 0; j < phg->EdgeWeightDim; j++) + for (j = 0; j < phg->EdgeWeightDim; j++) tmp_ewgt[rEdge_lno*phg->EdgeWeightDim+j] = (float) recvgno[NSEND*i+2]; #else if (zz->Get_Obj_Size_Multi || zz->Get_Obj_Size) { - for (j = 0; j < phg->EdgeWeightDim; j++) + for (j = 0; j < phg->EdgeWeightDim; j++) tmp_ewgt[rEdge_lno*phg->EdgeWeightDim+j] = (float) recvsize[i]; } else{ - for (j = 0; j < phg->EdgeWeightDim; j++) + for (j = 0; j < phg->EdgeWeightDim; j++) tmp_ewgt[rEdge_lno*phg->EdgeWeightDim+j] = 1.0; } #endif @@ -1551,7 +1514,7 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges if (cnt != i) { tmp_hindex[cnt] = tmp_hindex[i]; for (j = 0; j < phg->EdgeWeightDim; j++) - tmp_ewgt[cnt*phg->EdgeWeightDim+j] = + tmp_ewgt[cnt*phg->EdgeWeightDim+j] = tmp_ewgt[i*phg->EdgeWeightDim+j]; } cnt++; @@ -1560,14 +1523,14 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges tmp_hindex[cnt] = tmp_hindex[nRepartEdge]; phg->nRepartEdge = nRepartEdge = cnt; ZOLTAN_FREE(&pins_per_edge); - + /* Accrue edge weights across processor rows */ MPI_Allreduce(tmp_ewgt, &phg->ewgt[phg->nEdge*phg->EdgeWeightDim], nRepartEdge*phg->EdgeWeightDim, MPI_FLOAT, MPI_SUM, phg->comm->row_comm); if (tmp_ewgt) ZOLTAN_FREE(&tmp_ewgt); - /* Modify hypergraph edge weights to account for the number of + /* Modify hypergraph edge weights to account for the number of * communications done between migrations (the RepartMultiplier). * Do not apply the multiplier to the repartition edges. */ @@ -1584,9 +1547,9 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges /* SANITY CHECK */ if (phg->nPins != phg->hindex[phg->nEdge]) { - uprintf(phg->comm, - "%d KDDKDD SANITY CHECK FAILED %d != %d %d %d %d %d %d %d\n", - zz->Proc, phg->nPins, phg->hindex[phg->nEdge], nRepartVtx, + uprintf(phg->comm, + "%d KDDKDD SANITY CHECK FAILED %d != %d %d %d %d %d %d %d\n", + zz->Proc, phg->nPins, phg->hindex[phg->nEdge], nRepartVtx, phg->nVtx, nRepartEdge, phg->nEdge, nRepartPin, phg->nPins); exit( -1); } @@ -1601,12 +1564,12 @@ ZOLTAN_GNO_TYPE *repart_dist_y = NULL; /* Distribution of repartition edges /* Tougher for repartition edges, since we removed the empty ones. * Need to get actual nRepartEdge values from each proc in column. */ - + colProc_cnt = (int *) ZOLTAN_MALLOC(nProc_y * sizeof(int)); if (!colProc_cnt) MEMORY_ERROR; - MPI_Allgather(&nRepartEdge, 1, MPI_INT, colProc_cnt, 1, MPI_INT, + MPI_Allgather(&nRepartEdge, 1, MPI_INT, colProc_cnt, 1, MPI_INT, phg->comm->col_comm); for (sum = 0, i = 0; i < nProc_y; i++) { phg->dist_y[i] += sum; @@ -1641,7 +1604,7 @@ int Zoltan_PHG_Remove_Repart_Data( PHGPartParams *hgp ) { -/* Routine to remove repartition vertices, repartition edges, and +/* Routine to remove repartition vertices, repartition edges, and * repartition pins after partitioning with REPARTITION. * We don't have to actually remove the data; we only have to update * certain hypergraph fields so subsequent processing calls don't @@ -1657,7 +1620,7 @@ int myProc_y = phg->comm->myProc_y; int ierr = ZOLTAN_OK; if (myProc_x >= 0 && myProc_y >= 0) { /* This proc is part of 2D decomp */ - /* Only processors in the 2D decomp added repartition data, so + /* Only processors in the 2D decomp added repartition data, so * only those processors need to remove it. */ phg->nVtx -= phg->nRepartVtx; @@ -1681,14 +1644,14 @@ int ierr = ZOLTAN_OK; sum += NumRepart(i, nProc_x, zhg->GnRepartVtx); } phg->dist_x[nProc_x] -= (int)sum; - + colProc_cnt = (int *) ZOLTAN_MALLOC(nProc_y * sizeof(int)); if (!colProc_cnt){ ierr = ZOLTAN_MEMERR; goto End; } - MPI_Allgather(&(phg->nRepartEdge), 1, MPI_INT, colProc_cnt, 1, MPI_INT, + MPI_Allgather(&(phg->nRepartEdge), 1, MPI_INT, colProc_cnt, 1, MPI_INT, phg->comm->col_comm); for (sum = 0, i = 0; i < nProc_y; i++) { phg->dist_y[i] -= sum; @@ -1703,7 +1666,7 @@ int ierr = ZOLTAN_OK; } /****************************************************************************/ -static int remove_dense_edges(ZZ *zz, +static int remove_dense_edges(ZZ *zz, ZHG *zhg, /* on output may contain removed edges */ float esize_threshold, /* %age of gnVtx considered a dense edge */ int save_removed, /* save the removed edges in ZHG */ @@ -1720,8 +1683,8 @@ char *yo = "remove_dense_edges"; int ierr = ZOLTAN_OK; int i, w, esize, k, l, kpin, lpin, pin; int ew_dim = zhg->edgeWeightDim; -ZOLTAN_GNO_TYPE global_nremove = 0; -ZOLTAN_GNO_TYPE global_nremove_pins = 0; +ZOLTAN_GNO_TYPE global_nremove = 0; +ZOLTAN_GNO_TYPE global_nremove_pins = 0; ZOLTAN_GNO_TYPE nremove = 0; ZOLTAN_GNO_TYPE nremove_size = 0; ZOLTAN_GNO_TYPE nkeep = 0; @@ -1867,7 +1830,7 @@ MPI_Datatype zoltan_gno_mpi_type; if (ew_dim && !keepEdgeWeight){ Zoltan_Multifree(__FILE__, __LINE__, 9, - &goEdgeGNO, &goEdgeSize, &goPinGNO, &goPinProc, + &goEdgeGNO, &goEdgeSize, &goPinGNO, &goPinProc, &goEdgeWeight, &keepEdgeGNO, &keepEdgeSize, &keepPinGNO, &keepPinProc); MEMORY_ERROR; diff --git a/packages/zoltan/src/phg/phg_build.c.improved_calculate_cuts b/packages/zoltan/src/phg/phg_build.c.improved_calculate_cuts index d8e4758520..ff9b2bfa47 100644 --- a/packages/zoltan/src/phg/phg_build.c.improved_calculate_cuts +++ b/packages/zoltan/src/phg/phg_build.c.improved_calculate_cuts @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -881,7 +844,7 @@ End: fflush(stdout); } - rc = MPI_Barrier(MPI_COMM_WORLD); + rc = MPI_Barrier(zoltan_get_global_comm()); } #endif diff --git a/packages/zoltan/src/phg/phg_build_calls.c b/packages/zoltan/src/phg/phg_build_calls.c index 95666f7a0f..c90513f98c 100644 --- a/packages/zoltan/src/phg/phg_build_calls.c +++ b/packages/zoltan/src/phg/phg_build_calls.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER @@ -150,7 +113,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; * This is the hypergraph intended by the application, before alterations * for the phg algorithm. This hypergraph is suitable for Zoltan_LB_Eval. * - * The hyperedges returned are whole hyperedges - they are not distributed + * The hyperedges returned are whole hyperedges - they are not distributed * over more than one process. */ @@ -564,7 +527,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; } msg_tag--; - ierr = Zoltan_Comm_Do_Reverse(plan, msg_tag, (char *)sendGnoBuf, + ierr = Zoltan_Comm_Do_Reverse(plan, msg_tag, (char *)sendGnoBuf, sizeof(ZOLTAN_GNO_TYPE) * 2, NULL, (char *)recvGnoBuf); if (ierr != ZOLTAN_OK){ @@ -651,7 +614,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; ew_lids = ZOLTAN_MALLOC_LID_ARRAY(zz, myEWs.size); myEWs.wgt = (float *)ZOLTAN_MALLOC(myEWs.size * cnt); - if (!myEWs.edgeGID || !ew_lids || !myEWs.wgt){ + if (!myEWs.edgeGID || !myEWs.wgt){ MEMORY_ERROR; } @@ -666,7 +629,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; /* Get process assigned to each hyperedge. */ - ierr = phg_map_GIDs_to_processes(zz, myEWs.edgeGID, myEWs.size, gid_size, + ierr = phg_map_GIDs_to_processes(zz, myEWs.edgeGID, myEWs.size, gid_size, &myEWs.edgeHash, nProc); if ((ierr!=ZOLTAN_OK) && (ierr!=ZOLTAN_WARN)){ @@ -781,21 +744,21 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; msg_tag--; ierr = Zoltan_Comm_Create(&plan, zhg->nPins, zhg->Pin_Procs, comm, msg_tag, &nRequests); - + if (ierr != ZOLTAN_OK){ goto End; } - + if (nRequests > 0){ gid_buf = ZOLTAN_MALLOC_GID_ARRAY(zz, nRequests); if (!gid_buf) MEMORY_ERROR; sendGnoBuf = (ZOLTAN_GNO_TYPE *)ZOLTAN_MALLOC(sizeof(ZOLTAN_GNO_TYPE) * nRequests); if (!sendGnoBuf) MEMORY_ERROR; } - + msg_tag--; ierr = Zoltan_Comm_Do(plan, msg_tag, (char *)myPins.pinGID, gid_chars, (char *)gid_buf); - + if (ierr != ZOLTAN_OK){ goto End; } @@ -804,7 +767,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; zhg->numHEdges = (int *)ZOLTAN_CALLOC(sizeof(int), zhg->nObj); if (zhg->nObj && !zhg->numHEdges) MEMORY_ERROR; - + for (i=0; ipinGNO = (ZOLTAN_GNO_TYPE *)ZOLTAN_CALLOC(sizeof(ZOLTAN_GNO_TYPE) , zhg->nPins); if (zhg->nPins && !zhg->pinGNO) MEMORY_ERROR; - + ierr = Zoltan_Comm_Do_Reverse(plan, msg_tag, (char *)sendGnoBuf, sizeof(ZOLTAN_GNO_TYPE), NULL, (char *)zhg->pinGNO); - + if (ierr != ZOLTAN_OK){ goto End; } @@ -832,10 +795,10 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; Zoltan_Comm_Destroy(&plan); /* - * There may be two edge weights provided for a single edge, depending on - * how the application supplied the graph in the query functions. + * There may be two edge weights provided for a single edge, depending on + * how the application supplied the graph in the query functions. * Find the one or two weights supplied for each edge. - * If there are two weights, combine them as specified by the + * If there are two weights, combine them as specified by the * PHG_EDGE_WEIGHT_OPERATION. */ @@ -889,7 +852,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; if (ew_dim){ /* this proc provided weights for [v0,v1] and [v1, v0] */ index = iptr - 1; - dest = wgts + k * ew_dim; + dest = wgts + k * ew_dim; src = zhg->Ewgt + index * ew_dim; for (dim = 0; dim < ew_dim; dim++){ dest[dim] = src[dim]; @@ -926,13 +889,13 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; msg_tag--; ierr = Zoltan_Comm_Create(&plan, cnt, procBuf, comm, msg_tag, &nRequests); - + if (ierr != ZOLTAN_OK){ goto End; } ZOLTAN_FREE(&procBuf); - + if (nRequests > 0){ sendFloatBuf = (float *) ZOLTAN_CALLOC(sizeof(float) , nRequests * ew_dim); if (ew_dim && !sendFloatBuf) MEMORY_ERROR; @@ -942,13 +905,13 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; msg_tag--; ierr = Zoltan_Comm_Do(plan, msg_tag, (char *)sendGnoBuf, sizeof(ZOLTAN_GNO_TYPE) * 2, (char *)recvGnoBuf); - + if (ierr != ZOLTAN_OK){ goto End; } ZOLTAN_FREE(&sendGnoBuf); - + nEdge = 0; for (i=0; iEwgt + index * ew_dim; for (dim = 0; dim < ew_dim; dim++){ dest[dim] = src[dim]; @@ -985,23 +948,23 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; /* Before doing global communication, determine whether there is any information to share. */ rc = MPI_Allreduce(&nEdge, &w, 1, MPI_INT, MPI_MAX, comm); CHECK_FOR_MPI_ERROR(rc); - + if (w > 0){ if (cnt > 0){ recvFloatBuf = (float *)ZOLTAN_MALLOC(sizeof(float) * cnt * ew_dim); if (ew_dim && !recvFloatBuf) MEMORY_ERROR; } - + msg_tag--; - + ierr = Zoltan_Comm_Do_Reverse(plan, msg_tag, (char *)sendFloatBuf, sizeof(float) * ew_dim, NULL, (char *)recvFloatBuf); - + if (ierr != ZOLTAN_OK){ goto End; } ZOLTAN_FREE(&sendFloatBuf); - + if (cnt > 0){ cnt = 0; for (k=0; k < zhg->nPins; k++){ @@ -1015,7 +978,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; } } } - + ZOLTAN_FREE(&recvFloatBuf); } else{ @@ -1036,7 +999,7 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; ZOLTAN_FREE(&wgts); - /************************************************************************* + /************************************************************************* * Convert the graph edges to hyperedges. */ @@ -1045,10 +1008,10 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; ew_dim = zhg->edgeWeightDim; if (use_all_neighbors){ - /* + /* * Create a hyperedge out of each vertex, containing that vertex * and all of its neighbors. The hyperedge weight will be the - * maximum (not sum) of the weight of each original graph edge. + * maximum (not sum) of the weight of each original graph edge. */ zhg->nHedges = zhg->nObj; @@ -1108,8 +1071,8 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; zhg->Ewgt = wgts; } else{ - /* - * Create a hyperedge out of each pair of neighboring vertices. + /* + * Create a hyperedge out of each pair of neighboring vertices. * The hyperedge weight will be the weight of the original graph edge. * * The user may or may not have specified graph edges twice @@ -1175,13 +1138,13 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; ZOLTAN_FREE(&zhg->Pin_Procs); if (cnt > 0){ - + if (ew_dim > 0){ zhg->Ewgt = (float *)ZOLTAN_MALLOC(sizeof(float) * cnt * ew_dim); if (!zhg->Ewgt) MEMORY_ERROR; memcpy(zhg->Ewgt, wgts, ew_dim * cnt * sizeof(float)); } - + zhg->edgeGNO = (ZOLTAN_GNO_TYPE *)ZOLTAN_MALLOC(sizeof(ZOLTAN_GNO_TYPE) * cnt); if (!zhg->edgeGNO) MEMORY_ERROR; zhg->Esize = (int *)ZOLTAN_MALLOC(sizeof(int) * cnt); @@ -1190,11 +1153,11 @@ phg_GID_lookup *lookup_myHshVtxs = NULL; if (!zhg->pinGNO) MEMORY_ERROR; zhg->Pin_Procs = (int *)ZOLTAN_MALLOC(sizeof(int) * cnt * 2); if (!zhg->Pin_Procs) MEMORY_ERROR; - + memcpy(zhg->pinGNO, edgeBuf, 2 * cnt * sizeof(ZOLTAN_GNO_TYPE)); - + memcpy(zhg->Pin_Procs, procBuf, 2 * cnt * sizeof(int)); - + for (i=0; i < cnt; i++){ zhg->Esize[i] = 2; } @@ -1370,7 +1333,7 @@ int Zoltan_PHG_GIDs_to_global_numbers(ZZ *zz, ZOLTAN_GNO_TYPE *gnos, int len, in * use global numbers which are consecutive integers beginning with zero. Convert * the application's global IDs to our global numbers. */ - + if (randomize) { /* Randomize the global numbers */ gtotal = (ZOLTAN_GNO_TYPE *) ZOLTAN_CALLOC(3*nProc+1, sizeof(ZOLTAN_GNO_TYPE)); @@ -1442,7 +1405,7 @@ int Zoltan_PHG_GIDs_to_global_numbers(ZZ *zz, ZOLTAN_GNO_TYPE *gnos, int len, in } /*****************************************************************************/ -int Zoltan_Hypergraph_Queries(ZZ *zz, +int Zoltan_Hypergraph_Queries(ZZ *zz, int *num_lists, /* output: number of edges */ int *num_pins, /* output: total number of pins in edges */ ZOLTAN_ID_PTR *edg_GID, /* output: list of edge global IDs */ @@ -1633,7 +1596,7 @@ int numGID = zz->Num_GID; if (!found){ /* O(numEdges) calls to malloc may be costlier in some platforms. An * array of size O(numVerts) allocated first, and the reallocated if - * numVerts < numEdges could be useful then. SRSR : The performance + * numVerts < numEdges could be useful then. SRSR : The performance * improvement in octopi was small. */ hn = (struct _hash_node *)ZOLTAN_MALLOC(sizeof(struct _hash_node)); @@ -1651,7 +1614,7 @@ int numGID = zz->Num_GID; } /* Create array of indices into location in pin list. - * Create the corresponding list of unique edge IDs. + * Create the corresponding list of unique edge IDs. */ vIdx = (int *)ZOLTAN_MALLOC((numEdges+1) * sizeof(int)); @@ -1736,7 +1699,7 @@ int numGID = zz->Num_GID; } /*****************************************************************************/ -int Zoltan_Graph_Queries( ZZ *zz, +int Zoltan_Graph_Queries( ZZ *zz, int numVertex, ZOLTAN_ID_PTR vgid, ZOLTAN_ID_PTR vlid, /* IN */ int *tot_nbors, int **num_nbors, /* OUT */ ZOLTAN_ID_PTR *nbor_GIDs, int **nbor_Procs, /* OUT */ @@ -1778,7 +1741,7 @@ int *numEdges = NULL; if (sumNumEntries == 0){ goto End; } - + nbor_gids = ZOLTAN_MALLOC_GID_ARRAY(zz, sumNumEntries); nbor_procs = (int *)ZOLTAN_MALLOC(sizeof(int) * sumNumEntries); gewgts = (float *)ZOLTAN_MALLOC(sizeof(float) * ew_dim * sumNumEntries); @@ -1808,12 +1771,12 @@ int *numEdges = NULL; gid_ptr = nbor_gids; proc_ptr = nbor_procs; wgt_ptr = gewgts; - + for (i=0; iGet_Edge_List(zz->Get_Edge_List_Data, - gid_size, lid_size, - vgid + (i * gid_size), vlid + (i * lid_size), + gid_size, lid_size, + vgid + (i * gid_size), vlid + (i * lid_size), gid_ptr, proc_ptr, ew_dim, wgt_ptr, &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { diff --git a/packages/zoltan/src/phg/phg_coarse.c b/packages/zoltan/src/phg/phg_coarse.c index e58fa7e8c1..a9a7c48771 100644 --- a/packages/zoltan/src/phg/phg_coarse.c +++ b/packages/zoltan/src/phg/phg_coarse.c @@ -1,66 +1,29 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { #endif -#include "zz_sort.h" +#include "zz_sort.h" #include "phg.h" #include "zoltan_comm.h" #include "zz_util_const.h" -#define PLAN_TAG 32010 /* tag for comm plan */ +#define PLAN_TAG 32010 /* tag for comm plan */ /* #define _DEBUG1 #define _DEBUG2 - #define _DEBUG3 + #define _DEBUG3 */ #ifdef _DEBUG @@ -69,7 +32,7 @@ extern "C" { #define BITSET(data, elem) ((data)[(elem) >> 5] |=( 1 << ((elem) & 31))) #define BITCHECK(data, elem) ((data)[(elem) >> 5] & (1 << ((elem) & 31))) - + static unsigned int hashValue(HGraph *hg, int n, int *ar) { @@ -93,7 +56,7 @@ static unsigned int hashValue(HGraph *hg, int n, int *ar) in the same part (note that if a coarse vertex constitues of multiple fixed vertices; since they have to be fixed in the "same" side of bisection; the coarse vertex is fixed in the "first" fixed part). - Identical hyperedges are identified and collapsed into single one. + Identical hyperedges are identified and collapsed into single one. The array LevelMap is the mapping of the old vertices to the new vertices. It will be used to pass a partition of the coarse graph back to the original graph. */ @@ -108,7 +71,7 @@ int Zoltan_PHG_Coarsening int **LevelData, /* information to reverse coarsenings later */ struct Zoltan_Comm_Obj **comm_plan, PHGPartParams *hgp - ) + ) { char *yo = "Zoltan_PHG_Coarsening"; PHGComm *hgc = hg->comm; @@ -117,7 +80,7 @@ int Zoltan_PHG_Coarsening int *ahindex=NULL, *hlsize=NULL, *hsize=NULL, *ids=NULL, *iden; int *emptynets=NULL, emptynetsize, *idennets=NULL, *allemptynets=NULL, *allidennets=NULL, #ifdef _DEBUG1 - emptynetcnt, + emptynetcnt, #endif *idennetdest=NULL, rootRank; int *extmatchsendcnt=NULL, extmatchrecvcnt=0, *extmatchrecvcounts=NULL; @@ -141,7 +104,7 @@ int Zoltan_PHG_Coarsening int time_details; #ifdef _DEBUG1 - int totiden, totsize1; + int totiden, totsize1; double t_all, t_coarse, t_redhash, t_redsize, t_userredop, t_suffle, t_sort, t_iden, t_shrink, t_mirror, t_cur; #endif @@ -182,8 +145,8 @@ int Zoltan_PHG_Coarsening Zoltan_HG_HGraph_Init (c_hg); /* inits working copy of hypergraph info */ c_hg->comm = hg->comm; /* set communicators */ c_hg->info = hg->info + 1; /* for debugging */ - c_hg->coor = NULL; - c_hg->nDim = hg->nDim; + c_hg->coor = NULL; + c_hg->nDim = hg->nDim; c_hg->vmap = NULL; /* only needed by rec-bisec */ c_hg->redl = hg->redl; /* to stop coarsening near desired count */ c_hg->VtxWeightDim = hg->VtxWeightDim; @@ -196,15 +159,15 @@ int Zoltan_PHG_Coarsening MEMORY_ERROR; } -#ifdef _DEBUG1 - if (c_hg->fixed_part) +#ifdef _DEBUG1 + if (c_hg->fixed_part) for (i = 0; i < hg->nVtx; i++) c_hg->fixed_part[i] = -2; - if (c_hg->pref_part) + if (c_hg->pref_part) for (i = 0; i < hg->nVtx; i++) c_hg->pref_part[i] = -2; #endif - + /* (over) estimate number of external matches that we need to send data to */ count = 0; if (hgp->match_array_type==0) { /* old style */ @@ -223,7 +186,7 @@ int Zoltan_PHG_Coarsening if (px!=me) { ++extmatchsendcnt[px]; - ++count; + ++count; } } @@ -245,7 +208,7 @@ int Zoltan_PHG_Coarsening || !(listlno = (int*) ZOLTAN_MALLOC (count * sizeof(int))))) MEMORY_ERROR; - if (extmatchrecvcnt && + if (extmatchrecvcnt && !(*LevelData= (int*) ZOLTAN_MALLOC (extmatchrecvcnt * sizeof(int) * 2))) MEMORY_ERROR; @@ -259,37 +222,37 @@ int Zoltan_PHG_Coarsening for (i = 0; i < hg->nVtx; i++) { /* loop over every local vertice */ if (match[i] < 0) { /* external processor match */ ZOLTAN_GNO_TYPE gx = -match[i]-1, proc = VTX_TO_PROC_X(hg, gx); - + /* rule to determine "ownership" of coarsened vertices between procs */ proc = ((gx + VTX_LNO_TO_GNO (hg,i)) & 1) ? MIN(proc, me) : MAX(proc, me); - + /* prepare to send data to owner */ if (proc != me) { /* another processor owns this vertex */ LevelMap[i] = -gx - 1; - size += hg->vindex[i+1] - hg->vindex[i]; /* send buffer sizing */ + size += hg->vindex[i+1] - hg->vindex[i]; /* send buffer sizing */ listgno[count] = gx; /* listgno of vtx's to send */ listproc[count] = proc; /* proc to send to */ listlno[count++] = i; /* lno of my match to gno */ - } else { /* myProc owns the matching across processors */ + } else { /* myProc owns the matching across processors */ LevelMap[i] = (ZOLTAN_GNO_TYPE)c_hg->nVtx++; /* next available coarse vertex */ } } else if (!vmark[i]) { /* local matching, packing and groupings */ int v = i; - int fixed = -1, pref = -1; + int fixed = -1, pref = -1; while (!vmark[v]) { /* TODO64 invalid read if v is ZOLTAN_GNO_TYPE*/ if (hgp->UseFixedVtx && hg->fixed_part[v] >= 0) fixed = hg->fixed_part[v]; if (hgp->UsePrefPart && hg->pref_part[v] >= 0) pref = hg->pref_part[v]; - LevelMap[v] = (ZOLTAN_GNO_TYPE)c_hg->nVtx; /* next available coarse vertex */ + LevelMap[v] = (ZOLTAN_GNO_TYPE)c_hg->nVtx; /* next available coarse vertex */ vmark[v] = 1; /* flag this as done already */ - v = (int)match[v]; + v = (int)match[v]; } if (hgp->UseFixedVtx) { c_hg->fixed_part[c_hg->nVtx] = fixed; } if (hgp->UsePrefPart) - c_hg->pref_part[c_hg->nVtx] = pref; + c_hg->pref_part[c_hg->nVtx] = pref; ++c_hg->nVtx; } } @@ -310,14 +273,14 @@ int Zoltan_PHG_Coarsening ++c_hg->nVtx; } } - + for (i = 0; i < hg->nVtx; i++) { /* loop over every local vertices */ if (match[i] != VTX_LNO_TO_GNO(hg, i)) { ZOLTAN_GNO_TYPE gx = match[i], proc = VTX_TO_PROC_X(hg, gx); - + if (proc != me) { /* owner is external */ LevelMap[i] = -gx - 1; /* prepare to send data to owner */ - size += hg->vindex[i+1] - hg->vindex[i]; /* send buffer sizing */ + size += hg->vindex[i+1] - hg->vindex[i]; /* send buffer sizing */ listgno[count] = gx; /* listgno of vtx's to send */ listproc[count] = proc; /* proc to send to */ listlno[count++] = i; /* lno of my match to gno */ @@ -331,7 +294,7 @@ int Zoltan_PHG_Coarsening *LevelSndCnt = count; /* errexit("this type of coarsening is not implemented yet"); */ } - + /* Write list of: gno, lno, fixed_part, pref_part, size, vedge * size, weight * VtxWeightDim */ /* sizes of parts of the messages as multiples of integers */ @@ -370,7 +333,7 @@ int Zoltan_PHG_Coarsening for (j=0; j < sz; j++){ *intptr++ = hg->vedge[hg->vindex[lno] + j]; } - + if (hg->VtxWeightDim > 0){ for (j=0; j < hg->VtxWeightDim; j++){ *floatptr++ = hg->vwgt[lno*hg->VtxWeightDim + j]; @@ -378,7 +341,7 @@ int Zoltan_PHG_Coarsening } msg_size[i] = (b - (char *)gnoptr) / sizeof(int); - } + } if (hg->nDim) { /* Only process coords for coarse graph if fine graph has them */ if (count && !(coordbuf = (double *) ZOLTAN_MALLOC(count * hg->nDim * sizeof(double)))) @@ -392,9 +355,9 @@ int Zoltan_PHG_Coarsening } } /* Create comm plan. */ - Zoltan_Comm_Create(comm_plan, count, listproc, hgc->row_comm, PLAN_TAG, + Zoltan_Comm_Create(comm_plan, count, listproc, hgc->row_comm, PLAN_TAG, &size); /* we'll use size for coords and then resize*/ - + if (hg->nDim) { if (size && !(coordrecbuf = (double *) ZOLTAN_MALLOC(size * hg->nDim * sizeof(double)))) @@ -403,7 +366,7 @@ int Zoltan_PHG_Coarsening /* No need for resize yet, since coordinates won't be of variable sizes */ Zoltan_Comm_Do(*comm_plan, PLAN_TAG+1, (char *)coordbuf, sizeof(double) * hg->nDim, (char *)coordrecbuf); - + /* Allocate coordinate array for coarse hgraph */ if (c_hg->nVtx && ( !(c_hg->coor = (double *) ZOLTAN_CALLOC(c_hg->nVtx * hg->nDim, sizeof(double))) @@ -421,9 +384,9 @@ int Zoltan_PHG_Coarsening } } } - + /* call Comm_Resize since we have variable-size messages */ - Zoltan_Comm_Resize(*comm_plan, msg_size, PLAN_TAG+2, &size); + Zoltan_Comm_Resize(*comm_plan, msg_size, PLAN_TAG+2, &size); /* Allocate receive buffer. */ /* size is the size of the received data, measured in #ints */ @@ -442,7 +405,7 @@ int Zoltan_PHG_Coarsening /* Comm_Do sends personalized messages of variable sizes */ Zoltan_Comm_Do(*comm_plan, PLAN_TAG+3, (char *)buffer, sizeof(int), (char *)rbuffer); - + /* Allocate vertex weight array for coarse hgraph */ if (c_hg->nVtx > 0 && c_hg->VtxWeightDim > 0 && !(c_hg->vwgt = (float*) ZOLTAN_CALLOC (c_hg->nVtx * c_hg->VtxWeightDim, @@ -454,8 +417,8 @@ int Zoltan_PHG_Coarsening for (j=0; jVtxWeightDim; ++j) c_hg->vwgt[nni*hg->VtxWeightDim+j] += hg->vwgt[i*hg->VtxWeightDim+j]; } - - /* index all received data for rapid lookup */ + + /* index all received data for rapid lookup */ *LevelCnt = 0; b = rbuffer; b_end = rbuffer + (size * sizeof(int)); @@ -472,35 +435,35 @@ int Zoltan_PHG_Coarsening sz = intptr[1 + alt_field_count]; floatptr = (float *)(intptr + 2 + alt_field_count + sz); b = (char *)(floatptr + hg->VtxWeightDim); - + source_lno = *intptr++; lno = VTX_GNO_TO_LNO (hg, gnoptr[0]); - + if (hgp->UseFixedVtx) { int fixed = *intptr++; c_hg->fixed_part [LevelMap[lno]] = (fixed >= 0) ? fixed : hg->fixed_part[lno]; - } + } if (hgp->UsePrefPart) { int pref = *intptr++; c_hg->pref_part [LevelMap[lno]] = (pref >= 0) ? pref : hg->pref_part[lno]; - } - + } + (*LevelData)[(*LevelCnt)++] = source_lno; (*LevelData)[(*LevelCnt)++] = lno; /* to lookup in part[] */ lno = (int)LevelMap[lno]; if (hg->nDim) { for (j = 0; j < hg->nDim; j++){ - /* NOTE: This code must preceed accumulation of vwgt below so that + /* NOTE: This code must preceed accumulation of vwgt below so that * floatptr is correct. */ c_hg->coor[lno * hg->nDim + j] += (*floatptr * *doubleptr++); } coorcount[lno] += *floatptr; } - + for (j=0; jVtxWeightDim; ++j) c_hg->vwgt[lno*hg->VtxWeightDim+j] += *floatptr++; - + intptr++; /* skip sz */ for (j=0; jcoor[i * hg->nDim + j] = c_hg->coor[i * hg->nDim + j] / coorcount[i]; ZOLTAN_FREE(&coorcount); } - + for (i=0; inEdge; ++i) /* prefix sum over ahindex */ ahindex[i+1] += ahindex[i]; /* now prepare ahvertex */ @@ -530,7 +493,7 @@ int Zoltan_PHG_Coarsening floatptr = (float *)(intptr + 2 + alt_field_count + sz); b = (char *)(floatptr + hg->VtxWeightDim); - intptr += (2 + alt_field_count); + intptr += (2 + alt_field_count); lno=VTX_GNO_TO_LNO (hg, gnoptr[0]); @@ -539,7 +502,7 @@ int Zoltan_PHG_Coarsening } Zoltan_Multifree (__FILE__, __LINE__, 4, &buffer, &rbuffer, &coordbuf, &coordrecbuf); - + c_hg->nPins = hg->nPins + ahindex[hg->nEdge]; /* safe over estimate of nPins */ c_hg->nEdge = hg->nEdge; @@ -578,10 +541,10 @@ int Zoltan_PHG_Coarsening for (j=ahindex[i]; j=0 && vmark[nvno]!=i) { - c_hg->hvertex[idx++] = (int)nvno; + c_hg->hvertex[idx++] = (int)nvno; vmark[nvno] = i; } - } + } /* in qsort start and end indices are inclusive */ Zoltan_quicksort_list_inc_one_int(&c_hg->hvertex[sidx], 0, idx-sidx-1); } @@ -605,11 +568,11 @@ int Zoltan_PHG_Coarsening /* UVC TODO to compute global hash; right now we'll use SUM (UVC TODO: try:bitwise xor); we need to check if this is good, if not we need to find a better way */ - if (c_hg->nEdge) + if (c_hg->nEdge) MPI_Allreduce(lhash, hash, c_hg->nEdge, MPI_UNSIGNED, MPI_SUM, hgc->row_comm); Zoltan_Multifree(__FILE__, __LINE__, 3, &vmark, &ahvertex, &ahindex); - + #ifdef _DEBUG1 MPI_Barrier(hgc->Communicator); t_cur = MPI_Wtime(); @@ -619,8 +582,8 @@ int Zoltan_PHG_Coarsening for (i=0; i < c_hg->nEdge; ++i) /* decide where to send */ listproc[i] = (int) (hash[i] % hgc->nProc_y); - - Zoltan_Comm_Create(&plan, c_hg->nEdge, listproc, hgc->col_comm, PLAN_TAG+10, + + Zoltan_Comm_Create(&plan, c_hg->nEdge, listproc, hgc->col_comm, PLAN_TAG+10, &size); /* send hash values */ @@ -642,7 +605,7 @@ int Zoltan_PHG_Coarsening } if (size && ( !(ip = (int *) ZOLTAN_MALLOC(size * sizeof(int))) - || !(hsize = (int *) ZOLTAN_MALLOC(size * sizeof(int))) + || !(hsize = (int *) ZOLTAN_MALLOC(size * sizeof(int))) || !(c_ewgt = (float *)ZOLTAN_MALLOC(size * sizeof(float)*c_hg->EdgeWeightDim)))) { Zoltan_Comm_Destroy (&plan); MEMORY_ERROR; @@ -671,7 +634,7 @@ int Zoltan_PHG_Coarsening ZOLTAN_FREE(&hlsize); hlsize=ip; - if (size) + if (size) MPI_Allreduce(hlsize, hsize, size, MPI_INT, MPI_SUM, hgc->row_comm); #ifdef _DEBUG1 MPI_Barrier(hgc->Communicator); @@ -695,7 +658,7 @@ int Zoltan_PHG_Coarsening } /* lhash is actually global hash */ - Zoltan_quicksort_pointer_inc_int_int((int *)ids, (int *)lhash, hsize, 0, size-1); + Zoltan_quicksort_pointer_inc_int_int((int *)ids, (int *)lhash, hsize, 0, size-1); /* uqsort_ptr_uint_int(size, lhash, hsize, ids); */ #ifdef _DEBUG1 @@ -721,7 +684,7 @@ int Zoltan_PHG_Coarsening else { iden[j] = -1; BITSET(emptynets, j); -#ifdef _DEBUG1 +#ifdef _DEBUG1 ++emptynetcnt; #endif } @@ -735,14 +698,14 @@ int Zoltan_PHG_Coarsening for (i = j+1; iCommunicator); t_cur = MPI_Wtime(); @@ -785,11 +748,11 @@ int Zoltan_PHG_Coarsening /* a simple message size opt; proc with largest message is root; so it won't sent it */ - Zoltan_PHG_Find_Root(idx+emptynetsize, hgc->myProc_x, hgc->row_comm, - &i, &rootRank); - + Zoltan_PHG_Find_Root(idx+emptynetsize, hgc->myProc_x, hgc->row_comm, + &i, &rootRank); + /* communicate empty-nets to row-root */ - if (hgc->myProc_x == rootRank){ + if (hgc->myProc_x == rootRank){ allemptynets = (int *) ZOLTAN_MALLOC(emptynetsize*hgc->nProc_x*sizeof(int)); if ((emptynetsize*hgc->nProc_x > 0) && !allemptynets) MEMORY_ERROR; } @@ -799,21 +762,21 @@ int Zoltan_PHG_Coarsening MPI_Gather(&idx, 1, MPI_INT, msg_size, 1, MPI_INT, rootRank, hgc->row_comm); if (hgc->myProc_x == rootRank) { int recsize = 0; - for (i = 0; i < hgc->nProc_x; i++) + for (i = 0; i < hgc->nProc_x; i++) recsize += msg_size[i]; allidennets = (int *) ZOLTAN_MALLOC(recsize*sizeof(int)); idennetdest = (int *) ZOLTAN_MALLOC(hgc->nProc_x*sizeof(int)); if ((recsize && !allidennets) || (hgc->nProc_x && !idennetdest)) MEMORY_ERROR; - + idennetdest[0] = 0; for (i = 1; i < hgc->nProc_x; i++) idennetdest[i] = idennetdest[i-1] + msg_size[i-1]; - } + } MPI_Gatherv (idennets, idx, MPI_INT, allidennets, msg_size, idennetdest, MPI_INT, rootRank, hgc->row_comm); - + ip = (int *) lhash; if (hgc->myProc_x == rootRank) { for (j=0; jnProc_x; ++j) { @@ -827,9 +790,9 @@ int Zoltan_PHG_Coarsening } for (i=0; i UVC note that this is same as x < y x -1 -1==bb[x] ? x : 0 --> UVC note that this is same as y < x 0 y 0 : 0 means not identical to anyone in this proc; hence not identical anyone in all - x 0 0 + x 0 0 x x x : they are identical to same net x < y x==a[y] ? y : 0 x > y y==bb[x] ? x : 0 */ - + x = ip; y = iden; memcpy(ids, iden, size*sizeof(int)); aa = ip-1; bb=ids-1; /* net ids in the aa and bb are base-1 numbers */ @@ -859,18 +822,18 @@ int Zoltan_PHG_Coarsening ; /* no op */ else if (*x < *y) *y = (*x==aa[*y]) ? *y : 0; - else /* *x > *y */ + else /* *x > *y */ *y = (*y==bb[*x]) ? *x : 0; } } } ip = iden; } - ZOLTAN_FREE(&ids); + ZOLTAN_FREE(&ids); MPI_Bcast(ip, size, MPI_INT, rootRank, hgc->row_comm); Zoltan_Multifree(__FILE__, __LINE__, 5, &idennets, &emptynets, &allemptynets, &allidennets, &idennetdest); -#ifdef _DEBUG1 +#ifdef _DEBUG1 MPI_Barrier(hgc->Communicator); t_cur = MPI_Wtime(); t_userredop += t_cur; @@ -878,7 +841,7 @@ int Zoltan_PHG_Coarsening me = idx = 0; #endif - + c_hg->nPins = 0; c_hg->nEdge = 0; for (i=0; i1) { /* NOT identical and size not 0/1 */ + } else if (hsize[i]>1) { /* NOT identical and size not 0/1 */ c_hg->nPins += hlsize[i]; ++c_hg->nEdge; ip[i] = 1; /* Don't ignore */ @@ -908,7 +871,7 @@ int Zoltan_PHG_Coarsening ip[i] = 0; /* ignore size 0/1 nets*/ #ifdef _DEBUG1 ++me; -#endif +#endif } } @@ -921,7 +884,7 @@ int Zoltan_PHG_Coarsening MPI_Allreduce(&idx, &totiden, 1, MPI_INT, MPI_SUM, hgc->col_comm); MPI_Allreduce(&me, &totsize1, 1, MPI_INT, MPI_SUM, hgc->col_comm); if (!hgc->myProc) - uprintf(hgc, "Level %d - Orig #Nets=%d Iden=%d Size-0/1=%d CurT=%.3lf user-def redopT=%.3lf\n", hg->info, hg->dist_y[hgc->nProc_y], totiden, totsize1, t_cur, t_userredop); + uprintf(hgc, "Level %d - Orig #Nets=%d Iden=%d Size-0/1=%d CurT=%.3lf user-def redopT=%.3lf\n", hg->info, hg->dist_y[hgc->nProc_y], totiden, totsize1, t_cur, t_userredop); #endif Zoltan_Multifree(__FILE__, __LINE__, 3, &c_hg->hindex, &c_hg->hvertex, &c_hg->ewgt); @@ -938,13 +901,13 @@ int Zoltan_PHG_Coarsening !(c_hg->esize=(ZOLTAN_GNO_TYPE*)ZOLTAN_MALLOC(c_hg->nEdge*sizeof(ZOLTAN_GNO_TYPE)))) MEMORY_ERROR; -#ifdef _DEBUG1 +#ifdef _DEBUG1 #ifndef _DEBUG2 if (!hgc->myProc) #endif uprintf(hgc, "Reconstructing coarsen hygr.... ElapT= %.3lf\n", MPI_Wtime()-t_all); -#endif - +#endif + for (idx=ni=i=0; ihindex[ni] = idx; @@ -962,7 +925,7 @@ int Zoltan_PHG_Coarsening } #ifdef _DEBUG1 - MPI_Barrier(hgc->Communicator); + MPI_Barrier(hgc->Communicator); t_cur = MPI_Wtime(); t_shrink += t_cur; t_mirror = -t_cur; @@ -981,26 +944,26 @@ int Zoltan_PHG_Coarsening MPI_Scan(&tmp_gno, c_hg->dist_x, 1, zoltan_gno_mpi_type, MPI_SUM, hgc->row_comm); MPI_Allgather(c_hg->dist_x, 1, zoltan_gno_mpi_type, &(c_hg->dist_x[1]), 1, zoltan_gno_mpi_type, hgc->row_comm); c_hg->dist_x[0] = 0; - + tmp_gno = (ZOLTAN_GNO_TYPE)c_hg->nEdge; MPI_Scan(&tmp_gno, c_hg->dist_y, 1, zoltan_gno_mpi_type, MPI_SUM, hgc->col_comm); MPI_Allgather(c_hg->dist_y, 1, zoltan_gno_mpi_type, &(c_hg->dist_y[1]), 1, zoltan_gno_mpi_type, hgc->col_comm); - c_hg->dist_y[0] = 0; + c_hg->dist_y[0] = 0; ierr = Zoltan_HG_Create_Mirror(zz, c_hg); #ifdef _DEBUG1 if (c_hg->fixed_part) for (i = 0; i < c_hg->nVtx; i++){ if (c_hg->fixed_part[i] == -2) - printf ("RTHRTH BAD COARSENING for FIXED VERTICES\n"); + printf ("RTHRTH BAD COARSENING for FIXED VERTICES\n"); } if (c_hg->pref_part) for (i = 0; i < c_hg->nVtx; i++){ if (c_hg->pref_part[i] == -2) uprintf(hgc, "*******BAD COARSENING for PREF[%d] is unassigned\n", i); } - - MPI_Barrier(hgc->Communicator); + + MPI_Barrier(hgc->Communicator); t_mirror += MPI_Wtime(); #endif End: @@ -1015,7 +978,7 @@ int Zoltan_PHG_Coarsening ); #ifdef _DEBUG1 - MPI_Barrier(hgc->Communicator); + MPI_Barrier(hgc->Communicator); t_cur = MPI_Wtime(); t_mirror += t_cur; t_all = t_cur-t_all; diff --git a/packages/zoltan/src/phg/phg_comm.c b/packages/zoltan/src/phg/phg_comm.c index 43cdb11248..309753c1de 100644 --- a/packages/zoltan/src/phg/phg_comm.c +++ b/packages/zoltan/src/phg/phg_comm.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus extern "C" { diff --git a/packages/zoltan/src/phg/phg_comm.h b/packages/zoltan/src/phg/phg_comm.h index 27b1e131db..fb2111d53a 100644 --- a/packages/zoltan/src/phg/phg_comm.h +++ b/packages/zoltan/src/phg/phg_comm.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_COMM_H #define __ZOLTAN_PHG_COMM_H diff --git a/packages/zoltan/src/phg/phg_const.h b/packages/zoltan/src/phg/phg_const.h index 604af72511..047f941c28 100644 --- a/packages/zoltan/src/phg/phg_const.h +++ b/packages/zoltan/src/phg/phg_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PHG_CONST_H #define __PHG_CONST_H diff --git a/packages/zoltan/src/phg/phg_distrib.c b/packages/zoltan/src/phg/phg_distrib.c index 9919633116..c91a6fc142 100644 --- a/packages/zoltan/src/phg/phg_distrib.c +++ b/packages/zoltan/src/phg/phg_distrib.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -58,14 +21,14 @@ extern "C" { #define _DEBUG3 */ - + int Zoltan_PHG_Gno_To_Proc_Block( ZOLTAN_GNO_TYPE gno, ZOLTAN_GNO_TYPE *dist_dim, int nProc_dim ) { -/* Function that locates a given global number gno within a distribution +/* Function that locates a given global number gno within a distribution * vector dist. * Works for both vtx and edges. * Takes an initial guess based on equal distribution of gno's. @@ -102,10 +65,10 @@ static void PrintArr(PHGComm *hgc, char *st, int *ar, int n) static int Zoltan_PHG_Redistribute_Hypergraph( - ZZ *zz, + ZZ *zz, PHGPartParams *hgp, /* Input: parameters; used only for UseFixedVtx */ HGraph *ohg, /* Input: Local part of distributed hypergraph */ - int firstproc, /* Input: rank (in ocomm) of the first proc of + int firstproc, /* Input: rank (in ocomm) of the first proc of the ncomm*/ int *v2Col, /* Input: Vertex to processor Column Mapping */ int *n2Row, /* Input: Net to processor Row Mapping */ @@ -122,19 +85,19 @@ static int Zoltan_PHG_Redistribute_Hypergraph( int ierr=ZOLTAN_OK; int i, v, n, nPins, nsend, elemsz, nVtx, nEdge; int msg_tag = 9999; - int *proclist=NULL, *cnt=NULL; + int *proclist=NULL, *cnt=NULL; int *intbuf; ZOLTAN_GNO_TYPE *sendbuf=NULL; ZOLTAN_GNO_TYPE *vno=NULL, *nno=NULL, *dist_x=NULL, *dist_y=NULL, *vsn=NULL, *nsn=NULL, *pins=NULL; - ZOLTAN_COMM_OBJ *plan; + ZOLTAN_COMM_OBJ *plan; MPI_Datatype zoltan_gno_mpi_type; zoltan_gno_mpi_type = Zoltan_mpi_gno_type(); - + Zoltan_HG_HGraph_Init (nhg); nhg->comm = ncomm; - + nhg->dist_x = (ZOLTAN_GNO_TYPE *) ZOLTAN_CALLOC(ncomm->nProc_x+1, sizeof(ZOLTAN_GNO_TYPE)); nhg->dist_y = (ZOLTAN_GNO_TYPE *) ZOLTAN_CALLOC(ncomm->nProc_y+1, sizeof(ZOLTAN_GNO_TYPE)); dist_x = (ZOLTAN_GNO_TYPE *) ZOLTAN_CALLOC(ncomm->nProc_x+1, sizeof(ZOLTAN_GNO_TYPE)); @@ -149,7 +112,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( uprintf(ocomm, " new comm nProcx=%d nProcy=%d nvtx=%d nedge=%d", ncomm->nProc_x, ncomm->nProc_y, ohg->nVtx, ohg->nEdge); MEMORY_ERROR; } - + for (v = 0; v < ohg->nVtx; ++v) ++dist_x[v2Col[v]]; for (n = 0; n < ohg->nEdge; ++n) @@ -161,17 +124,17 @@ static int Zoltan_PHG_Redistribute_Hypergraph( 1- in the increasing processor order, 2- order of the items send by a processor is preserved. */ - + /* compute prefix sum to find new vertex start numbers; for each processor */ MPI_Scan(dist_x, vsn, ncomm->nProc_x, zoltan_gno_mpi_type, MPI_SUM, ocomm->row_comm); - /* All reduce to compute how many each processor will have */ - MPI_Allreduce(dist_x, &(nhg->dist_x[1]), ncomm->nProc_x, zoltan_gno_mpi_type, MPI_SUM, + /* All reduce to compute how many each processor will have */ + MPI_Allreduce(dist_x, &(nhg->dist_x[1]), ncomm->nProc_x, zoltan_gno_mpi_type, MPI_SUM, ocomm->row_comm); - nhg->dist_x[0] = 0; - for (i=1; i<=ncomm->nProc_x; ++i) + nhg->dist_x[0] = 0; + for (i=1; i<=ncomm->nProc_x; ++i) nhg->dist_x[i] += nhg->dist_x[i-1]; - + MPI_Scan(dist_y, nsn, ncomm->nProc_y, zoltan_gno_mpi_type, MPI_SUM, ocomm->col_comm); MPI_Allreduce(dist_y, &(nhg->dist_y[1]), ncomm->nProc_y, zoltan_gno_mpi_type, MPI_SUM, ocomm->col_comm); @@ -183,7 +146,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( PrintArr(ocomm, "vsn", vsn, ncomm->nProc_x); PrintArr(ocomm, "nsn", nsn, ncomm->nProc_y); #endif - + /* find mapping of current LOCAL vertex no (in my node) to "new" vertex no LOCAL to dest node*/ for (v = ohg->nVtx-1; v>=0; --v) @@ -202,7 +165,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( /* first communicate pins */ nPins = 0; - for (v = 0; v < ohg->nVtx; ++v) { + for (v = 0; v < ohg->nVtx; ++v) { for (i = ohg->vindex[v]; i < ohg->vindex[v+1]; ++i) { #ifdef _DEBUG1 if ((n2Row[ohg->vedge[i]] * ncomm->nProc_x + v2Col[v])<0 || @@ -212,7 +175,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( proclist[nPins] = firstproc + n2Row[ohg->vedge[i]] * ncomm->nProc_x + v2Col[v]; sendbuf[2*nPins] = vno[v]; sendbuf[2*nPins+1]= nno[ohg->vedge[i]]; - ++nPins; + ++nPins; } } #ifdef _DEBUG1 @@ -231,8 +194,8 @@ static int Zoltan_PHG_Redistribute_Hypergraph( errexit("terminating"); } #endif - - if (nPins && (pins = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nPins * 2 * sizeof(ZOLTAN_GNO_TYPE)))==NULL) + + if (nPins && (pins = (ZOLTAN_GNO_TYPE *) ZOLTAN_MALLOC(nPins * 2 * sizeof(ZOLTAN_GNO_TYPE)))==NULL) MEMORY_ERROR; --msg_tag; @@ -243,41 +206,41 @@ static int Zoltan_PHG_Redistribute_Hypergraph( nsend = 0; intbuf = (int *)sendbuf; if (!ocomm->myProc_y) { /* only first row sends to the first row of ncomm */ - for (v = 0; v < ohg->nVtx; ++v) { + for (v = 0; v < ohg->nVtx; ++v) { proclist[nsend] = firstproc+v2Col[v]; intbuf[nsend++] = ohg->vmap[v]; } } - - --msg_tag; - ierr |= Zoltan_Comm_Create(&plan, nsend, proclist, ocomm->Communicator, msg_tag, &nVtx); + + --msg_tag; + ierr |= Zoltan_Comm_Create(&plan, nsend, proclist, ocomm->Communicator, msg_tag, &nVtx); #ifdef _DEBUG1 - if (ncomm->myProc==-1 && nVtx>1) { /* this processor is not in new comm but receiving data?*/ + if (ncomm->myProc==-1 && nVtx>1) { /* this processor is not in new comm but receiving data?*/ uprintf(ocomm, "Something wrong; why I'm receiving data nVtx=%d\n", nVtx); errexit("terminating"); } #endif /* those are only needed in the first row of ncomm */ - *vmap = *vdest = NULL; + *vmap = *vdest = NULL; if (!ncomm->myProc_y && nVtx && (!(*vmap = (int *) ZOLTAN_MALLOC(nVtx * sizeof(int))) || !(*vdest = (int *) ZOLTAN_MALLOC(nVtx * sizeof(int))))) MEMORY_ERROR; - + --msg_tag; Zoltan_Comm_Do(plan, msg_tag, (char *) sendbuf, sizeof(int), (char *) *vmap); intbuf = (int *)sendbuf; if (!ocomm->myProc_y) { /* only first row sends to the first row of ncomm */ - for (v = 0; v < ohg->nVtx; ++v) + for (v = 0; v < ohg->nVtx; ++v) intbuf[v] = ocomm->myProc; } --msg_tag; Zoltan_Comm_Do(plan, msg_tag, (char *) sendbuf, sizeof(int), (char *) *vdest); - + if (ncomm->myProc!=-1) { /* I'm in the new comm */ /* ncomm's first row now bcast to other rows */ MPI_Bcast(&nVtx, 1, MPI_INT, 0, ncomm->col_comm); @@ -285,7 +248,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( if (nVtx!=(int)(nhg->dist_x[ncomm->myProc_x+1] - nhg->dist_x[ncomm->myProc_x])) errexit("nVtx(%d)!= nhg->dist_x[ncomm->myProc_x+1] - nhg->dist_x[ncomm->myProc_x](%d)", nVtx, nhg->dist_x[ncomm->myProc_x+1] - nhg->dist_x[ncomm->myProc_x]); #endif - if (nVtx && (nhg->vmap = (int *) ZOLTAN_MALLOC(nVtx * sizeof(int)))==NULL) + if (nVtx && (nhg->vmap = (int *) ZOLTAN_MALLOC(nVtx * sizeof(int)))==NULL) MEMORY_ERROR; for (i=0; ivmap[i] = i; @@ -298,7 +261,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( nhg->vwgt = (float*) ZOLTAN_MALLOC(nVtx*ohg->VtxWeightDim*sizeof(float)); if (!nhg->vwgt) MEMORY_ERROR; } - + --msg_tag; Zoltan_Comm_Do(plan, msg_tag, (char *) ohg->vwgt, ohg->VtxWeightDim*sizeof(float), (char *) nhg->vwgt); @@ -319,7 +282,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( if (ncomm->myProc != -1) /* ncomm's first row bcast to other rows */ MPI_Bcast(nhg->coor, nVtx * ohg->nDim, MPI_DOUBLE, 0, ncomm->col_comm); } - + /* communicate fixed vertices, if any */ if (hgp->UseFixedVtx) { if (nVtx){ @@ -331,7 +294,7 @@ static int Zoltan_PHG_Redistribute_Hypergraph( sizeof(int), (char *) nhg->fixed_part); if (ncomm->myProc!=-1) /* ncomm's first row now bcast to other rows */ MPI_Bcast(nhg->fixed_part, nVtx, MPI_INT, 0, ncomm->col_comm); - } + } /* communicate pref parts, if any */ if (hgp->UsePrefPart) { if (nVtx){ @@ -348,13 +311,13 @@ static int Zoltan_PHG_Redistribute_Hypergraph( /* this comm plan is no longer needed. */ Zoltan_Comm_Destroy(&plan); - + if (ohg->EdgeWeightDim) { /* now communicate edge weights */ nsend = 0; if (!ocomm->myProc_x) /* only first column sends to first column of ncomm */ - for (n = 0; n < ohg->nEdge; ++n) + for (n = 0; n < ohg->nEdge; ++n) proclist[nsend++] = firstproc + n2Row[n]*ncomm->nProc_x; - + --msg_tag; ierr |= Zoltan_Comm_Create(&plan, nsend, proclist, ocomm->Communicator, msg_tag, &nEdge); @@ -373,28 +336,28 @@ static int Zoltan_PHG_Redistribute_Hypergraph( errexit("nEdge(%d)!=nhg->dist_y[ncomm->myProc_y+1] - nhg->dist_y[ncomm->myProc_y](%d)", nEdge, nhg->dist_y[ncomm->myProc_y+1] - nhg->dist_y[ncomm->myProc_y]); #endif } - + if (nEdge){ nhg->ewgt = (float*) ZOLTAN_MALLOC(nEdge*ohg->EdgeWeightDim*sizeof(float)); if (!nhg->ewgt) MEMORY_ERROR; } - + --msg_tag; Zoltan_Comm_Do(plan, msg_tag, (char *) ohg->ewgt, ohg->EdgeWeightDim*sizeof(float), (char *) nhg->ewgt); if (ncomm->myProc!=-1) { /* if we're in the new comm */ /* ncomm's first column now bcast to other columns */ - if (nEdge) - MPI_Bcast(nhg->ewgt, nEdge*ohg->EdgeWeightDim, MPI_FLOAT, 0, + if (nEdge) + MPI_Bcast(nhg->ewgt, nEdge*ohg->EdgeWeightDim, MPI_FLOAT, 0, ncomm->row_comm); } Zoltan_Comm_Destroy(&plan); - } else - nEdge = (ncomm->myProc==-1) - ? 0 + } else + nEdge = (ncomm->myProc==-1) + ? 0 : (int)(nhg->dist_y[ncomm->myProc_y+1] - nhg->dist_y[ncomm->myProc_y]); - + if (ncomm->myProc==-1) { #ifdef _DEBUG1 @@ -406,28 +369,28 @@ static int Zoltan_PHG_Redistribute_Hypergraph( nhg->nEdge = (int)(nhg->dist_y[ncomm->myProc_y+1] - nhg->dist_y[ncomm->myProc_y]); nhg->nVtx = (int)(nhg->dist_x[ncomm->myProc_x+1] - nhg->dist_x[ncomm->myProc_x]); nhg->nPins = nPins; - + /* Unpack the pins received. */ cnt = (int *) ZOLTAN_CALLOC(nhg->nVtx + 1, sizeof(int)); nhg->vindex = (int *) ZOLTAN_CALLOC(nhg->nVtx + 1, sizeof(int)); nhg->vedge = (int *) ZOLTAN_MALLOC(nhg->nPins * sizeof(int)); - + if (!cnt || !nhg->vindex || (nPins && !nhg->vedge)) MEMORY_ERROR; /* Count the number of pins per vertex */ for (i = 0; i < nPins; ++i) ++cnt[pins[2*i]]; - + /* Compute prefix sum to represent hindex correctly. */ for (i = 0; i < nhg->nVtx; ++i) { nhg->vindex[i+1] = nhg->vindex[i] + cnt[i]; cnt[i] = nhg->vindex[i]; } - for (i = 0; i < nPins; ++i) + for (i = 0; i < nPins; ++i) nhg->vedge[cnt[pins[2*i]]++] = pins[2*i+1]; - + nhg->info = ohg->info; nhg->nDim = ohg->nDim; nhg->VtxWeightDim = ohg->VtxWeightDim; @@ -445,15 +408,15 @@ static int Zoltan_PHG_Redistribute_Hypergraph( &proclist, &sendbuf, &pins, &cnt, &vno, &nno, &dist_x, &dist_y, &vsn, &nsn ); - + return ierr; } - + /**********************************************************************/ int Zoltan_PHG_Redistribute( - ZZ *zz, + ZZ *zz, PHGPartParams *hgp, /* Input: parameters; used only for user's request of nProc_x and nProc_y */ HGraph *ohg, /* Input: Local part of distributed hypergraph */ @@ -465,7 +428,7 @@ int Zoltan_PHG_Redistribute( vertex map from nhg to ohg's local vertex number*/ int **vdest /* Output: allocated with the size nhg->nVtx and stores dest proc in ocomm */ - ) + ) { char * yo = "Zoltan_PHG_Redistribute"; PHGComm *ocomm = ohg->comm; @@ -487,24 +450,24 @@ int Zoltan_PHG_Redistribute( for (i=lo; i<=hi; ++i) ranks[i-lo] = i; - + MPI_Group_incl(allgrp, hi-lo+1, ranks, &newgrp); MPI_Comm_create(ocomm->Communicator, newgrp, &nmpicomm); MPI_Group_free(&newgrp); - MPI_Group_free(&allgrp); + MPI_Group_free(&allgrp); ZOLTAN_FREE(&ranks); if (reqx==1 || reqy==1) ; else reqx = reqy = -1; - + /* fill ncomm */ - ierr = Zoltan_PHG_Set_2D_Proc_Distrib(ocomm->zz, nmpicomm, - ocomm->myProc-lo, hi-lo+1, + ierr = Zoltan_PHG_Set_2D_Proc_Distrib(ocomm->zz, nmpicomm, + ocomm->myProc-lo, hi-lo+1, reqx, reqy, ncomm); - - v2Col = (int *) ZOLTAN_MALLOC(ohg->nVtx * sizeof(int)); + + v2Col = (int *) ZOLTAN_MALLOC(ohg->nVtx * sizeof(int)); n2Row = (int *) ZOLTAN_MALLOC(ohg->nEdge * sizeof(int)); if ( (ohg->nVtx && !v2Col) || (ohg->nEdge && !n2Row)) MEMORY_ERROR; @@ -514,28 +477,28 @@ int Zoltan_PHG_Redistribute( mechanisms */ /* KDDKDD 5/11/07: Round-off error in the computation of v2Col * and n2Row can lead to different answers on different platforms. - * Vertices or edges get sent to different processors during the + * Vertices or edges get sent to different processors during the * split, resulting in different matchings and, thus, different * answers. * Problem was observed on hg_cage10, zdrive.inp.phg.ipm.nproc_vertex1 * and zdrive.inp.phg.ipm.nproc_edge1; * solaris machine seamus and linux machine patches give different - * results due to differences in n2Row and v2Col, respectively. + * results due to differences in n2Row and v2Col, respectively. * Neither answer is wrong, * but the linux results result in FAILED test in test_zoltan. - * KDDKDD 10/28/15: Round-off error when using floats can cause v2Col - * and n2Row to have invalid results, which exhibited in Comm_Do_Post. + * KDDKDD 10/28/15: Round-off error when using floats can cause v2Col + * and n2Row to have invalid results, which exhibited in Comm_Do_Post. * Changing to doubles solved the problem (for now, at least). */ frac = (double) ohg->nVtx / (double) ncomm->nProc_x; for (i=0; inVtx; ++i) v2Col[i] = (int) ((double) i / frac); frac = (double) ohg->nEdge / (double) ncomm->nProc_y; - for (i=0; inEdge; ++i) + for (i=0; inEdge; ++i) n2Row[i] = (int) ((double) i / frac); - ierr |= Zoltan_PHG_Redistribute_Hypergraph(zz, hgp, ohg, lo, - v2Col, n2Row, ncomm, + ierr |= Zoltan_PHG_Redistribute_Hypergraph(zz, hgp, ohg, lo, + v2Col, n2Row, ncomm, nhg, vmap, vdest); End: @@ -545,7 +508,7 @@ int Zoltan_PHG_Redistribute( return ierr; } - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif diff --git a/packages/zoltan/src/phg/phg_distrib.h b/packages/zoltan/src/phg/phg_distrib.h index cfa43cd4de..dc23b8a878 100644 --- a/packages/zoltan/src/phg/phg_distrib.h +++ b/packages/zoltan/src/phg/phg_distrib.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_DISTRIB_H #define __ZOLTAN_PHG_DISTRIB_H @@ -55,7 +18,7 @@ extern "C" { int Zoltan_PHG_Gno_To_Proc_Block(ZOLTAN_GNO_TYPE gno, ZOLTAN_GNO_TYPE *dist_dim, int nProc_dim); - + int Zoltan_PHG_Redistribute( ZZ *zz, PHGPartParams *hgp, /* Input: parameters; used only for user's @@ -68,13 +31,13 @@ int Zoltan_PHG_Redistribute( int **vmap, /* Output: allocated with the size nhg->nVtx and vertex map from nhg to ohg's local vertex number*/ int **vdest /* Output: allocated with the size nhg->nVtx and - stores dest proc in ocomm */ + stores dest proc in ocomm */ ); + + - - - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif diff --git a/packages/zoltan/src/phg/phg_gather.c b/packages/zoltan/src/phg/phg_gather.c index cbc3bb0964..61afddd1d6 100644 --- a/packages/zoltan/src/phg/phg_gather.c +++ b/packages/zoltan/src/phg/phg_gather.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -58,14 +21,14 @@ extern "C" { /****************************************************************************/ int Zoltan_PHG_Gather_To_All_Procs( - ZZ *zz, + ZZ *zz, HGraph *phg, /* Input: Local part of distributed hypergraph */ PHGPartParams *hgp, /* Input: Hypergraph parameters */ PHGComm *scomm, /* Input: Serial PHGComm for use by shg. */ HGraph **gathered_hg /* Output: combined hypergraph combined to proc */ ) { -/* +/* * Function to gather distributed hypergraph onto each processor for * coarsest partitioning. * First hypergraph arrays for the hypergraph on a column of processors @@ -110,8 +73,8 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); #endif /****************************************************************** - * 0. Allocate the hypergraph to be returned. - * Set values that we already know. + * 0. Allocate the hypergraph to be returned. + * Set values that we already know. ******************************************************************/ shg = *gathered_hg = (HGraph *) ZOLTAN_MALLOC(sizeof(HGraph)); @@ -134,10 +97,10 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); shg->EdgeWeightDim = phg->EdgeWeightDim; shg->VtxWeightDim = phg->VtxWeightDim; if (shg->VtxWeightDim && shg->nVtx) - shg->vwgt = (float *) ZOLTAN_MALLOC(shg->nVtx * shg->VtxWeightDim + shg->vwgt = (float *) ZOLTAN_MALLOC(shg->nVtx * shg->VtxWeightDim * sizeof(float)); if (shg->EdgeWeightDim && shg->nEdge) - shg->ewgt = (float *) ZOLTAN_MALLOC(shg->nEdge * shg->EdgeWeightDim + shg->ewgt = (float *) ZOLTAN_MALLOC(shg->nEdge * shg->EdgeWeightDim * sizeof(float)); /* Fixed vertices */ shg->bisec_split = phg->bisec_split; @@ -145,30 +108,30 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); shg->fixed_part = (int *) ZOLTAN_MALLOC(shg->nVtx * sizeof(int)); if (hgp->UsePrefPart) shg->pref_part = (int *) ZOLTAN_MALLOC(shg->nVtx * sizeof(int)); - + /* Allocate arrays for use in gather operations */ recv_size = (int *) ZOLTAN_MALLOC(3 * max_nProc_xy * sizeof(int)); each = recv_size + max_nProc_xy; disp = each + max_nProc_xy; - + /* TODO64 - phg->dist_y[nProc_y] could exceed 2 Billion, NO? */ - send_size = MAX(phg->dist_x[myProc_x+1] - phg->dist_x[myProc_x], + send_size = MAX(phg->dist_x[myProc_x+1] - phg->dist_x[myProc_x], phg->dist_y[nProc_y]); send_buf = (int *) ZOLTAN_MALLOC(send_size * sizeof(int)); - + if ((shg->VtxWeightDim && shg->nVtx && !shg->vwgt) || (shg->EdgeWeightDim && shg->nEdge && !shg->ewgt) || !recv_size || - (send_size && !send_buf)) + (send_size && !send_buf)) MEMORY_ERROR; - + /************************************************************* * 1. Gather all non-zeros for vertices in processor column * *************************************************************/ - + if (nProc_y == 1) { - /* + /* * Don't need a gather; just set pointers appropriately for row-gather * in Step 2 below. */ @@ -189,9 +152,9 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); /* Gather local size info for each proc in column */ - MPI_Allgather(&(phg->nPins), 1, MPI_INT, recv_size, 1, MPI_INT, + MPI_Allgather(&(phg->nPins), 1, MPI_INT, recv_size, 1, MPI_INT, phg->comm->col_comm); - + /* Compute number of vtx, edge, and nnz in column */ col_nVtx = (int)(phg->dist_x[myProc_x+1] - phg->dist_x[myProc_x]); col_nEdge = phg->dist_y[nProc_y]; /* SCHEMEA */ @@ -199,55 +162,55 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); for (i = 0; i < nProc_y; i++) { col_nPin += recv_size[i]; } - + /* Allocate arrays for column hypergraph */ col_hindex = (int *) ZOLTAN_CALLOC((col_nEdge+1), sizeof(int)); col_hvertex = (int *) ZOLTAN_MALLOC(col_nPin * sizeof(int)); - + col_vindex = (int *) ZOLTAN_CALLOC((col_nVtx+1), sizeof(int)); col_vedge = (int *) ZOLTAN_MALLOC(col_nPin * sizeof(int)); - - if (!col_vindex || !col_hindex || + + if (!col_vindex || !col_hindex || (col_nPin && (!col_vedge || !col_hvertex))) MEMORY_ERROR; - + /* Gather hvertex data for all procs in column */ - + /* SCHEMEA uses same vertex LNO on each proc in column. */ /* SCHEMEB would require conversion from vertex LNO to GNO here. */ - + disp[0] = 0; for (i = 1; i < nProc_y; i++) disp[i] = disp[i-1] + recv_size[i-1]; - + MPI_Allgatherv(phg->hvertex, phg->nPins, MPI_INT, col_hvertex, recv_size, disp, MPI_INT, phg->comm->col_comm); - + /* SCHEMEA uses same vertex LNO on each proc in column. */ /* SCHEMEB would require conversion from vertex GNO to LNO here */ - + /* Gather hindex data for all procs in column */ - + for (i = 0; i < phg->nEdge; i++) send_buf[i] = phg->hindex[i+1] - phg->hindex[i]; - + /* SCHEMEA can assume a recv for each edge; * SCHEMEB needs to gather the number of edges recv'd from each proc. */ - - for (i = 0; i < nProc_y; i++) + + for (i = 0; i < nProc_y; i++) each[i] = phg->dist_y[i+1] - phg->dist_y[i]; disp[0] = 0; /* Can't use dist_y because it may not be sizeof(int) */ for (i=1; i < nProc_y; i++){ disp[i] = disp[i-1] + each[i-1]; } - + /* SCHEMEA can use phg->dist_y for displacement array. * SCHEMEB requires separate displacement array. */ - MPI_Allgatherv(send_buf, phg->nEdge, MPI_INT, + MPI_Allgatherv(send_buf, phg->nEdge, MPI_INT, col_hindex, each, disp, MPI_INT, phg->comm->col_comm); - + /* Perform prefix sum on col_hindex */ sum = 0; for (i = 0; i < col_nEdge; i++) { @@ -260,34 +223,34 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); /* Sanity check */ if (col_hindex[col_nEdge] != col_nPin) { printf("%d Sanity check failed: " - "col_hindex[col_nEdge] %d != col_nPin %d\n", + "col_hindex[col_nEdge] %d != col_nPin %d\n", zz->Proc, col_hindex[col_nEdge], col_nPin); exit(-1); } - + /* Gather edge weights, if any. */ if (shg->EdgeWeightDim) { - + /* Can use nearly the same each array. */ /* Need to compute new disp array. */ - + disp[0] = 0; each[0] *= phg->EdgeWeightDim; for (i = 1; i < nProc_y; i++) { each[i] *= phg->EdgeWeightDim; disp[i] = disp[i-1] + each[i-1]; } - - MPI_Allgatherv(phg->ewgt, phg->nEdge*phg->EdgeWeightDim, MPI_FLOAT, + + MPI_Allgatherv(phg->ewgt, phg->nEdge*phg->EdgeWeightDim, MPI_FLOAT, shg->ewgt, each, disp, MPI_FLOAT, phg->comm->col_comm); } - - - Zoltan_HG_Mirror(col_nEdge, col_hindex, col_hvertex, + + + Zoltan_HG_Mirror(col_nEdge, col_hindex, col_hvertex, col_nVtx, col_vindex, col_vedge); - + } /* End column-gather */ - + /************************************************************* * 2. Gather all non-zeros for edges in processor rows * * All processors in a processor column now have the same * @@ -295,7 +258,7 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); *************************************************************/ if (nProc_x == 1) { - /* + /* * Don't need a gather across the row; just set pointers appropriately * in shg. */ @@ -319,55 +282,55 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); /* Gather info about size within the row */ - MPI_Allgather(&col_nPin, 1, MPI_INT, recv_size, 1, MPI_INT, + MPI_Allgather(&col_nPin, 1, MPI_INT, recv_size, 1, MPI_INT, phg->comm->row_comm); - + tmp = 0; - for (i = 0; i < nProc_x; i++) + for (i = 0; i < nProc_x; i++) tmp += recv_size[i]; shg->nPins = tmp; - + shg->vindex = (int *) ZOLTAN_CALLOC((shg->nVtx+1), sizeof(int)); shg->vedge = (int *) ZOLTAN_MALLOC(shg->nPins * sizeof(int)); shg->hindex = (int *) ZOLTAN_CALLOC((shg->nEdge+1), sizeof(int)); shg->hvertex = (int *) ZOLTAN_MALLOC(shg->nPins * sizeof(int)); - + if (!shg->vindex || !shg->hindex || (shg->nPins && (!shg->vedge || !shg->hvertex))) MEMORY_ERROR; - + /* Gather vedge data for all procs in row */ - - /* SCHEMEA can send local edge numbers; + + /* SCHEMEA can send local edge numbers; SCHEMEB requires edge LNO to GNO conversion. */ - + disp[0] = 0; for (i = 1; i < nProc_x; i++) disp[i] = disp[i-1] + recv_size[i-1]; - + MPI_Allgatherv(col_vedge, col_nPin, MPI_INT, shg->vedge, recv_size, disp, MPI_INT, phg->comm->row_comm); - + /* Gather vindex data for all procs in row */ - + for (i = 0; i < col_nVtx; i++) send_buf[i] = col_vindex[i+1] - col_vindex[i]; - + /* SCHEMEA can assume a recv for each vertex; * SCHEMEB would need to gather the number of vtxs recv'd from each proc. */ - - for (i = 0; i < nProc_x; i++) + + for (i = 0; i < nProc_x; i++) each[i] = (int)(phg->dist_x[i+1] - phg->dist_x[i]); disp[0] = 0; /* Can't use dist_x, may not be sizeof(int) */ - for (i = 1; i < nProc_x; i++) + for (i = 1; i < nProc_x; i++) disp[i] = disp[i-1] + each[i-1]; /* SCHEMEA can use phg->dist_x as displacement array; * SCHEMEB requires separate displacement array. */ - MPI_Allgatherv(send_buf, col_nVtx, MPI_INT, + MPI_Allgatherv(send_buf, col_nVtx, MPI_INT, shg->vindex, each, disp, MPI_INT, phg->comm->row_comm); @@ -379,18 +342,18 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); sum += tmp; } shg->vindex[shg->nVtx] = sum; - + /* Sanity check */ if (shg->vindex[shg->nVtx] != shg->nPins) { printf("%d Sanity check failed: " - "shg->vindex %d != nPins %d\n", + "shg->vindex %d != nPins %d\n", zz->Proc, shg->vindex[shg->nVtx], shg->nPins); exit(-1); } - + /* Gather fixed array, if any */ if (hgp->UseFixedVtx){ - + #ifdef DEBUG_ uprintf(phg->comm, "Debug in PHG_gather before gather. phg->fixed ="); for (i=0; inVtx; i++){ @@ -401,13 +364,13 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); /* Can use the same each array. */ /* Need to compute new disp array. */ - + disp[0] = 0; for (i = 1; i < nProc_x; i++) { disp[i] = disp[i-1] + each[i-1]; } - - MPI_Allgatherv(phg->fixed_part, phg->nVtx, MPI_FLOAT, + + MPI_Allgatherv(phg->fixed_part, phg->nVtx, MPI_FLOAT, shg->fixed_part, each, disp, MPI_FLOAT, phg->comm->row_comm); #ifdef DEBUG_ @@ -426,33 +389,33 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); for (i = 1; i < nProc_x; i++) { disp[i] = disp[i-1] + each[i-1]; } - - MPI_Allgatherv(phg->pref_part, phg->nVtx, MPI_FLOAT, + + MPI_Allgatherv(phg->pref_part, phg->nVtx, MPI_FLOAT, shg->pref_part, each, disp, MPI_FLOAT, phg->comm->row_comm); } - + /* Gather vertex weights, if any. */ if (shg->VtxWeightDim) { - + /* Can use nearly the same each array. */ /* Need to compute new disp array. */ - + disp[0] = 0; each[0] *= phg->VtxWeightDim; for (i = 1; i < nProc_x; i++) { each[i] *= phg->VtxWeightDim; disp[i] = disp[i-1] + each[i-1]; } - - MPI_Allgatherv(phg->vwgt, phg->nVtx*phg->VtxWeightDim, MPI_FLOAT, + + MPI_Allgatherv(phg->vwgt, phg->nVtx*phg->VtxWeightDim, MPI_FLOAT, shg->vwgt, each, disp, MPI_FLOAT, phg->comm->row_comm); } - - Zoltan_HG_Mirror(shg->nVtx, shg->vindex, shg->vedge, + + Zoltan_HG_Mirror(shg->nVtx, shg->vindex, shg->vedge, shg->nEdge, shg->hindex, shg->hvertex); } /* End row gather */ - + #ifdef KDDKDD_CHECK Zoltan_HG_Print(zz, shg, NULL, stdout, "GatherAfter");/* NULL parts for now; add non-NULL later */ @@ -467,10 +430,10 @@ int max_nProc_xy = MAX(nProc_x, nProc_y); ZOLTAN_FREE(gathered_hg); } - Zoltan_Multifree(__FILE__, __LINE__, 2, &send_buf, + Zoltan_Multifree(__FILE__, __LINE__, 2, &send_buf, &recv_size); - if (nProc_x > 1 && nProc_y > 1) + if (nProc_x > 1 && nProc_y > 1) Zoltan_Multifree(__FILE__, __LINE__, 4, &col_vedge, &col_vindex, &col_hvertex, diff --git a/packages/zoltan/src/phg/phg_hypergraph.c b/packages/zoltan/src/phg/phg_hypergraph.c index 2f9f2cc6fd..2082dae64a 100644 --- a/packages/zoltan/src/phg/phg_hypergraph.c +++ b/packages/zoltan/src/phg/phg_hypergraph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -100,25 +63,25 @@ int Zoltan_HG_HGraph_Free( { if (hg){ /* - Zoltan_Multifree (__FILE__, __LINE__, 11, + Zoltan_Multifree (__FILE__, __LINE__, 11, &hg->coor, &hg->vwgt, &hg->ewgt, &hg->hindex, &hg->hvertex, &hg->vindex, &hg->vedge, &hg->dist_x, &hg->dist_y, &hg->vmap, &hg->fixed); */ - ZOLTAN_FREE(&hg->esize); - ZOLTAN_FREE(&hg->coor); - ZOLTAN_FREE(&hg->vwgt); + ZOLTAN_FREE(&hg->esize); + ZOLTAN_FREE(&hg->coor); + ZOLTAN_FREE(&hg->vwgt); ZOLTAN_FREE(&hg->ewgt); - ZOLTAN_FREE(&hg->hindex); - ZOLTAN_FREE(&hg->hvertex); - ZOLTAN_FREE(&hg->vindex); - ZOLTAN_FREE(&hg->vedge); + ZOLTAN_FREE(&hg->hindex); + ZOLTAN_FREE(&hg->hvertex); + ZOLTAN_FREE(&hg->vindex); + ZOLTAN_FREE(&hg->vedge); ZOLTAN_FREE(&hg->dist_x); - ZOLTAN_FREE(&hg->dist_y); - ZOLTAN_FREE(&hg->vmap); + ZOLTAN_FREE(&hg->dist_y); + ZOLTAN_FREE(&hg->vmap); ZOLTAN_FREE(&hg->fixed_part); - ZOLTAN_FREE(&hg->pref_part); + ZOLTAN_FREE(&hg->pref_part); } return ZOLTAN_OK; } @@ -160,7 +123,7 @@ int Zoltan_HG_Info ( } printf("Vertex weights : %9.2f %9.2f %9.2f %12.2f\n", wgt_min, wgt_tot/hg->nVtx, wgt_max, wgt_tot); - + mean = var = 0.0; if (hg->nVtx > 1) { mean = wgt_tot / hg->nVtx; @@ -171,7 +134,7 @@ int Zoltan_HG_Info ( var = sqrt(var/(hg->nVtx-1)); printf ("Vertex Stats: stdev %.2f, Coef of Var %.2f\n", var, var/mean); } - + count=0; temp=0.0; for (i = 0; i < hg->nVtx; i++) @@ -263,7 +226,7 @@ int Zoltan_HG_Info ( void Zoltan_HG_Mirror( int inlength, /* Input: either nVtx or nEdge */ - int *inindex, /* Input: index array, either vindex or hindex; + int *inindex, /* Input: index array, either vindex or hindex; length = inlength+1 */ int *indata, /* Input: non-zeros array, either vedge or hvertex; length = nPins */ @@ -274,8 +237,8 @@ void Zoltan_HG_Mirror( length = nPins */ ) { -/* Routine to invert arrays describing vertices and edges. - * Usually called by Zoltan_HG_Create_Mirror, with arguments +/* Routine to invert arrays describing vertices and edges. + * Usually called by Zoltan_HG_Create_Mirror, with arguments * determined by Zoltan_HG_Create_Mirror. * Arrays must be allocated to correct size before calling * the function. @@ -368,7 +331,7 @@ int Zoltan_HG_Create_Mirror ( return ZOLTAN_FATAL; /* unable to proceed */ } - Zoltan_HG_Mirror(inlength, index, data, + Zoltan_HG_Mirror(inlength, index, data, outlength, outindex, outdata); ZOLTAN_TRACE_EXIT(zz, yo); @@ -400,7 +363,7 @@ int Zoltan_HG_Check ( ZOLTAN_TRACE_ENTER(zz, yo); if ((hg->nEdge && !hg->hindex) || - (hg->nVtx && !hg->vindex) || + (hg->nVtx && !hg->vindex) || (hg->nPins && (!hg->vedge || !hg->hvertex))) { ZOLTAN_PRINT_WARN(zz->Proc, yo, "NULL arrays found"); err = ZOLTAN_WARN; @@ -451,7 +414,7 @@ int Zoltan_HG_Check ( err = ZOLTAN_WARN; } - if (hg->comm && hg->comm->nProc_x == 1) { + if (hg->comm && hg->comm->nProc_x == 1) { /* In 2D distribution, check makes sense only if proc has entire hedge */ for (i = 0; i < hg->nEdge; i++) if (hg->hindex[i+1] == hg->hindex[i]) { @@ -486,10 +449,10 @@ int Zoltan_HG_Check ( /* for each vertex of current hyperedge get index to hyperedges */ if (hg->vedge[k] == iedge) /* does it match with original edge? */ break; - if (k == hg->vindex[hg->hvertex[j]+1]) { + if (k == hg->vindex[hg->hvertex[j]+1]) { /* if no match was found then failure, else keep on */ ZOLTAN_PRINT_WARN(zz->Proc, yo, "Inconsistent hvertex/vedge"); - err = ZOLTAN_WARN; + err = ZOLTAN_WARN; break; } } @@ -513,7 +476,7 @@ void Zoltan_HG_Print( { /* Routine to print hypergraph weights and edges. Assumes serial execution; * put inside Zoltan_Print_Sync_Start/Zoltan_Print_Sync_End for parallel - * programs. + * programs. */ int i, j; int num_vwgt; @@ -531,14 +494,14 @@ char *yo = "Zoltan_HG_Print"; sum = (float *) ZOLTAN_MALLOC(MAX(num_vwgt, num_ewgt) * sizeof(float)); - fprintf(fp, "%s nVtx=%d nEdge=%d nPins=%d vWgt=%d eWgt=%d\n", - str, hg->nVtx, hg->nEdge, hg->nPins, + fprintf(fp, "%s nVtx=%d nEdge=%d nPins=%d vWgt=%d eWgt=%d\n", + str, hg->nVtx, hg->nEdge, hg->nPins, hg->VtxWeightDim, hg->EdgeWeightDim); /* Print Vertex Info */ fprintf(fp, "%s Vertices: (edges)\n", str); for (i = 0; i < hg->nVtx; i++) { - fprintf(fp, "%d (" ZOLTAN_GNO_SPEC ") in part %d: ", + fprintf(fp, "%d (" ZOLTAN_GNO_SPEC ") in part %d: ", i, VTX_LNO_TO_GNO(hg, i), (parts ? parts[i] : -1)); fprintf(fp, "("); for (j = hg->vindex[i]; j < hg->vindex[i+1]; j++) @@ -665,7 +628,7 @@ void Zoltan_Input_HG_Init(ZHG *zhg) zhg->numHEdges= NULL; zhg->coor = NULL; - + zhg->fixed = NULL; zhg->GnRepartVtx = 0; diff --git a/packages/zoltan/src/phg/phg_hypergraph.h b/packages/zoltan/src/phg/phg_hypergraph.h index 4774491ca0..c1d9e2a6ad 100644 --- a/packages/zoltan/src/phg/phg_hypergraph.h +++ b/packages/zoltan/src/phg/phg_hypergraph.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PHG_HYPERGRAPH_H #define __PHG_HYPERGRAPH_H @@ -59,8 +22,8 @@ extern "C" { #endif /******************************************************************** - * Hypergraph data structure. Supports both serial hypergraph and - * 2D data distribution (where each block is, in fact, a serial + * Hypergraph data structure. Supports both serial hypergraph and + * 2D data distribution (where each block is, in fact, a serial * hypergraph). ********************************************************************/ typedef struct { @@ -68,20 +31,20 @@ typedef struct { int nVtx; /* number of vertices on this processor */ int nEdge; /* number of hyperedges on this processor */ int nPins; /* number of pins (nonzeros) on this processor */ - int nRepartVtx; /* number of repartition vertices added + int nRepartVtx; /* number of repartition vertices added when LB_APPROACH=repartition */ - int nRepartEdge; /* number of repartition edges added + int nRepartEdge; /* number of repartition edges added when LB_APPROACH=repartition. */ - int nRepartPin; /* number of repartition pins added + int nRepartPin; /* number of repartition pins added when LB_APPROACH=repartition. */ - + int VtxWeightDim; /* number of weight dimensions for a vertex */ int EdgeWeightDim; /* number of weight dimensions for a hyperedge */ /* arrays with vertex and edge weights */ float *vwgt; /* weights of vertices, nVtx long by VtxWeightDim */ float *ewgt; /* weights of hypergraph edges, nEdge long by EdgeWeightDim */ - + /* physical coordinates of each vertex, optional */ int nDim; /* number of coordinate dimensions for a vertex */ double *coor; /* |V| long by CoordinateDim */ @@ -100,32 +63,32 @@ typedef struct { int *vmap; /* used when recursively dividing for p > 2 */ double ratio; /* split when recursively dividing for p > 2 */ int redl; /* working reduction limit */ - + int *fixed_part; /* an array of size |V| containing part assignments of fixed - vertices. If it is NULL no vertex is fixed in any part; - otherwise + vertices. If it is NULL no vertex is fixed in any part; + otherwise < 0 (negative) : vertex is free, [0,..., p-1]: part that vertex is fixed >= p is invalid. */ int *pref_part; /* parallel to fixed array with size of |V| containing the preferred parts for each vertex; again -1 is free. If both a vertex has both prefered and fixed part; - fixed part takes precedence. */ + fixed part takes precedence. */ int bisec_split; /* For fixed vertex partitioning via Recursive Bisection treat vertices fixed in parts < bisec_split as they were in the part 0 and the others in part 1. - if bisec_split < 0 + if bisec_split < 0 it is k-way partitioning use fixed parts as they apear - */ - - + */ + + PHGComm *comm; /* this is a pointer to storage PHGPartParamsStruct: (set in phg_build) UVCUVC: I included here because nProc_x, nProc_y was here for convenience. */ ZOLTAN_GNO_TYPE *dist_x; /* distributions of vertices to processor columns. Vertices * dist_x[n] to dist_x[n+1]-1 are stored in col block n */ - ZOLTAN_GNO_TYPE *dist_y; /* distribution of hyperedges to processor rows as above */ + ZOLTAN_GNO_TYPE *dist_y; /* distribution of hyperedges to processor rows as above */ } HGraph; @@ -164,12 +127,12 @@ typedef struct { #define VTX_TO_PROC_X(phg, gno) \ Zoltan_PHG_Gno_To_Proc_Block(gno, (phg)->dist_x, (phg)->comm->nProc_x) - + /******************************************************************** - * Data structure for hypergraph returned by query functions. + * Data structure for hypergraph returned by query functions. * Includes Zoltan IDs corresponding to local objects (vertices). - * Includes HGraph built by Zoltan for use by the partitioning algorithms. + * Includes HGraph built by Zoltan for use by the partitioning algorithms. ********************************************************************/ struct Zoltan_HGraph { @@ -197,7 +160,7 @@ struct Zoltan_HGraph { double *coor; /* Array of gathered coordinates returned from */ /* Zoltan_Get_Coordinates */ - + /* This hyperedge list includes all hyperedges when LB_Eval uses ZHG, and it includes only removed edges when Zoltan_PHG uses ZHG. */ @@ -217,7 +180,7 @@ struct Zoltan_HGraph { received from other processors in row. Used to fill buffer for Comm_Do_Reverse with VtxPlan in building return lists. */ - ZOLTAN_COMM_OBJ *VtxPlan; /* Communication plan mapping GIDs to GNOs + ZOLTAN_COMM_OBJ *VtxPlan; /* Communication plan mapping GIDs to GNOs within row communicators. */ #ifdef CEDRIC_2D_PARTITIONS struct Zoltan_DD_Struct *ddHedge; @@ -251,10 +214,10 @@ extern int Zoltan_HG_Info (ZZ*, HGraph*); extern int Zoltan_HG_Check (ZZ*, HGraph*); extern void Zoltan_HG_Print(ZZ*, HGraph*, Partition, FILE*, char*); extern void Zoltan_HG_HGraph_Print(ZZ *zz, ZHG *, HGraph *, Partition, FILE *fp); - + extern void Zoltan_Input_HG_Init (ZHG *); extern int Zoltan_Input_HG_Free (ZHG *); - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif diff --git a/packages/zoltan/src/phg/phg_lookup.c b/packages/zoltan/src/phg/phg_lookup.c index c77d7b7906..72c3d4e6dc 100644 --- a/packages/zoltan/src/phg/phg_lookup.c +++ b/packages/zoltan/src/phg/phg_lookup.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -93,7 +56,7 @@ void phg_free_temp_vertices(zoltan_temp_vertices *ztv) } /*****************************************************************************/ -int phg_map_GIDs_to_processes(ZZ *zz, ZOLTAN_ID_PTR eid, int size, +int phg_map_GIDs_to_processes(ZZ *zz, ZOLTAN_ID_PTR eid, int size, int lenGID, int **hashedProc, int nprocs) { int i, j; @@ -109,7 +72,7 @@ static char *yo = "map_GIDs_to_processes"; procList = (int *)ZOLTAN_MALLOC(sizeof(int) * size); if (!procList){ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); return ZOLTAN_MEMERR; } @@ -125,7 +88,7 @@ static char *yo = "map_GIDs_to_processes"; } /****************************************************************************/ -/* +/* * Create, access and delete a hash table mapping a GID its * position in a list. */ @@ -172,11 +135,11 @@ phg_GID_lookup *phg_create_GID_lookup_table(ZOLTAN_ID_PTR gids, int size, int le lu->htTop[i].gno = i; j = Zoltan_Hash(lu->htTop[i].gid, lenGID, tsize); - + lu->htTop[i].next = lu->ht[j]; lu->ht[j] = lu->htTop + i; } - + return lu; } @@ -191,7 +154,7 @@ phg_GID_lookup *phg_create_GID_lookup_table2(ZOLTAN_ID_PTR gids, int ngids, int phg_GID_lookup *lu = NULL; tsize = ngids; /* actually may be larger than number of unique ids */ - + nextGID = nextUniqueGID = gids; lu = (phg_GID_lookup *)ZOLTAN_MALLOC(sizeof(phg_GID_lookup)); @@ -224,7 +187,7 @@ phg_GID_lookup *phg_create_GID_lookup_table2(ZOLTAN_ID_PTR gids, int ngids, int if (nextUniqueGID < nextGID){ for (k=0; knext = lu->ht[j]; lu->ht[j] = hn; - + hn++; nextUniqueGID += lenGID; lu->numGIDs++; @@ -250,7 +213,7 @@ int phg_lookup_GID(phg_GID_lookup *lu, ZOLTAN_ID_PTR gid) if (lu->numGIDs < 1) return -1; i = Zoltan_Hash(gid, lu->lenGID, (unsigned int) lu->table_size); - + for (hn=lu->ht[i]; hn != NULL; hn = hn->next){ match = 1; for (k=0; klenGID; k++){ diff --git a/packages/zoltan/src/phg/phg_lookup.h b/packages/zoltan/src/phg/phg_lookup.h index 416a20d443..6e4f16f1b9 100644 --- a/packages/zoltan/src/phg/phg_lookup.h +++ b/packages/zoltan/src/phg/phg_lookup.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_LOOKUP_H #define __ZOLTAN_PHG_LOOKUP_H @@ -56,12 +19,12 @@ extern "C" { /*****************************************************************************/ -/* +/* * Structures to hold hypergraph data returned by query functions, * and hypergraph data gathered by processes to which edges/vertices * map to via a hash function. */ - + typedef struct _myObj{ /* Vertices returned in Get_Obj_List queries */ int *vtxHash; /* Process to which GID hashes, temporary owner */ }zoltan_objects; @@ -95,7 +58,7 @@ typedef struct _hshVtx{ /* Vertices assigned to this process with hash func */ ZOLTAN_GNO_TYPE *vtxGNO; /* vertex global number */ }zoltan_temp_vertices; -/* +/* * A search structure, to find the index of a global ID in any of the * above structures. */ @@ -116,7 +79,7 @@ void phg_free_ews(zoltan_ews *zew); void phg_free_temp_edges(zoltan_temp_edges *zte); void phg_free_temp_vertices(zoltan_temp_vertices *ztv); -int phg_map_GIDs_to_processes(ZZ *zz, ZOLTAN_ID_PTR eid, int size, int lenGID, +int phg_map_GIDs_to_processes(ZZ *zz, ZOLTAN_ID_PTR eid, int size, int lenGID, int **hashedProc, int nprocs); phg_GID_lookup *phg_create_GID_lookup_table(ZOLTAN_ID_PTR gids, int size, int lenGID); diff --git a/packages/zoltan/src/phg/phg_match.c b/packages/zoltan/src/phg/phg_match.c index 652e418cf6..82065bbbb1 100644 --- a/packages/zoltan/src/phg/phg_match.c +++ b/packages/zoltan/src/phg/phg_match.c @@ -1,49 +1,12 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ - +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER + #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -71,14 +34,14 @@ static ZOLTAN_NUM_OBJ_FN geometric_get_num_obj; static ZOLTAN_OBJ_LIST_FN geometric_get_obj_list; static ZOLTAN_NUM_GEOM_FN geometric_get_num_geom; static ZOLTAN_GEOM_MULTI_FN geometric_get_geom_multi; - + typedef struct triplet { ZOLTAN_GNO_TYPE candidate; /* gno of candidate vertex */ ZOLTAN_GNO_TYPE partner; /* gno of best match found so far */ float ip; /* total inner product between candidate and partner */ } Triplet; - + static HGraph *HG_Ptr; /* @@ -92,14 +55,14 @@ static HGraph *HG_Ptr; same side of that level's bisection. For example for 4-way partitioning since bisec_split will be 2 in the first bisection; we'll allow vertices fixed in parts {0, 1} are matched among themselves, also the vertices fixed in {2, 3} are allowed to - be matched among themselves. - */ + be matched among themselves. + */ #define MATCH_OK(hgp, hg, fv1, fv2) \ (!((hgp)->UsePrefPart) || \ ((fv1) < 0) || \ ((fv2) < 0) || \ ((((fv1) < (hg)->bisec_split) ? 0 : 1) == (((fv2) < (hg)->bisec_split) ? 0 : 1))) - + /* In addition to above conditions, in Agglomerative matching, in order to reduce the extra communication, we will only allow matching if candidate vertex is free or its fixed part @@ -110,7 +73,7 @@ static HGraph *HG_Ptr; (!((hgp)->UsePrefPart) || (((candf) < 0) || \ (((fv2)>=0) && ((((candf) < (hg)->bisec_split) ? 0 : 1) == (((fv2) < (hg)->bisec_split) ? 0 : 1))))) - + /*****************************************************************************/ int Zoltan_PHG_Set_Matching_Fn (PHGPartParams *hgp) @@ -121,7 +84,7 @@ int Zoltan_PHG_Set_Matching_Fn (PHGPartParams *hgp) hgp->matching = pmatching_agg_ipm; hgp->match_array_type = 1; } - else if (!strcasecmp(hgp->redm_str, "rcb") || + else if (!strcasecmp(hgp->redm_str, "rcb") || !strcasecmp(hgp->redm_str, "rib")) { hgp->matching = pmatching_geom; hgp->match_array_type = 1; @@ -133,9 +96,9 @@ int Zoltan_PHG_Set_Matching_Fn (PHGPartParams *hgp) else if (!strcasecmp(hgp->redm_str, "ipm")) hgp->matching = pmatching_ipm; else if (!strcasecmp(hgp->redm_str, "l-ipm")) - hgp->matching = pmatching_local_ipm; + hgp->matching = pmatching_local_ipm; else if (!strcasecmp(hgp->redm_str, "c-ipm")) - hgp->matching = pmatching_ipm; + hgp->matching = pmatching_ipm; else if (!strcasecmp(hgp->redm_str, "a-ipm")) hgp->matching = pmatching_alt_ipm; else if (!strcasecmp(hgp->redm_str, "h-ipm")) @@ -144,7 +107,7 @@ int Zoltan_PHG_Set_Matching_Fn (PHGPartParams *hgp) exist = 0; hgp->matching = NULL; } - + return exist; } @@ -164,19 +127,19 @@ char *yo = "Zoltan_PHG_Matching"; /* Scale the weight of the edges */ if (hgp->edge_scaling) { - if (hg->nEdge && !(new_ewgt = (float*) + if (hg->nEdge && !(new_ewgt = (float*) ZOLTAN_MALLOC(hg->nEdge * sizeof(float)))) MEMORY_ERROR; - + Zoltan_PHG_Scale_Edges (zz, hg, new_ewgt, hgp->edge_scaling); old_ewgt = hg->ewgt; hg->ewgt = new_ewgt; } /* Create/update scale vector for vertices for inner product */ - if (hgp->vtx_scaling) + if (hgp->vtx_scaling) Zoltan_PHG_Scale_Vtx (zz, hg, hgp); - + /* Do the matching */ if (hgp->matching) { /* first match isolated vertices */ @@ -189,12 +152,12 @@ char *yo = "Zoltan_PHG_Matching"; ierr = hgp->matching (zz, hg, match, hgp); /* clean up by matching "near-isolated" vertices of degree 1 */ /* only useful in special cases (e.g. near-diagonal matrices). - in many cases there is a slight increase in cuts, so + in many cases there is a slight increase in cuts, so turn it off for now. */ /* Zoltan_PHG_match_isolated(zz, hg, hgp, match, 1); */ } -End: +End: /* Restore the old edge weights if scaling was used. */ if (hgp->edge_scaling) @@ -210,9 +173,9 @@ char *yo = "Zoltan_PHG_Matching"; /***************************************************************************/ /* MPI_Op for computing the maximum inner-product for each candidate */ static void phasethreereduce ( - void *tin, - void *tinout, - int *tnum, + void *tin, + void *tinout, + int *tnum, MPI_Datatype *mytype) { int num = *tnum; @@ -238,8 +201,8 @@ static void phasethreereduce ( int in_proc = VTX_TO_PROC_X (HG_Ptr, in[i].partner); int inout_proc = VTX_TO_PROC_X (HG_Ptr, inout[i].partner); int cand_proc = VTX_TO_PROC_X (HG_Ptr, in[i].candidate); - - + + /* Give preference to partners on candidate's processor */ if (((in_proc == cand_proc) && (inout_proc == cand_proc)) || ((in_proc != cand_proc) && (inout_proc != cand_proc))) { @@ -252,7 +215,7 @@ static void phasethreereduce ( else if (in_proc == cand_proc) { inout[i] = in[i]; /* Give preference to local partner */ } - } + } /* } */ @@ -262,7 +225,7 @@ static void phasethreereduce ( /* UVCUVC TODO CHECK: later consider about reusing edge size computed in recursive bisection split; but that also requires communication of - those values in redistribution */ + those values in redistribution */ static int Zoltan_PHG_compute_esize( ZZ *zz, HGraph *hg, @@ -286,7 +249,7 @@ static int Zoltan_PHG_compute_esize( zoltan_gno_mpi_type = Zoltan_mpi_gno_type(); MPI_Allreduce(lsize, hg->esize, hg->nEdge, zoltan_gno_mpi_type, MPI_SUM, hg->comm->row_comm); - + End: ZOLTAN_FREE(&lsize); } @@ -320,7 +283,7 @@ static int Zoltan_PHG_match_isolated( for (i=0; inVtx; ++i) ldeg[i] = hg->vindex[i+1] - hg->vindex[i]; MPI_Allreduce(ldeg, deg, hg->nVtx, MPI_INT, MPI_SUM, hg->comm->col_comm); - + if (small_degree>0){ /* Only match on procs with many unmatched vertices */ unmatched= 0; @@ -329,7 +292,7 @@ static int Zoltan_PHG_match_isolated( } if ((small_degree==0) || (unmatched > 0.8*hg->nVtx)) for (i=0; inVtx; ++i){ - if ((match[i]==i) && (deg[i] <= small_degree)) { + if ((match[i]==i) && (deg[i] <= small_degree)) { #ifdef _DEBUG ++cnt; #endif @@ -347,7 +310,7 @@ static int Zoltan_PHG_match_isolated( } #ifdef _DEBUG if (cnt) - uprintf(hg->comm, "Local H(%d, %d, %d) and there were %d isolated vertices\n", hg->nVtx, hg->nEdge, hg->nPins, cnt); + uprintf(hg->comm, "Local H(%d, %d, %d) and there were %d isolated vertices\n", hg->nVtx, hg->nEdge, hg->nPins, cnt); #endif End: ZOLTAN_FREE(&ldeg); @@ -357,7 +320,7 @@ static int Zoltan_PHG_match_isolated( /*****************************************************************************/ -/* inner product matching */ +/* inner product matching */ /* based on implementations by Rob Bisseling and Umit Catalyurek */ /* for each vertex, we match with the unmatched vertex which has the most */ /* hyperedges in common with it (ie, the pair with greatest inner product). */ @@ -370,25 +333,25 @@ static int matching_ipm(ZZ *zz, HGraph *hg, PHGPartParams *hgp, int i, j, k, n; float maxip; int *order = NULL; - float *ips = NULL; + float *ips = NULL; ZOLTAN_GNO_TYPE v1, v2, edge, maxindex; ZOLTAN_GNO_TYPE *adj = NULL; char *yo = "matching_ipm"; - if (hg->nVtx && - (!(ips = (float*) ZOLTAN_MALLOC(hg->nVtx * sizeof(float))) + if (hg->nVtx && + (!(ips = (float*) ZOLTAN_MALLOC(hg->nVtx * sizeof(float))) || !(adj = (ZOLTAN_GNO_TYPE*) ZOLTAN_MALLOC(hg->nVtx * sizeof(ZOLTAN_GNO_TYPE))) || !(order = (int*) ZOLTAN_MALLOC(hg->nVtx * sizeof(int))))) { Zoltan_Multifree(__FILE__, __LINE__, 3, &ips, &adj, &order); ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); return ZOLTAN_MEMERR; } - + for (i = 0; i < hg->nVtx; i++){ ips[i] = .0; order[i] = i; } - + /* random node visit order is default */ /* other options may be added later */ Zoltan_Rand_Perm_Int (order, hg->nVtx, NULL); @@ -399,7 +362,7 @@ static int matching_ipm(ZZ *zz, HGraph *hg, PHGPartParams *hgp, if (match[v1] != v1) continue; - + n = 0; /* number of neighbors */ /* for every hyperedge containing the vertex */ for (i = hg->vindex[v1]; i < hg->vindex[v1+1]; i++) { @@ -437,8 +400,8 @@ static int matching_ipm(ZZ *zz, HGraph *hg, PHGPartParams *hgp, match[v1] = maxindex; match[maxindex] = v1; (*limit)--; - } - + } + /* printf("Done with %d, best match is %d with product %d\n", v1, maxindex, maxip); @@ -474,30 +437,30 @@ static int pmatching_local_ipm( /* UVC: In order to simplify adding/testing old sequential matching codes easy I'm keeping the interface same; just move your favorite matching code to this file - and change the function name in the next line */ + and change the function name in the next line */ err = matching_ipm(zz, hg, hgp, match, &limit); - + /* UVC: again to simplify testing Optimization; I'm leaving the call here, just move your function and rename the call - if (hgp->matching_opt) + if (hgp->matching_opt) err = hgp->matching_opt (zz, hg, match, &limit); */ - + /* find the index of the proc in column group with the best match (max #matches); it will be our root proc */ Zoltan_PHG_Find_Root(hg->nVtx-limit, hgc->myProc_y, hgc->col_comm, &root_matchcnt, &root_rank); - + zoltan_gno_mpi_type = Zoltan_mpi_gno_type(); MPI_Bcast(match, hg->nVtx, zoltan_gno_mpi_type, root_rank, hgc->col_comm); - + return err; } /************************************************************************** - Alternating ipm method. Alternate between full ipm and fast method. + Alternating ipm method. Alternate between full ipm and fast method. *************************************************************************/ static int pmatching_alt_ipm( ZZ *zz, @@ -515,7 +478,7 @@ static int pmatching_alt_ipm( if ((hg->info&1) == 0) /* alternate even-odd levels */ strcpy(hgp->redm_str, hgp->redm_fast); /* fast method is typically l-ipm */ else - strcpy(hgp->redm_str, "ipm"); + strcpy(hgp->redm_str, "ipm"); Zoltan_PHG_Set_Matching_Fn (hgp); /* set pointer to the desired matching function */ ierr = hgp->matching (zz, hg, match, hgp); @@ -523,7 +486,7 @@ static int pmatching_alt_ipm( /* set redm parameter back to original */ strcpy(hgp->redm_str, redm_orig); - + return ierr; } @@ -548,18 +511,18 @@ static int pmatching_hybrid_ipm( /* First do (partial) c-ipm. */ strcpy(hgp->redm_str, "c-ipm"); - ierr = pmatching_ipm(zz, hg, match, hgp); + ierr = pmatching_ipm(zz, hg, match, hgp); /* Reset hybrid_keep_factor to be safe. */ hgp->hybrid_keep_factor = 0.0; /* Then do full ipm on remaining unmatched vertices. */ - strcpy(hgp->redm_str, "ipm"); - ierr = pmatching_ipm(zz, hg, match, hgp); + strcpy(hgp->redm_str, "ipm"); + ierr = pmatching_ipm(zz, hg, match, hgp); /* Reset redm parameter back to original */ strcpy(hgp->redm_str, redm_orig); - + return ierr; } @@ -570,25 +533,25 @@ static int pmatching_hybrid_ipm( * Based on conversations with Rob Bisseling by Aaron Becker, UIUC, summer 2004 * completed by R. Heaphy. New features by Karen Devine & Erik Boman. */ - + /* match[] is local slice of global matching array. Initially, match[i] = i. * After matching, match[i]=i indicates an unmatched vertex. A matching between * vertices i & j is indicated by match[i] = j & match[j] = i. NOTE: Positive * integers are local numbering (zero-based). A match to an off processor * vertex is indicated by a negative number, -(gno+1), and must use global - * numbers (gno's) and not local numbers, lno's. */ - -#define ROUNDS_CONSTANT 8 /* controls the number of candidate vertices */ + * numbers (gno's) and not local numbers, lno's. */ + +#define ROUNDS_CONSTANT 8 /* controls the number of candidate vertices */ #define IPM_TAG 28731 /* MPI message tag, arbitrary value */ -#define CONFLICT_TAG IPM_TAG+1 +#define CONFLICT_TAG IPM_TAG+1 /* these thresholds need to become parameters in phg - maybe ??? */ #define PSUM_THRESHOLD 0.0 /* ignore partial inner products < threshold */ #define TSUM_THRESHOLD 0.0 /* ignore total inner products < threshold */ - + /* Forward declaration for a routine that encapsulates the common calls to use ** the Zoltan unstructured communications library for the matching code */ -static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, +static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, int scale, char * send, int* reccnt, int* recsize, int* nRec, char ** rec, MPI_Comm comm, int tag); @@ -620,7 +583,7 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, }\ }\ } - + /* Mostly identical inner product calculation to above for c-ipm variant. Here */ /* candidates are a subset of local vertices and are not in a separate buffer */ @@ -636,7 +599,7 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, }\ }\ }\ - } + } @@ -646,7 +609,7 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, if (timer->matchstage[arg] < (arg))\ timer->matchstage[arg] = Zoltan_Timer_Init(zz->ZTime, sync, message);\ ZOLTAN_TIMER_START(zz->ZTime, timer->matchstage[arg], hg->comm->Communicator);\ - } + } /* simple corresponding macro to stop timer */ #define MACRO_TIMER_STOP(arg) \ @@ -659,7 +622,7 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, old_size = (new_size); \ if (!(buffer = (char*) ZOLTAN_REALLOC (buffer, (old_size) * sizeof(char) ))) \ MEMORY_ERROR; \ - } + } /* instead of realloc; just free and alloc new one to avoid memcpy in realloc */ #define MACRO_RESIZE(new_size, old_size, buffer) {\ @@ -669,7 +632,7 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, if (!(buffer = (char*) ZOLTAN_MALLOC (old_size * sizeof(char)))) \ MEMORY_ERROR; \ } \ -} +} /****************************************************************************/ /* Because this calculation is done in two locations it has been converted to a @@ -680,7 +643,7 @@ static int calc_nCandidates (int num_vtx, int procs) /* Constant 2 below because each match pairs 2 vertices */ return num_vtx ? 1 + num_vtx/(2 * procs * ROUNDS_CONSTANT) : 0; } - + /****************************************************************************/ static int pmatching_ipm (ZZ *zz, @@ -703,7 +666,7 @@ static int pmatching_ipm (ZZ *zz, ZOLTAN_GNO_TYPE candidate_gno = 0; /* gno of current candidate */ - int *dest = NULL, nDest, + int *dest = NULL, nDest, *size = NULL, nSize, *index = NULL, nIndex, *aux = NULL; @@ -747,13 +710,13 @@ static int pmatching_ipm (ZZ *zz, double ipsum = 0.; struct phg_timer_indices *timer = Zoltan_PHG_LB_Data_timers(zz); char *yo = "pmatching_ipm"; - - + + ZOLTAN_TRACE_ENTER (zz, yo); MACRO_TIMER_START (0, "matching setup", 0); zoltan_gno_mpi_type = Zoltan_mpi_gno_type(); Zoltan_Srand_Sync (Zoltan_Rand(NULL), &(hgc->RNGState_col), hgc->col_comm); - + /* set a flag if user wants a column matching or a full matching */ cFLAG = strcasecmp (hgp->redm_str, "c-ipm") ? 0 : 1; if (!cFLAG) { @@ -764,14 +727,14 @@ static int pmatching_ipm (ZZ *zz, /* determine basic working parameters */ nRounds = cFLAG ? ROUNDS_CONSTANT : hgc->nProc_x * ROUNDS_CONSTANT; - nCandidates = calc_nCandidates (hg->nVtx, cFLAG ? 1 : hgc->nProc_x); + nCandidates = calc_nCandidates (hg->nVtx, cFLAG ? 1 : hgc->nProc_x); /* determine maximum number of Vtx and Pins for storage allocation */ /* determine initial sum of all candidates = total_nCandidates==>allocation */ if (cFLAG) { max_nVtx = hg->nVtx; max_nPins = hg->nPins; - total_nCandidates = nCandidates; + total_nCandidates = nCandidates; } else { MPI_Allreduce(&hg->nPins, &max_nPins, 1, MPI_INT,MPI_MAX,hgc->Communicator); @@ -795,10 +758,10 @@ static int pmatching_ipm (ZZ *zz, nSend = nEdgebuf = nRec = max_nPins * sizeof(int); /* nSend/nRec for all other paired communication */ - if (hg->nVtx) + if (hg->nVtx) if (!(cmatch = (ZOLTAN_GNO_TYPE*) ZOLTAN_MALLOC (hg->nVtx * sizeof(ZOLTAN_GNO_TYPE))) || !(visit = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) - || !(aux = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) + || !(aux = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) || !(sums = (float*) ZOLTAN_CALLOC (hg->nVtx, sizeof(float)))) MEMORY_ERROR; @@ -811,12 +774,12 @@ static int pmatching_ipm (ZZ *zz, master_data[i].partner = -1; master_data[i].ip = -1.0; } - } + } if (!cFLAG) if (!(edgebuf = (char*) ZOLTAN_MALLOC (nEdgebuf))) MEMORY_ERROR; - + if (!(dest = (int*) ZOLTAN_MALLOC (nDest * sizeof(int))) || !(size = (int*) ZOLTAN_MALLOC (nSize * sizeof(int))) @@ -828,11 +791,11 @@ static int pmatching_ipm (ZZ *zz, || (total_nCandidates && !(gno_locs = (intptr_t *) ZOLTAN_MALLOC (total_nCandidates * sizeof(intptr_t)))) || (total_nCandidates && !(select = (int*) ZOLTAN_MALLOC (total_nCandidates * sizeof(int))))) MEMORY_ERROR; - + /* Compute candidates' vertex visit order (selection). Random is default. */ Zoltan_PHG_Vertex_Visit_Order (zz, hg, hgp, visit); - + /* Loop processing ncandidates vertices per column each round. * Each loop has 3 phases, phase 3 may be repeated as necessary * Phase 1: send ncandidates vertices for global matching - horizontal comm @@ -845,15 +808,15 @@ static int pmatching_ipm (ZZ *zz, vindex = 0; /* marks current position in visit array */ for (round = 0; round < nRounds; round++) { MACRO_TIMER_START (1, "matching phase 1", 0); - + /************************ PHASE 1: ****************************************/ - - memcpy (cmatch, match, hg->nVtx * sizeof(ZOLTAN_GNO_TYPE)); /* for temporary locking */ + + memcpy (cmatch, match, hg->nVtx * sizeof(ZOLTAN_GNO_TYPE)); /* for temporary locking */ if (cFLAG) { /* select upto nCandidates unmatched vertices to locally match */ for (i = 0; i < total_nCandidates; i++) permute[i] = -1; /* to flag missing candidates */ - + for (nTotal = 0; nTotal < nCandidates && vindex < hg->nVtx; vindex++) if (cmatch [visit[vindex]] == (ZOLTAN_GNO_TYPE)visit[vindex]) { /* unmatched */ permute [nTotal++] = visit[vindex]; /* select it as a candidate */ @@ -862,16 +825,16 @@ static int pmatching_ipm (ZZ *zz, total_nCandidates = nTotal; for (i = 0; i < total_nCandidates; i++) - select[i] = i; + select[i] = i; } - else { + else { /* Select upto nCandidates unmatched vertices to globally match. */ for (sendcnt = 0; sendcnt < nCandidates && vindex < hg->nVtx; vindex++) if (cmatch[visit[vindex]] == (ZOLTAN_GNO_TYPE)visit[vindex]) { /* unmatched */ select [sendcnt++] = visit[vindex]; /* select it as a candidate */ cmatch [visit[vindex]] = (ZOLTAN_GNO_TYPE)(-visit[vindex])-1; /* mark as pending match */ } - + /* assure send buffer is large enough by first computing required size */ gno_size = int_size = float_size = 0; @@ -889,7 +852,7 @@ static int pmatching_ipm (ZZ *zz, sendsize = gno_size + int_size; /* total size in chars */ if (sendsize > nSend) - MACRO_REALLOC (1.2 * sendsize, nSend, sendbuf); /* resize send buffer */ + MACRO_REALLOC (1.2 * sendsize, nSend, sendbuf); /* resize send buffer */ /* put > into send buffer */ @@ -907,26 +870,26 @@ static int pmatching_ipm (ZZ *zz, *gnoptr++ = VTX_LNO_TO_GNO(hg, lno); /* gno of candidate */ *intptr++ = i + first_candidate_index; /* candidate index */ - if (hgp->UsePrefPart) + if (hgp->UsePrefPart) *intptr++ = hg->pref_part[lno]; /* pref partition info */ *intptr++ = n; /* edge count */ - for (j = hg->vindex[lno]; j < hg->vindex[lno+1]; j++) + for (j = hg->vindex[lno]; j < hg->vindex[lno+1]; j++) *intptr++ = hg->vedge[j]; /* edge lno */ s = (char *)intptr; } } - + /* communication to determine global size of rec buffer */ MPI_Allgather (&sendsize, 1, MPI_INT, size, 1, MPI_INT, hgc->row_comm); - + /* determine size of the rec buffer & reallocate bigger iff necessary */ recsize = 0; for (i = 0; i < hgc->nProc_x; i++) recsize += size[i]; /* compute total size of edgebuf in chars */ if (recsize > nEdgebuf) MACRO_REALLOC (1.2 * recsize, nEdgebuf, edgebuf); /* enlarge edgebuf */ - + /* setup displacement array necessary for MPI_Allgatherv */ dest[0] = 0; for (i = 1; i < hgc->nProc_x; i++) @@ -934,7 +897,7 @@ static int pmatching_ipm (ZZ *zz, /* communicate vertices & their edges to all row neighbors */ MPI_Allgatherv(sendbuf, sendsize, MPI_CHAR, edgebuf, size, dest, MPI_CHAR, hgc->row_comm); - + /* Communication has grouped candidates by processor, rescramble! */ /* Otherwise all candidates from proc column 0 will be matched first, */ @@ -959,20 +922,20 @@ static int pmatching_ipm (ZZ *zz, permute[candidate_index] = n; - if (hgp->UsePrefPart) intptr++; - count = *intptr++; /* count of edges */ + if (hgp->UsePrefPart) intptr++; + count = *intptr++; /* count of edges */ r = (char *)(intptr + count); /* skip of edge lnos */ n++; } - } /* DONE: if (cFLAG) else ... */ + } /* DONE: if (cFLAG) else ... */ MACRO_TIMER_STOP (1); - + /************************ PHASE 2: ***************************************/ - - /* for each candidate vertex, compute all local partial inner products */ + + /* for each candidate vertex, compute all local partial inner products */ kstart = old_kstart = 0; /* next candidate (of nTotal) to process */ @@ -989,9 +952,9 @@ static int pmatching_ipm (ZZ *zz, n = permute[select[k]]; - if (n == -1) + if (n == -1) continue; /* don't have this sparse candidate locally */ - + if (!cFLAG) { gnoptr = (ZOLTAN_GNO_TYPE *)(edgebuf + gno_locs[n]); @@ -1000,8 +963,8 @@ static int pmatching_ipm (ZZ *zz, candidate_gno = *gnoptr; candidate_index = *intptr++; /* candidate_index of vertex */ - if (hgp->UsePrefPart) - pref = *intptr++; /* pref vertex information */ + if (hgp->UsePrefPart) + pref = *intptr++; /* pref vertex information */ count = *intptr++; /* count of following hyperedges */ } @@ -1009,11 +972,11 @@ static int pmatching_ipm (ZZ *zz, candidate_index = k; candidate_gno = permute[k]; /* need to use next local vertex */ - if (hgp->UsePrefPart) - pref = hg->pref_part[candidate_gno]; + if (hgp->UsePrefPart) + pref = hg->pref_part[candidate_gno]; } /* here candidate_gno is really a local id */ - + /* now compute the row's nVtx inner products for kth candidate */ m = 0; if (!cFLAG) { @@ -1040,14 +1003,14 @@ static int pmatching_ipm (ZZ *zz, else if ((hg->ewgt != NULL) && (hgp->vtx_scal != NULL)) INNER_PRODUCT2(hgp->vtx_scal[hg->hvertex[j]] * hg->ewgt[edge]) } - + /* if local vtx, remove self inner product (useless maximum) */ if (cFLAG) sums[candidate_gno] = 0.0; /* since candidate_gno is really lno */ else if (VTX_TO_PROC_X(hg, candidate_gno) == hgc->myProc_x) sums[VTX_GNO_TO_LNO(hg, candidate_gno)] = 0.0; - - /* count partial sums exceeding PSUM_THRESHOLD */ + + /* count partial sums exceeding PSUM_THRESHOLD */ count = 0; for (i = 0; i < m; i++) { lno = index[i]; @@ -1055,10 +1018,10 @@ static int pmatching_ipm (ZZ *zz, && MATCH_OK(hgp, hg, hg->pref_part[lno], pref)) aux[count++] = lno; /* save lno for significant partial sum */ else - sums[lno] = 0.0; /* clear unwanted entries */ - } + sums[lno] = 0.0; /* clear unwanted entries */ + } if (count == 0) - continue; /* no partial sums to append to message */ + continue; /* no partial sums to append to message */ /* iff necessary, resize send buffer to fit at least first message */ @@ -1070,9 +1033,9 @@ static int pmatching_ipm (ZZ *zz, if (sendcnt == 0 && (msgsize > nSend)) { MACRO_REALLOC (1.2 * msgsize, nSend, sendbuf); /* increase buffer size */ - s = sendbuf; + s = sendbuf; } - + /* message is , > */ if (sendsize + msgsize <= nSend) { /* flag first data in each destination row for merging */ @@ -1080,7 +1043,7 @@ static int pmatching_ipm (ZZ *zz, rows[candidate_gno % hgc->nProc_y] = 1; candidate_index = -candidate_index -1; } - + /* current partial sums fit, so put them into the send buffer */ dest[sendcnt] = candidate_gno % hgc->nProc_y; /* destination */ size[sendcnt++] = msgsize; /* size of message */ @@ -1091,40 +1054,40 @@ static int pmatching_ipm (ZZ *zz, intptr = (int *)(s); s += int_size; floatptr = (float*)(s); - + *gnoptr++ = candidate_gno; - *intptr++ = candidate_index; + *intptr++ = candidate_index; *intptr++ = count; - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) { *intptr++ = aux[i]; /* lno of partial sum */ } - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) { *floatptr++ = sums[aux[i]]; /* partial sum */ sums[aux[i]] = 0.0; } sendsize += msgsize; /* cummulative size of message */ } else { /* psum message doesn't fit into buffer */ - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) sums[aux[i]] = 0.0; - break; - } - } /* DONE: loop over k */ + break; + } + } /* DONE: loop over k */ MACRO_TIMER_STOP (2); MACRO_TIMER_START (3, "Matching kstart B", 0); - + /* synchronize all rows in this column to next kstart value */ old_kstart = kstart; MPI_Allreduce (&k, &kstart, 1, MPI_INT, MPI_MIN, hgc->col_comm); /* Send inner product data in send buffer to appropriate rows */ - ierr = communication_by_plan (zz, sendcnt, dest, size, 1, sendbuf, &reccnt, + ierr = communication_by_plan (zz, sendcnt, dest, size, 1, sendbuf, &reccnt, &recsize, &nRec, &recvbuf, hgc->col_comm, IPM_TAG); if (ierr != ZOLTAN_OK) goto End; - + /* build index into receive buffer pointer for each proc's row of data */ for (i = 0; i < hgc->nProc_y; i++) rows[i] = recsize; /* sentinal in case no row's data available */ @@ -1146,9 +1109,9 @@ static int pmatching_ipm (ZZ *zz, } /* merge partial i.p. sum data to compute total inner products */ - s = sendbuf; + s = sendbuf; for (n = old_kstart; n < kstart; n++) { - m = 0; + m = 0; for (i = 0; i < hgc->nProc_y; i++) { if (rows[i] < recsize){ @@ -1166,7 +1129,7 @@ static int pmatching_ipm (ZZ *zz, if (sums[lno] == 0.0){ /* is this first time for this lno? */ aux[m++] = lno; /* then save the lno */ } - + sums[lno] += *floatptr++; } rows[i] = (char *)floatptr - recvbuf; @@ -1191,7 +1154,7 @@ static int pmatching_ipm (ZZ *zz, sendsize = s - sendbuf; MACRO_REALLOC (1.2*(sendsize + msgsize), nSend, sendbuf); s = sendbuf + sendsize; /* since realloc buffer could move */ - } + } gnoptr = (ZOLTAN_GNO_TYPE *)s; intptr = (int *)(gnoptr + 1); @@ -1200,31 +1163,31 @@ static int pmatching_ipm (ZZ *zz, *gnoptr = candidate_gno; *intptr++ = candidate_index; *intptr++ = count; - } + } for (i = 0; i < m; i++) { - lno = aux[i]; + lno = aux[i]; if (sums[lno] > TSUM_THRESHOLD) { *intptr++ = lno; *floatptr++ = sums[lno]; - } - sums[lno] = 0.0; - } + } + sums[lno] = 0.0; + } s += msgsize; } sendsize = s - sendbuf; - + /* Communicate total inner product results to MASTER ROW */ MPI_Gather(&sendsize, 1, MPI_INT, size, 1, MPI_INT, 0, hgc->col_comm); - + if (hgc->myProc_y == 0) { recsize = 0; for (i = 0; i < hgc->nProc_y; i++) - recsize += size[i]; - + recsize += size[i]; + dest[0] = 0; for (i = 1; i < hgc->nProc_y; i++) dest[i] = dest[i-1] + size[i-1]; - + if (recsize > nRec) MACRO_REALLOC (1.2 * recsize, nRec, recvbuf); /* make rec buffer bigger */ } @@ -1247,29 +1210,29 @@ static int pmatching_ipm (ZZ *zz, for (i = 0; i < count; i++) { lno = *intptr++; - f = *floatptr++; + f = *floatptr++; - if ((f > bestsum) && cmatch[lno] == lno) { + if ((f > bestsum) && cmatch[lno] == lno) { bestsum = f; bestlno = lno; - } + } } r = (char *)(floatptr); - + /* For hybrid ipm, keep matches that are above average in c-ipm */ if (bestsum>0){ /* ipsum is cumulative sum of best inner products (bestsum) */ ipsum += bestsum; - num_matches_considered++; + num_matches_considered++; } - if (cFLAG && bestsum > MAX(TSUM_THRESHOLD, - hgp->hybrid_keep_factor*ipsum/num_matches_considered)) { - cmatch[bestlno] = -1; + if (cFLAG && bestsum > MAX(TSUM_THRESHOLD, + hgp->hybrid_keep_factor*ipsum/num_matches_considered)) { + cmatch[bestlno] = -1; match[bestlno] = candidate_gno; match[candidate_gno] = bestlno; } - + if (!cFLAG && bestsum > TSUM_THRESHOLD) { cmatch[bestlno] = -1; /* mark pending match to avoid conflicts */ master_data[candidate_index].candidate = candidate_gno; @@ -1277,19 +1240,19 @@ static int pmatching_ipm (ZZ *zz, master_data[candidate_index].ip = bestsum; } } - } - MACRO_TIMER_STOP (3); + } + MACRO_TIMER_STOP (3); } /* DONE: kstart < max_nTotal loop */ if (cFLAG) { - MPI_Bcast (match, hg->nVtx, zoltan_gno_mpi_type, 0, hgc->col_comm); - continue; /* skip phases 3 and 4, continue rounds */ - } + MPI_Bcast (match, hg->nVtx, zoltan_gno_mpi_type, 0, hgc->col_comm); + continue; /* skip phases 3 and 4, continue rounds */ + } /************************ NEW PHASE 3: ********************************/ - + MACRO_TIMER_START (4, "Matching Phase 3", 1); - + /* Only MASTER ROW computes best global match for candidates */ /* EBEB or perhaps we can do this fully distributed? */ if (hgc->myProc_y == 0) { @@ -1321,9 +1284,9 @@ static int pmatching_ipm (ZZ *zz, match[v1] = (ZOLTAN_GNO_TYPE)v2; match[v2] = (ZOLTAN_GNO_TYPE)v1; } - else + else match[VTX_GNO_TO_LNO(hg, candidate_gno)] = -partner_gno - 1; - } + } else if (vproc == hgc->myProc_x) match[VTX_GNO_TO_LNO(hg, partner_gno)] = -candidate_gno - 1; } @@ -1345,7 +1308,7 @@ static int pmatching_ipm (ZZ *zz, ZOLTAN_FREE(&visit); ZOLTAN_FREE(&global_best); ZOLTAN_FREE(&master_data); - + MACRO_TIMER_START (6, "Matching Cleanup", 0); /* optional sanity tests */ @@ -1372,18 +1335,18 @@ static int pmatching_ipm (ZZ *zz, if (match[i] < 0) cmatch[i] = -match[i] - 1; else cmatch[i] = VTX_LNO_TO_GNO(hg, match[i]); - MPI_Allgather (&hg->nVtx, 1, MPI_INT, size, 1, MPI_INT, hgc->row_comm); + MPI_Allgather (&hg->nVtx, 1, MPI_INT, size, 1, MPI_INT, hgc->row_comm); recsize = 0; for (i = 0; i < hgc->nProc_x; i++) recsize += size[i]; msgsize = recsize * sizeof(ZOLTAN_GNO_TYPE); - + dest[0] = 0; for (i = 1; i < hgc->nProc_x; i++) dest[i] = dest[i-1] + size[i-1]; - + if (nRec < msgsize){ MACRO_REALLOC (msgsize, nRec, recvbuf); } @@ -1401,7 +1364,7 @@ static int pmatching_ipm (ZZ *zz, /* TODO64 Here we are indexing an array by a global number. Is this a problem? */ /* From 5/4/10 meeting: return an error in phg build if it looks like a proc could have - more than 2*10^9 vertices in the 2D distribution + more than 2*10^9 vertices in the 2D distribution (so globalNumVertex/sqrt(numProcs) < 2*10^9) */ for (i = 0; i < recsize; i++) @@ -1413,8 +1376,8 @@ static int pmatching_ipm (ZZ *zz, for (i = 0; i < recsize; i++) if (gnoptr[i] != 1) count++; - if (count) - uprintf (hgc, "RTHRTH %d FINAL MATCH ERRORS of %d\n", count, recsize); + if (count) + uprintf (hgc, "RTHRTH %d FINAL MATCH ERRORS of %d\n", count, recsize); } MACRO_TIMER_STOP (6); @@ -1434,24 +1397,24 @@ static int pmatching_ipm (ZZ *zz, } - + /****************************************************************************/ -static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, - int scale, char * send, +static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, + int scale, char * send, int* reccnt, int *recsize, int * nRec, char ** rec, MPI_Comm comm, int tag) { ZOLTAN_COMM_OBJ *plan = NULL; int err; char *yo = "communication_by_plan"; - - /* communicate send buffer messages to other row/columns in my comm */ + + /* communicate send buffer messages to other row/columns in my comm */ err = Zoltan_Comm_Create (&plan, sendcnt, dest, comm, tag, reccnt); if (err != ZOLTAN_OK) { ZOLTAN_PRINT_ERROR (zz->Proc, yo, "failed to create plan"); return err; } - + /* resize plan if necessary */ if (size != NULL) { err = Zoltan_Comm_Resize (plan, size, tag+1, recsize); @@ -1460,13 +1423,13 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, ZOLTAN_PRINT_ERROR (zz->Proc, yo, "failed to resize plan"); return err; } - scale = 1; + scale = 1; } else *recsize = *reccnt * scale; - - /* realloc rec buffer if necessary */ - if (*recsize > *nRec) { + + /* realloc rec buffer if necessary */ + if (*recsize > *nRec) { if (!(*rec = (char*) ZOLTAN_REALLOC (*rec, *recsize * sizeof(char)))){ Zoltan_Comm_Destroy(&plan); ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Memory error"); @@ -1474,17 +1437,17 @@ static int communication_by_plan (ZZ* zz, int sendcnt, int* dest, int* size, } *nRec = *recsize; } - - /* send messages from send buffer to destinations */ + + /* send messages from send buffer to destinations */ err = Zoltan_Comm_Do (plan, tag+2, (char*) send, scale * sizeof(char), (char*) *rec); if (err != ZOLTAN_OK) { Zoltan_Comm_Destroy(&plan); ZOLTAN_PRINT_ERROR (zz->Proc, yo, "failed in Comm_Do"); return err; } - + /* free memory associated with the plan */ - Zoltan_Comm_Destroy (&plan); + Zoltan_Comm_Destroy (&plan); return ZOLTAN_OK; } @@ -1497,15 +1460,15 @@ static int pmatching_agg_ipm (ZZ *zz, ZOLTAN_GNO_TYPE *match, PHGPartParams *hgp) { - int ierr = ZOLTAN_OK; + int ierr = ZOLTAN_OK; int i, j, n, m, round, vindex; /* loop counters */ int sendcnt, sendsize, reccnt=0, recsize, msgsize; /* temp variables */ int nRounds; /* # of matching rounds to be performed; */ int nSend, /* working buffers and their sizes */ - *dest = NULL, nDest, + *dest = NULL, nDest, *size = NULL, nSize, nRec, - *aux = NULL, + *aux = NULL, nEdgebuf; /* holds candidates for processing (ipm) */ int *visit = NULL, /* candidate visit order (all candidates) */ *lhead = NULL, /* to accumulate ipm values correctly */ @@ -1557,28 +1520,28 @@ static int pmatching_agg_ipm (ZZ *zz, ZOLTAN_TRACE_ENTER (zz, yo); MACRO_TIMER_START (0, "matching setup", 0); Zoltan_Srand_Sync (Zoltan_Rand(NULL), &(hgc->RNGState_col), hgc->col_comm); - + /* this restriction may be removed later, but for now NOTE this test */ if (sizeof(int) < sizeof(float)) { ZOLTAN_PRINT_ERROR (zz->Proc, yo, "Code must be modified before using"); ierr = ZOLTAN_FATAL; goto End; } - - + + MPI_Type_contiguous (sizeof(Triplet), MPI_CHAR, &phasethreetype); MPI_Type_commit (&phasethreetype); MPI_Op_create (&phasethreereduce, 1, &phasethreeop); - + /* compute nCandidates per process; unless hypergraph is too small use user given parameter otherwise use nVtx/3 to allow some matching */ nCandidates = MAX(1, MIN(hgp->nCand, hg->nVtx/3)); - if (!(candIdx = (int*) ZOLTAN_MALLOC ((1+hgc->nProc_x) * sizeof(int)))) + if (!(candIdx = (int*) ZOLTAN_MALLOC ((1+hgc->nProc_x) * sizeof(int)))) MEMORY_ERROR; - + /* determine maximum number of Vtx and Pins for storage allocation */ /* determine initial sum of all candidates = total_nCandidates==>allocation */ MPI_Allreduce(&hg->nPins, &max_nPins, 1, MPI_INT,MPI_MAX,hgc->Communicator); @@ -1592,33 +1555,33 @@ static int pmatching_agg_ipm (ZZ *zz, total_nCandidates += MIN(hgp->nCand, count); } candIdx[i] = total_nCandidates; - + /* allocate "complicated" fixed-sized array storage */ msgsize = MAX (total_nCandidates, max_nVtx); nSize = nDest = 1 + MAX (msgsize, MAX (hgc->nProc_x, hgc->nProc_y)); header_size = 2 + (hgp->UsePrefPart ? 1 : 0); - nSend = nRec = nEdgebuf = - max_nPins * sizeof(int) + + nSend = nRec = nEdgebuf = + max_nPins * sizeof(int) + total_nCandidates * (sizeof(ZOLTAN_GNO_TYPE) + (header_size * sizeof(int)) + (VtxDim * sizeof(float))); - if (hg->nVtx) + if (hg->nVtx) if (!(lhead = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) || (hgp->UsePrefPart && !(lheadpref = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int)))) || !(visited= (char*) ZOLTAN_MALLOC (hg->nVtx * sizeof(char))) || !(cw = (float*) ZOLTAN_MALLOC (VtxDim * hg->nVtx * sizeof(float))) || !(visit = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) - || !(aux = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) + || !(aux = (int*) ZOLTAN_MALLOC (hg->nVtx * sizeof(int))) || !(sums = (float*) ZOLTAN_CALLOC (hg->nVtx, sizeof(float)))) MEMORY_ERROR; - if (VtxDim) + if (VtxDim) if (!(tw = (float*) ZOLTAN_MALLOC (VtxDim * sizeof(float))) || !(maxw = (float*) ZOLTAN_MALLOC (VtxDim * sizeof(float)))) MEMORY_ERROR; - if (hgc->myProc_y==0 && total_nCandidates ) { + if (hgc->myProc_y==0 && total_nCandidates ) { if (!(master_data=(Triplet*)ZOLTAN_CALLOC(total_nCandidates,sizeof(Triplet))) || !(global_best=(Triplet*)ZOLTAN_CALLOC(total_nCandidates,sizeof(Triplet)))) MEMORY_ERROR; @@ -1627,7 +1590,7 @@ static int pmatching_agg_ipm (ZZ *zz, master_data[i].partner = -1; master_data[i].ip = -1.0; } - } + } if (!(edgebuf = (char*) ZOLTAN_MALLOC (nEdgebuf)) || !(dest = (int*) ZOLTAN_MALLOC (nDest * sizeof(int))) @@ -1638,7 +1601,7 @@ static int pmatching_agg_ipm (ZZ *zz, MEMORY_ERROR; if (total_nCandidates) { if (!(idxptr = (int*) ZOLTAN_MALLOC (total_nCandidates * sizeof(int))) - || !(candvisit = (int*) ZOLTAN_MALLOC (total_nCandidates * sizeof(int))) + || !(candvisit = (int*) ZOLTAN_MALLOC (total_nCandidates * sizeof(int))) || !(gno_locs = (intptr_t*) ZOLTAN_MALLOC (total_nCandidates * sizeof(intptr_t))) || !(locCandidates = (int*) ZOLTAN_MALLOC (nCandidates * sizeof(int))) || !(candw = (float*) ZOLTAN_MALLOC (VtxDim * total_nCandidates * sizeof(float)))) @@ -1648,10 +1611,10 @@ static int pmatching_agg_ipm (ZZ *zz, MEMORY_ERROR; } } - + /* Compute candidates' vertex visit order (selection). Random is default. */ Zoltan_PHG_Vertex_Visit_Order (zz, hg, hgp, visit); - + /* Loop processing ncandidates vertices per column each round. * Each loop has 3 phases, phase 3 may be repeated as necessary * Phase 1: send ncandidates vertices for global matching - horizontal comm @@ -1674,7 +1637,7 @@ static int pmatching_agg_ipm (ZZ *zz, tw[j] += (cw[i*VtxDim+j] = hg->vwgt[i*VtxDim+j]); } else { tw[0] += hg->nVtx; - for (i=0; i< hg->nVtx; ++i) + for (i=0; i< hg->nVtx; ++i) cw[i] = 1.0; } MPI_Allreduce(tw, maxw, VtxDim, MPI_FLOAT, MPI_SUM, hgc->row_comm); @@ -1682,20 +1645,20 @@ static int pmatching_agg_ipm (ZZ *zz, maxw[j] /= 4.0; /* we don't allow a cluster to grow more than half of a part */ - + ZOLTAN_FREE(&tw); vindex = 0; /* marks current position in visit array */ nRounds = 1; for (round = 0; nRounds; ++round) { MACRO_TIMER_START (1, "matching phase 1", 0); - + /************************ PHASE 1: ****************************************/ /* Select upto nCandidates unmatched vertices to globally match. */ for (locCandCnt = 0; locCandCnt < nCandidates && vindex < hg->nVtx; ++vindex) { - int v=visit[vindex]; + int v=visit[vindex]; if (!visited[v]) { /* unmatched */ locCandidates [locCandCnt++] = v; /* select it as a candidate */ visited[v] = 1; @@ -1727,7 +1690,7 @@ static int pmatching_agg_ipm (ZZ *zz, sendsize = gno_size + int_size + float_size; if (sendsize > nSend){ - MACRO_RESIZE (1.2 * sendsize, nSend, sendbuf); /* resize send buffer */ + MACRO_RESIZE (1.2 * sendsize, nSend, sendbuf); /* resize send buffer */ } s = sendbuf; @@ -1741,13 +1704,13 @@ static int pmatching_agg_ipm (ZZ *zz, *gnoptr = VTX_LNO_TO_GNO(hg, lno); /* gno of candidate */ *intptr++ = candIdx[hgc->myProc_x] + i; /* candidate index */ - - if (hgp->UsePrefPart) + + if (hgp->UsePrefPart) *intptr++ = hg->pref_part[lno]; /* pref partition info */ *intptr++ = hg->vindex[lno+1] - hg->vindex[lno]; /* edge count */ - for (j = hg->vindex[lno]; j < hg->vindex[lno+1]; j++) { + for (j = hg->vindex[lno]; j < hg->vindex[lno+1]; j++) { *intptr++ = hg->vedge[j]; /* edge lno */ } @@ -1758,13 +1721,13 @@ static int pmatching_agg_ipm (ZZ *zz, } s = (char *)floatptr; - + /* } */ } /* communication to determine global size of rec buffer */ MPI_Allgather (&sendsize, 1, MPI_INT, size, 1, MPI_INT, hgc->row_comm); - + /* determine size of the rec buffer & reallocate bigger iff necessary */ recsize = 0; for (i = 0; i < hgc->nProc_x; i++) @@ -1772,7 +1735,7 @@ static int pmatching_agg_ipm (ZZ *zz, if (recsize > nEdgebuf){ MACRO_RESIZE (1.2 * recsize, nEdgebuf, edgebuf); /* enlarge edgebuf */ } - + /* setup displacement array necessary for MPI_Allgatherv */ dest[0] = 0; for (i = 1; i < hgc->nProc_x; i++) @@ -1821,8 +1784,8 @@ static int pmatching_agg_ipm (ZZ *zz, MACRO_TIMER_STOP (1); /************************ PHASE 2: ***************************************/ - - /* for each candidate vertex, compute all local partial inner products */ + + /* for each candidate vertex, compute all local partial inner products */ kstart = old_kstart = 0; /* next candidate (of nTotal) to process */ while (kstart < total_nCandidates) { @@ -1837,7 +1800,7 @@ static int pmatching_agg_ipm (ZZ *zz, n = idxptr[candvisit[k]]; - if (n == -1) + if (n == -1) continue; /* don't have this sparse candidate locally */ gnoptr = (ZOLTAN_GNO_TYPE *)(edgebuf + gno_locs[n]); @@ -1846,25 +1809,25 @@ static int pmatching_agg_ipm (ZZ *zz, candidate_gno = *gnoptr; /* gno of candidate vertex */ candidate_index = *intptr++; /* candidate_index of vertex */ - if (hgp->UsePrefPart) - pref = *intptr++; /* pref vertex information */ - + if (hgp->UsePrefPart) + pref = *intptr++; /* pref vertex information */ + count = *intptr++; /* intptr points to edge lnos */ /* now compute the row's nVtx inner products for kth candidate */ m = 0; - if (hg->ewgt != NULL) + if (hg->ewgt != NULL) AGG_INNER_PRODUCT1(hg->ewgt[*intptr]) - else + else AGG_INNER_PRODUCT1(1.0) /* if local vtx, remove self inner product (useless maximum) */ if (VTX_TO_PROC_X(hg, candidate_gno) == hgc->myProc_x) sums[VTX_GNO_TO_LNO(hg, candidate_gno)] = 0.0; - + /* if it is partitioning with preferred parts and/or fixed vertices check if matches are OK also eliminate sending value 0.0*/ - for (count=0; countPSUM_THRESHOLD && AGG_MATCH_OK(hgp, hg, pref, lheadpref[aux[count]])) ++count; @@ -1873,7 +1836,7 @@ static int pmatching_agg_ipm (ZZ *zz, aux[count] = aux[--m]; } if (count == 0) - continue; /* no partial sums to append to message */ + continue; /* no partial sums to append to message */ /* iff necessary, resize send buffer to fit at least first message */ @@ -1888,7 +1851,7 @@ static int pmatching_agg_ipm (ZZ *zz, if (rows[candidate_gno % hgc->nProc_y] != 1) { rows[candidate_gno % hgc->nProc_y] = 1; candidate_index = -candidate_index -1; - } + } /* current partial sums fit, so put them into the send buffer */ @@ -1896,39 +1859,39 @@ static int pmatching_agg_ipm (ZZ *zz, intptr = (int *)(gnoptr + 1); floatptr = (float *)(intptr + 2 + count); - dest[sendcnt] = candidate_gno % hgc->nProc_y; /* destination */ + dest[sendcnt] = candidate_gno % hgc->nProc_y; /* destination */ size[sendcnt++] = msgsize; /* size of message */ sendsize += msgsize; /* cummulative size of message */ *gnoptr++ = candidate_gno; - *intptr++ = candidate_index; + *intptr++ = candidate_index; *intptr++ = count; - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) { *intptr++ = aux[i]; /* lno of partial sum */ - *floatptr++ = sums[aux[i]]; /* partial sum */ + *floatptr++ = sums[aux[i]]; /* partial sum */ sums[aux[i]] = 0.0; - } + } } else { /* psum message doesn't fit into buffer */ - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) sums[aux[i]] = 0.0; /* uprintf(hgc, "WARYNING: psum msg doesn't fit into buffer!!!! sub-phases!!!!!\n"); */ - break; - } - } /* DONE: loop over k */ + break; + } + } /* DONE: loop over k */ MACRO_TIMER_STOP (2); MACRO_TIMER_START (3, "Matching kstart B", 0); - + /* synchronize all rows in this column to next kstart value */ old_kstart = kstart; MPI_Allreduce (&k, &kstart, 1, MPI_INT, MPI_MIN, hgc->col_comm); /* Send inner product data in send buffer to appropriate rows */ - ierr = communication_by_plan (zz, sendcnt, dest, size, 1, sendbuf, &reccnt, + ierr = communication_by_plan (zz, sendcnt, dest, size, 1, sendbuf, &reccnt, &recsize, &nRec, &recvbuf, hgc->col_comm, IPM_TAG); if (ierr != ZOLTAN_OK) goto End; - + /* build index into receive buffer pointer for each proc's row of data */ for (i = 0; i < hgc->nProc_y; i++) rows[i] = recsize; /* sentinal in case no row's data available */ @@ -1952,13 +1915,13 @@ static int pmatching_agg_ipm (ZZ *zz, /* UVCUVC */ if (k>hgc->nProc_y) errexit("k(%d)!=nProc_y(%d) recsize %d", k, hgc->nProc_y, recsize); - + /* merge partial i.p. sum data to compute total inner products */ sendsize = 0; - + for (n = old_kstart; n < kstart; n++) { - m = 0; + m = 0; for (i = 0; i < hgc->nProc_y; i++) { if (rows[i] < recsize){ gnoptr = (ZOLTAN_GNO_TYPE *)(recvbuf + rows[i]); @@ -1973,7 +1936,7 @@ static int pmatching_agg_ipm (ZZ *zz, for (j = 0; j < count; j++) { lno = intptr[2+j]; - if (sums[lno] == 0.0) /* is this first time for this lno? */ + if (sums[lno] == 0.0) /* is this first time for this lno? */ aux[m++] = lno; /* then save the lno */ sums[lno] += *floatptr++; /* sum the psums */ } @@ -2006,14 +1969,14 @@ static int pmatching_agg_ipm (ZZ *zz, bestsum = val; bestlno = llno; } - sums[llno] = 0.0; + sums[llno] = 0.0; } /* if (m) printf("\n"); */ - + /* Put > into send */ msgsize = sizeof(ZOLTAN_GNO_TYPE) + (2 * sizeof(int)) + sizeof(float); @@ -2022,7 +1985,7 @@ static int pmatching_agg_ipm (ZZ *zz, if (sendsize + msgsize > nSend ) { uprintf(hgc, "resize with nSend=%d sendsize=%d m=%d\n", nSend, sendsize, m); MACRO_REALLOC (1.2*(sendsize + msgsize), nSend, sendbuf); - } + } gnoptr = (ZOLTAN_GNO_TYPE *)(sendbuf + sendsize); intptr = (int *)(gnoptr + 1); floatptr = (float *)(intptr + 2); @@ -2034,29 +1997,29 @@ static int pmatching_agg_ipm (ZZ *zz, /* uprintf(hgc, "cand_gno=%d partner_lno=%d with ip=%f\n", candidate_gno, bestlno, bestsum);*/ sendsize += msgsize; - } + } } - + /* Communicate total inner product results to MASTER ROW */ MPI_Gather(&sendsize, 1, MPI_INT, size, 1, MPI_INT, 0, hgc->col_comm); - + if (hgc->myProc_y == 0) { recsize = 0; for (i = 0; i < hgc->nProc_y; i++) - recsize += size[i]; - + recsize += size[i]; + dest[0] = 0; for (i = 1; i < hgc->nProc_y; i++) dest[i] = dest[i-1] + size[i-1]; - + if (recsize > nRec) MACRO_RESIZE (1.2 * recsize, nRec, recvbuf); /* make rec buffer bigger */ } - + MPI_Gatherv (sendbuf, sendsize, MPI_CHAR, recvbuf, size, dest, MPI_CHAR, 0, hgc->col_comm); /* uprintf(hgc, "recsize=%d\n", recsize);*/ - + /* Determine best vertex and best sum for each candidate */ if (hgc->myProc_y == 0) { /* do following only if I am the MASTER ROW */ for (r = recvbuf; r < recvbuf + recsize;) { @@ -2073,26 +2036,26 @@ static int pmatching_agg_ipm (ZZ *zz, /* uprintf(hgc, "local best for cand %zd (idx=%d) is %d with ip=%f\n", candidate_gno, candidate_index, (bestlno<0) ? -1 : match[bestlno], bestsum);*/ master_data[candidate_index].candidate = candidate_gno; - master_data[candidate_index].partner = match[bestlno]; + master_data[candidate_index].partner = match[bestlno]; master_data[candidate_index].ip = bestsum; if (match[bestlno]<0) errexit("hey for bestlno: match[%d]=%zd\n", bestlno, match[bestlno]); } - } + } - MACRO_TIMER_STOP (3); + MACRO_TIMER_STOP (3); } /* DONE: kstart < max_nTotal loop */ /************************ PHASE 3 & 4 ********************************/ - + MACRO_TIMER_START (4, "Matching Phase 3&4", 1); replycnt=0; msgsize = header_size * sizeof(int) + VtxDim * sizeof(float); - if (hgc->myProc_y == 0) { + if (hgc->myProc_y == 0) { HG_Ptr = hg; MPI_Allreduce(master_data, global_best, total_nCandidates, @@ -2106,30 +2069,30 @@ static int pmatching_agg_ipm (ZZ *zz, */ /* Reinitialize master_data for next round */ - for (i = 0; i < total_nCandidates; i++) { + for (i = 0; i < total_nCandidates; i++) { master_data[i].candidate = -1; master_data[i].partner = -1; master_data[i].ip = -1.0; } - if (total_nCandidates * msgsize > nSend) + if (total_nCandidates * msgsize > nSend) MACRO_RESIZE (total_nCandidates * msgsize, nSend, sendbuf); /* increase buffer size */ - s = sendbuf; - + s = sendbuf; + for (i = 0; i < total_nCandidates; i++) { int cproc, pproc; candidate_gno = global_best[i].candidate; - + if (candidate_gno == -1) continue; - + partner_gno = global_best[i].partner; cproc = VTX_TO_PROC_X(hg, candidate_gno); pproc = VTX_TO_PROC_X(hg, partner_gno); if (pproc == hgc->myProc_x) { /* partner is mine */ /* check weight constraints */ - + int plno = VTX_GNO_TO_LNO(hg, partner_gno); for (j=0; jmaxw[j]) @@ -2150,7 +2113,7 @@ static int pmatching_agg_ipm (ZZ *zz, *floatptr = -1.0; /* negative means rejected */ /* uprintf(hgc, "I'm rejecting (%zd, %zd)\n", candidate_gno, partner_gno); */ - } else { /* accept */ + } else { /* accept */ for (j=0; jcol_comm); - + if (hgc->myProc_y!=0 && (replycnt*msgsize)>nSend) MACRO_REALLOC (replycnt*msgsize, nSend, sendbuf); /* increase buffer size */ - + MPI_Bcast (sendbuf, replycnt*msgsize, MPI_CHAR, 0, hgc->col_comm); if (hgc->myProc_y!=0) { int plno; - + s = sendbuf; for (i=0; imyProc_y == 0) { + if (hgc->myProc_y == 0) { /* send accept/reject message */ communication_by_plan(zz, replycnt, dest, NULL, msgsize, sendbuf, &reccnt, &recsize, &nRec, &recvbuf, hgc->row_comm, CONFLICT_TAG); msgsize = sizeof(ZOLTAN_GNO_TYPE) + header_size * sizeof(int) + VtxDim * sizeof(float); - if (reccnt*msgsize > nSend) + if (reccnt*msgsize > nSend) MACRO_RESIZE (reccnt*msgsize, nSend, sendbuf); /* increase buffer size */ - s = sendbuf; + s = sendbuf; for (r = recvbuf; r < recvbuf + recsize;) { int ci, lheadno; ZOLTAN_GNO_TYPE partner; @@ -2242,15 +2205,15 @@ static int pmatching_agg_ipm (ZZ *zz, lheadno = -1; /* uprintf(hgc, "(%zd, %zd) has been rejected\n", global_best[ci].candidate, global_best[ci].partner);*/ } else { /* accepted */ - lheadno = Zoltan_KVHash_Insert(&hash, partner, lno); + lheadno = Zoltan_KVHash_Insert(&hash, partner, lno); - for (j=0; jUsePrefPart) lheadpref[lno] = pref; lhead[lno] = lheadno; match[lno] = partner; - + /* uprintf(hgc, "(%zd, %zd) has been accepted\n", global_best[ci].candidate, global_best[ci].partner);*/ } @@ -2258,8 +2221,8 @@ static int pmatching_agg_ipm (ZZ *zz, intptr = (int *)(gnoptr + 1); floatptr = (float *)(intptr + header_size); s = (char *)(floatptr + VtxDim); - - *gnoptr = partner; + + *gnoptr = partner; *intptr++ = lno; *intptr++ = lheadno; if (hgp->UsePrefPart) @@ -2290,14 +2253,14 @@ static int pmatching_agg_ipm (ZZ *zz, lheadno = *intptr++; partner = *gnoptr; pref = 0; - + if (hgp->UsePrefPart) pref = *intptr++; - if (lheadno!=-1) { + if (lheadno!=-1) { lhead[lno] = lheadno; match[lno] = partner; - memcpy(&cw[lheadno*VtxDim], floatptr, sizeof(float)*VtxDim); + memcpy(&cw[lheadno*VtxDim], floatptr, sizeof(float)*VtxDim); if (hgp->UsePrefPart) lheadpref[lheadno] = pref; @@ -2306,7 +2269,7 @@ static int pmatching_agg_ipm (ZZ *zz, } for (; vindex < hg->nVtx && visited[visit[vindex]]; ++vindex); - + i = vindex < hg->nVtx; MPI_Allreduce(&i, &nRounds, 1, MPI_INT, MPI_SUM, hgc->row_comm); MACRO_TIMER_STOP (5); /* end of phase 4 */ @@ -2343,14 +2306,14 @@ static int pmatching_agg_ipm (ZZ *zz, ZOLTAN_FREE(&rows); ZOLTAN_FREE(&master_data); ZOLTAN_FREE(&master_procs); - + /* Zoltan_Multifree (__FILE__, __LINE__, 22, &candIdx, &cw, &tw, &maxw, &candw, &lhead, &lheadpref, &visit, &visited, &sums, &sendbuf, &dest, &size, &recvbuf, &aux, &idxptr, &candvisit, &edgebuf, &locCandidates, &rows, &master_data, &master_procs); */ ZOLTAN_TRACE_EXIT(zz, yo); - + return ierr; } @@ -2366,7 +2329,7 @@ static int pmatching_geom (ZZ *zz, char *yo = "pmatching_geom"; ZZ *zz2 = Zoltan_Create(hg->comm->Communicator); int i; - char s[28]; + char s[28]; int changes, num_gid_entries, num_lid_entries, local_vtx; ZOLTAN_GNO_TYPE *procmatch; MPI_Datatype zoltan_gno_mpi_type; @@ -2410,7 +2373,7 @@ static int pmatching_geom (ZZ *zz, hgp->geometric_red = 0.1; } - /* Parts are reduced by a factor, result should not be 0 */ + /* Parts are reduced by a factor, result should not be 0 */ local_vtx = (int)(hgp->geometric_red * (double) hg->nVtx / (double) hg->comm->nProc_y); sprintf(s, "%d", (local_vtx == 0) ? 1 : local_vtx); @@ -2449,7 +2412,7 @@ static int pmatching_geom (ZZ *zz, MPI_Allreduce(procmatch, match, hg->nVtx, zoltan_gno_mpi_type, MPI_SUM, hg->comm->col_comm); - /* + /* * Perform geometric matching only on geometric_levels levels. If done, * switch to agglomerative matching. */ @@ -2468,7 +2431,7 @@ static int pmatching_geom (ZZ *zz, ZOLTAN_FREE(&candidate_ids); ZOLTAN_TRACE_EXIT(zz, yo); - + return ierr; } @@ -2477,7 +2440,7 @@ static int geometric_get_num_obj(void *data, int *ierr) { /* Return number of vertices / number of processes on the y-axis */ HGraph *hg; int count, diff; - + if (data == NULL) { *ierr = ZOLTAN_FATAL; return 0; @@ -2488,7 +2451,7 @@ static int geometric_get_num_obj(void *data, int *ierr) { count = hg->nVtx / hg->comm->nProc_y; diff = hg->nVtx % hg->comm->nProc_y; - + /* Use processor ID to select which will take extra processes */ return hg->comm->myProc_y < diff? count + 1 : count; } @@ -2497,16 +2460,16 @@ static void geometric_get_obj_list(void *data, int num_gid, int num_lid, ZOLTAN_ID_PTR global_id, ZOLTAN_ID_PTR local_id, int wdim, float *wgt, int *ierr) { /* Return GNOs, LNOs, and weights */ - + HGraph *hg; int local_obj; /* Number of objects endemic to this processor */ int count, diff, idx; int i, j; - - if (data == NULL) { - *ierr = ZOLTAN_FATAL; + + if (data == NULL) { + *ierr = ZOLTAN_FATAL; return; - } + } hg = ((HGraph*) data); *ierr = ZOLTAN_OK; @@ -2516,7 +2479,7 @@ static void geometric_get_obj_list(void *data, int num_gid, int num_lid, local_obj = hg->comm->myProc_y < diff? count + 1 : count; idx = (count * hg->comm->myProc_y) + (hg->comm->myProc_y > diff ? diff : hg->comm->myProc_y); - + for (i = 0; i < local_obj; i++) { global_id[i] = VTX_LNO_TO_GNO(hg, (idx + i)); local_id[i] = idx + i; @@ -2554,7 +2517,7 @@ static void geometric_get_geom_multi(void *data, int num_obj, int num_gid, int local_obj; ZOLTAN_ID_TYPE glob; int i, j; - + if (data == NULL) { *ierr = ZOLTAN_FATAL; return; @@ -2564,11 +2527,11 @@ static void geometric_get_geom_multi(void *data, int num_obj, int num_gid, *ierr = ZOLTAN_OK; local_obj = geometric_get_num_obj(hg, ierr); - - for (i = 0; i < local_obj; i++) { + + for (i = 0; i < local_obj; i++) { glob = local_id[i]; for (j = 0; j < hg->nDim; j++) - coor[i * hg->nDim + j] = hg->coor[glob * hg->nDim + j]; + coor[i * hg->nDim + j] = hg->coor[glob * hg->nDim + j]; } } @@ -2586,3 +2549,5 @@ static void geometric_get_geom_multi(void *data, int num_obj, int num_gid, #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + + diff --git a/packages/zoltan/src/phg/phg_order.c b/packages/zoltan/src/phg/phg_order.c index cdc3e90b16..15fa196f3a 100644 --- a/packages/zoltan/src/phg/phg_order.c +++ b/packages/zoltan/src/phg/phg_order.c @@ -1,64 +1,27 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ - - +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER + + #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { #endif #include -#include "zz_sort.h" +#include "zz_sort.h" #include "phg.h" #include "zz_const.h" int Zoltan_PHG_Vertex_Visit_Order( - ZZ *zz, - HGraph *hg, - PHGPartParams *hgp, + ZZ *zz, + HGraph *hg, + PHGPartParams *hgp, int *order) { int i, j, edge; @@ -73,7 +36,7 @@ int Zoltan_PHG_Vertex_Visit_Order( /* Permute order array according to chosen strategy. */ switch (hgp->visit_order){ - case 0: + case 0: /* random node visit order (recommended) */ /* Synchronize so each proc in column visits in same order */ Zoltan_Srand_Sync(Zoltan_Rand(NULL), &(hg->comm->RNGState_col), @@ -81,7 +44,7 @@ int Zoltan_PHG_Vertex_Visit_Order( Zoltan_Rand_Perm_Int (order, hg->nVtx, &(hg->comm->RNGState_col)); break; - case 1: + case 1: /* linear (natural) vertex visit order */ break; @@ -99,17 +62,17 @@ int Zoltan_PHG_Vertex_Visit_Order( for (i = 0; i < hg->nVtx; i++) tmpvwgt[i] = hg->vwgt[i*hg->VtxWeightDim]; - } - + } + Zoltan_quicksort_pointer_inc_float (order, tmpvwgt, 0, hg->nVtx-1); if (tmpvwgt != hg->vwgt) ZOLTAN_FREE(&tmpvwgt); break; } - case 3: + case 3: /* increasing vertex degree */ /* intentionally fall through into next case */ - case 4: + case 4: /* increasing vertex degree, weighted by # pins */ /* allocate 4 arrays of size hg->nVtx with a single malloc */ @@ -136,7 +99,7 @@ int Zoltan_PHG_Vertex_Visit_Order( /* sum up local degrees in each column to get global degrees */ /* also sum up #pins in same communication */ - MPI_Allreduce(ldegree, gdegree, 2*hg->nVtx, MPI_INT, MPI_SUM, + MPI_Allreduce(ldegree, gdegree, 2*hg->nVtx, MPI_INT, MPI_SUM, hg->comm->col_comm); /* sort by global values. same on every processor. */ diff --git a/packages/zoltan/src/phg/phg_params.h b/packages/zoltan/src/phg/phg_params.h index d7ae46c4d3..ea8d0c7a7f 100644 --- a/packages/zoltan/src/phg/phg_params.h +++ b/packages/zoltan/src/phg/phg_params.h @@ -1,52 +1,15 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PHG_PARAMS_H #define __PHG_PARAMS_H - + #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -67,7 +30,7 @@ static PARAM_VARS PHG_params[] = { {"PHG_OUTPUT_LEVEL", NULL, "INT", 0}, /* Higher value -> more output */ {"FINAL_OUTPUT", NULL, "INT", 0}, - /* Output related to final partitioning only */ + /* Output related to final partitioning only */ {"CHECK_GRAPH", NULL, "INT", 0}, /* Same as CHECK_HYPERGRAPH */ {"CHECK_HYPERGRAPH", NULL, "INT", 0}, @@ -78,7 +41,7 @@ static PARAM_VARS PHG_params[] = { /* No. of processors along hyperedge direction initially in 2D layout */ {"PHG_COARSENING_LIMIT", NULL, "INT", 0}, /* When to stop coarsening (global no. of vertices) */ - {"PHG_COARSENING_NCANDIDATE", NULL, "INT", 0}, + {"PHG_COARSENING_NCANDIDATE", NULL, "INT", 0}, /* Max no. of candidate vertices in a round of matching */ {"PHG_COARSENING_METHOD", NULL, "STRING", 0}, /* Coarsening method (ipm, agg, etc. ) */ @@ -98,20 +61,20 @@ static PARAM_VARS PHG_params[] = { /* Direct k-way partitioning not yet implemented! */ {"PHG_REFINEMENT_LOOP_LIMIT", NULL, "INT", 0}, /* Max no. of loops in KL/FM. */ - {"PHG_REFINEMENT_MAX_NEG_MOVE", NULL, "INT", 0}, + {"PHG_REFINEMENT_MAX_NEG_MOVE", NULL, "INT", 0}, /* Max. no. of negative moves allowed before exiting refinement. */ {"PHG_REFINEMENT_QUALITY", NULL, "FLOAT", 0}, /* 1.0 is default; higher (lower) value gives more (less) refinement. */ - {"PHG_USE_TIMERS", NULL, "INT", 0}, + {"PHG_USE_TIMERS", NULL, "INT", 0}, /* Same as USE_TIMERS. */ - {"USE_TIMERS", NULL, "INT", 0}, + {"USE_TIMERS", NULL, "INT", 0}, /* Same as PHG_USE_TIMERS. */ {"PHG_EDGE_SIZE_THRESHOLD", NULL, "FLOAT", 0}, /* Ignore hyperedges larger than this threshold times nvertex */ /* If PHG_EDGE_SIZE_THRESHOLD>1, interpret it as absolute value. */ {"PHG_MATCH_EDGE_SIZE_THRESHOLD", NULL, "INT", 0}, /* Ignore hyperedges larger than this threshold, in local processor, during matching */ - {"PHG_BAL_TOL_ADJUSTMENT", NULL, "FLOAT", 0}, + {"PHG_BAL_TOL_ADJUSTMENT", NULL, "FLOAT", 0}, /* Adjustment factor for balance in recursive bisection. */ {"PHG_EDGE_WEIGHT_OPERATION", NULL, "STRING", 0}, /* How to handle inconsistent edge weights across processors */ @@ -119,8 +82,8 @@ static PARAM_VARS PHG_params[] = { /* Serial partitioner for ParKway (PaToH or hMetis) */ {"ADD_OBJ_WEIGHT", NULL, "STRING", 0}, /* Add implicit vertex weight, like no. of pins (nonzeros)? */ - {"PHG_RANDOMIZE_INPUT", NULL, "INT", 0}, - /* Randomizing input often improves load balance within PHG but destroys + {"PHG_RANDOMIZE_INPUT", NULL, "INT", 0}, + /* Randomizing input often improves load balance within PHG but destroys locality, so may produce lower quality partitions */ {"PHG_PROCESSOR_REDUCTION_LIMIT", NULL, "FLOAT", 0}, /* When to move data to fewer processors. */ @@ -132,11 +95,11 @@ static PARAM_VARS PHG_params[] = { /* # of levels on which to use geometric matching; INT_MAX-->all levels. */ {"PATOH_ALLOC_POOL0", NULL, "INT", 0}, /* Memory allocation parameter for Patoh. */ - {"PATOH_ALLOC_POOL1", NULL, "INT", 0}, + {"PATOH_ALLOC_POOL1", NULL, "INT", 0}, /* Memory allocation parameter for Patoh. */ {"PHG_KEEP_TREE", NULL, "INT", 0}, /* Keep bisection tree */ - {NULL, NULL, NULL, 0} + {NULL, NULL, NULL, 0} }; diff --git a/packages/zoltan/src/phg/phg_parkway.c b/packages/zoltan/src/phg/phg_parkway.c index 71c4f22425..4334438d23 100644 --- a/packages/zoltan/src/phg/phg_parkway.c +++ b/packages/zoltan/src/phg/phg_parkway.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -53,9 +16,9 @@ extern "C" { #ifdef ZOLTAN_PARKWAY - -void Zoltan_ParaPartKway(int numVertices, int numHedges, const int *vWeights, const int *hEdgeWts, const int *pinList, const int *offsets, int numParts, double constraint, int *k_1cut, const int *options, int *pVector, const char *outFile, MPI_Comm comm); - + +void Zoltan_ParaPartKway(int numVertices, int numHedges, const int *vWeights, const int *hEdgeWts, const int *pinList, const int *offsets, int numParts, double constraint, int *k_1cut, const int *options, int *pVector, const char *outFile, MPI_Comm comm); + static int scale_round_weights(float *, int *, int, int, int); #define ZOLTAN_PARKWAY_ERROR(str, err) \ @@ -70,7 +33,7 @@ int Zoltan_PHG_ParKway( HGraph *hg, int nparts, /* # of desired partitions */ Partition partvec, /* Output: partition assignment vector */ - PHGPartParams *hgp /* Input: hypergraph parameters */ + PHGPartParams *hgp /* Input: hypergraph parameters */ ) { char *yo = "Zoltan_HG_ParKway"; @@ -91,35 +54,35 @@ int Zoltan_PHG_ParKway( PHGComm *hgc=hg->comm; int *disp=NULL, *recv_size=NULL; /* for allgatherv */ static int seed=1; - + /* ParKway expects integer weights; convert if weights are provided. */ ivwgts = (int *) ZOLTAN_MALLOC(hg->nVtx * sizeof(int)); - iewgts = (int *) ZOLTAN_MALLOC(hg->nEdge * sizeof(int)); + iewgts = (int *) ZOLTAN_MALLOC(hg->nEdge * sizeof(int)); if (!ivwgts || !iewgts) ZOLTAN_PARKWAY_ERROR("Memory error.", ZOLTAN_MEMERR); - - - if (hg->VtxWeightDim > 1) { + + + if (hg->VtxWeightDim > 1) { ZOLTAN_PARKWAY_ERROR("ParKway supports Vtx_Weight_Dim == 0 or 1 only.", ZOLTAN_FATAL); - } else if (hg->VtxWeightDim == 1) + } else if (hg->VtxWeightDim == 1) scale_round_weights(hg->vwgt, ivwgts, hg->nVtx, hg->VtxWeightDim, 0); - else + else for (i=0; inVtx; ++i) ivwgts[i] = 1; - + if (hg->EdgeWeightDim > 1) { ZOLTAN_PARKWAY_ERROR("ParKway supports Edge_Weight_Dim == 0 or 1 only.", ZOLTAN_FATAL); - } else if (hg->EdgeWeightDim == 1) + } else if (hg->EdgeWeightDim == 1) scale_round_weights(hg->ewgt, iewgts, hg->nEdge, hg->EdgeWeightDim, 0); else for (i=0; inEdge; ++i) iewgts[i] = 1; - - - + + + anVtx = hg->nVtx / hgc->nProc; nVtx = (hgc->myProc==hgc->nProc-1) ? hg->nVtx-(anVtx*(hgc->nProc-1)) : anVtx; @@ -146,9 +109,9 @@ int Zoltan_PHG_ParKway( options[12] = 3;/*divide connectivity by cluster weight/hyperedge length: 0-neither, 1-only cluster, 2-only hedge len, 3-both */ options[13] = 3;/*matching request resolution order: 3 -> random, 2 -> as they arrive */ options[14] = 1;/*number serial partitioning runs*/ - + options[15] = 5;/*serial partitioning routine, 1-3 RB, 4 khmetis, 5 patoh, see manual*/ - + if (!strcasecmp(hgp->parkway_serpart, "patoh")) options[15] = 5; else if (!strcasecmp(hgp->parkway_serpart, "hmetis")) @@ -162,9 +125,9 @@ int Zoltan_PHG_ParKway( else { ZOLTAN_PARKWAY_ERROR("Invalid ParKway serial partitioner. It should be one of; generic, genericv, genericmv, hmetis, patoh.", ZOLTAN_FATAL); } - + /* uprintf(hgc, "ParKway serpart='%s' options[13]=%d\n", hgp->parkway_serpart, options[13]); */ - + options[16] = 2;/*serial coarsening algorithm (only if [15] = RB, see manual)*/ options[17] = 2;/*num bisection runs in RB (only if [15] = RB, see manual)*/ options[18] = 10;/*num initial partitioning runs in RB (only if [13] = RB, see manual)*/ @@ -178,61 +141,61 @@ int Zoltan_PHG_ParKway( options[26] = 0;/*reduction in [23] as partitions propagate by factor [24]/100 (see manual)*/ options[27] = 100;/*early exit criterion in parallel refinement, will exit if see ([25]*num vert)/100 consecutive -ve moves */ options[28] = 0;/*parallel refinement 0->basic, 1->use approx 2->use early exit 3->use approx and early exit */ - + constraint = hgp->bal_tol-1.0; - + Zoltan_ParaPartKway(nVtx, hg->nEdge, &ivwgts[hgc->myProc*anVtx], iewgts, hg->hindex, hg->hvertex, nparts, constraint, &cut, options, pvector, NULL, hgc->Communicator); - + /* KDDKDD uprintf(hgc, "ParaPartKway cut=%d\n", cut); */ - - - /* after partitioning Zoltan needs partvec exist on all procs for nProc_x=1 */ - disp[0] = 0; + + + /* after partitioning Zoltan needs partvec exist on all procs for nProc_x=1 */ + disp[0] = 0; for (i = 1; i < hgc->nProc; ++i) disp[i] = disp[i-1] + anVtx; - - MPI_Allgather (&nVtx, 1, MPI_INT, recv_size, 1, MPI_INT, hgc->Communicator); - MPI_Allgatherv(pvector, nVtx, MPI_INT, + + MPI_Allgather (&nVtx, 1, MPI_INT, recv_size, 1, MPI_INT, hgc->Communicator); + MPI_Allgatherv(pvector, nVtx, MPI_INT, partvec, recv_size, disp, MPI_INT, hgc->Communicator); - + /* HERE: Check whether imbalance criteria were met. */ End: Zoltan_Multifree(__FILE__,__LINE__, 5, &ivwgts, &iewgts, &pvector, &disp, &recv_size); - + return ierr; #endif } - + /*****************************************************************************/ #ifdef ZOLTAN_PARKWAY - + #define INT_EPSILON (1e-5) static int scale_round_weights( - float *fwgts, - int *iwgts, - int n, + float *fwgts, + int *iwgts, + int n, int dim, int mode ) { /* Convert floating point weights to integer weights. * This routine is stolen from scale_round_weights in parmetis_jostle.c. - * Because it needs to run only serially, and because it uses only + * Because it needs to run only serially, and because it uses only * integers (not idxtype), it has been largely duplicated here. */ - int i, j, tmp, ierr; + int i, j, tmp, ierr; int max_wgt_sum = INT_MAX/8; int *nonint; float *scale, *sum_wgt, *max_wgt; @@ -271,7 +234,7 @@ static int scale_round_weights( /* Check if all weights are integers */ for (i=0; i INT_EPSILON){ @@ -280,7 +243,7 @@ static int scale_round_weights( } sum_wgt[j] += fwgts[i*dim+j]; if (fwgts[i*dim+j] > max_wgt[j]) - max_wgt[j] = fwgts[i*dim+j]; + max_wgt[j] = fwgts[i*dim+j]; } } @@ -288,7 +251,7 @@ static int scale_round_weights( for (j=0; j max_wgt_sum)){ if (sum_wgt[j] == 0){ ierr = ZOLTAN_WARN; diff --git a/packages/zoltan/src/phg/phg_partition_tree.c b/packages/zoltan/src/phg/phg_partition_tree.c index ba998a77c8..e9bd00068e 100644 --- a/packages/zoltan/src/phg/phg_partition_tree.c +++ b/packages/zoltan/src/phg/phg_partition_tree.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/phg/phg_patoh.c b/packages/zoltan/src/phg/phg_patoh.c index d9c887b8b2..d85c8cb82f 100644 --- a/packages/zoltan/src/phg/phg_patoh.c +++ b/packages/zoltan/src/phg/phg_patoh.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -97,7 +60,7 @@ char *yo = "Zoltan_HG_PaToH"; } if (hg->EdgeWeightDim) { - if (hg->EdgeWeightDim > 1) + if (hg->EdgeWeightDim > 1) ZOLTAN_PATOH_ERROR("PaToH supports Edge_Weight_Dim == 0 or 1 only.", ZOLTAN_FATAL); iewgts = (int *) ZOLTAN_MALLOC(hg->nEdge*hg->EdgeWeightDim*sizeof(int)); @@ -112,11 +75,11 @@ char *yo = "Zoltan_HG_PaToH"; /* set the same imbalanace ratio to the required one */ pargs.init_imbal = pargs.final_imbal = hgp->bal_tol-1.0; if (hgp->patoh_alloc_pool0>0) - pargs.MemMul_CellNet = hgp->patoh_alloc_pool0; + pargs.MemMul_CellNet = hgp->patoh_alloc_pool0; if (hgp->patoh_alloc_pool1>0) - pargs.MemMul_Pins = hgp->patoh_alloc_pool1; + pargs.MemMul_Pins = hgp->patoh_alloc_pool1; - PaToH_Alloc(&pargs, hg->nVtx, hg->nEdge, hg->VtxWeightDim, + PaToH_Alloc(&pargs, hg->nVtx, hg->nEdge, hg->VtxWeightDim, ivwgts, iewgts, hg->hindex, hg->hvertex); @@ -124,7 +87,7 @@ char *yo = "Zoltan_HG_PaToH"; pargs.seed = cnt; /* Differ each call to allow */ /* randomized testing. */ - partweight = (int *) ZOLTAN_MALLOC(nparts * MAX(1, hg->VtxWeightDim) + partweight = (int *) ZOLTAN_MALLOC(nparts * MAX(1, hg->VtxWeightDim) * sizeof(int)); if (!partweight) ZOLTAN_PATOH_ERROR("Memory error.", ZOLTAN_MEMERR); @@ -133,7 +96,7 @@ char *yo = "Zoltan_HG_PaToH"; if (hgp->UseFixedVtx){ /* Copy fixed vertices from hg->fixed_part */ memcpy(partvec, hg->fixed_part, hg->nVtx*sizeof(int) ); - PaToH_Partition_with_FixCells(&pargs, hg->nVtx, hg->nEdge, + PaToH_Partition_with_FixCells(&pargs, hg->nVtx, hg->nEdge, ivwgts, iewgts, hg->hindex, hg->hvertex, partvec, partweight, &cut); } @@ -141,11 +104,11 @@ char *yo = "Zoltan_HG_PaToH"; PaToH_Partition(&pargs, hg->nVtx, hg->nEdge, ivwgts, iewgts, hg->hindex, hg->hvertex, partvec, partweight, &cut); } - else + else PaToH_MultiConst_Partition(&pargs, hg->nVtx, hg->nEdge, hg->VtxWeightDim, ivwgts, hg->hindex, hg->hvertex, partvec, partweight, &cut); - + /* HERE: Check whether imbalance criteria were met. */ @@ -167,20 +130,20 @@ char *yo = "Zoltan_HG_PaToH"; #define INT_EPSILON (1e-5) static int scale_round_weights( - float *fwgts, - int *iwgts, - int n, + float *fwgts, + int *iwgts, + int n, int dim, int mode ) { /* Convert floating point weights to integer weights. * This routine is stolen from scale_round_weights in parmetis_jostle.c. - * Because it needs to run only serially, and because it uses only + * Because it needs to run only serially, and because it uses only * integers (not idxtype), it has been largely duplicated here. */ - int i, j, tmp, ierr; + int i, j, tmp, ierr; int max_wgt_sum = INT_MAX/8; int *nonint; float *scale, *sum_wgt, *max_wgt; @@ -219,7 +182,7 @@ static int scale_round_weights( /* Check if all weights are integers */ for (i=0; i INT_EPSILON){ @@ -228,7 +191,7 @@ static int scale_round_weights( } sum_wgt[j] += fwgts[i*dim+j]; if (fwgts[i*dim+j] > max_wgt[j]) - max_wgt[j] = fwgts[i*dim+j]; + max_wgt[j] = fwgts[i*dim+j]; } } @@ -236,7 +199,7 @@ static int scale_round_weights( for (j=0; j max_wgt_sum)){ if (sum_wgt[j] == 0){ ierr = ZOLTAN_WARN; diff --git a/packages/zoltan/src/phg/phg_plot.c b/packages/zoltan/src/phg/phg_plot.c index f65b4b88fd..4924b32e37 100644 --- a/packages/zoltan/src/phg/phg_plot.c +++ b/packages/zoltan/src/phg/phg_plot.c @@ -1,55 +1,18 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { #endif -#include "zz_sort.h" +#include "zz_sort.h" #include "phg.h" #include "zz_const.h" @@ -59,13 +22,13 @@ void Zoltan_PHG_Plot_2D_Distrib( HGraph *phg ) { -/* Routine that produces gnuplot output of 2D data distribution in form of +/* Routine that produces gnuplot output of 2D data distribution in form of * a matrix. * One column for each vertex. * One row for each hyperedge. * Separate files are produced for each processor. * Vertex and edge global node numbers are used for "coordinates" in plotting. - * No partitioning information is displayed; only the 2D data distribution + * No partitioning information is displayed; only the 2D data distribution * is shown. */ static int cnt = 0; @@ -105,7 +68,7 @@ ZOLTAN_GNO_TYPE egno, vgno; } /* Sanity check to ensure Mirror is working correctly */ - /* Don't need to generate both sets of files, but they should differ only + /* Don't need to generate both sets of files, but they should differ only * in the order of the points */ sprintf(filename, "phgmirror%02d.%02d", cnt, zz->Proc); fp = fopen(filename, "w"); diff --git a/packages/zoltan/src/phg/phg_rdivide.c b/packages/zoltan/src/phg/phg_rdivide.c index 056b58d753..d17b8cf1ef 100644 --- a/packages/zoltan/src/phg/phg_rdivide.c +++ b/packages/zoltan/src/phg/phg_rdivide.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -83,15 +46,15 @@ int Zoltan_PHG_rdivide( int hi, /* Highest partition number to be found */ Partition final, /* Input: initial partition assignments for vtxs; Output: computed partition assignments. */ - ZZ *zz, + ZZ *zz, HGraph *hg, - PHGPartParams *hgp, + PHGPartParams *hgp, int level, int father ) { char *yo = "Zoltan_PHG_rdivide"; - int i, j, mid, ierr=ZOLTAN_OK, leftend, rightstart; + int i, j, mid, ierr=ZOLTAN_OK, leftend, rightstart; int *pins[2] = {NULL,NULL}, *lpins[2] = {NULL,NULL}; Partition part=NULL; HGraph *left=NULL, *right=NULL; @@ -101,7 +64,7 @@ int Zoltan_PHG_rdivide( ZOLTAN_GNO_TYPE gnVtx = hg->dist_x[hgc->nProc_x]; double leftw=0.0, rightw=0.0; float bal_tol = hgp->bal_tol; - float *bisec_part_sizes=NULL; /* Target partition sizes; dimension is 2*hg->VtxWeightDim + float *bisec_part_sizes=NULL; /* Target partition sizes; dimension is 2*hg->VtxWeightDim because we are doing bisection */ int part_dim = hg->VtxWeightDim ? hg->VtxWeightDim : 1; struct phg_timer_indices *timer = Zoltan_PHG_LB_Data_timers(zz); @@ -118,29 +81,29 @@ int Zoltan_PHG_rdivide( return ierr; } - - if (do_timing) { - if (timer->rdrdivide < 0) + + if (do_timing) { + if (timer->rdrdivide < 0) timer->rdrdivide = Zoltan_Timer_Init(zz->ZTime, 1, "Rdivide"); ZOLTAN_TIMER_START(zz->ZTime, timer->rdrdivide, hgc->Communicator); } if (detail_timing) { - if (timer->rdbefore < 0) + if (timer->rdbefore < 0) timer->rdbefore = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_BefPart"); ZOLTAN_TIMER_START(zz->ZTime, timer->rdbefore, hgc->Communicator); - if (timer->rdafter < 0) + if (timer->rdafter < 0) timer->rdafter = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_AftPart"); - if (timer->rdsplit < 0) + if (timer->rdsplit < 0) timer->rdsplit = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_Split"); - if (timer->rdredist < 0) + if (timer->rdredist < 0) timer->rdredist = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_Redist"); - if (timer->rdsend < 0) + if (timer->rdsend < 0) timer->rdsend = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_Send"); - if (timer->rdwait < 0) + if (timer->rdwait < 0) timer->rdwait = Zoltan_Timer_Init(zz->ZTime, 0, "Rdivide_LoadBalWait"); } hg->redl = hgp->redl; - + /* only one part remaining, record results and exit */ if (lo == hi) { for (i = 0; i < hg->nVtx; ++i) @@ -171,14 +134,14 @@ int Zoltan_PHG_rdivide( /* uprintf(hgc, "RDIVIDE: [%d, %d] mid=%d target sizes: [%.3lf, %.3lf]\n", lo, hi, mid, bisec_part_sizes[0], bisec_part_sizes[1]); */ - + if (hgp->bal_tol_adjustment>1.0) { float q = (float) ceil(log((double)1+hi-lo) / log(2.0)); /* uprintf(hgc, "for k=%d q=%.1f\n", 1+hi-lo, q);*/ hgp->bal_tol = MIN(bal_tol, 1.0 + hgp->bal_tol_adjustment*(bal_tol-1.0)/q); - } else - hgp->bal_tol = (hi==lo+1) ? bal_tol + } else + hgp->bal_tol = (hi==lo+1) ? bal_tol : 1.0 + hgp->bal_tol_adjustment*(bal_tol-1.0); if (do_timing) /* Don't include partitioning time in rdivide */ @@ -202,9 +165,9 @@ int Zoltan_PHG_rdivide( goto End; if (hgp->output_level) - uprintf(hgc, "Rdivide(%d, %d): %.1lf\n", lo, hi, + uprintf(hgc, "Rdivide(%d, %d): %.1lf\n", lo, hi, Zoltan_PHG_Compute_ConCut(hgc, hg, part, 2, &ierr)); - + /* if only two parts total, record results and exit */ if (lo + 1 == hi) { if (hgp->keep_tree) { @@ -214,7 +177,7 @@ int Zoltan_PHG_rdivide( for (i = 0; i < hg->nVtx; ++i) final[hg->vmap[i]] = ((part[i] == 0) ? lo : hi); ZOLTAN_FREE (&part); - if (detail_timing) + if (detail_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdafter, hgc->Communicator); goto End; } @@ -226,36 +189,36 @@ int Zoltan_PHG_rdivide( pins[1] = &( pins[0][hg->nEdge]); lpins[1] = &(lpins[0][hg->nEdge]); } - + /* Initial calculation of the local pin distribution (sigma in UVC's papers)*/ for (i = 0; i < hg->nEdge; ++i) for (j = hg->hindex[i]; j < hg->hindex[i+1]; ++j) ++(lpins[part[hg->hvertex[j]]][i]); - + /* now compute global pin distribution */ if (hg->nEdge) - MPI_Allreduce(lpins[0], pins[0], 2*hg->nEdge, MPI_INT, MPI_SUM, + MPI_Allreduce(lpins[0], pins[0], 2*hg->nEdge, MPI_INT, MPI_SUM, hgc->row_comm); ZOLTAN_FREE (&lpins[0]); /* we don't need lpins anymore */ - + if (detail_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdafter, hgc->Communicator); ZOLTAN_TIMER_START(zz->ZTime, timer->rdsplit, hgc->Communicator); } - + /* recursively divide in two parts and repartition hypergraph */ if (mid>lo) { /* only split if we really need it */ if (!(left = (HGraph*) ZOLTAN_MALLOC (sizeof (HGraph)))) MEMORY_ERROR; - - ierr = split_hypergraph (pins, hg, left, hgp, part, 0, zz, + + ierr = split_hypergraph (pins, hg, left, hgp, part, 0, zz, &leftw, &rightw, hgp->connectivity_cut); - if (ierr != ZOLTAN_OK) + if (ierr != ZOLTAN_OK) goto End; if (!left->dist_x[hgc->nProc_x]) { /* left is empty */ Zoltan_HG_HGraph_Free (left); ZOLTAN_FREE(&left); - } + } } else { for (i = 0; i < hg->nVtx; ++i) if (part[i]==0) @@ -267,9 +230,9 @@ int Zoltan_PHG_rdivide( if (hi>mid+1) { /* only split if we need it */ if (!(right = (HGraph*) ZOLTAN_MALLOC (sizeof (HGraph)))) MEMORY_ERROR; - ierr = split_hypergraph (pins, hg, right, hgp, part, 1, zz, + ierr = split_hypergraph (pins, hg, right, hgp, part, 1, zz, &rightw, &leftw, hgp->connectivity_cut); - + if (ierr != ZOLTAN_OK) goto End; if (!right->dist_x[hgc->nProc_x]) { /* right is empty */ @@ -284,7 +247,7 @@ int Zoltan_PHG_rdivide( if (hgp->keep_tree) Zoltan_PHG_Tree_Set(zz, 2*father+1, hi, hi); } - + #ifdef _DEBUG1 for (i=0; inVtx; ++i) if (part[i]<0 || part[i]>1) @@ -295,7 +258,7 @@ int Zoltan_PHG_rdivide( ltotw += hg->vwgt[i*hg->VtxWeightDim]; MPI_Allreduce(<otw, &totw, 1, MPI_DOUBLE, MPI_SUM, hgc->row_comm); targetw0=totw*bisec_part_sizes[0]; - imbal = (targetw0==0.0) ? 0.0 : fabs(leftw-targetw0)/targetw0; + imbal = (targetw0==0.0) ? 0.0 : fabs(leftw-targetw0)/targetw0; uprintf(hgc, "Total Vertex Weight=%.2lf LeftW=%.2lf RightW=%.2lf tps=(%.2lf, %.2lf) ib=%.2lf\n", totw, leftw, rightw, bisec_part_sizes[0], bisec_part_sizes[1], imbal); if ((totw - (leftw+rightw)) > 0.000001) errexit("During recursive bisection for [%d, %d] totw (%.2lf) != Left(%.2lf) + Right(%.2lf)\n", lo, hi, totw, leftw, rightw); @@ -304,26 +267,26 @@ int Zoltan_PHG_rdivide( if (level>0) { /* some output functions in phg depends on hg being exist for top level hypergraph hence we only free the rest after we split - because in theory we shouldn't need them */ + because in theory we shouldn't need them */ Zoltan_HG_HGraph_Free(hg); hg = NULL; - } + } Zoltan_Multifree (__FILE__, __LINE__, 2, &pins[0], &part); - - if (detail_timing) + + if (detail_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdsplit, hgc->Communicator); -#if PHG_PROC_SPLIT +#if PHG_PROC_SPLIT if ((hgc->nProc>1) && left && right) { /* redistribute left and right parts */ - leftend = (int)((float) (hgc->nProc-1) - * (float) left->dist_x[hgc->nProc_x] + leftend = (int)((float) (hgc->nProc-1) + * (float) left->dist_x[hgc->nProc_x] / (float) gnVtx); if ((leftend+1)>=hgc->nProc) /* just to be sure :) */ - leftend = hgc->nProc-1; - + leftend = hgc->nProc-1; + if (hgp->nProc_x_req != 1 && hgp->nProc_y_req != 1) { /* Want 2D decomp */ if ((leftend+1) > SMALL_PRIME && Zoltan_PHG_isPrime(leftend+1)) --leftend; /* if it was prime just use one less #procs @@ -334,7 +297,7 @@ int Zoltan_PHG_rdivide( by increasing offset by one */ } else rightstart = leftend + 1; - + #ifdef _DEBUG1 if (leftend<0 || (leftend+1)>=hgc->nProc || rightstart<0 || rightstart>=hgc->nProc) @@ -348,49 +311,49 @@ int Zoltan_PHG_rdivide( rightstart = leftend = -1; } #else - rightstart = leftend = -1; + rightstart = leftend = -1; #endif /* if we want proc_split and there are more than one procs avail, and the left and right exist and they have enough vertex to distribute */ - if (rightstart != -1 && + if (rightstart != -1 && (left->dist_x[hgc->nProc_x]>2*(leftend+1)) && (right->dist_x[hgc->nProc_x]>2*(hgc->nProc-rightstart))) { PHGComm leftcomm, rightcomm; HGraph newleft, newright; - int *leftvmap=NULL, *rightvmap=NULL, + int *leftvmap=NULL, *rightvmap=NULL, *leftdest=NULL, *rightdest=NULL; - ZOLTAN_COMM_OBJ *plan=NULL; + ZOLTAN_COMM_OBJ *plan=NULL; - if (detail_timing) + if (detail_timing) ZOLTAN_TIMER_START(zz->ZTime, timer->rdredist, hgc->Communicator); - + #ifdef _DEBUG1 uprintf(hgc, "before redistribute for left leftend=%d ---------------\n", leftend); #endif - Zoltan_PHG_Redistribute(zz, hgp, left, 0, leftend, &leftcomm, + Zoltan_PHG_Redistribute(zz, hgp, left, 0, leftend, &leftcomm, &newleft, &leftvmap, &leftdest); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Left: H(%d, %d, %d) ----> H(%d, %d, %d) Weights=(%.2lf, %.2lf)\n", left->nVtx, left->nEdge, left->nPins, newleft.nVtx, newleft.nEdge, newleft.nPins, leftw, rightw); Zoltan_HG_HGraph_Free (left); - + #ifdef _DEBUG1 uprintf(hgc, "before redistribute for right ++++++++++++++++++++++\n"); #endif Zoltan_PHG_Redistribute(zz, hgp, right, rightstart, hgc->nProc-1, &rightcomm, &newright, &rightvmap, &rightdest); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Right: H(%d, %d, %d) ----> H(%d, %d, %d) Weights=(%.2lf, %.2lf)\n", - right->nVtx, right->nEdge, right->nPins, newright.nVtx, + right->nVtx, right->nEdge, right->nPins, newright.nVtx, newright.nEdge, newright.nPins, leftw, rightw); Zoltan_HG_HGraph_Free (right); - - if (detail_timing) + + if (detail_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdredist, hgc->Communicator); - + nsend = MAX(newleft.nVtx, newright.nVtx); part = (Partition) ZOLTAN_MALLOC (nsend * sizeof (int)); proclist = (int *) ZOLTAN_MALLOC (nsend * sizeof (int)); @@ -405,13 +368,13 @@ int Zoltan_PHG_rdivide( /* I'm on the left part so I should partition newleft */ hgp->bal_tol = balanceTol(hgp, part_dim, 0, bisec_part_sizes, leftw+rightw, leftw); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Left: H(%d, %d, %d) OldI: %.2lf NewI: %.2lf\n", newleft.nVtx, newleft.nEdge, newleft.nPins, - save_bal_tol, hgp->bal_tol); - - ierr = rdivide_and_prepsend (lo, mid, part, zz, &newleft, hgp, - level+1, proclist, sendbuf, + save_bal_tol, hgp->bal_tol); + + ierr = rdivide_and_prepsend (lo, mid, part, zz, &newleft, hgp, + level+1, proclist, sendbuf, leftdest, leftvmap, &nsend, (timer ? timer->rdrdivide : -1), 2*father); @@ -421,32 +384,32 @@ int Zoltan_PHG_rdivide( allocated in Redistribute*/ if (detail_timing) { ZOLTAN_TIMER_START(zz->ZTime, timer->rdwait, hgc->Communicator); - } + } } else if (hgc->myProc>=rightstart) { float save_bal_tol=hgp->bal_tol; /* I'm on the right part so I should partition newright */ hgp->bal_tol = balanceTol(hgp, part_dim, 1, bisec_part_sizes, leftw+rightw, rightw); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Right: H(%d, %d, %d) OldI: %.2lf NewI: %.2lf\n", newright.nVtx, newright.nEdge, newright.nPins, save_bal_tol, hgp->bal_tol); - ierr |= rdivide_and_prepsend (mid+1, hi, part, zz, &newright, hgp, - level+1, proclist, sendbuf, + ierr |= rdivide_and_prepsend (mid+1, hi, part, zz, &newright, hgp, + level+1, proclist, sendbuf, rightdest, rightvmap, &nsend, (timer ? timer->rdrdivide : -1), 2*father+1); - hgp->bal_tol = save_bal_tol; + hgp->bal_tol = save_bal_tol; Zoltan_HG_HGraph_Free (&newleft); /* free dist_x and dist_y allocated in Redistribute*/ if (detail_timing) { ZOLTAN_TIMER_START(zz->ZTime, timer->rdwait, hgc->Communicator); - } + } } else { - nsend = 0; + nsend = 0; Zoltan_HG_HGraph_Free (&newleft); /* free dist_x and dist_y */ Zoltan_HG_HGraph_Free (&newright); /* allocated in Redistribute*/ } @@ -464,14 +427,14 @@ int Zoltan_PHG_rdivide( #ifdef _DEBUG1 if (!hgc->myProc_y) { - if (i!=nVtx) + if (i!=nVtx) errexit("(%d,%d) I should be receiving nVtx(%d) part info but received %d", hgc->myProc_x, hgc->myProc_y, nVtx, i); } else { if (i) - errexit("I'm not in the first row; why I'm receiving %d vertices?", i); + errexit("I'm not in the first row; why I'm receiving %d vertices?", i); } #endif - + --msg_tag; Zoltan_Comm_Do(plan, msg_tag, (char *) sendbuf, 2*sizeof(int), (char *) recvbuf); @@ -489,7 +452,7 @@ int Zoltan_PHG_rdivide( #endif final[recvbuf[i*2]] = recvbuf[i*2+1]; } - + Zoltan_Comm_Destroy(&plan); if (detail_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdsend, hgc->Communicator); @@ -497,14 +460,14 @@ int Zoltan_PHG_rdivide( } else { if (left) { float save_bal_tol=hgp->bal_tol; - + hgp->bal_tol = balanceTol(hgp, part_dim, 0, bisec_part_sizes, leftw+rightw, leftw); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Left: H(%d, %d, %d) OldI: %.2lf NewI: %.2lf\n", left->nVtx, left->nEdge, left->nPins, - save_bal_tol, hgp->bal_tol); - + save_bal_tol, hgp->bal_tol); + if (do_timing) /* Stop timer before recursion */ ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdrdivide, hgc->Communicator); @@ -513,47 +476,47 @@ int Zoltan_PHG_rdivide( /* rdivide call will free "left" */ if (do_timing) /* Restart timer after recursion */ - ZOLTAN_TIMER_START(zz->ZTime, timer->rdrdivide, + ZOLTAN_TIMER_START(zz->ZTime, timer->rdrdivide, hgc->Communicator); - hgp->bal_tol = save_bal_tol; + hgp->bal_tol = save_bal_tol; } if (right) { float save_bal_tol=hgp->bal_tol; - + hgp->bal_tol = balanceTol(hgp, part_dim, 1, bisec_part_sizes, leftw+rightw, rightw); - if (hgp->output_level >= PHG_DEBUG_LIST) + if (hgp->output_level >= PHG_DEBUG_LIST) uprintf(hgc, "Right: H(%d, %d, %d) OldI: %.2lf NewI: %.2lf\n", right->nVtx, right->nEdge, right->nPins, save_bal_tol, hgp->bal_tol); - + if (do_timing) /* Stop timer before recursion */ ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdrdivide, hgc->Communicator); - + ierr |= Zoltan_PHG_rdivide(mid+1, hi, final, zz, right, hgp, level+1, 2*father+1); /* rdivide call will free "right" */ - + if (do_timing) /* Restart timer after recursion */ - ZOLTAN_TIMER_START(zz->ZTime, timer->rdrdivide, + ZOLTAN_TIMER_START(zz->ZTime, timer->rdrdivide, hgc->Communicator); - hgp->bal_tol = save_bal_tol; + hgp->bal_tol = save_bal_tol; } } - + End: if (level>0) Zoltan_HG_HGraph_Free(hg); - - Zoltan_Multifree (__FILE__, __LINE__, 9, &pins[0], &lpins[0], &part, - &left, &right, &proclist, &sendbuf, &recvbuf, + + Zoltan_Multifree (__FILE__, __LINE__, 9, &pins[0], &lpins[0], &part, + &left, &right, &proclist, &sendbuf, &recvbuf, &bisec_part_sizes); - if (do_timing) + if (do_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->rdrdivide, hgc->Communicator); ZOLTAN_TRACE_EXIT(zz, yo); @@ -566,7 +529,7 @@ static int rdivide_and_prepsend(int lo, int hi, Partition final, ZZ *zz, HGraph *hg, PHGPartParams *hgp, int level, int *proclist, int *sendbuf, int *dest, - int *vmap, int *nsend, int timer_rdivide, + int *vmap, int *nsend, int timer_rdivide, int father) { int ierr=ZOLTAN_OK, i, nVtx=hg->nVtx; @@ -581,7 +544,7 @@ static int rdivide_and_prepsend(int lo, int hi, Partition final, ZZ *zz, ierr = Zoltan_PHG_rdivide (lo, hi, final, zz, hg, hgp, level, father); /* rdivide will free the content of "hg" */ - + if (do_timing) /* Restart rdivide timer */ ZOLTAN_TIMER_START(zz->ZTime, timer_rdivide, hgc->Communicator); @@ -594,7 +557,7 @@ static int rdivide_and_prepsend(int lo, int hi, Partition final, ZZ *zz, ++(*nsend); } } - + ZOLTAN_FREE(&vmap); ZOLTAN_FREE(&dest); #ifdef _DEBUG1 @@ -610,13 +573,13 @@ static int rdivide_and_prepsend(int lo, int hi, Partition final, ZZ *zz, -static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, - PHGPartParams *hgp, Partition part, int partid, - ZZ *zz, double *splitpw, double *otherpw, +static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, + PHGPartParams *hgp, Partition part, int partid, + ZZ *zz, double *splitpw, double *otherpw, int connectivitycut) { int *tmap = NULL; /* temporary array mapping from old HGraph info to new */ - int edge, i, j, ierr=ZOLTAN_OK; + int edge, i, j, ierr=ZOLTAN_OK; PHGComm *hgc = ohg->comm; char *yo = "split_hypergraph"; double pw[2], tpw[2]; @@ -632,15 +595,15 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, nhg->nDim = ohg->nDim; nhg->VtxWeightDim = ohg->VtxWeightDim; nhg->EdgeWeightDim = ohg->EdgeWeightDim; - + /* allocate memory for dynamic arrays in new HGraph and for tmap array */ if (ohg->nVtx && (tmap = (int*) ZOLTAN_MALLOC (ohg->nVtx * sizeof (int)))==NULL) MEMORY_ERROR; - + /* fill in tmap array, -1 for ignored vertices, otherwise nonnegative int */ nhg->nVtx = 0; for (i = 0; i < ohg->nVtx; i++) - tmap[i] = (part[i] == partid) ? nhg->nVtx++ : -1; + tmap[i] = (part[i] == partid) ? nhg->nVtx++ : -1; /* save vertex weights, edge weights, and coordinates if they exist */ if (nhg->nVtx && ohg->vwgt && nhg->VtxWeightDim && /* KDDKDD DO WE NEED CHECK OF ohg->vwgt HERE? */ @@ -654,10 +617,10 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, MEMORY_ERROR; if (nhg->nVtx && hgp->UsePrefPart && !(nhg->pref_part = (int*)ZOLTAN_MALLOC(nhg->nVtx*sizeof(int)))) - MEMORY_ERROR; + MEMORY_ERROR; if (nhg->nVtx && (nhg->vmap = (int*) ZOLTAN_MALLOC (nhg->nVtx * sizeof (int)))==NULL) MEMORY_ERROR; - + for (i = 0; i < ohg->nVtx; i++) { int v=tmap[i]; if (v!=-1) { @@ -672,28 +635,28 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, otherwise keep the preferred part */ nhg->pref_part[v] = (partid!=((ohg->pref_part[i] < ohg->bisec_split) ? 0 : 1) ) ? -1 : ohg->pref_part[i]; - } + } } if (nhg->VtxWeightDim) { /* UVC: TODO CHECK we're only using 1st weight! Right now this will be used to compute balance ratio! Check this code when multiconstraint is added! - */ + */ pw[0] += ohg->vwgt[i*nhg->VtxWeightDim]; - memcpy(&nhg->vwgt[v*nhg->VtxWeightDim], &ohg->vwgt[i*nhg->VtxWeightDim], - nhg->VtxWeightDim * sizeof(float)); + memcpy(&nhg->vwgt[v*nhg->VtxWeightDim], &ohg->vwgt[i*nhg->VtxWeightDim], + nhg->VtxWeightDim * sizeof(float)); } else pw[0] += 1.0; - if (nhg->nDim) + if (nhg->nDim) for (j = 0; j < nhg->nDim; j++) nhg->coor[v*nhg->nDim + j] = ohg->coor[i*nhg->nDim + j]; } else { pw[1] += (nhg->VtxWeightDim) ? ohg->vwgt[i*nhg->VtxWeightDim] : 1.0; } - + } MPI_Allreduce(pw, tpw, 2, MPI_DOUBLE, MPI_SUM, hgc->row_comm); *splitpw = tpw[0]; *otherpw = tpw[1]; - + /* fill in hindex and hvertex arrays in new HGraph */ nhg->nEdge = 0; nhg->nPins = 0; @@ -711,7 +674,7 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, if (ohg->ewgt && nhg->EdgeWeightDim && nhg->nEdge && !(nhg->ewgt=(float*)ZOLTAN_MALLOC(nhg->nEdge*sizeof(float)*nhg->EdgeWeightDim))) MEMORY_ERROR; - + nhg->nEdge = 0; nhg->nPins = 0; for (edge = 0; edge < ohg->nEdge; ++edge) @@ -724,7 +687,7 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, for (i = ohg->hindex[edge]; i < ohg->hindex[edge+1]; ++i) if (tmap [ohg->hvertex[i]] >= 0) { nhg->hvertex[nhg->nPins] = tmap[ohg->hvertex[i]]; - nhg->nPins++; + nhg->nPins++; } if (nhg->ewgt) memcpy(&nhg->ewgt[nhg->nEdge*nhg->EdgeWeightDim], &ohg->ewgt[edge*nhg->EdgeWeightDim], @@ -744,13 +707,13 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, MPI_Scan(&tmp_gno, nhg->dist_x, 1, zoltan_gno_mpi_type, MPI_SUM, hgc->row_comm); MPI_Allgather(nhg->dist_x, 1, zoltan_gno_mpi_type, &(nhg->dist_x[1]), 1, zoltan_gno_mpi_type, hgc->row_comm); nhg->dist_x[0] = 0; - + tmp_gno = (ZOLTAN_GNO_TYPE)nhg->nEdge; MPI_Scan(&tmp_gno, nhg->dist_y, 1, zoltan_gno_mpi_type, MPI_SUM, hgc->col_comm); MPI_Allgather(nhg->dist_y, 1, zoltan_gno_mpi_type, &(nhg->dist_y[1]), 1, zoltan_gno_mpi_type, hgc->col_comm); nhg->dist_y[0] = 0; - + ierr = Zoltan_HG_Create_Mirror (zz, nhg); End: ZOLTAN_FREE (&tmap); @@ -766,7 +729,7 @@ static int split_hypergraph (int *pins[2], HGraph *ohg, HGraph *nhg, * optimization of this function. All the input arguments were identical, yet the function * returned different values for release builds than for debug builds. The debug builds' * results matched the results we get with every other compiler (release or debug), so I am - * disabling optimization of this function only to restore passing tests with this compiler. + * disabling optimization of this function only to restore passing tests with this compiler. */ /* UVCUVC: CHECK currently only uses 1st weight */ static float balanceTol(PHGPartParams *hgp, int part_dim, int pno, float *ratios, diff --git a/packages/zoltan/src/phg/phg_refinement.c b/packages/zoltan/src/phg/phg_refinement.c index f153b0094c..5c54656fe8 100644 --- a/packages/zoltan/src/phg/phg_refinement.c +++ b/packages/zoltan/src/phg/phg_refinement.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -56,19 +19,19 @@ extern "C" { #include "zz_const.h" #define BADBALANCE 2.0 -#define HANDLE_ISOLATED_VERTICES +#define HANDLE_ISOLATED_VERTICES #define USE_SERIAL_REFINEMENT_ON_ONE_PROC - + /* -#define _DEBUG -#define _DEBUG2 +#define _DEBUG +#define _DEBUG2 #define _DEBUG3 */ - + static ZOLTAN_PHG_REFINEMENT_FN refine_no; static ZOLTAN_PHG_REFINEMENT_FN refine_fm2; @@ -76,9 +39,9 @@ static ZOLTAN_PHG_REFINEMENT_FN refine_fm2; ZOLTAN_PHG_REFINEMENT_FN *Zoltan_PHG_Set_Refinement_Fn(char *str) { - - if (!strcasecmp(str, "fm")) return refine_fm2; - else if (!strcasecmp(str, "fm2")) return refine_fm2; + + if (!strcasecmp(str, "fm")) return refine_fm2; + else if (!strcasecmp(str, "fm2")) return refine_fm2; else if (!strcasecmp(str, "no")) return refine_no; else if (!strcasecmp(str, "none")) return refine_no; else return NULL; @@ -192,7 +155,7 @@ HEAP heap[2]; int steplimit; char *yo="serial_fm2"; int part_dim = (hg->VtxWeightDim ? hg->VtxWeightDim : 1); -#ifdef HANDLE_ISOLATED_VERTICES +#ifdef HANDLE_ISOLATED_VERTICES int isocnt=0; #endif #ifdef _DEBUG @@ -229,7 +192,7 @@ int best_imbalance, imbalance; #ifdef _DEBUG tw0 = total_weight * part_sizes[0]; #endif - + if (!(pins[0] = (int*) ZOLTAN_CALLOC(2*hg->nEdge, sizeof(int))) || !(locked = (int*) ZOLTAN_CALLOC(hg->nVtx, sizeof(int))) || !(locked_list = (int*) ZOLTAN_CALLOC(hg->nVtx, sizeof(int))) @@ -256,12 +219,12 @@ int best_imbalance, imbalance; /* Initialize the heaps and fill them with the gain values */ Zoltan_Heap_Init(zz, &heap[0], hg->nVtx); - Zoltan_Heap_Init(zz, &heap[1], hg->nVtx); + Zoltan_Heap_Init(zz, &heap[1], hg->nVtx); for (i = 0; i < hg->nVtx; i++) if (!hgp->UseFixedVtx || hg->fixed_part[i]<0) { -#ifdef HANDLE_ISOLATED_VERTICES +#ifdef HANDLE_ISOLATED_VERTICES if (hg->vindex[i+1]==hg->vindex[i]) { /* isolated vertex */ - part_weight[part[i]] -= (hg->vwgt ? hg->vwgt[i*hg->VtxWeightDim] + part_weight[part[i]] -= (hg->vwgt ? hg->vwgt[i*hg->VtxWeightDim] : 1.0); part[i] = -(part[i]+1); /* remove those vertices from that part*/ ++isocnt; @@ -272,10 +235,10 @@ int best_imbalance, imbalance; #ifdef _DEBUG else { int pp = (hg->fixed_part[i] < hg->bisec_split) ? 0 : 1; - if (part[i]!=pp) + if (part[i]!=pp) errexit("%s: beginning of pass for hg->info=%d vertex %d is fixed at %d bisec_split is %d but its part is %d\n", uMe(hg->comm), hg->info, i, hg->fixed_part[i], hg->bisec_split, part[i]); - - + + } #endif Zoltan_Heap_Make(&heap[0]); @@ -322,8 +285,8 @@ int best_imbalance, imbalance; locked[vertex] = part[vertex] + 1; locked_list[number_locked++] = vertex; - cur_cutsize -= gain[vertex]; - + cur_cutsize -= gain[vertex]; + Zoltan_HG_move_vertex (hg, vertex, sour, dest, part, pins, gain, heap); #ifdef _DEBUG @@ -336,10 +299,10 @@ int best_imbalance, imbalance; cutsize); } #endif - - part_weight[sour] -= (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] + + part_weight[sour] -= (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] : 1.0); - part_weight[dest] += (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] + part_weight[dest] += (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] : 1.0); error = MAX (part_weight[0]-max_weight[0],part_weight[1]-max_weight[1]); @@ -361,7 +324,7 @@ int best_imbalance, imbalance; #ifdef _DEBUG uprintf(hg->comm, "SEQ Best CUT=%6.0lf at move %d\n", best_cutsize, best_locked); #endif - + /* rollback */ while (number_locked != best_locked) { vertex = locked_list[--number_locked]; @@ -370,22 +333,22 @@ int best_imbalance, imbalance; Zoltan_HG_move_vertex (hg, vertex, sour, dest, part, pins, gain, heap); - part_weight[sour] -= (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] + part_weight[sour] -= (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] : 1.0); - part_weight[dest] += (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] + part_weight[dest] += (hg->vwgt ? hg->vwgt[vertex*hg->VtxWeightDim] : 1.0); Zoltan_Heap_Input(&heap[dest], vertex, gain[vertex]); locked[vertex] = 0; } /* only update data structures if we're going to do another pass */ - if ((best_cutsize < cutsize_beforepass) && (round < hgp->fm_loop_limit)) { + if ((best_cutsize < cutsize_beforepass) && (round < hgp->fm_loop_limit)) { while (number_locked) { vertex = locked_list[--number_locked]; locked[vertex] = 0; Zoltan_Heap_Input(&heap[part[vertex]], vertex, gain[vertex]); } - + Zoltan_Heap_Make(&(heap[0])); Zoltan_Heap_Make(&(heap[1])); } @@ -393,31 +356,31 @@ int best_imbalance, imbalance; #ifdef HANDLE_ISOLATED_VERTICES if (isocnt) { -#ifdef _DEBUG +#ifdef _DEBUG double isoimbalbefore, isoimbal; #endif double targetw0; - + targetw0 = total_weight * part_sizes[0]; -#ifdef _DEBUG +#ifdef _DEBUG isoimbalbefore = (targetw0==0) ? 0.0 : (part_weight[0] - targetw0)/ targetw0; #endif for (i=0; i < hg->nVtx; ++i) if (!hgp->UseFixedVtx || hg->fixed_part[i]<0) { if (hg->vindex[i+1]==hg->vindex[i]) { /* go over isolated vertices */ int npno = (part_weight[0] < targetw0) ? 0 : 1; - part_weight[npno] += (hg->vwgt ? hg->vwgt[i*hg->VtxWeightDim] - : 1.0); + part_weight[npno] += (hg->vwgt ? hg->vwgt[i*hg->VtxWeightDim] + : 1.0); part[i] = npno; } } -#ifdef _DEBUG +#ifdef _DEBUG isoimbal = (targetw0==0) ? 0.0 : (part_weight[0] - targetw0)/ targetw0; uprintf(hg->comm, "SEQ %d isolated vertices, balance before: %.3lf after: %.3lf\n", isocnt, isoimbalbefore, isoimbal); #endif } -#endif - +#endif + /* gain_check (hg, gain, part, pins); */ Zoltan_Multifree(__FILE__,__LINE__, 4, &pins[0], &locked, &locked_list, &gain); Zoltan_Heap_Free(&heap[0]); @@ -434,14 +397,14 @@ int best_imbalance, imbalance; * direction, from the heavier partition to the lighter one. */ /*****************************************************************************/ -static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, +static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, float *gain, HEAP *heap, - int *pins[2], int *lpins[2], + int *pins[2], int *lpins[2], double *weights, double *lweights, int *mark, int *adj) { int pno=part[v], vto=1-pno, adjsz=0, j, i; - + mark[v] = 1; /* mark as moved */ part[v] = vto; weights[pno] -= (hg->vwgt ? hg->vwgt[v*hg->VtxWeightDim] : 1.0); @@ -452,7 +415,7 @@ static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, for (j = hg->vindex[v]; j < hg->vindex[v+1]; j++) { int n = hg->vedge[j]; float w = hg->ewgt ? hg->ewgt[n] : 1.0; - + --pins[pno][n]; --lpins[pno][n]; ++pins[vto][n]; @@ -468,7 +431,7 @@ static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, if (pins[pno][n]==1) { for (i = hg->hindex[n]; i < hg->hindex[n+1]; ++i) { - int u = hg->hvertex[i]; + int u = hg->hvertex[i]; if (part[u]==pno) { gain[u] += w; if (!mark[u]) { @@ -482,7 +445,7 @@ static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, if (pins[vto][n]==1) { /* now there is at least one pin here */ for (i = hg->hindex[n]; i < hg->hindex[n+1]; ++i) { int u = hg->hvertex[i]; - if (part[u]==pno) { + if (part[u]==pno) { gain[u] += w; if (!mark[u]) { adj[adjsz++] = u; @@ -490,12 +453,12 @@ static void fm2_move_vertex_oneway(int v, HGraph *hg, Partition part, } } } - } + } } - + for (i=0; ivwgt ? hg->vwgt[v*hg->VtxWeightDim] : 1.0); lweights[vto] += (hg->vwgt ? hg->vwgt[v*hg->VtxWeightDim] : 1.0); for (j = hg->vindex[v]; j < hg->vindex[v+1]; j++) { int n = hg->vedge[j]; - + --lpins[pno][n]; ++lpins[vto][n]; } @@ -548,12 +511,12 @@ static int refine_fm2 (ZZ *zz, max_weight[2], lmax_weight[2], avail[2], gavail[2]; int availcnt[2], gavailcnt[2]; double targetw0, ltargetw0, minvw=DBL_MAX; - double cutsize, best_cutsize, + double cutsize, best_cutsize, best_limbal, imbal, limbal; HEAP heap[2]; char *yo="refine_fm2"; int part_dim = (hg->VtxWeightDim ? hg->VtxWeightDim : 1); -#ifdef HANDLE_ISOLATED_VERTICES +#ifdef HANDLE_ISOLATED_VERTICES int isocnt=hg->nVtx; /* only root uses isocnt, isolated vertices are kept at the end of moves array */ int *deg=NULL, *ldeg=NULL; @@ -563,7 +526,7 @@ static int refine_fm2 (ZZ *zz, #endif PHGComm *hgc=hg->comm; int rootRank; - + struct phg_timer_indices *timer = Zoltan_PHG_LB_Data_timers(zz); int do_timing = (hgp->use_timers > 2); int detail_timing = (hgp->use_timers > 3); @@ -590,45 +553,45 @@ static int refine_fm2 (ZZ *zz, } #endif - if (do_timing) { - if (timer->rfrefine < 0) + if (do_timing) { + if (timer->rfrefine < 0) timer->rfrefine = Zoltan_Timer_Init(zz->ZTime, 1, "Ref_P_Total"); ZOLTAN_TIMER_START(zz->ZTime, timer->rfrefine, hgc->Communicator); } if (detail_timing) { - if (timer->rfpins < 0) + if (timer->rfpins < 0) timer->rfpins = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_Pins"); - if (timer->rfiso < 0) + if (timer->rfiso < 0) timer->rfiso = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_IsolatedVert"); - if (timer->rfgain < 0) + if (timer->rfgain < 0) timer->rfgain = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_Gain"); - if (timer->rfheap < 0) + if (timer->rfheap < 0) timer->rfheap = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_Heap"); - if (timer->rfpass < 0) + if (timer->rfpass < 0) timer->rfpass = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_Pass"); - if (timer->rfroll < 0) + if (timer->rfroll < 0) timer->rfroll = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_Roll"); - if (timer->rfnonroot < 0) + if (timer->rfnonroot < 0) timer->rfnonroot = Zoltan_Timer_Init(zz->ZTime, 0, "Ref_P_NonRoot"); } - - - /* find the index of the proc in column group with + + + /* find the index of the proc in column group with the most #nonzeros; it will be our root - proc for computing moves since it has better + proc for computing moves since it has better knowedge about global hypergraph. We ignore returned #pins (i) in root */ - Zoltan_PHG_Find_Root(hg->nPins, hgc->myProc_y, hgc->col_comm, + Zoltan_PHG_Find_Root(hg->nPins, hgc->myProc_y, hgc->col_comm, &i, &rootRank); - + /* Calculate the weights in each partition and total, then maxima */ weights[0] = weights[1] = 0.0; lweights[0] = lweights[1] = 0.0; - if (hg->vwgt) + if (hg->vwgt) for (i = 0; i < hg->nVtx; i++) { lweights[part[i]] += hg->vwgt[i*hg->VtxWeightDim]; - minvw = (minvw > hg->vwgt[i*hg->VtxWeightDim]) - ? hg->vwgt[i*hg->VtxWeightDim] + minvw = (minvw > hg->vwgt[i*hg->VtxWeightDim]) + ? hg->vwgt[i*hg->VtxWeightDim] : minvw; } else { @@ -660,11 +623,11 @@ static int refine_fm2 (ZZ *zz, (max_weight[1] - weights[1]) * ( lweights[1] / weights[1] ); total_lweight = lweights[0]+lweights[1]; - + avail[0] = MAX(0.0, lmax_weight[0]-total_lweight); avail[1] = MAX(0.0, lmax_weight[1]-total_lweight); availcnt[0] = (avail[0] == 0) ? 1 : 0; - availcnt[1] = (avail[1] == 0) ? 1 : 0; + availcnt[1] = (avail[1] == 0) ? 1 : 0; MPI_Allreduce(avail, gavail, 2, MPI_DOUBLE, MPI_SUM, hgc->row_comm); MPI_Allreduce(availcnt, gavailcnt, 2, MPI_INT, MPI_SUM, hgc->row_comm); @@ -673,12 +636,12 @@ static int refine_fm2 (ZZ *zz, uprintf(hgc, "before adjustment, LMW[%.1lf, %.1lf]\n", lmax_weight[0], lmax_weight[1]); #endif - if (gavailcnt[0]) + if (gavailcnt[0]) lmax_weight[0] += gavail[0] / (double) gavailcnt[0]; - - if (gavailcnt[1]) + + if (gavailcnt[1]) lmax_weight[1] += gavail[1] / (double) gavailcnt[1]; - + /* Our strategy is to stay close to the current local weight balance. We do not need the same local balance on each proc, as long as we achieve approximate global balance. */ @@ -689,7 +652,7 @@ static int refine_fm2 (ZZ *zz, uprintf(hgc, "H(%d, %d, %d), FM2: W[%.1lf, %.1lf] MW:[%.1lf, %.1lf] I=%.3lf LW[%.1lf, %.1lf] LMW[%.1lf, %.1lf] LI=%.3lf\n", hg->nVtx, hg->nEdge, hg->nPins, weights[0], weights[1], max_weight[0], max_weight[1], imbal, lweights[0], lweights[1], lmax_weight[0], lmax_weight[1], limbal); #endif - + if ((hg->nEdge && (!(pins[0] = (int*) ZOLTAN_MALLOC(2 * hg->nEdge * sizeof(int))) || !(lpins[0] = (int*) ZOLTAN_CALLOC(2 * hg->nEdge, sizeof(int))))) || (hg->nVtx && (!(moves = (int*) ZOLTAN_MALLOC(hg->nVtx * sizeof(int))) @@ -703,31 +666,31 @@ static int refine_fm2 (ZZ *zz, if (hgc->myProc_y==rootRank) { /* only root needs mark, adj, gain and heaps*/ Zoltan_Heap_Init(zz, &heap[0], hg->nVtx); - Zoltan_Heap_Init(zz, &heap[1], hg->nVtx); + Zoltan_Heap_Init(zz, &heap[1], hg->nVtx); if (hg->nVtx && (!(mark = (int*) ZOLTAN_CALLOC(hg->nVtx, sizeof(int))) - || !(adj = (int*) ZOLTAN_MALLOC(hg->nVtx * sizeof(int))) + || !(adj = (int*) ZOLTAN_MALLOC(hg->nVtx * sizeof(int))) || !(gain = (float*) ZOLTAN_MALLOC(hg->nVtx * sizeof(float))))) MEMORY_ERROR; } /* Initial calculation of the local pin distribution (sigma in UVC's papers) */ - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfpins, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfpins, hgc->Communicator); for (i = 0; i < hg->nEdge; ++i) for (j = hg->hindex[i]; j < hg->hindex[i+1]; ++j){ ++(lpins[part[hg->hvertex[j]]][i]); } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfpins, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfpins, hgc->Communicator); + - -#ifdef HANDLE_ISOLATED_VERTICES +#ifdef HANDLE_ISOLATED_VERTICES /* first compute vertex degree to find any isolated vertices we use lgain and gain, as ldeg, deg.*/ if (hg->nVtx) { - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); ldeg = (int *) lgain; deg = (int *) gain; /* null for non-root but that is fine */ for (i = 0; i < hg->nVtx; ++i) @@ -743,26 +706,26 @@ static int refine_fm2 (ZZ *zz, part[i] = -(part[i]+1); /* remove those vertices from that part*/ } } - } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); + } + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); } #endif - + do { int v=1, movecnt=0, neggaincnt=0, from, to; int maxneggain = (hgp->fm_max_neg_move < 0) ? hg->nVtx : hgp->fm_max_neg_move; int notfeasible=(weights[0]>max_weight[0]) || (weights[1]>max_weight[1]); - + /* now compute global pin distribution */ if (hg->nEdge) { - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfpins, hgc->Communicator); - MPI_Allreduce(lpins[0], pins[0], 2*hg->nEdge, MPI_INT, MPI_SUM, + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfpins, hgc->Communicator); + MPI_Allreduce(lpins[0], pins[0], 2*hg->nEdge, MPI_INT, MPI_SUM, hgc->row_comm); - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfpins, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfpins, hgc->Communicator); } /* now we can compute actual cut */ @@ -775,7 +738,7 @@ static int refine_fm2 (ZZ *zz, MPI_Allreduce(&cutsize, &best_cutsize, 1, MPI_DOUBLE, MPI_SUM, hgc->col_comm); cutsize = best_cutsize; - imbal = (targetw0==0.0) ? 0.0 : fabs(weights[0]-targetw0)/targetw0; + imbal = (targetw0==0.0) ? 0.0 : fabs(weights[0]-targetw0)/targetw0; best_limbal = limbal = (ltargetw0==0.0) ? 0.0 : fabs(lweights[0]-ltargetw0)/ltargetw0; @@ -784,13 +747,13 @@ static int refine_fm2 (ZZ *zz, Hence if the imbal is not really bad (2x worse) we use that approach */ if (imbal > BADBALANCE*(bal_tol-1.0) ) /* decide which way the moves will be in this pass */ from = (weights[0] < targetw0) ? 1 : 0; - else - from = passcnt % 2; + else + from = passcnt % 2; /* we want to be sure that everybody!!! picks the same source */ - MPI_Bcast(&from, 1, MPI_INT, 0, hgc->Communicator); + MPI_Bcast(&from, 1, MPI_INT, 0, hgc->Communicator); to = 1-from; - + #ifdef _DEBUG /* Just for debugging */ best_cutsize = Zoltan_PHG_Compute_NetCut(hgc, hg, part); @@ -806,9 +769,9 @@ static int refine_fm2 (ZZ *zz, #endif /* compute only the gains of the vertices from 'from' part */ - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfgain, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfgain, hgc->Communicator); + for (i = 0; i < hg->nVtx; ++i) { lgain[i] = 0.0; if ((part[i]==from) && (!hgp->UseFixedVtx || hg->fixed_part[i]<0)) @@ -824,11 +787,11 @@ static int refine_fm2 (ZZ *zz, } /* now sum up all gains on only root proc */ if (hg->nVtx) - MPI_Reduce(lgain, gain, hg->nVtx, MPI_FLOAT, MPI_SUM, rootRank, + MPI_Reduce(lgain, gain, hg->nVtx, MPI_FLOAT, MPI_SUM, rootRank, hgc->col_comm); - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfgain, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfgain, hgc->Communicator); + if (hgp->output_level >= PHG_DEBUG_ALL) { imbal = (targetw0==0.0) ? 0.0 : fabs(weights[0]-targetw0)/targetw0; @@ -841,8 +804,8 @@ static int refine_fm2 (ZZ *zz, version we'll do it in the root procs and broadcast */ #ifdef HANDLE_ISOLATED_VERTICES - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); lwadjust[0] = lwadjust[1] = 0.0; for (i=isocnt; i < hg->nVtx; ++i) { /* go over isolated vertices */ int u=moves[i], pno=-part[u]-1; @@ -851,19 +814,19 @@ static int refine_fm2 (ZZ *zz, if (pno<0 || pno>1) errexit("heeeey pno=%d", pno); /* let's remove it from its part */ - lwadjust[pno] -= w; + lwadjust[pno] -= w; } lweights[0] += lwadjust[0]; lweights[1] += lwadjust[1]; - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); #endif - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfheap, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfheap, hgc->Communicator); + /* Initialize the heaps and fill them with the gain values */ - Zoltan_Heap_Clear(&heap[from]); + Zoltan_Heap_Clear(&heap[from]); for (i = 0; i < hg->nVtx; ++i) if ((part[i]==from) && (!hgp->UseFixedVtx || hg->fixed_part[i]<0)) Zoltan_Heap_Input(&heap[from], i, gain[i]); @@ -878,32 +841,32 @@ static int refine_fm2 (ZZ *zz, v = -1; break; } - - v = Zoltan_Heap_Extract_Max(&heap[from]); - + + v = Zoltan_Heap_Extract_Max(&heap[from]); + #ifdef _DEBUG if (from != part[v]) errexit("hooop from=%d part[%d]=%d", from, v, part[v]); #endif - /* Mark vertex we picked from the heap so it is "locked". - For the current strategy, moving only one direction + /* Mark vertex we picked from the heap so it is "locked". + For the current strategy, moving only one direction at a time, the mark information is not critical. - Note that the mark array is also used in the move/update + Note that the mark array is also used in the move/update routine so don't remove it! */ ++mark[v]; if (lweights[to]+((hg->vwgt)?hg->vwgt[v*hg->VtxWeightDim]:1.0) > lmax_weight[to]) { -#ifdef _DEBUG2 +#ifdef _DEBUG2 printf("%s %4d: %6d (g: %5.1lf), p:%2d [%4.0lf, %4.0lf] NF\n", uMe(hgc), movecnt, v, gain[v], from, weights[0], weights[1]); #endif - /* Negative value in moves array means we have examined + /* Negative value in moves array means we have examined the vertex but couldn't move it. Note offset by one, otherwise zero would be ambiguous. */ moves[movecnt++] = -(v+1); continue; - } - + } + moves[movecnt] = v; ++neggaincnt; cutsize -= gain[v]; @@ -916,7 +879,7 @@ static int refine_fm2 (ZZ *zz, if (notfeasible || (cutsizemax_weight[from]; @@ -925,14 +888,14 @@ static int refine_fm2 (ZZ *zz, best_limbal = limbal; neggaincnt = 0; } -#ifdef _DEBUG2 +#ifdef _DEBUG2 else printf("%s %4d: %6d (g: %5.1lf), p:%2d [%4.0lf, %4.0lf] %.1lf\n", uMe(hgc), movecnt, v, gain[v], from, weights[0], weights[1], cutsize); #endif ++movecnt; } - + if (detail_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfpass, hgc->Communicator); ZOLTAN_TIMER_START(zz->ZTime, timer->rfroll, hgc->Communicator); @@ -941,12 +904,12 @@ static int refine_fm2 (ZZ *zz, #ifdef _DEBUG if (v<0) uprintf(hgc, "EOLB @ %d there was no vertex to select: v=%d\n", movecnt, v); - else if (neggaincnt >= maxneggain) + else if (neggaincnt >= maxneggain) uprintf(hgc, "EOLB @ %d max neg move reached neggaincnt(%d) >= maxneggain\n", movecnt, neggaincnt, maxneggain); - else + else uprintf(hgc, "EOLB @ %d balance constraint LW[%.1lf, %.1lf] and MAXW[%.1lf, %.1lf]\n", movecnt, lweights[0], lweights[1], lmax_weight[0], lmax_weight[1]); #endif - + /* roll back the moves without any improvement */ for (i=movecnt-1; i>=best_cutsizeat; --i) { int vv = moves[i]; @@ -960,13 +923,13 @@ static int refine_fm2 (ZZ *zz, int vv = (moves[i] < 0 ) ? -moves[i] - 1 : moves[i]; mark[vv] = 0; } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfroll, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfroll, hgc->Communicator); } - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfnonroot, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfnonroot, hgc->Communicator); + /* now root bcast moves to column procs */ MPI_Bcast(&best_cutsizeat, 1, MPI_INT, rootRank, hgc->col_comm); MPI_Bcast(moves, best_cutsizeat, MPI_INT, rootRank, hgc->col_comm); @@ -977,10 +940,10 @@ static int refine_fm2 (ZZ *zz, fm2_move_vertex_oneway_nonroot(vv, hg, part, lpins, lweights); } } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfnonroot, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfnonroot, hgc->Communicator); + #ifdef _DEBUG for (i = 0; i < hg->nEdge; ++i) { int lp[2]; @@ -995,20 +958,20 @@ static int refine_fm2 (ZZ *zz, #ifdef HANDLE_ISOLATED_VERTICES - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); - + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); + #if 0 - MPI_Allreduce(lweights, weights, 2, MPI_DOUBLE, MPI_SUM, hgc->row_comm); + MPI_Allreduce(lweights, weights, 2, MPI_DOUBLE, MPI_SUM, hgc->row_comm); best_imbal = (targetw0==0.0) ? 0.0 : fabs(weights[0]-targetw0)/targetw0; - if (hgc->myProc_y==rootRank) + if (hgc->myProc_y==rootRank) uprintf(hgc, "BEFORE ISOLATED VERTEX HANDLING WE *THINK* GLOBAL IMBALANCE is %.3lf\n", best_imbal); #endif - + if (hgc->myProc_y==rootRank) { best_limbal = (ltargetw0==0.0) ? 0.0 : fabs(lweights[0]-ltargetw0)/ltargetw0; - + for (i=isocnt; i < hg->nVtx; ++i) { /* go over isolated vertices */ int u = moves[i], npno; float w=(hg->vwgt ? hg->vwgt[u*hg->VtxWeightDim] : 1.0); @@ -1021,7 +984,7 @@ static int refine_fm2 (ZZ *zz, } limbal = (ltargetw0==0.0) ? 0.0 : fabs(lweights[0]-ltargetw0)/ltargetw0; -#if 0 +#if 0 uprintf(hgc, "before binpacking of %d isolated vertices balance was: %.3lf now: %.3lf\n", hg->nVtx-isocnt, best_limbal, limbal); #endif } @@ -1031,18 +994,18 @@ static int refine_fm2 (ZZ *zz, lweights[0] += lwadjust[0]; lweights[1] += lwadjust[1]; } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); -#endif - + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); +#endif + MPI_Allreduce(lweights, weights, 2, MPI_DOUBLE, MPI_SUM, hgc->row_comm); -#if 0 +#if 0 best_imbal = (targetw0==0.0) ? 0.0 : fabs(weights[0]-targetw0)/targetw0; - if (hgc->myProc_y==rootRank) + if (hgc->myProc_y==rootRank) uprintf(hgc, "NEW GLOBAL IMBALANCE is %.3lf\n", best_imbal); #endif - - if (weights[0]==0.0) + + if (weights[0]==0.0) ltargetw0 = lmax_weight[0] = 0.0; else { lmax_weight[0] = lweights[0] + @@ -1051,16 +1014,16 @@ static int refine_fm2 (ZZ *zz, } lmax_weight[1] = (weights[1]==0.0) ? 0.0 : lweights[1] + (max_weight[1] - weights[1]) * ( lweights[1] / weights[1] ); - + cont = 0; MPI_Allreduce(&best_cutsizeat, &cont, 1, MPI_INT, MPI_LOR, hgc->row_comm); /* since we're only moving in one direction; make sure two successive pass didn't produce any improvement before terminating */ if (!cont) - ++successivefails; + ++successivefails; else - successivefails = 0; + successivefails = 0; #ifdef _DEBUG /* Just for debugging */ best_cutsize = Zoltan_PHG_Compute_NetCut(hgc, hg, part); @@ -1072,41 +1035,41 @@ static int refine_fm2 (ZZ *zz, #ifdef HANDLE_ISOLATED_VERTICES - if (detail_timing) - ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_START(zz->ZTime, timer->rfiso, hgc->Communicator); /* now root sneds the final part no's of isolated vertices; if any */ MPI_Bcast(&isocnt, 1, MPI_INT, rootRank, hgc->col_comm); if (isocntnVtx) { deg = (int *) lgain; /* we'll use for part no's of isolated vertices */ - if (hgc->myProc_y==rootRank) + if (hgc->myProc_y==rootRank) for (i=isocnt; i < hg->nVtx; ++i) { /* go over isolated vertices */ int u = moves[i]; - deg[i] = part[u] = -part[u]-1; + deg[i] = part[u] = -part[u]-1; } - + MPI_Bcast(&moves[isocnt], hg->nVtx-isocnt, MPI_INT, rootRank, hgc->col_comm); MPI_Bcast(°[isocnt], hg->nVtx-isocnt, MPI_INT, rootRank, hgc->col_comm); - if (hgc->myProc_y!=rootRank) + if (hgc->myProc_y!=rootRank) for (i=isocnt; i < hg->nVtx; ++i) /* go over isolated vertices */ part[moves[i]] = deg[i]; } - if (detail_timing) - ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); + if (detail_timing) + ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfiso, hgc->Communicator); #endif - End: + End: - if (hgc->myProc_y==rootRank) { /* only root needs mark, adj, gain and heaps*/ + if (hgc->myProc_y==rootRank) { /* only root needs mark, adj, gain and heaps*/ Zoltan_Multifree(__FILE__,__LINE__, 3, &mark, &adj, &gain); Zoltan_Heap_Free(&heap[0]); - Zoltan_Heap_Free(&heap[1]); + Zoltan_Heap_Free(&heap[1]); } - + Zoltan_Multifree(__FILE__, __LINE__, 4, &pins[0], &lpins[0], &moves, &lgain); - if (do_timing) + if (do_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->rfrefine, hgc->Communicator); - - + + ZOLTAN_TRACE_EXIT(zz, yo); return ierr; } diff --git a/packages/zoltan/src/phg/phg_scale.c b/packages/zoltan/src/phg/phg_scale.c index 1ee268f203..3baf9432bf 100644 --- a/packages/zoltan/src/phg/phg_scale.c +++ b/packages/zoltan/src/phg/phg_scale.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -55,9 +18,9 @@ extern "C" { /****************************************************************************/ -/* Scaling the weight of hypergraph edges. +/* Scaling the weight of hypergraph edges. This changes the inner product used in matching, - usually to the better! + usually to the better! Note that the scaled weights are returned in a separate array (new_ewgts) and the hypergraph is not changed in this function. @@ -66,10 +29,10 @@ extern "C" { 2: net size scaling (1/size) 3: clique scaling (2/(size*(size-1))) - EBEB: Removed Robert's old serial scaling methods. + EBEB: Removed Robert's old serial scaling methods. We should look at these later. */ -int Zoltan_PHG_Scale_Edges (ZZ *zz, HGraph *hg, float *new_ewgt, +int Zoltan_PHG_Scale_Edges (ZZ *zz, HGraph *hg, float *new_ewgt, int edge_scaling) { int i, err; @@ -77,7 +40,7 @@ int *lsize = NULL; /* local edge sizes */ int *size = NULL; /* edge sizes */ static char *yo = "Zoltan_PHG_Scale_Edges"; - err = ZOLTAN_OK; + err = ZOLTAN_OK; /* allocate size arrays */ if (hg->nEdge == 0) @@ -94,7 +57,7 @@ static char *yo = "Zoltan_PHG_Scale_Edges"; case 0: /* copy current weights; no scaling. */ - for (i = 0; i < hg->nEdge; i++) + for (i = 0; i < hg->nEdge; i++) new_ewgt[i] = (hg->ewgt ? hg->ewgt[i] : 1.0); break; @@ -114,7 +77,7 @@ static char *yo = "Zoltan_PHG_Scale_Edges"; /* sum up local sizes */ /* assume SCHEMEA : all procs in a row have same # hyperedges */ - MPI_Allreduce(lsize, size, hg->nEdge, MPI_INT, MPI_SUM, + MPI_Allreduce(lsize, size, hg->nEdge, MPI_INT, MPI_SUM, hg->comm->row_comm); #ifdef DEBUG_EB @@ -132,7 +95,7 @@ static char *yo = "Zoltan_PHG_Scale_Edges"; else if (edge_scaling==2) new_ewgt[i] = (hg->ewgt ? hg->ewgt[i] : 1.0) / size[i]; else if (edge_scaling==3) - new_ewgt[i] = (hg->ewgt ? hg->ewgt[i] : 1.0) * 2.0 / + new_ewgt[i] = (hg->ewgt ? hg->ewgt[i] : 1.0) * 2.0 / (size[i]*(size[i]-1.0)); } else /* size[i] == 1 */ @@ -163,7 +126,7 @@ static char *yo = "Zoltan_PHG_Scale_Edges"; int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) { int i; - int *ldegree, *gdegree; + int *ldegree, *gdegree; char *yo = "Zoltan_PHG_Scale_Vtx"; if ((hgp->vtx_scaling==0) || (hg->nVtx==0)) @@ -177,7 +140,7 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) } /* Allocate vtx_scal array if necessary */ - if (hgp->vtx_scal==NULL){ + if (hgp->vtx_scal==NULL){ /* first level in V-cycle or ...*/ /* nVtx increased due to processor reduction */ hgp->vtx_scal_size = hg->nVtx; @@ -202,7 +165,7 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) for (i=0; inVtx; i++){ ldegree[i] = hg->vindex[i+1] - hg->vindex[i]; /* local degree */ } - + /* Sum up along columns for global degrees. */ MPI_Allreduce(ldegree, gdegree, hg->nVtx, MPI_INT, MPI_SUM, hg->comm->col_comm); @@ -229,7 +192,7 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) for (i=0; inVtx; i++) if (gdegree[i] == 0) hgp->vtx_scal[i] = 1.0; - else + else hgp->vtx_scal[i] = 1. / gdegree[i]; } else if (hgp->vtx_scaling==3){ /* scale by sqrt vertex weights */ @@ -238,7 +201,7 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) /* KDD Note: Scaling by only first weight */ if (hg->vwgt[i*hg->VtxWeightDim] == 0) hgp->vtx_scal[i] = 1.0; - else + else /* KDD Note: Scaling by only first weight */ hgp->vtx_scal[i] = 1. / sqrt((double)hg->vwgt[i*hg->VtxWeightDim]); } @@ -249,7 +212,7 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) /* KDD Note: Scaling by only first weight */ if (hg->vwgt[i*hg->VtxWeightDim] == 0) hgp->vtx_scal[i] = 1.0; - else + else /* KDD Note: Scaling by only first weight */ hgp->vtx_scal[i] = 1. / hg->vwgt[i*hg->VtxWeightDim]; } @@ -259,7 +222,8 @@ int Zoltan_PHG_Scale_Vtx (ZZ *zz, HGraph *hg, PHGPartParams *hgp) return ZOLTAN_OK; } - + #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/phg/phg_serialpartition.c b/packages/zoltan/src/phg/phg_serialpartition.c index 4887ac35a0..33f40a52a0 100644 --- a/packages/zoltan/src/phg/phg_serialpartition.c +++ b/packages/zoltan/src/phg/phg_serialpartition.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -53,9 +16,9 @@ extern "C" { #include "zz_heap.h" #include "phg.h" #include "zz_const.h" - -/* If adding a new coarse partitioning fn, add prototype here - * AND add entry to CoarsePartitionFns array + +/* If adding a new coarse partitioning fn, add prototype here + * AND add entry to CoarsePartitionFns array * AND increment NUM_COARSEPARTITION_FN. */ #define NUM_COARSEPARTITION_FNS 3 @@ -64,7 +27,7 @@ static ZOLTAN_PHG_COARSEPARTITION_FN coarse_part_greedy; static ZOLTAN_PHG_COARSEPARTITION_FN coarse_part_random; static ZOLTAN_PHG_COARSEPARTITION_FN coarse_part_linear; -static ZOLTAN_PHG_COARSEPARTITION_FN* CoarsePartitionFns[] = +static ZOLTAN_PHG_COARSEPARTITION_FN* CoarsePartitionFns[] = {&coarse_part_greedy, &coarse_part_random, &coarse_part_linear, @@ -92,32 +55,32 @@ char *str, *str2; if (!strncasecmp(str2, "l-", 2)) { str = str2+2; hgp->LocalCoarsePartition = 1; - } + } else { str = str2; hgp->LocalCoarsePartition = 0; } if (!strcasecmp(str, "auto")) return NULL; /* try all methods */ - else if (!strcasecmp(str, "no")) return NULL; - else if (!strcasecmp(str, "none")) return NULL; + else if (!strcasecmp(str, "no")) return NULL; + else if (!strcasecmp(str, "none")) return NULL; else if (!strcasecmp(str, "greedy")) return coarse_part_greedy; else if (!strcasecmp(str, "random")) return coarse_part_random; else if (!strcasecmp(str, "linear")) return coarse_part_linear; - else { - *ierr = ZOLTAN_FATAL; + else { + *ierr = ZOLTAN_FATAL; return NULL; } } /****************************************************************************/ -#define NUM_PART_KEEP 1 /* No. of partition vectors to keep; +#define NUM_PART_KEEP 1 /* No. of partition vectors to keep; must be at least 1! Currently only the best partition vector is used. */ int Zoltan_PHG_CoarsePartition( - ZZ *zz, + ZZ *zz, HGraph *phg, /* Input: coarse hypergraph -- distributed! */ int numPart, /* Input: number of partitions to generate. */ float *part_sizes, /* Input: array of size numPart listing target sizes @@ -127,12 +90,12 @@ int Zoltan_PHG_CoarsePartition( PHGPartParams *hgp /* Input: parameters to use. */ ) { -/* +/* * Zoltan_PHG_CoarsePartition computes a partitioning of a hypergraph. * Typically, this routine is called at the bottom level in a * multilevel scheme (V-cycle). * It gathers the distributed hypergraph to each processor and computes - * a decomposition of the serial hypergraph. + * a decomposition of the serial hypergraph. * It computes a different partition on each processor * using different random numbers (and possibly also * different algorithms) and selects the best. @@ -154,7 +117,7 @@ int local_coarse_part = hgp->LocalCoarsePartition; /* Number of iterations to try coarse partitioning on each proc. */ /* 10 when p=1, and 1 when p is large. */ -const int num_coarse_iter = 1 + 9/zz->Num_Proc; +const int num_coarse_iter = 1 + 9/zz->Num_Proc; ZOLTAN_TRACE_ENTER(zz, yo); @@ -172,7 +135,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; /* Force LocalCoarsePartition if large global graph */ #define LARGE_GRAPH_VTX 64000 -/*#define LARGE_GRAPH_PINS 256000*/ +#define LARGE_GRAPH_PINS 256000 if (phg->dist_x[phg->comm->nProc_x] > LARGE_GRAPH_VTX){ /* TODO: || (global_nPins > LARGE_GRAPH_PINS) */ local_coarse_part = 1; @@ -185,7 +148,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; /* Do no coarse partitioning. */ /* Do a sanity test and mapping to parts [0,...,numPart-1] */ int first = 1; - PHGComm *hgc=phg->comm; + PHGComm *hgc=phg->comm; Zoltan_Srand_Sync (Zoltan_Rand(NULL), &(hgc->RNGState_col), hgc->col_comm); if (hgp->UsePrefPart) { @@ -201,7 +164,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; else /* recursive bisection, map to 0-1 part numbers */ part[i] = (phg->pref_part[i] < phg->bisec_split ? 0 : 1); - } + } } } else { for (i = 0; i < phg->nVtx; i++) { @@ -212,16 +175,16 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; ierr = ZOLTAN_WARN; } part[i] = ((part[i]<0) ? -part[i] : part[i]) % numPart; - } + } } } } - else if (numPart == 1) { + else if (numPart == 1) { /* everything goes in the one partition */ for (i = 0; i < phg->nVtx; i++) part[i] = 0; } - else if (!hgp->UsePrefPart && numPart >= phg->dist_x[phg->comm->nProc_x]) { + else if (!hgp->UsePrefPart && numPart >= phg->dist_x[phg->comm->nProc_x]) { /* more partitions than vertices, trivial answer */ for (i = 0; i < phg->nVtx; i++) part[i] = phg->dist_x[phg->comm->myProc_x]+i; @@ -244,7 +207,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; CoarsePartition = hgp->CoarsePartition; if (CoarsePartition == NULL) { /* auto */ /* Select a coarse partitioner from the array of coarse partitioners */ - CoarsePartition = CoarsePartitionFns[phg->comm->myProc % + CoarsePartition = CoarsePartitionFns[phg->comm->myProc % NUM_COARSEPARTITION_FNS]; } @@ -271,7 +234,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; scomm.RNGState_col = Zoltan_Rand(NULL); scomm.zz = zz; - /* + /* * Gather parallel hypergraph phg to each processor, creating * serial hypergraph shg. */ @@ -293,19 +256,19 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; } - /* + /* * Allocate partition array spart for the serial hypergraph shg * and partition shg. */ spart = (int *) ZOLTAN_CALLOC(shg->nVtx * (NUM_PART_KEEP+1), sizeof(int)); - bestvals = (float *) ZOLTAN_MALLOC((NUM_PART_KEEP+1)*sizeof(int)); + bestvals = (float *) ZOLTAN_MALLOC((NUM_PART_KEEP+1)*sizeof(int)); if ((!spart) || (!bestvals)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Out of memory."); ierr = ZOLTAN_MEMERR; goto End; } - + /* Compute several coarse partitionings. */ /* Keep the NUM_PART_KEEP best ones around. */ /* Currently, only the best one is used. */ @@ -318,12 +281,12 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; for (i=0; i< num_coarse_iter; i++){ int savefmlooplimit=hgp->fm_loop_limit; - + /* Overwrite worst partition with new candidate. */ - ierr = CoarsePartition(zz, shg, numPart, part_sizes, + ierr = CoarsePartition(zz, shg, numPart, part_sizes, new_part, hgp); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from CoarsePartition."); goto End; } @@ -338,7 +301,7 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; hgp->fm_loop_limit = 1; Zoltan_PHG_Refinement(zz, shg, numPart, part_sizes, new_part, hgp); hgp->fm_loop_limit = savefmlooplimit; - + /* stop refinement timer */ if (fine_timing) { ZOLTAN_TIMER_STOP(zz->ZTime, timer->cprefine, phg->comm->Communicator); @@ -348,15 +311,15 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; /* Decide if candidate is in the top tier or not. */ /* Our objective is a combination of cuts and balance */ - bal = Zoltan_PHG_Compute_Balance(zz, shg, part_sizes, 0, - numPart, new_part); + bal = Zoltan_PHG_Compute_Balance(zz, shg, part_sizes, 0, + numPart, new_part); cut = Zoltan_PHG_Compute_ConCut(shg->comm, shg, new_part, numPart, &ierr); - + /* Use ratio-cut as our objective. There are many other options! */ bestvals[new_cand] = cut/(MAX(2.-bal, 0.0001)); /* avoid divide-by-0 */ if (ierr < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_PHG_Compute_ConCut."); goto End; } @@ -388,15 +351,15 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; /* Evaluate and select the best. */ /* For now, only pick the best one, in the future we pick the k best. */ - ierr = pick_best(zz, hgp, phg->comm, shg, numPart, + ierr = pick_best(zz, hgp, phg->comm, shg, numPart, MIN(NUM_PART_KEEP, num_coarse_iter), spart, bestvals); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from pick_best."); goto End; } - + if (phg->comm->nProc > 1) { /* Map gathered partition back to 2D distribution */ for (i = 0; i < phg->nVtx; i++) { @@ -407,15 +370,15 @@ const int num_coarse_iter = 1 + 9/zz->Num_Proc; Zoltan_HG_HGraph_Free(shg); ZOLTAN_FREE(&shg); - } + } else { /* single processor */ for (i = 0; i < phg->nVtx; i++) part[i] = spart[i]; } } - + End: - if (fine_timing) + if (fine_timing) ZOLTAN_TIMER_STOP(zz->ZTime, timer->cpart, phg->comm->Communicator); ZOLTAN_FREE(&spart); @@ -436,11 +399,11 @@ static int local_coarse_partitioner( ZOLTAN_PHG_COARSEPARTITION_FN *CoarsePartition ) { -/* +/* * Function that allows any of the coarse partitioning strategies to be applied * locally, without a gather operation. * Each column group does independent partitioning; each tries to balance - * local vertex weights; our hope is that this will give somewhat balanced + * local vertex weights; our hope is that this will give somewhat balanced * result. */ PHGComm *hgc = hg->comm; @@ -452,16 +415,16 @@ int rootnpins, rootrank; } /* The column processor with the most pins will be our root. */ - Zoltan_PHG_Find_Root(hg->nPins, hgc->myProc_y, hgc->col_comm, + Zoltan_PHG_Find_Root(hg->nPins, hgc->myProc_y, hgc->col_comm, &rootnpins, &rootrank); if (hgc->myProc_y==rootrank) /* only root of each column does this */ - err = CoarsePartition(zz, hg, numPart, part_sizes, part, hgp); + err = CoarsePartition(zz, hg, numPart, part_sizes, part, hgp); MPI_Bcast(&err, 1, MPI_INT, rootrank, hgc->col_comm); if (!err) MPI_Bcast(part, hg->nVtx, MPI_INT, rootrank, hgc->col_comm); - + return err; } @@ -472,15 +435,15 @@ int rootnpins, rootrank; in a given order. The goal is to assign approximately even weights to each partition, or alternatively, proportional to the target weights (if such are given), subject to - a specified linear order (sequence). + a specified linear order (sequence). Multi-weights are not yet supported; only the first weight is used in computing the partition. This is a quick but effective heuristic. We could alternatively use - a more expensive but optimal algorithm, see e.g. + a more expensive but optimal algorithm, see e.g. "Fast Optimal Load Balancing Algorithms for 1D Partitioning" - by Ali Pinar and C. Aykanat, but for our purpose it is + by Ali Pinar and C. Aykanat, but for our purpose it is probably not worth the effort. Adapted for fixed vertices and/or prefered parts. @@ -488,7 +451,7 @@ int rootnpins, rootrank; */ static int seq_part ( - ZZ *zz, + ZZ *zz, HGraph *hg, /* the hypergraph, containing vertex weights */ int *order, /* the ordering of the vertices */ int p, /* desired number of partitions */ @@ -546,7 +509,7 @@ static int seq_part ( fixed_wgts[part[i]] += hg->vwgt[i*vwgtdim]; } } - + /* Sum up all the target partition weights. */ /* Only use first vweight for now. */ @@ -560,7 +523,7 @@ static int seq_part ( cutoff = weight_sum*part_sizes[0]/psize_sum; /* Loop through all vertices in specified order, and assign - partition numbers. */ + partition numbers. */ for (i=0; inVtx; i++) { /* If order==NULL, then use linear order. */ j = order ? order[i] : i; @@ -573,7 +536,7 @@ static int seq_part ( if ((pnumber+1) < p && part_sum > cutoff) { pnumber++; /* Increase current part number */ /* Decide if current vertex should be moved to the next partition */ - if ((part_sum-cutoff) > (cutoff-old_sum)) { + if ((part_sum-cutoff) > (cutoff-old_sum)) { part[j]++; part_sum = old_sum; } @@ -588,7 +551,7 @@ static int seq_part ( } } if (hgp->output_level >= PHG_DEBUG_PRINT) - printf("COARSE_PART i=%2d, part[%2d] = %2d, part_sum=%f, cutoff=%f\n", + printf("COARSE_PART i=%2d, part[%2d] = %2d, part_sum=%f, cutoff=%f\n", i, j, part[j], part_sum, cutoff); } @@ -603,11 +566,11 @@ static int seq_part ( /* Linear partitioning. Sequence partitioning with vertices in linear order. */ static int coarse_part_linear ( - ZZ *zz, - HGraph *hg, - int p, + ZZ *zz, + HGraph *hg, + int p, float *part_sizes, - Partition part, + Partition part, PHGPartParams *hgp ) { @@ -631,7 +594,7 @@ static int coarse_part_linear ( for (i=0; inVtx; i++) { order[i] = offset + i; - if (order[i] >= hg->nVtx) + if (order[i] >= hg->nVtx) order[i] -= hg->nVtx; } @@ -669,7 +632,7 @@ static int coarse_part_random ( /* Randomly permute order array */ Zoltan_Rand_Perm_Int (order, hg->nVtx, NULL); - + /* Call sequence partitioning with random order array. */ err = seq_part (zz, hg, order, p, part_sizes, part, hgp); @@ -680,13 +643,13 @@ static int coarse_part_random ( /*********************************************************************/ -/* Greedy growing algorithm. +/* Greedy growing algorithm. Start with all vertices in part 0, except start_vtx goes in part 1. Greedily grow part 1 while minimizing the cut at every step. - Note: This version assumes p==2 (bisection). + Note: This version assumes p==2 (bisection). */ static int greedy_grow_part ( @@ -725,13 +688,13 @@ static int greedy_grow_part ( /* Initially put all vertices in part 0, except fixed ones. */ for (i=0; inVtx; i++) - part[i] = 0; + part[i] = 0; if (hgp->UsePrefPart){ for (i=0; inVtx; i++) if ((hg->bisec_split >= 0) && (hg->pref_part[i] >= hg->bisec_split)) - part[i] = 1; + part[i] = 1; } - + cut[0] = (int*) ZOLTAN_CALLOC (2*hg->nEdge, sizeof (int)); if ((hg->nEdge > 0 && cut[0] == NULL) ) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); @@ -748,7 +711,7 @@ static int greedy_grow_part ( /* Initialize gain values. */ for (i=0; inVtx; i++){ /* compute gain only if vertex is free */ - if (!hgp->UseFixedVtx || (hg->fixed_part[i] < 0)) + if (!hgp->UseFixedVtx || (hg->fixed_part[i] < 0)) for (j=hg->vindex[i]; jvindex[i+1]; j++) { edge = hg->vedge[j]; edgesize = cut[0][edge]+cut[1][edge]; @@ -765,7 +728,7 @@ static int greedy_grow_part ( part_sum = 0.0; /* Weight in the growing partition (1) */ for (i=0; inVtx; i++){ weight_sum += hg->vwgt[i*vwgtdim]; - if (part[i]>0) + if (part[i]>0) part_sum += hg->vwgt[i*vwgtdim]; } @@ -777,7 +740,7 @@ static int greedy_grow_part ( printf("Debug: Starting new greedy growing at vertex %d, part=%2d\n", start_vtx, p); /* Initialize heap. */ - if (!hgp->UseFixedVtx) + if (!hgp->UseFixedVtx) gain[start_vtx] = 1e10; /* Make start_vtx max value in heap. */ /* All other values should be negative. */ for (i=0; inVtx; i++){ @@ -838,7 +801,7 @@ static int coarse_part_greedy ( int scaling; float *new_ewgt=NULL; #endif - float *old_ewgt=NULL; + float *old_ewgt=NULL; int err = ZOLTAN_OK; char *yo = "coarse_part_greedy"; @@ -886,10 +849,10 @@ static int coarse_part_greedy ( /*****************************************************************************/ static int pick_best( - ZZ *zz, - PHGPartParams *hgp, + ZZ *zz, + PHGPartParams *hgp, PHGComm *phg_comm, - HGraph *shg, + HGraph *shg, int numPart, int numLocalCandidates, int *spart, /* On input: All candidate partition vectors concatenated. @@ -923,7 +886,7 @@ int err = ZOLTAN_OK; local[1].val = Zoltan_PHG_Compute_ConCut(shg->comm, shg, spart, numPart, &err); if (err < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_PHG_Compute_ConCut"); goto End; } @@ -937,10 +900,10 @@ int err = ZOLTAN_OK; if (cutvals) cut = cutvals[i]; else { - cut = Zoltan_PHG_Compute_ConCut(shg->comm, shg, + cut = Zoltan_PHG_Compute_ConCut(shg->comm, shg, spart+i*(shg->nVtx), numPart, &err); if (err < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_PHG_Compute_ConCut"); goto End; } @@ -952,21 +915,21 @@ int err = ZOLTAN_OK; local[1].val = cut; } } - + /* copy best partition to beginning of spart */ for (i=0; inVtx; i++) spart[i] = spart[mybest*(shg->nVtx)+i]; /* Pick lowest ratio cut as best. */ - MPI_Allreduce(local, global, 2, MPI_FLOAT_INT, MPI_MINLOC, + MPI_Allreduce(local, global, 2, MPI_FLOAT_INT, MPI_MINLOC, phg_comm->Communicator); if (hgp->output_level) uprintf(phg_comm, - "Local Ratio Cut= %.2lf Global Ratio Cut= %.2lf\n", + "Local Ratio Cut= %.2lf Global Ratio Cut= %.2lf\n", local[1].val, global[1].val); - MPI_Bcast(spart, shg->nVtx, MPI_INT, global[1].rank, + MPI_Bcast(spart, shg->nVtx, MPI_INT, global[1].rank, phg_comm->Communicator); End: @@ -976,3 +939,4 @@ int err = ZOLTAN_OK; #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/phg/phg_tree.c b/packages/zoltan/src/phg/phg_tree.c index a160afedff..fe999eabba 100644 --- a/packages/zoltan/src/phg/phg_tree.c +++ b/packages/zoltan/src/phg/phg_tree.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/phg/phg_tree.h b/packages/zoltan/src/phg/phg_tree.h index 4119e8a4cd..52b6575e51 100644 --- a/packages/zoltan/src/phg/phg_tree.h +++ b/packages/zoltan/src/phg/phg_tree.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_TREE_H #define __ZOLTAN_PHG_TREE_H diff --git a/packages/zoltan/src/phg/phg_two_ways.c b/packages/zoltan/src/phg/phg_two_ways.c index 5133795b54..6ff02fcb04 100644 --- a/packages/zoltan/src/phg/phg_two_ways.c +++ b/packages/zoltan/src/phg/phg_two_ways.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/phg/phg_util.c b/packages/zoltan/src/phg/phg_util.c index 805a784cbc..6a4f98fef8 100644 --- a/packages/zoltan/src/phg/phg_util.c +++ b/packages/zoltan/src/phg/phg_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -61,8 +24,8 @@ extern "C" { #define SHOW_MINMAXN */ #define SHOW_MINMAXP - - + + char *Zoltan_PHG_uMe(PHGComm *hgc) { static char msg[1024]; @@ -77,7 +40,7 @@ va_list argp; fflush(stdout); fflush(stderr); -printf("%s", uMe(hgc)); +printf("%s", uMe(hgc)); va_start(argp, f_str); vfprintf(stdout, f_str, argp); va_end(argp); @@ -116,7 +79,7 @@ void Zoltan_PHG_Find_Root( { /* Based on local input value val, find the processor with the best val. * Return that processor and its value. - * (Used when performing, say, local matching in each processor of a column + * (Used when performing, say, local matching in each processor of a column * and want to compute the best match in the column.) */ struct { @@ -166,9 +129,9 @@ int Zoltan_PHG_LoadBalStat(ZZ *zz, HGraph *hg) av /= (double) comm->nProc; an /= (double) comm->nProc; ap /= (double) comm->nProc; - + if (!comm->myProc) { -#ifdef SHOW_DISTMATRIX +#ifdef SHOW_DISTMATRIX printf("Hypergraph distribution:\n "); for (x=0; xnProc_x; ++x) printf("%-33d", x); @@ -177,7 +140,7 @@ int Zoltan_PHG_LoadBalStat(ZZ *zz, HGraph *hg) printf("%3d: ", y); for (x=0; xnProc_x; ++x) { i = y* comm->nProc_x + x; - printf("H(%7d, %7d, %9d) ", v[i], n[i], p[i]); + printf("H(%7d, %7d, %9d) ", v[i], n[i], p[i]); } printf("\n"); printf(" "); @@ -186,38 +149,38 @@ int Zoltan_PHG_LoadBalStat(ZZ *zz, HGraph *hg) printf(" "); #ifdef SHOW_MINMAXV if (v[i]==minv) - printf("vvvvvvv "); + printf("vvvvvvv "); else if (v[i]==maxv) - printf("^^^^^^^ "); + printf("^^^^^^^ "); else #endif printf(" "); -#ifdef SHOW_MINMAXN +#ifdef SHOW_MINMAXN if (n[i]==minn) - printf("<<<<<<< "); + printf("<<<<<<< "); else if (n[i]==maxn) - printf(">>>>>>> "); + printf(">>>>>>> "); else #endif printf(" "); -#ifdef SHOW_MINMAXP +#ifdef SHOW_MINMAXP if (p[i]==minp) - printf("--------- "); + printf("--------- "); else if (p[i]==maxp) - printf("+++++++++ "); + printf("+++++++++ "); else #endif printf(" "); } - printf("\n"); + printf("\n"); } #endif printf("Min: (%7d, %7d, %9d) Max: (%7d, %7d, %9d)\n", minv, minn, minp, maxv, maxn, maxp); - printf("Imbal: (%7.2f, %7.2f, %9.2f) (%7.2f, %7.2f, %9.2f)\n", 100.0*(av-minv)/av, 100.0*(an-minn)/an, 100.0*(ap-minp)/ap, 100.0*(maxv-av)/av, 100.0*(maxn-an)/an, 100.0*(maxp-ap)/ap); + printf("Imbal: (%7.2f, %7.2f, %9.2f) (%7.2f, %7.2f, %9.2f)\n", 100.0*(av-minv)/av, 100.0*(an-minn)/an, 100.0*(ap-minp)/ap, 100.0*(maxv-av)/av, 100.0*(maxn-an)/an, 100.0*(maxp-ap)/ap); } End: Zoltan_Multifree(__FILE__, __LINE__, 1, &v); - + return ierr; } @@ -228,10 +191,10 @@ int Zoltan_PHG_isPrime(int n) static const int maxValid = 250000; static const int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, - 101, 103, 107, 109, 113, 127, 131, 137, 139, - 149, 151, 157, 163, 167, 173, 179, 181, + 101, 103, 107, 109, 113, 127, 131, 137, 139, + 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, - 233, 239, 241, 251, 257, 263, 269, 271, 277, + 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, @@ -250,12 +213,12 @@ int isprime = 1; break; } if (isprime && n>maxValid) { - char str[128]; + char str[128]; sprintf(str, "Warning: isPrime function may not be accurate for n(%i)>%d\n", n, maxValid); ZOLTAN_PRINT_WARN(-1, "Zoltan_PHG_isPrime", str); } - + return isprime; } diff --git a/packages/zoltan/src/phg/phg_util.h b/packages/zoltan/src/phg/phg_util.h index c940251e8a..4f99326bf3 100644 --- a/packages/zoltan/src/phg/phg_util.h +++ b/packages/zoltan/src/phg/phg_util.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PHG_UTIL_H #define __PHG_UTIL_H @@ -56,8 +19,8 @@ extern "C" { #endif -/* Definitions to allow simplicity in PHG code - * while protecting application namespace. +/* Definitions to allow simplicity in PHG code + * while protecting application namespace. */ #define uMe Zoltan_PHG_uMe #define uprintf Zoltan_PHG_uprintf diff --git a/packages/zoltan/src/phg/phg_verbose.c b/packages/zoltan/src/phg/phg_verbose.c index 049f36314a..fc83c0cf71 100644 --- a/packages/zoltan/src/phg/phg_verbose.c +++ b/packages/zoltan/src/phg/phg_verbose.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -150,11 +113,11 @@ void print_hypergraph(ZZ *zz, ZHG *zhg, int sumWeight) printf("\n"); } printf("\n"); - + wgt = zhg->Ewgt; pin = zhg->pinGNO; owner = zhg->Pin_Procs; - + printf("(%d) %d INPUT or REMOVED EDGES (out of " ZOLTAN_GNO_SPEC "), %d pins: gno size (weights) (pinGNO/pinProc)\n", p, zhg->nHedges, zhg->globalHedges, zhg->nPins); diff --git a/packages/zoltan/src/phg/phg_verbose.h b/packages/zoltan/src/phg/phg_verbose.h index 39805fa1b3..97cc5aac9e 100644 --- a/packages/zoltan/src/phg/phg_verbose.h +++ b/packages/zoltan/src/phg/phg_verbose.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_PHG_VERBOSE_H #define __ZOLTAN_PHG_VERBOSE_H diff --git a/packages/zoltan/src/rcb/README b/packages/zoltan/src/rcb/README index e7fc7a4b0c..197ac055f1 100644 --- a/packages/zoltan/src/rcb/README +++ b/packages/zoltan/src/rcb/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER RCB DIRECTORY -- Implementation of Recursive Coordinate Bisection. Also diff --git a/packages/zoltan/src/rcb/box_assign.c b/packages/zoltan/src/rcb/box_assign.c index 197c59917d..c153528628 100644 --- a/packages/zoltan/src/rcb/box_assign.c +++ b/packages/zoltan/src/rcb/box_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -93,11 +56,11 @@ int *numparts) /* number of parts in part list */ RIB_STRUCT *rib; /* Pointer to data structures for RIB. */ struct rib_tree *itree; /* tree of RIB cuts */ struct rcb_box box; /* box data structure */ - int *proc_array = NULL; + int *proc_array = NULL; /* Array of size zz->Num_Proc; initialized - to 0; entry i incremented each time - a found part is on processor i. - Added to support + to 0; entry i incremented each time + a found part is on processor i. + Added to support !zz->LB.Single_Proc_Per_Part. */ int include_procs = (procs != NULL); int include_parts = (parts != NULL); @@ -106,7 +69,7 @@ int *numparts) /* number of parts in part list */ double p[8][3]; if (zz->LB.Data_Structure == NULL) { - ZOLTAN_PRINT_ERROR(-1, yo, + ZOLTAN_PRINT_ERROR(-1, yo, "No Decomposition Data available; use KEEP_CUTS parameter."); ierr = ZOLTAN_FATAL; goto End; @@ -140,16 +103,16 @@ int *numparts) /* number of parts in part list */ box.hi[2] = zmax; if (rcb->Tran.Target_Dim > 0){ - /* + /* * Degenerate geometry, transform box to the lower dimensional * space that the partitioning occured in. Our new box may * encompass more parts, but it won't miss any. */ - Zoltan_Transform_Box(box.lo, box.hi, rcb->Tran.Transformation, + Zoltan_Transform_Box(box.lo, box.hi, rcb->Tran.Transformation, rcb->Tran.Permutation, rcb->Num_Dim, rcb->Tran.Target_Dim); } - Box_Assign(zz, treept, &box, include_procs, include_parts, + Box_Assign(zz, treept, &box, include_procs, include_parts, proc_array, parts, numparts, treept[0].right_leaf); } else if (zz->LB.Method == RIB) { @@ -173,21 +136,21 @@ int *numparts) /* number of parts in part list */ box.hi[2] = zmax; if (rib->Tran.Target_Dim <= 0){ - Box_Assign3(zz, itree, &box, include_procs, include_parts, + Box_Assign3(zz, itree, &box, include_procs, include_parts, proc_array, parts, numparts, itree[0].right_leaf); } else{ /* degenerate geometry, Target_Dim is 2 or 1 */ Zoltan_Transform_Box_Points(box.lo, box.hi, - rib->Tran.Transformation, rib->Tran.Permutation, 3, + rib->Tran.Transformation, rib->Tran.Permutation, 3, rib->Tran.Target_Dim, p); if (rib->Tran.Target_Dim == 1){ /* box -> line */ box.lo[0] = box.hi[0] = p[0][0]; for (i=1; i<8; i++){ - if (p[i][0] < box.lo[0]) box.lo[0] = p[i][0]; - else if (p[i][0] > box.hi[0]) box.hi[0] = p[i][0]; + if (p[i][0] < box.lo[0]) box.lo[0] = p[i][0]; + else if (p[i][0] > box.hi[0]) box.hi[0] = p[i][0]; } Box_Assign1(zz, itree, &box, include_procs, include_parts, proc_array, parts, numparts, itree[0].right_leaf); @@ -195,7 +158,7 @@ int *numparts) /* number of parts in part list */ else{ /* box -> plane, no longer axis-aligned */ Transformed_Box_Assign(zz, itree, p, rib->Tran.Target_Dim, - include_procs, include_parts, proc_array, parts, numparts, + include_procs, include_parts, proc_array, parts, numparts, itree[0].right_leaf); } } @@ -220,8 +183,8 @@ int *numparts) /* number of parts in part list */ box.lo[0] = box.hi[0] = p[0][0]; for (i=1; i<4; i++){ - if (p[i][0] < box.lo[0]) box.lo[0] = p[i][0]; - else if (p[i][0] > box.hi[0]) box.hi[0] = p[i][0]; + if (p[i][0] < box.lo[0]) box.lo[0] = p[i][0]; + else if (p[i][0] > box.hi[0]) box.hi[0] = p[i][0]; } Box_Assign1(zz, itree, &box, include_procs, include_parts, @@ -240,7 +203,7 @@ int *numparts) /* number of parts in part list */ } } else { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Valid only when load-balancing method is RCB and RIB."); ierr = ZOLTAN_FATAL; goto End; @@ -272,7 +235,7 @@ struct rcb_box *boxpt, /* extended box */ int include_procs, /* Flag: Compute proc lists. */ int include_parts, /* Flag: Compute part lists. */ int *proc_array, /* Array of size Num_Proc; entry i is - incremented if a found part is on + incremented if a found part is on proc i. */ int *parts, /* parts that box is in */ int *numparts, /* current number of parts on list */ @@ -285,7 +248,7 @@ int partmid) /* 1st part in upper half */ /* add part to list of parts */ if (partmid <= 0) { - add_to_list(zz, include_procs, include_parts, proc_array, + add_to_list(zz, include_procs, include_parts, proc_array, parts, numparts, -partmid); return; } @@ -317,7 +280,7 @@ struct rcb_box *box, /* extended box */ int include_procs, /* Flag: Compute proc lists. */ int include_parts, /* Flag: Compute part lists. */ int *proc_array, /* Array of size Num_Proc; entry i is - incremented if a found part is on + incremented if a found part is on proc i. */ int *parts, /* parts that box is in */ int *numparts, /* current number of parts on list */ @@ -330,7 +293,7 @@ int partmid) /* 1st part in upper half */ /* end recursion when part size is a single part */ /* add part to list of parts */ if (partmid <= 0) { - add_to_list(zz, include_procs, include_parts, proc_array, + add_to_list(zz, include_procs, include_parts, proc_array, parts, numparts, -partmid); return; } @@ -401,7 +364,7 @@ int ndims, /* partition reduced to 2 or 1 dimensions */ int include_procs, /* Flag: Compute proc lists. */ int include_parts, /* Flag: Compute part lists. */ int *proc_array, /* Array of size Num_Proc; entry i is - incremented if a found part is on + incremented if a found part is on proc i. */ int *parts, /* parts that box is in */ int *numparts, /* current number of parts on list */ @@ -412,7 +375,7 @@ int partmid) /* 1st part in upper half */ int i; if (partmid <= 0) { - add_to_list(zz, include_procs, include_parts, proc_array, + add_to_list(zz, include_procs, include_parts, proc_array, parts, numparts, -partmid); return; } @@ -440,10 +403,10 @@ int partmid) /* 1st part in upper half */ cut = itree[partmid].cut; if (min <= cut) - Transformed_Box_Assign(zz, itree, p, ndims, include_procs, include_parts, + Transformed_Box_Assign(zz, itree, p, ndims, include_procs, include_parts, proc_array, parts, numparts, itree[partmid].left_leaf); if (max >= cut) - Transformed_Box_Assign(zz, itree, p, ndims, include_procs, include_parts, + Transformed_Box_Assign(zz, itree, p, ndims, include_procs, include_parts, proc_array, parts, numparts, itree[partmid].right_leaf); } @@ -455,7 +418,7 @@ struct rcb_box *box, /* extended box */ int include_procs, /* Flag: Compute proc lists. */ int include_parts, /* Flag: Compute part lists. */ int *proc_array, /* Array of size Num_Proc; entry i is - incremented if a found part is on + incremented if a found part is on proc i. */ int *parts, /* parts that box is in */ int *numparts, /* current number of parts on list */ @@ -468,7 +431,7 @@ int partmid) /* 1st part in upper half */ /* end recursion when part size is a single part */ /* add part to list of parts */ if (partmid <= 0) { - add_to_list(zz, include_procs, include_parts, proc_array, + add_to_list(zz, include_procs, include_parts, proc_array, parts, numparts, -partmid); return; } @@ -524,7 +487,7 @@ struct rcb_box *box, /* extended box */ int include_procs, /* Flag: Compute proc lists. */ int include_parts, /* Flag: Compute part lists. */ int *proc_array, /* Array of size Num_Proc; entry i is - incremented if a found part is on + incremented if a found part is on proc i. */ int *parts, /* parts that box is in */ int *numparts, /* current number of parts on list */ @@ -535,7 +498,7 @@ int partmid) /* 1st part in upper half */ /* end recursion when part size is a single part */ /* add part to list of parts */ if (partmid <= 0) { - add_to_list(zz, include_procs, include_parts, proc_array, + add_to_list(zz, include_procs, include_parts, proc_array, parts, numparts, -partmid); return; } @@ -586,7 +549,7 @@ int i; last_proc = Zoltan_LB_Part_To_Proc(zz, add_part+1, NULL); else last_proc = zz->Num_Proc; - + for (i = add_proc+1; i < last_proc; i++) proc_array[i]++; } diff --git a/packages/zoltan/src/rcb/create_proc_list.c b/packages/zoltan/src/rcb/create_proc_list.c index cb6c674001..b158a82034 100644 --- a/packages/zoltan/src/rcb/create_proc_list.c +++ b/packages/zoltan/src/rcb/create_proc_list.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/rcb/create_proc_list_const.h b/packages/zoltan/src/rcb/create_proc_list_const.h index 4c2aab0e92..4363e3b61f 100644 --- a/packages/zoltan/src/rcb/create_proc_list_const.h +++ b/packages/zoltan/src/rcb/create_proc_list_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __CREATE_PROC_LIST_CONST_H diff --git a/packages/zoltan/src/rcb/inertial.h b/packages/zoltan/src/rcb/inertial.h index e01212e7f0..5718ec793a 100644 --- a/packages/zoltan/src/rcb/inertial.h +++ b/packages/zoltan/src/rcb/inertial.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __INERTIAL_H #define __INERTIAL_H diff --git a/packages/zoltan/src/rcb/inertial1d.c b/packages/zoltan/src/rcb/inertial1d.c index 4f05df999e..d4b9fc987c 100644 --- a/packages/zoltan/src/rcb/inertial1d.c +++ b/packages/zoltan/src/rcb/inertial1d.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/rcb/inertial2d.c b/packages/zoltan/src/rcb/inertial2d.c index 9296264e52..70487dd1d0 100644 --- a/packages/zoltan/src/rcb/inertial2d.c +++ b/packages/zoltan/src/rcb/inertial2d.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -131,7 +94,7 @@ int Zoltan_RIB_inertial2d( tmp1[0] = xcm; tmp1[1] = ycm; tmp1[2] = wgt_sum; Zoltan_RIB_reduce_double(tmp1, tmp2, 3, comm, nproc, rank, proc, 1); xcmt = tmp2[0]; ycmt = tmp2[1]; wgtt = tmp2[2]; - } + } else { tmp1[0] = xcm; tmp1[1] = ycm; tmp1[2] = wgt_sum; MPI_Allreduce(tmp1, tmp2, 3, MPI_DOUBLE, MPI_SUM, comm); diff --git a/packages/zoltan/src/rcb/inertial3d.c b/packages/zoltan/src/rcb/inertial3d.c index 8597b5e2d4..236505d4e9 100644 --- a/packages/zoltan/src/rcb/inertial3d.c +++ b/packages/zoltan/src/rcb/inertial3d.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -149,7 +112,7 @@ int Zoltan_RIB_inertial3d( if (dotpt->nWeights) for (j = 0; j < dotnum; j++) { i = (dindx ? dindx[j] : j); - wgt = dotpt->Weight[i * dotpt->nWeights]; + wgt = dotpt->Weight[i * dotpt->nWeights]; xdif = x[i] - cm[0]; ydif = y[i] - cm[1]; zdif = z[i] - cm[2]; @@ -177,17 +140,17 @@ int Zoltan_RIB_inertial3d( /* Sum tensor across processors */ if (Tflops_Special) { - tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = zz; + tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = zz; tmp1[3] = xy; tmp1[4] = xz; tmp1[5] = yz; Zoltan_RIB_reduce_double(tmp1, tmp2, 6, comm, nproc, rank, proc, 1); - xxt = tmp2[0]; yyt = tmp2[1]; zzt = tmp2[2]; + xxt = tmp2[0]; yyt = tmp2[1]; zzt = tmp2[2]; xyt = tmp2[3]; xzt = tmp2[4]; yzt = tmp2[5]; } else { - tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = zz; + tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = zz; tmp1[3] = xy; tmp1[4] = xz; tmp1[5] = yz; MPI_Allreduce(tmp1, tmp2, 6, MPI_DOUBLE, MPI_SUM, comm); - xxt = tmp2[0]; yyt = tmp2[1]; zzt = tmp2[2]; + xxt = tmp2[0]; yyt = tmp2[1]; zzt = tmp2[2]; xyt = tmp2[3]; xzt = tmp2[4]; yzt = tmp2[5]; } @@ -466,7 +429,7 @@ void Zoltan_RIB_reduce_double(double *in, double *out, int len, MPI_Comm comm, { int i, m, to, tag = 32107; MPI_Status status; - + /* this is a recursive function for Tflops_Special that takes a double vector in and returns the summed vector out for a subset of processors of the entire number of processors. rank is a processors rank within @@ -488,10 +451,10 @@ void Zoltan_RIB_reduce_double(double *in, double *out, int len, MPI_Comm comm, if (m < nproc) Zoltan_RIB_reduce_double(in, out, len, comm, nproc, rank, proc, m); else - for (i = 0; i < len; i++) + for (i = 0; i < len; i++) out[i] = in[i]; MPI_Send(out, len, MPI_DOUBLE, to, tag, comm); - } + } else Zoltan_RIB_reduce_double(in, out, len, comm, nproc, rank, proc, m); } diff --git a/packages/zoltan/src/rcb/point_assign.c b/packages/zoltan/src/rcb/point_assign.c index 6178edd0b6..12176b84ef 100644 --- a/packages/zoltan/src/rcb/point_assign.c +++ b/packages/zoltan/src/rcb/point_assign.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -62,7 +25,7 @@ ZZ *zz, /* The Zoltan structure */ double *coords, int *proc, /* processor that point lands in; if NULL, processor info is not returned. */ -int *part /* part that point lands in; +int *part /* part that point lands in; if NULL, part info is not returned. */ ) { @@ -83,7 +46,7 @@ int *part /* part that point lands in; double *c = coords; if (zz->LB.Data_Structure == NULL) { - ZOLTAN_PRINT_ERROR(-1, yo, + ZOLTAN_PRINT_ERROR(-1, yo, "No Decomposition Data available; use KEEP_CUTS parameter."); ierr = ZOLTAN_FATAL; goto End; @@ -100,7 +63,7 @@ int *part /* part that point lands in; } if (rcb->Tran.Target_Dim > 0){ /* degenerate geometry */ - Zoltan_Transform_Point(c, rcb->Tran.Transformation, + Zoltan_Transform_Point(c, rcb->Tran.Transformation, rcb->Tran.Permutation, rcb->Num_Dim, rcb->Tran.Target_Dim, cnew); c = cnew; } @@ -124,7 +87,7 @@ int *part /* part that point lands in; } if (rib->Tran.Target_Dim > 0){ /* degenerate geometry */ - Zoltan_Transform_Point(c, rib->Tran.Transformation, + Zoltan_Transform_Point(c, rib->Tran.Transformation, rib->Tran.Permutation, rib->Num_Geom, rib->Tran.Target_Dim, cnew); c = cnew; num_geom = rib->Tran.Target_Dim; @@ -178,7 +141,7 @@ int *part /* part that point lands in; if (proc != NULL) { if (zz->LB.Remap) *proc = Zoltan_LB_Part_To_Proc(zz, zz->LB.Remap[-partmid], NULL); - else + else *proc = Zoltan_LB_Part_To_Proc(zz, -partmid, NULL); } diff --git a/packages/zoltan/src/rcb/rcb.c b/packages/zoltan/src/rcb/rcb.c index c06d389071..6474bb2de7 100644 --- a/packages/zoltan/src/rcb/rcb.c +++ b/packages/zoltan/src/rcb/rcb.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -94,7 +57,7 @@ extern "C" { #define RCB_DEFAULT_OVERALLOC 1.2 #define RCB_DEFAULT_REUSE FALSE -/* The median of an array of floating point values is found by iterating +/* The median of an array of floating point values is found by iterating * through candidates. We have two methods for choosing candidates: * * BISECTION - Candidate within region [L, R] is value closest to (L+R)/2 @@ -107,7 +70,7 @@ extern "C" { * this last step with narrowed region until median is found. * * BISECTION works very well if the geometry is symmetric, because the initial - * guess is very close to the true median. + * guess is very close to the true median. * * RANDOM attempts to do less communication at the expense of more local * computation, and is a good choice when running on large numbers of @@ -129,7 +92,7 @@ static int rcb_fn(ZZ *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **, double, int, int, int, int, int, int, int, int, int, int, double, int, int, int, float *); static void print_rcb_tree(ZZ *, int, int, struct rcb_tree *); -static int cut_dimension(int, struct rcb_tree *, int, int, int *, int *, +static int cut_dimension(int, struct rcb_tree *, int, int, int *, int *, struct rcb_box *); static int set_preset_dir(int, int, int, struct rcb_box *, int **); static int serial_rcb(ZZ *, struct Dot_Struct *, int *, int *, int, int, @@ -170,7 +133,7 @@ int Zoltan_RCB( * zz->Obj_Weight_Dim containing the percentage of work to be assigned to each part. */ - int *num_import, /* Returned value: Number of non-local + int *num_import, /* Returned value: Number of non-local objects assigned to this processor in the new decomposition. */ ZOLTAN_ID_PTR *import_global_ids, /* Returned value: array of global IDs for @@ -193,7 +156,7 @@ int Zoltan_RCB( { /* Wrapper routine to set parameter values and call the real rcb. */ double overalloc; /* amount to overallocate by when realloc - of dot array must be done. + of dot array must be done. 1.0 = no extra; 1.5 = 50% extra; etc. */ int reuse; /* (0) don't use (1) use previous cuts stored in treept at initial guesses. */ @@ -208,7 +171,7 @@ int Zoltan_RCB( 1: xyz, 2: xzy, 3: yzx, 4: yxz, 5: zxy, 6: zyx */ int rectilinear_blocks; /* (0) do (1) don't break ties in find_median */ - int obj_wgt_comp; /* 1 if all (multi-)weights for an object + int obj_wgt_comp; /* 1 if all (multi-)weights for an object have same units (comparable), 0 otherwise. */ int mcnorm; /* norm (1,2,3) to use in multicriteria alg. */ double max_aspect_ratio; /* maximum allowed ratio of box dimensions */ @@ -260,8 +223,8 @@ int Zoltan_RCB( reuse_dir = 0; preset_dir = 0; rectilinear_blocks = 0; - obj_wgt_comp = 0; - mcnorm = 1; + obj_wgt_comp = 0; + mcnorm = 1; max_aspect_ratio = 10.; recompute_box = 0; idummy = 0; @@ -296,7 +259,7 @@ int Zoltan_RCB( import_procs, import_to_part, num_export, export_global_ids, overalloc, reuse, wgtflag, check_geom, stats, gen_tree, reuse_dir, preset_dir, - rectilinear_blocks, obj_wgt_comp, mcnorm, + rectilinear_blocks, obj_wgt_comp, mcnorm, max_aspect_ratio, recompute_box, average_cuts, pivot_choice, part_sizes); @@ -309,41 +272,41 @@ static int rcb_fn( ZZ *zz, /* The Zoltan structure with info for the RCB balancer. */ int *num_import, /* Number of non-local objects assigned to this - processor in the new decomposition. + processor in the new decomposition. When LB.Return_Lists==CANDIDATE_LISTS, num_import returns the number of input objects as given by ZOLTAN_NUM_OBJ_FN. */ ZOLTAN_ID_PTR *import_global_ids, /* Returned value: array of global IDs for non-local objects in this processor's new - decomposition. + decomposition. When LB.Return_Lists==CANDIDATE_LISTS, - this array contains GIDs for all input + this array contains GIDs for all input objs as given by ZOLTAN_OBJ_LIST_FN. */ ZOLTAN_ID_PTR *import_local_ids, /* Returned value: array of local IDs for non-local objects in this processor's new - decomposition. + decomposition. When LB.Return_Lists==CANDIDATE_LISTS, - this array contains LIDs for all input + this array contains LIDs for all input objs as given by ZOLTAN_OBJ_LIST_FN. */ int **import_procs, /* Returned value: array of processor IDs for processors owning the non-local objects in - this processor's new decomposition. + this processor's new decomposition. When LB.Return_Lists==CANDIDATE_LISTS, the returned array is NULL. */ int **import_to_part, /* Returned value: array of parts - to which objects are imported. + to which objects are imported. When LB.Return_Lists==CANDIDATE_LISTS, the returned array is NULL. */ - int *num_export, /* Returned value only when + int *num_export, /* Returned value only when LB.Return_Lists==CANDIDATE_LISTS; number of input objs as given by ZOLTAN_NUM_OBJ_FN */ ZOLTAN_ID_PTR *export_global_ids, /* Returned value only when LB.Return_Lists==CANDIDATE_LISTS; for each - input obj (from ZOLTAN_OBJ_LIST_FN), + input obj (from ZOLTAN_OBJ_LIST_FN), return a candidate obj from the part to which the obj is assigned; used in PHG matching */ double overalloc, /* amount to overallocate by when realloc - of dot array must be done. + of dot array must be done. 1.0 = no extra; 1.5 = 50% extra; etc. */ int reuse, /* (0) don't use (1) use previous cuts stored in treept at initial guesses. */ @@ -365,10 +328,10 @@ static int rcb_fn( partition sets at each level of recursion */ int average_cuts, /* Flag forcing median line to be drawn halfway between two closest objects. */ - int pivot_choice, - float *part_sizes /* Input: Array of size - zz->LB.Num_Global_Parts * wgtflag - containing the percentage of work + int pivot_choice, + float *part_sizes /* Input: Array of size + zz->LB.Num_Global_Parts * wgtflag + containing the percentage of work to be assigned to each part. */ ) { @@ -401,7 +364,7 @@ static int rcb_fn( int allocflag; /* have to re-allocate space */ double time1=0,time2=0,time3=0,time4=0; /* timers */ double timestart=0,timestop=0; /* timers */ - double timers[4]={0.,0.,0.,0.}; /* diagnostic timers + double timers[4]={0.,0.,0.,0.}; /* diagnostic timers 0 = start-up time before recursion 1 = time before median iterations 2 = time in median iterations @@ -420,11 +383,11 @@ static int rcb_fn( int use_ids; /* When true, global and local IDs will be stored along with dots in the RCB_STRUCT. When false, storage, manipulation, and - communication of IDs is avoided. + communication of IDs is avoided. Set by call to Zoltan_RB_Use_IDs(). */ RCB_STRUCT *rcb = NULL; /* Pointer to data structures for RCB. */ struct rcb_box *rcbbox = NULL; /* bounding box of final RCB sub-domain */ - struct rcb_tree *treept = NULL; /* tree of RCB cuts - only single cut on + struct rcb_tree *treept = NULL; /* tree of RCB cuts - only single cut on exit */ double start_time=0, end_time=0; @@ -433,12 +396,12 @@ static int rcb_fn( must enter Zoltan_RB_find_bisector when Tflops_Special==1. This flag indicates that the aspect ratio test - failed on this processor, so its + failed on this processor, so its results from Zoltan_RB_find_bisector should be ignored. */ int tfs[2], tmp_tfs[2]; /* added for Tflops_Special; max number of procs and parts over all processors - in each iteration (while loop) of + in each iteration (while loop) of parallel partitioning. */ int old_nprocs; /* added for Tflops_Special */ int old_nparts; /* added for Tflops_Special */ @@ -451,7 +414,7 @@ static int rcb_fn( double wgtscale[RB_MAX_WGTS]; /* weight scaling factors */ double fraclo[RB_MAX_WGTS]; /* desired weight in lower half */ int *dotlist = NULL; /* list of dots used only in find_median; - allocated above find_median for + allocated above find_median for better efficiency (don't necessarily have to realloc for each find_median).*/ int lock_direction = 0; /* flag to determine direction after first @@ -504,20 +467,20 @@ static int rcb_fn( if ((wgtflag > 1) && (pivot_choice == PIVOT_CHOICE_RANDOM)){ /* If RANDOM turns out to be wanted for wgtflag>1, we can implement it */ - ZOLTAN_PRINT_WARN(proc, yo, + ZOLTAN_PRINT_WARN(proc, yo, "random_pivots turned off because it is not implemented for " "multiple weights"); pivot_choice = PIVOT_CHOICE_BISECTION; } - /* - * Determine whether to store, manipulate, and communicate global and + /* + * Determine whether to store, manipulate, and communicate global and * local IDs. */ use_ids = Zoltan_RB_Use_IDs(zz); /* - * Build the RCB Data structure and + * Build the RCB Data structure and * set pointers to information in it. */ @@ -578,7 +541,7 @@ static int rcb_fn( if (zz->LB.Return_Lists == ZOLTAN_LB_CANDIDATE_LISTS) { ierr = Zoltan_RB_Candidates_Copy_Input(zz, dotnum, rcb->Global_IDs, rcb->Local_IDs, - &rcb->Dots, + &rcb->Dots, num_import, import_global_ids, import_local_ids, import_procs, import_to_part); @@ -608,7 +571,7 @@ static int rcb_fn( /* Also, if this is not first time through, send dots to previous proc. */ if (reuse) { - dotpt = &rcb->Dots; + dotpt = &rcb->Dots; pt[1] = pt[2] = 0; if (treept[0].dim != -1) { @@ -623,7 +586,7 @@ static int rcb_fn( } ierr = Zoltan_RB_Point_Assign(zz, pt, &dotmark[i], NULL); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RB_Point_Assign"); goto End; } @@ -647,21 +610,21 @@ static int rcb_fn( allocflag = 0; #if 0 ierr = Zoltan_RB_Send_Dots(zz, &(rcb->Global_IDs), &(rcb->Local_IDs), - &(rcb->Dots), &dotmark, - proc_list, outgoing, + &(rcb->Dots), &dotmark, + proc_list, outgoing, &dotnum, &dotmax, proc, &allocflag, overalloc, stats, reuse_count, use_ids, zz->Communicator); #else ierr = Zoltan_RB_Send_Dots_less_memory(zz, &(rcb->Global_IDs), &(rcb->Local_IDs), - &(rcb->Dots), &dotmark, - proc_list, outgoing, + &(rcb->Dots), &dotmark, + proc_list, outgoing, &dotnum, &dotmax, proc, &allocflag, overalloc, stats, reuse_count, use_ids, zz->Communicator); #endif if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RB_Send_Dots."); goto End; } @@ -728,22 +691,22 @@ static int rcb_fn( if (check_geom) { ierr = Zoltan_RB_check_geom_input(zz, dotpt, dotnum); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RB_check_geom_input"); goto End; } } /* initialize sub-domain bounding box to entire domain */ - compute_RCB_box(rcbbox, dotnum, dotpt, NULL, box_op, box_type, - zz->Communicator, zz->Num_Proc, zz->Proc, zz->Proc, + compute_RCB_box(rcbbox, dotnum, dotpt, NULL, box_op, box_type, + zz->Communicator, zz->Num_Proc, zz->Proc, zz->Proc, zz->Tflops_Special); - /* if preset_dir is turned on, assign cut order according to order of + /* if preset_dir is turned on, assign cut order according to order of directions */ if (preset_dir) { ierr = set_preset_dir(proc, num_parts, preset_dir, rcbbox, &dim_spec); - if (ierr < 0) + if (ierr < 0) goto End; } @@ -770,7 +733,7 @@ static int rcb_fn( } /* Main loop: recursively halve until just one part or proc in set */ - + old_nprocs = num_procs = nprocs; old_nparts = num_parts; partlower = 0; @@ -790,20 +753,20 @@ static int rcb_fn( } level = 0; - while ((num_parts > 1 && num_procs > 1) || + while ((num_parts > 1 && num_procs > 1) || (zz->Tflops_Special && tfs[0] > 1 && tfs[1] > 1)) { - sprintf(msg, "In main RCB loop: num_parts=%d, num_procs=%d\n", + sprintf(msg, "In main RCB loop: num_parts=%d, num_procs=%d\n", num_parts, num_procs); ZOLTAN_TRACE_DETAIL(zz, yo, msg); - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time1 = Zoltan_Time(zz->Timer); - ierr = Zoltan_Divide_Machine(zz, zz->Obj_Weight_Dim, part_sizes, - proc, local_comm, &set, - &proclower, &procmid, &num_procs, - &partlower, &partmid, &num_parts, + ierr = Zoltan_Divide_Machine(zz, zz->Obj_Weight_Dim, part_sizes, + proc, local_comm, &set, + &proclower, &procmid, &num_procs, + &partlower, &partmid, &num_parts, fraclo); if (ierr < 0) { ZOLTAN_PRINT_ERROR(proc, yo, "Error in Zoltan_Divide_Machine."); @@ -836,14 +799,14 @@ static int rcb_fn( if (recompute_box) { /* Compute bounding box for partition set */ compute_RCB_box(rcbbox, dotnum, dotpt, NULL, box_op, box_type, - local_comm, old_nprocs, proc - proclower, proc, + local_comm, old_nprocs, proc - proclower, proc, zz->Tflops_Special); } /* Compute max box length. */ max_box = 0.0; for (dim=0; dim<3; dim++) - if (rcbbox->hi[dim] - rcbbox->lo[dim] > max_box) + if (rcbbox->hi[dim] - rcbbox->lo[dim] > max_box) max_box = rcbbox->hi[dim] - rcbbox->lo[dim]; /* try all cut directions and pick best one. */ @@ -866,7 +829,7 @@ static int rcb_fn( /* One cut direction only */ if (one_cut_dir){ - dim = cut_dimension(lock_direction, treept, partmid, + dim = cut_dimension(lock_direction, treept, partmid, preset_dir, dim_spec, &level, rcbbox); breakflag= 1; } @@ -878,7 +841,7 @@ static int rcb_fn( if (zz->Tflops_Special)/* All procs must participate in find_bisector; compute cut but don't use the results. */ tfs_disregard_results = 1; - else + else continue; } @@ -899,18 +862,18 @@ static int rcb_fn( first_guess = 1; } else first_guess = 0; - - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time2 = Zoltan_Time(zz->Timer); - + if (wgtflag <= 1){ if (pivot_choice == PIVOT_CHOICE_BISECTION){ - if (!Zoltan_RB_find_median( + if (!Zoltan_RB_find_median( zz->Tflops_Special, pts, dotpt->Weight, dotpt->uniformWeight, - dotmark, dotnum, proc, + dotmark, dotnum, proc, fraclo, local_comm, &valuehalf, first_guess, - nprocs, old_nprocs, proclower, old_nparts, - wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], + nprocs, old_nprocs, proclower, old_nparts, + wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], weight[0], weightlo, weighthi, dotlist, rectilinear_blocks, average_cuts)) { ZOLTAN_PRINT_ERROR(proc, yo, @@ -922,10 +885,10 @@ static int rcb_fn( else{ if (!Zoltan_RB_find_median_randomized( zz->Tflops_Special, pts, dotpt->Weight, dotpt->uniformWeight, - dotmark, dotnum, proc, + dotmark, dotnum, proc, fraclo, local_comm, &valuehalf, first_guess, - nprocs, old_nprocs, proclower, old_nparts, - wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], + nprocs, old_nprocs, proclower, old_nparts, + wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], weight[0], weightlo, weighthi, dotlist, rectilinear_blocks, average_cuts)) { ZOLTAN_PRINT_ERROR(proc, yo, @@ -935,14 +898,14 @@ static int rcb_fn( } } } - else { + else { if (Zoltan_RB_find_bisector( zz, zz->Tflops_Special, pts, dotpt->Weight, dotpt->uniformWeight, - dotmark, dotnum, - wgtflag, mcnorm, fraclo, local_comm, + dotmark, dotnum, + wgtflag, mcnorm, fraclo, local_comm, &valuehalf, first_guess, - old_nprocs, proclower, old_nparts, - rcbbox->lo[dim], rcbbox->hi[dim], + old_nprocs, proclower, old_nparts, + rcbbox->lo[dim], rcbbox->hi[dim], weight, weightlo, weighthi, &norm_max, dotlist, rectilinear_blocks, average_cuts) != ZOLTAN_OK) { @@ -953,10 +916,10 @@ static int rcb_fn( } /* test for better balance */ - if ((!one_cut_dir) && + if ((!one_cut_dir) && ((norm_best<0.) || (!tfs_disregard_results && (norm_max < norm_best)))) { - norm_best = norm_max; + norm_best = norm_max; dim_best = dim; for (j=0; jDebug_Level >= ZOLTAN_DEBUG_ALL){ printf("[%1d] Debug: cut dim=%1d, norm_max=%f, dim_best=%1d, " - "norm_best=%f, cut value=%f\n", + "norm_best=%f, cut value=%f\n", proc, dim, norm_max, dim_best, norm_best, valuehalf); if (wgtflag>1) printf("[%1d] Debug: weightlo=(%f,%f), weighthi=(%f,%f)\n", @@ -981,7 +944,7 @@ static int rcb_fn( if (!one_cut_dir){ /* We have tried all cut directions. Restore best result. */ if (dim_best<0){ - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Zoltan could not find any valid RCB cut."); ierr = ZOLTAN_FATAL; goto End; @@ -999,7 +962,7 @@ static int rcb_fn( ZOLTAN_FREE(&dotmark_best); if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] Debug: BEST dim=%1d, cut value=%f, norm_max=%f \n", + printf("[%1d] Debug: BEST dim=%1d, cut value=%f, norm_max=%f \n", proc, dim, valuehalf, norm_max); if (wgtflag>1) printf("[%1d] Debug: BEST weightlo=(%f,%f), weighthi=(%f,%f)\n", @@ -1012,13 +975,13 @@ static int rcb_fn( else for (j=0; jDebug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time3 = Zoltan_Time(zz->Timer); /* store cut info in tree only if proc "owns" partmid */ - /* test of partmid > 0 prevents treept[0] being set when this cut is + /* test of partmid > 0 prevents treept[0] being set when this cut is only removing low-numbered processors (proclower to procmid-1) that - have no parts in them from the processors remaining to + have no parts in them from the processors remaining to be partitioned. */ if (treept && partmid > 0 && partmid == fp) { treept[partmid].dim = dim; @@ -1029,12 +992,12 @@ static int rcb_fn( treept[partmid].left_leaf = -partlower; treept[partmid].right_leaf = -partmid; } - if (old_nprocs > 1 && partmid > 0 && partmid != partlower + old_nparts) { - /* old_nprocs > 1 test: Don't reset these values if proc is in loop only + if (old_nprocs > 1 && partmid > 0 && partmid != partlower + old_nparts) { + /* old_nprocs > 1 test: Don't reset these values if proc is in loop only * because of other procs for Tflops_Special. * partmid > 0 test: Don't reset these values if low-numbered processors * (proclower to procmid-1) have zero parts and this cut is removing - * them from the processors remaining to be partitioned. + * them from the processors remaining to be partitioned. * partmid != partlower + old_nparts test: Don't reset these values if * cut is removing high-numbered processors with zero parts from * the processors remaining to be partitioned. @@ -1042,7 +1005,7 @@ static int rcb_fn( old_set = set; root = partmid; } - + /* use cut to shrink RCB domain bounding box */ if (old_nprocs > 1) { @@ -1058,7 +1021,7 @@ static int rcb_fn( &(rcb->Dots), &dotmark, &dottop, &dotnum, &dotmax, set, &allocflag, overalloc, - stats, counters, use_ids, + stats, counters, use_ids, local_comm, proclower, old_nprocs, partlower, partmid); if (ierr < 0) { @@ -1105,7 +1068,7 @@ static int rcb_fn( &dotnum, &dotmax, &allocflag, overalloc, stats, counters, use_ids); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_RB_Send_To_Part"); goto End; } @@ -1141,14 +1104,14 @@ static int rcb_fn( ierr = serial_rcb(zz, &rcb->Dots, dotmark, dotlist, old_set, root, rcbbox, weight, dotnum, num_parts, - &(dindx[0]), &(tmpdindx[0]), partlower, - proc, wgtflag, lock_direction, reuse, stats, gen_tree, - preset_dir, - rectilinear_blocks, obj_wgt_comp, mcnorm, + &(dindx[0]), &(tmpdindx[0]), partlower, + proc, wgtflag, lock_direction, reuse, stats, gen_tree, + preset_dir, + rectilinear_blocks, obj_wgt_comp, mcnorm, recompute_box, - box_op, box_type, average_cuts, + box_op, box_type, average_cuts, counters, treept, dim_spec, level, - coord, wgts, part_sizes, wgtscale, rcb->Num_Dim, pivot_choice, + coord, wgts, part_sizes, wgtscale, rcb->Num_Dim, pivot_choice, max_aspect_ratio, timers); if (ierr < 0) { ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from serial_rcb"); @@ -1170,7 +1133,7 @@ static int rcb_fn( ierr = Zoltan_RB_check_geom_output(zz, &rcb->Dots, part_sizes, np, fp, dotnum, pdotnum, rcbbox); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RB_check_geom_output"); goto End; } @@ -1179,7 +1142,7 @@ static int rcb_fn( EndReporting: /* update calling routine parameters */ - + start_time = Zoltan_Time(zz->Timer); pdotnum = dotnum; @@ -1191,7 +1154,7 @@ static int rcb_fn( &(rcb->Dots), &dotnum, &dotmax, &allocflag, overalloc, stats, counters, use_ids); /* Note: dottop is no longer valid after remapping. Remapping might - destroy the nice local-followed-by-non-local ordering of the + destroy the nice local-followed-by-non-local ordering of the dots array. Do not use dottop after remapping. */ if (ierr < 0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_RB_Remap."); @@ -1201,13 +1164,13 @@ static int rcb_fn( /* build return arguments */ - if (zz->LB.Return_Lists != ZOLTAN_LB_NO_LISTS && + if (zz->LB.Return_Lists != ZOLTAN_LB_NO_LISTS && zz->LB.Return_Lists != ZOLTAN_LB_CANDIDATE_LISTS) { /* zz->LB.Return_Lists is true ==> use_ids is true */ - ierr = Zoltan_RB_Return_Arguments(zz, rcb->Global_IDs, rcb->Local_IDs, + ierr = Zoltan_RB_Return_Arguments(zz, rcb->Global_IDs, rcb->Local_IDs, &rcb->Dots, num_import, import_global_ids, import_local_ids, - import_procs, import_to_part, + import_procs, import_to_part, dotnum); if (ierr < 0) { ZOLTAN_PRINT_ERROR(proc,yo, @@ -1219,7 +1182,7 @@ static int rcb_fn( /* Select a candidate for each part and return it in the export_GIDs. */ ierr = Zoltan_RB_Candidates_Output(zz, dotnum, dindx, rcb->Global_IDs, rcb->Local_IDs, - &rcb->Dots, + &rcb->Dots, *num_import, *import_global_ids, num_export, export_global_ids); if (ierr < 0) { @@ -1250,7 +1213,7 @@ static int rcb_fn( ierr = Zoltan_RB_Tree_Gatherv(zz, sizeof(struct rcb_tree), &sendcount, recvcount, displ); - /* + /* * Create copy of treept so that MPI_Allgatherv doesn't use same * memory for sending and receiving; removes valgrind warning. */ @@ -1275,7 +1238,7 @@ static int rcb_fn( end_time = Zoltan_Time(zz->Timer); lb_time[0] += (end_time - start_time); - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) Zoltan_RB_stats(zz, timestop-timestart,&rcb->Dots,dotnum,part_sizes, timers,counters,stats,reuse_count,rcbbox,reuse); @@ -1283,15 +1246,15 @@ static int rcb_fn( if (zz->Proc == zz->Debug_Proc) { printf("ZOLTAN RCB Times: \n"); } - Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[0], + Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[0], "ZOLTAN Build: "); - Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[1], + Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[1], "ZOLTAN RCB: "); } if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) { /* zz->Debug_Level >= ZOLTAN_DEBUG_ALL ==> use_ids is true */ - Zoltan_RB_Print_All(zz, rcb->Global_IDs, &rcb->Dots, + Zoltan_RB_Print_All(zz, rcb->Global_IDs, &rcb->Dots, dotnum, *num_import, *import_global_ids, *import_procs); } @@ -1325,7 +1288,7 @@ static int rcb_fn( } ZOLTAN_TRACE_EXIT(zz, yo); - return(ierr); + return(ierr); } @@ -1400,7 +1363,7 @@ int dim; dim = 0; if (rcbbox->hi[1] - rcbbox->lo[1] > rcbbox->hi[0] - rcbbox->lo[0]) dim = 1; - if (dim == 0 && + if (dim == 0 && rcbbox->hi[2] - rcbbox->lo[2] > rcbbox->hi[0] - rcbbox->lo[0]) dim = 2; if (dim == 1 && @@ -1437,7 +1400,7 @@ int ierr = ZOLTAN_OK; int dim = 0; if (preset_dir < 0 || preset_dir > 6) { - ZOLTAN_PRINT_WARN(proc, yo, + ZOLTAN_PRINT_WARN(proc, yo, "Parameter RCB_SET_DIRECTIONS out of bounds; reset to 1."); ierr = ZOLTAN_WARN; preset_dir = 1; @@ -1518,17 +1481,17 @@ static int serial_rcb( struct Dot_Struct *dotpt, /* pointer to rcb->Dots. */ int *dotmark, /* which side of median for each dot */ int *dotlist, /* list of dots used only in find_median; - allocated above find_median for + allocated above find_median for better efficiency (don't necessarily have to realloc for each find_median).*/ - int old_set, /* Set the objects to be partitioned were in + int old_set, /* Set the objects to be partitioned were in for last cut */ int root, /* part for which last cut was stored. */ struct rcb_box *rcbbox, /* bounding box of RCB sub-domain */ double *weight, /* weight(s) for current set */ int dotnum, /* number of input dots */ int num_parts, /* number of parts to create. */ - int *dindx, /* Index into dotpt for dotnum dots to be + int *dindx, /* Index into dotpt for dotnum dots to be partitioned; reordered in serial_rcb so set0 dots are followed by set1 dots. */ int *tmpdindx, /* Temporary memory used in reordering dindx. */ @@ -1564,7 +1527,7 @@ static int serial_rcb( double *wgtscale, /* Array of size wgtflag that gives the scaling factors for each weight dimension. */ int ndim, /* number of geometric dimensions */ - int pivot_choice, + int pivot_choice, double max_aspect_ratio, double timers[] /* as in rcb_fn */ ) @@ -1583,7 +1546,7 @@ static int serial_rcb( double weighthi[RB_MAX_WGTS]; /* weight in upper half */ double weightlo_best[RB_MAX_WGTS]; /* temp weightlo */ double weighthi_best[RB_MAX_WGTS]; /* temp weighthi */ - int set0, set1, breakflag; + int set0, set1, breakflag; int one_cut_dir=1; struct rcb_box tmpbox; int *dotmark0 = NULL; /* temp dotmark array */ @@ -1603,7 +1566,7 @@ static int serial_rcb( dotpt->Part[dindx[i]] = partlower; } else { - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) start_time = Zoltan_Time(zz->Timer); ierr = Zoltan_Divide_Parts(zz, zz->Obj_Weight_Dim, part_sizes, num_parts, @@ -1612,7 +1575,7 @@ static int serial_rcb( /* Compute max box length. */ max_box = 0.0; for (dim=0; dim<3; dim++) - if (rcbbox->hi[dim] - rcbbox->lo[dim] > max_box) + if (rcbbox->hi[dim] - rcbbox->lo[dim] > max_box) max_box = rcbbox->hi[dim] - rcbbox->lo[dim]; /* try all cut directions and pick best one. */ @@ -1633,7 +1596,7 @@ static int serial_rcb( if (recompute_box) { /* Compute bounding box for partition set */ - compute_RCB_box(rcbbox, dotnum, dotpt, dindx, + compute_RCB_box(rcbbox, dotnum, dotpt, dindx, box_op, box_type, MPI_COMM_SELF, 1, 0, proc, 0); } @@ -1641,14 +1604,14 @@ static int serial_rcb( /* One cut direction only */ if (one_cut_dir){ - dim = cut_dimension(lock_direction, treept, partmid, + dim = cut_dimension(lock_direction, treept, partmid, preset_dir, dim_spec, &level, rcbbox); breakflag= 1; } else { /* Do not cut along this dimension if box is too thin. */ - if (rcbbox->hi[dim] - rcbbox->lo[dim] < max_box/max_aspect_ratio) + if (rcbbox->hi[dim] - rcbbox->lo[dim] < max_box/max_aspect_ratio) continue; /* Restore original dotmark array. */ @@ -1688,15 +1651,15 @@ static int serial_rcb( timers[1] += end_time - start_time; start_time = end_time; } - + if (wgtflag <= 1){ /* Call find_median with Tflops_Special == 0; avoids communication */ if (pivot_choice == PIVOT_CHOICE_BISECTION){ if (!Zoltan_RB_find_median( - 0, coord, wgts, uniformWeight, dotmark, dotnum, proc, - fractionlo, MPI_COMM_SELF, &valuehalf, + 0, coord, wgts, uniformWeight, dotmark, dotnum, proc, + fractionlo, MPI_COMM_SELF, &valuehalf, first_guess, zz->Num_Proc, 1, zz->Proc, num_parts, - wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], + wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], weight[0], weightlo, weighthi, dotlist, rectilinear_blocks, average_cuts)) { ZOLTAN_PRINT_ERROR(proc, yo,"Error returned from Zoltan_RB_find_median."); @@ -1704,13 +1667,13 @@ static int serial_rcb( goto End; } } - else{ + else{ if (!Zoltan_RB_find_median_randomized( - 0, coord, wgts, uniformWeight, dotmark, dotnum, proc, - fractionlo, MPI_COMM_SELF, &valuehalf, + 0, coord, wgts, uniformWeight, dotmark, dotnum, proc, + fractionlo, MPI_COMM_SELF, &valuehalf, first_guess, zz->Num_Proc, 1, zz->Proc, num_parts, - wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], + wgtflag, rcbbox->lo[dim], rcbbox->hi[dim], weight[0], weightlo, weighthi, dotlist, rectilinear_blocks, average_cuts)) { ZOLTAN_PRINT_ERROR(proc, yo,"Error returned from Zoltan_RB_find_median."); @@ -1719,14 +1682,14 @@ static int serial_rcb( } } } - else { + else { /* Call find_bisector with Tflops_Special == 0; avoids communication */ if (Zoltan_RB_find_bisector( - zz, 0, coord, wgts, uniformWeight, dotmark, dotnum, - wgtflag, mcnorm, fractionlo, MPI_COMM_SELF, - &valuehalf, first_guess, - 1, zz->Proc, num_parts, - rcbbox->lo[dim], rcbbox->hi[dim], + zz, 0, coord, wgts, uniformWeight, dotmark, dotnum, + wgtflag, mcnorm, fractionlo, MPI_COMM_SELF, + &valuehalf, first_guess, + 1, zz->Proc, num_parts, + rcbbox->lo[dim], rcbbox->hi[dim], weight, weightlo, weighthi, &norm_max, dotlist, rectilinear_blocks, average_cuts) != ZOLTAN_OK) { @@ -1736,10 +1699,10 @@ static int serial_rcb( } /* test for better balance */ - if ((!one_cut_dir) && + if ((!one_cut_dir) && ((norm_best<0.) || (norm_max < norm_best))) { - norm_best = norm_max; + norm_best = norm_max; dim_best = dim; for (j=0; jDebug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] Debug: cut dim=%1d, norm_max=%f, dim_best=%1d, norm_best=%f, cut value=%f\n", + printf("[%1d] Debug: cut dim=%1d, norm_max=%f, dim_best=%1d, norm_best=%f, cut value=%f\n", proc, dim, norm_max, dim_best, norm_best, valuehalf); if (wgtflag>1) printf("[%1d] Debug: weightlo=(%f,%f), weighthi=(%f,%f)\n", @@ -1763,7 +1726,7 @@ static int serial_rcb( if (!one_cut_dir){ /* We have tried all cut directions. Restore best result. */ if (dim_best<0){ - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Zoltan could not find any valid RCB cut."); ierr = ZOLTAN_FATAL; goto End; @@ -1781,7 +1744,7 @@ static int serial_rcb( ZOLTAN_FREE(&dotmark_best); if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL){ - printf("[%1d] Debug: BEST dim=%1d, cut value=%f, norm_max=%f \n", + printf("[%1d] Debug: BEST dim=%1d, cut value=%f, norm_max=%f \n", proc, dim, valuehalf, norm_max); if (wgtflag>1) printf("[%1d] Debug: BEST weightlo=(%f,%f), weighthi=(%f,%f)\n", @@ -1804,7 +1767,7 @@ static int serial_rcb( /* Create new dindx, grouping set 0 and set 1 dots together */ for (set0 = 0, set1 = dotnum, i = 0; i < dotnum; i++) { - if (dotmark[i] == 0) + if (dotmark[i] == 0) tmpdindx[set0++] = dindx[i]; else tmpdindx[--set1] = dindx[i]; @@ -1824,12 +1787,12 @@ static int serial_rcb( tmpbox.hi[dim] = valuehalf; ierr = serial_rcb(zz, dotpt, dotmark, dotlist, 0, root, &tmpbox, weightlo, set0, new_nparts, - &(dindx[0]), &(tmpdindx[0]), partlower, - proc, wgtflag, lock_direction, reuse, stats, gen_tree, - preset_dir, - rectilinear_blocks, obj_wgt_comp, mcnorm, + &(dindx[0]), &(tmpdindx[0]), partlower, + proc, wgtflag, lock_direction, reuse, stats, gen_tree, + preset_dir, + rectilinear_blocks, obj_wgt_comp, mcnorm, recompute_box, - box_op, box_type, average_cuts, + box_op, box_type, average_cuts, counters, treept, dim_spec, level, coord, wgts, part_sizes, wgtscale, ndim, pivot_choice, max_aspect_ratio, timers); @@ -1846,8 +1809,8 @@ static int serial_rcb( tmpbox.lo[dim] = valuehalf; ierr = serial_rcb(zz, dotpt, dotmark, dotlist, 1, root, &tmpbox, weighthi, dotnum-set0, new_nparts, - &(dindx[set1]), &(tmpdindx[set1]), partmid, - proc, wgtflag, lock_direction, reuse, stats, gen_tree, + &(dindx[set1]), &(tmpdindx[set1]), partmid, + proc, wgtflag, lock_direction, reuse, stats, gen_tree, preset_dir, rectilinear_blocks, obj_wgt_comp, mcnorm, recompute_box, box_op, box_type, average_cuts, @@ -1874,9 +1837,9 @@ static void compute_RCB_box( struct rcb_box *rcbbox, /* bounding box of RCB sub-domain */ int dotnum, /* # of dots on this processor */ struct Dot_Struct *dotpt, /* temporary pointer to rcb->Dots. */ - int *dindx, /* Index into dotpt used by serial RCB; + int *dindx, /* Index into dotpt used by serial RCB; NULL for parallel rcb. */ - MPI_Op box_op, + MPI_Op box_op, MPI_Datatype box_type, MPI_Comm comm, int nproc, /* number of processors */ @@ -1900,7 +1863,7 @@ struct rcb_box boxtmp; boxtmp.hi[1] = boxtmp.lo[1] = 0; } } - + for (i = 0; i < dotnum; i++) { k = (dindx ? dindx[i] : i); diff --git a/packages/zoltan/src/rcb/rcb.h b/packages/zoltan/src/rcb/rcb.h index 345171ceb0..c4d0d9ef18 100644 --- a/packages/zoltan/src/rcb/rcb.h +++ b/packages/zoltan/src/rcb/rcb.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RCB_H @@ -79,19 +42,19 @@ struct rcb_box { /* bounding box */ }; typedef struct RCB_Struct { - ZOLTAN_ID_PTR Global_IDs; /* Pointer to array of global IDs; global ID of + ZOLTAN_ID_PTR Global_IDs; /* Pointer to array of global IDs; global ID of Dots[i] starts in Global_IDs[i*zz->Num_GID]. Because zz->Num_GID is determined at runtime, this info is most easily stored, allocated and - reallocated separately from Dots. - This array is NOT used if Zoltan_RB_Use_IDs + reallocated separately from Dots. + This array is NOT used if Zoltan_RB_Use_IDs returns FALSE. */ - ZOLTAN_ID_PTR Local_IDs; /* Pointer to array of local IDs; local ID of + ZOLTAN_ID_PTR Local_IDs; /* Pointer to array of local IDs; local ID of Dots[i] starts in Local_IDs[i*zz->Num_LID]. Because zz->Num_LID is determined at runtime, this info is most easily stored, allocated and - reallocated separately from Dots. - This array is NOT used if Zoltan_RB_Use_IDs + reallocated separately from Dots. + This array is NOT used if Zoltan_RB_Use_IDs returns FALSE. */ struct Dot_Struct Dots; /* coordinates, weights, etc */ struct rcb_tree *Tree_Ptr; diff --git a/packages/zoltan/src/rcb/rcb_box.c b/packages/zoltan/src/rcb/rcb_box.c index 5c92d47167..96327ca700 100644 --- a/packages/zoltan/src/rcb/rcb_box.c +++ b/packages/zoltan/src/rcb/rcb_box.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -91,21 +54,21 @@ int i, ierr = ZOLTAN_OK; *ndim = -1; if (zz->LB.Data_Structure == NULL) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "No Decomposition Data available; use KEEP_CUTS parameter."); ierr = ZOLTAN_FATAL; goto End; } if (zz->LB.Method != RCB) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Function can be used only with LB_METHOD == RCB."); ierr = ZOLTAN_FATAL; goto End; } if (part < 0 || part >= zz->LB.Num_Global_Parts) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Invalid part number."); ierr = ZOLTAN_FATAL; goto End; diff --git a/packages/zoltan/src/rcb/rcb_const.h b/packages/zoltan/src/rcb/rcb_const.h index c8900f7d80..ab0d86afb5 100644 --- a/packages/zoltan/src/rcb/rcb_const.h +++ b/packages/zoltan/src/rcb/rcb_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RCB_CONST_H diff --git a/packages/zoltan/src/rcb/rcb_params.h b/packages/zoltan/src/rcb/rcb_params.h index 08dbedece5..d2cce4d233 100644 --- a/packages/zoltan/src/rcb/rcb_params.h +++ b/packages/zoltan/src/rcb/rcb_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RCB_PARAMS_H #define __RCB_PARAMS_H diff --git a/packages/zoltan/src/rcb/rcb_partition_tree.c b/packages/zoltan/src/rcb/rcb_partition_tree.c index 15bfd9be84..7e273d2981 100644 --- a/packages/zoltan/src/rcb/rcb_partition_tree.c +++ b/packages/zoltan/src/rcb/rcb_partition_tree.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/rcb/rcb_util.c b/packages/zoltan/src/rcb/rcb_util.c index 1d69f09fe9..187fba69cc 100644 --- a/packages/zoltan/src/rcb/rcb_util.c +++ b/packages/zoltan/src/rcb/rcb_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "zz_const.h" #include "rcb.h" @@ -55,7 +18,7 @@ int Zoltan_RCB_Build_Structure(ZZ *zz, int *num_obj, int *max_obj, int wgtflag, double overalloc, int use_ids, int gen_tree) { /* - * Function to build the geometry-based data structures for + * Function to build the geometry-based data structures for * Steve Plimpton's RCB implementation. */ char *yo = "Zoltan_RCB_Build_Structure"; @@ -120,7 +83,7 @@ int i, ierr = 0; &(rcb->Num_Dim), wgtflag, overalloc, use_ids, 1); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_RB_Build_Structure."); Zoltan_RCB_Free_Structure(zz); return(ierr); @@ -227,7 +190,7 @@ void Zoltan_RCB_Serialize_Structure(ZZ const *zz, char **buf) memcpy(bufptr, (void *)(zzrcb->Box), sizeof(struct rcb_box)); bufptr += sizeof(struct rcb_box); - memcpy(bufptr, (const void *) &(zzrcb->Tran), sizeof(ZZ_Transform)); + memcpy(bufptr, (void *) &(zzrcb->Tran), sizeof(ZZ_Transform)); bufptr += sizeof(ZZ_Transform); *buf = bufptr; diff --git a/packages/zoltan/src/rcb/rib.c b/packages/zoltan/src/rcb/rib.c index cae1c5dfd1..8f8c93d796 100644 --- a/packages/zoltan/src/rcb/rib.c +++ b/packages/zoltan/src/rcb/rib.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -113,11 +76,11 @@ int Zoltan_RIB_Set_Param( int Zoltan_RIB( ZZ *zz, /* The Zoltan structure with info for the RIB balancer. */ - float *part_sizes, /* Input: Array of size + float *part_sizes, /* Input: Array of size zz->Num_Global_Parts * max(zz->Obj_Weight_Dim, 1) containing the percentage of work to be assigned to each part. */ - int *num_import, /* Returned value: Number of non-local + int *num_import, /* Returned value: Number of non-local objects assigned to this processor in the new decomposition.*/ ZOLTAN_ID_PTR *import_global_ids, /* Returned value: array of global IDs for @@ -182,7 +145,7 @@ int Zoltan_RIB( if (final_output && (stats < 1)){ /* FINAL_OUTPUT is a graph/phg param, corresponds to our OUTPUT_LEVEL 1 */ - stats = 1; + stats = 1; } ierr = rib_fn(zz, num_import, import_global_ids, import_local_ids, @@ -200,37 +163,37 @@ static int rib_fn( ZZ *zz, /* The Zoltan structure with info for the RIB balancer. */ int *num_import, /* Number of non-local objects assigned to - this processor in the new decomposition. + this processor in the new decomposition. When LB.Return_Lists==CANDIDATE_LISTS, num_import returns the number of input objects as given by ZOLTAN_NUM_OBJ_FN. */ ZOLTAN_ID_PTR *import_global_ids, /* Returned value: array of global IDs for non-local objects in this processor's new - decomposition. + decomposition. When LB.Return_Lists==CANDIDATE_LISTS, - this array contains GIDs for all input + this array contains GIDs for all input objs as given by ZOLTAN_OBJ_LIST_FN.*/ ZOLTAN_ID_PTR *import_local_ids, /* Returned value: array of local IDs for non-local objects in this processor's new - decomposition. + decomposition. When LB.Return_Lists==CANDIDATE_LISTS, - this array contains LIDs for all input + this array contains LIDs for all input objs as given by ZOLTAN_OBJ_LIST_FN.*/ int **import_procs, /* Returned value: array of processor IDs for processors owning the non-local objects in - this processor's new decomposition. + this processor's new decomposition. When LB.Return_Lists==CANDIDATE_LISTS, the returned array is NULL. */ int **import_to_part, /* Returned value: array of parts to - which objects are imported. + which objects are imported. When LB.Return_Lists==CANDIDATE_LISTS, the returned array is NULL. */ - int *num_export, /* Returned value only when + int *num_export, /* Returned value only when LB.Return_Lists==CANDIDATE_LISTS; number of input objs as given by ZOLTAN_NUM_OBJ_FN */ ZOLTAN_ID_PTR *export_global_ids, /* Returned value only when LB.Return_Lists==CANDIDATE_LISTS; for each - input obj (from ZOLTAN_OBJ_LIST_FN), + input obj (from ZOLTAN_OBJ_LIST_FN), return a candidate obj from the part to which the obj is assigned; used in PHG matching */ double overalloc, /* amount to overallocate by when realloc @@ -276,7 +239,7 @@ static int rib_fn( double time1=0,time2=0; /* timers */ double time3=0,time4=0; /* timers */ double timestart=0,timestop=0; /* timers */ - double timers[4]={0.,0.,0.,0.}; + double timers[4]={0.,0.,0.,0.}; /* diagnostic timers 0 = start-up time before recursion 1 = time before median iterations @@ -294,7 +257,7 @@ static int rib_fn( int use_ids; /* When true, global and local IDs will be stored along with dots in the RCB_STRUCT. When false, storage, manipulation, and - communication of IDs is avoided. + communication of IDs is avoided. Set by call to Zoltan_RB_Use_IDs(). */ RIB_STRUCT *rib = NULL; /* Pointer to data structures for RIB */ @@ -357,7 +320,7 @@ static int rib_fn( ierr = Zoltan_RIB_Build_Structure(zz, &pdotnum, &dotmax, wgtflag, overalloc, use_ids, gen_tree); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RIB_Build_Structure."); goto End; } @@ -384,9 +347,9 @@ static int rib_fn( counters[6] = 0; /* Ensure there are dots */ - + MPI_Allreduce(&dotnum, &i, 1, MPI_INT, MPI_MAX, zz->Communicator); - + if (i == 0){ if (proc == 0){ ZOLTAN_PRINT_WARN(proc, yo, "RIB partitioning called with no objects"); @@ -499,16 +462,16 @@ static int rib_fn( tfs[1] = num_parts; } - while ((num_parts > 1 && num_procs > 1) || + while ((num_parts > 1 && num_procs > 1) || (zz->Tflops_Special && tfs[0] > 1 && tfs[1] > 1)) { - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time1 = Zoltan_Time(zz->Timer); - ierr = Zoltan_Divide_Machine(zz, zz->Obj_Weight_Dim, part_sizes, - proc, local_comm, &set, - &proclower, &procmid, &num_procs, - &partlower, &partmid, &num_parts, + ierr = Zoltan_Divide_Machine(zz, zz->Obj_Weight_Dim, part_sizes, + proc, local_comm, &set, + &proclower, &procmid, &num_procs, + &partlower, &partmid, &num_parts, fractionlo); if (ierr < 0) { ZOLTAN_PRINT_ERROR(proc, yo, "Error in Zoltan_Divide_Machine."); @@ -540,33 +503,33 @@ static int rib_fn( } dotpt = &rib->Dots; - + if (old_nparts > 1 && old_nprocs > 1) { /* test added for Tflops_Special; compute values only if looping to decompose, not if looping to keep Tflops_Special happy. */ - ierr = compute_rib_direction(zz, zz->Tflops_Special, rib->Num_Geom, - &valuelo, &valuehi, dotpt, NULL, dotnum, + ierr = compute_rib_direction(zz, zz->Tflops_Special, rib->Num_Geom, + &valuelo, &valuehi, dotpt, NULL, dotnum, wgtflag, cm, evec, value, local_comm, proc, old_nprocs, proclower); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from compute_rib_direction"); goto End; } } - else { /* For Tflops_Special: initialize value when looping only + else { /* For Tflops_Special: initialize value when looping only for Tflops_Special */ for (i = 0; i < dotmax; i++) value[i] = 0.0; valuelo = valuehi = 0.0; } - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time2 = Zoltan_Time(zz->Timer); if (!Zoltan_RB_find_median( - zz->Tflops_Special, value, dotpt->Weight, dotpt->uniformWeight, dotmark, dotnum, proc, + zz->Tflops_Special, value, dotpt->Weight, dotpt->uniformWeight, dotmark, dotnum, proc, fractionlo, local_comm, &valuehalf, first_guess, nprocs, old_nprocs, proclower, old_nparts, wgtflag, valuelo, valuehi, weight[0], weightlo, @@ -576,19 +539,19 @@ static int rib_fn( ierr = ZOLTAN_FATAL; goto End; } - + if (set) /* set weight for current part */ for (j=0; jDebug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time3 = Zoltan_Time(zz->Timer); /* store cut info in tree only if proc "owns" partmid */ - /* test of partmid > 0 prevents treept[0] being set when this cut is + /* test of partmid > 0 prevents treept[0] being set when this cut is only removing low-numbered processors (proclower to procmid-1) that - have no parts in them from the processors remaining to + have no parts in them from the processors remaining to be partitioned. */ if (treept && partmid > 0 && partmid == fp) { @@ -606,12 +569,12 @@ static int rib_fn( treept[partmid].right_leaf = -partmid; } - if (old_nprocs > 1 && partmid > 0 && partmid != partlower + old_nparts) { - /* old_nprocs > 1 test: Don't reset these values if proc is in loop only + if (old_nprocs > 1 && partmid > 0 && partmid != partlower + old_nparts) { + /* old_nprocs > 1 test: Don't reset these values if proc is in loop only * because of other procs for Tflops_Special. * partmid > 0 test: Don't reset these values if low-numbered processors * (proclower to procmid-1) have zero parts and this cut is removing - * them from the processors remaining to be partitioned. + * them from the processors remaining to be partitioned. * partmid != partlower + old_nparts test: Don't reset these values if * cut is removing high-numbered processors with zero parts from * the processors remaining to be partitioned. @@ -620,11 +583,11 @@ static int rib_fn( root = partmid; } - ierr = Zoltan_RB_Send_Outgoing(zz, &(rib->Global_IDs), &(rib->Local_IDs), + ierr = Zoltan_RB_Send_Outgoing(zz, &(rib->Global_IDs), &(rib->Local_IDs), &(rib->Dots), &dotmark, &dottop, &dotnum, &dotmax, set, &allocflag, overalloc, - stats, counters, use_ids, + stats, counters, use_ids, local_comm, proclower, old_nprocs, partlower, partmid); if (ierr < 0) { @@ -632,7 +595,7 @@ static int rib_fn( "Error returned from Zoltan_RB_Send_Outgoing."); goto End; } - + /* create new communicators */ if (zz->Tflops_Special) { @@ -666,7 +629,7 @@ static int rib_fn( most notably when a processor has zero parts on it, but still has some dots after the parallel partitioning. */ - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) time1 = Zoltan_Time(zz->Timer); ierr = Zoltan_RB_Send_To_Part(zz, &(rib->Global_IDs), &(rib->Local_IDs), @@ -680,15 +643,15 @@ static int rib_fn( goto End; } - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) timers[3] += (Zoltan_Time(zz->Timer) - time1); - + /* All dots are now on the processors they will end up on; now generate * more parts if needed. */ if (num_parts > 1) { - if (dotpt->nWeights) + if (dotpt->nWeights) wgts = (double *) ZOLTAN_MALLOC(dotpt->nWeights * dotnum * sizeof(double)); dindx = (int *) ZOLTAN_MALLOC(dotnum * 2 * sizeof(int)); tmpdindx = dindx + dotnum; @@ -755,7 +718,7 @@ static int rib_fn( &(rib->Dots), &dotnum, &dotmax, &allocflag, overalloc, stats, counters, use_ids); /* Note: dottop is no longer valid after remapping. Remapping might - destroy the nice local-followed-by-non-local ordering of the + destroy the nice local-followed-by-non-local ordering of the dots array. Do not use dottop after remapping. */ if (ierr < 0) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_RB_Remap."); @@ -768,10 +731,10 @@ static int rib_fn( if (zz->LB.Return_Lists != ZOLTAN_LB_NO_LISTS && zz->LB.Return_Lists != ZOLTAN_LB_CANDIDATE_LISTS) { /* zz->LB.Return_Lists is true ==> use_ids is true */ - ierr = Zoltan_RB_Return_Arguments(zz, rib->Global_IDs, rib->Local_IDs, + ierr = Zoltan_RB_Return_Arguments(zz, rib->Global_IDs, rib->Local_IDs, &rib->Dots, num_import, import_global_ids, import_local_ids, - import_procs, import_to_part, + import_procs, import_to_part, dotnum); if (ierr < 0) { ZOLTAN_PRINT_ERROR(proc, yo, @@ -816,7 +779,7 @@ static int rib_fn( ierr = Zoltan_RB_Tree_Gatherv(zz, sizeof(struct rib_tree), &sendcount, recvcount, displ); - /* + /* * Create copy of treept so that MPI_Allgatherv doesn't use same * memory for sending and receiving; removes valgrind warning. */ @@ -843,22 +806,22 @@ static int rib_fn( lb_time[0] += (end_time - start_time); if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) - Zoltan_RB_stats(zz, timestop-timestart, &rib->Dots, dotnum, + Zoltan_RB_stats(zz, timestop-timestart, &rib->Dots, dotnum, part_sizes, timers, counters, stats, NULL, NULL, FALSE); if (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME) { if (zz->Proc == zz->Debug_Proc) printf("ZOLTAN RIB Times: \n"); - Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[0], + Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[0], "ZOLTAN Build: "); - Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[1], + Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, lb_time[1], "ZOLTAN RIB: "); } if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) { /* zz->Debug_Level >= ZOLTAN_DEBUG_ALL ==> use_ids is true */ - Zoltan_RB_Print_All(zz, rib->Global_IDs, &rib->Dots, - dotnum, *num_import, + Zoltan_RB_Print_All(zz, rib->Global_IDs, &rib->Dots, + dotnum, *num_import, *import_global_ids, *import_procs); } @@ -897,9 +860,9 @@ struct rib_tree *treept = treept_arr; Zoltan_Print_Sync_Start(zz->Communicator, TRUE); for (i = fp; i < fp+np; i++) { printf("Proc %d Part %d: Tree Struct:\n", zz->Proc, i); - printf(" cm = (%e,%e,%e)\n", + printf(" cm = (%e,%e,%e)\n", treept->cm[0], treept->cm[1], treept->cm[2]); - printf(" ev = (%e,%e,%e)\n", + printf(" ev = (%e,%e,%e)\n", treept->ev[0], treept->ev[1], treept->ev[2]); printf(" cut = %e\n", treept->cut); printf(" parent = %d\n", treept->parent); @@ -939,13 +902,13 @@ void Zoltan_RIB_min_max( /* Find next lower power of 2. */ for (hbit = 0; (nprocs >> hbit) != 1; hbit++); - + nprocs_small = 1 << hbit; if (nprocs_small * 2 == nprocs) { nprocs_small *= 2; hbit++; } - + to = proclower + (rank ^ nprocs_small); if (rank & nprocs_small) { /* processors greater than largest power of 2 */ MPI_Send(tmp, 2, MPI_DOUBLE, to, tag, comm); @@ -957,7 +920,7 @@ void Zoltan_RIB_min_max( MPI_Recv(tmp1, 2, MPI_DOUBLE, to, tag, comm, &status); if (tmp1[0] < tmp[0]) tmp[0] = tmp1[0]; if (tmp1[1] > tmp[1]) tmp[1] = tmp1[1]; - } + } for (mask = nprocs_small >> 1; mask; mask >>= 1) { /* binary exchange */ tag++; partner = proclower + (rank ^ mask); @@ -965,7 +928,7 @@ void Zoltan_RIB_min_max( MPI_Recv(tmp1, 2, MPI_DOUBLE, partner, tag, comm, &status); if (tmp1[0] < tmp[0]) tmp[0] = tmp1[0]; if (tmp1[1] > tmp[1]) tmp[1] = tmp1[1]; - } + } tag++; if (rank + nprocs_small < nprocs) MPI_Send(tmp, 2, MPI_DOUBLE, to, tag, comm); @@ -978,7 +941,7 @@ void Zoltan_RIB_min_max( /*****************************************************************************/ static int compute_rib_direction( - ZZ *zz, + ZZ *zz, int Tflops_Special, /* Tflops_Special flag for special processing. Should be 0 when called by serial_rib. */ int num_geom, /* number of dimensions */ @@ -997,7 +960,7 @@ static int compute_rib_direction( int proc, /* Current processor; needed for Tflops_Special */ int nprocs, /* Number of procs in operation; needed for Tflops_Special */ - int proclower /* Lowest numbered proc; needed for + int proclower /* Lowest numbered proc; needed for Tflops_Special */ ) { @@ -1007,18 +970,18 @@ RIB_STRUCT *rib; rib = (RIB_STRUCT *)zz->LB.Data_Structure; - if (rib->Tran.Target_Dim > 0){ + if (rib->Tran.Target_Dim > 0){ num_geom = rib->Tran.Target_Dim; /* degenerate geometry */ } switch (num_geom) { case 3: - ierr = Zoltan_RIB_inertial3d(Tflops_Special, dotpt, dindx, dotnum, wgtflag, + ierr = Zoltan_RIB_inertial3d(Tflops_Special, dotpt, dindx, dotnum, wgtflag, cm, evec, value, local_comm, proc, nprocs, proclower); break; case 2: - ierr = Zoltan_RIB_inertial2d(Tflops_Special, dotpt, dindx, dotnum, wgtflag, + ierr = Zoltan_RIB_inertial2d(Tflops_Special, dotpt, dindx, dotnum, wgtflag, cm, evec, value, local_comm, proc, nprocs, proclower); break; @@ -1049,7 +1012,7 @@ RIB_STRUCT *rib; /*****************************************************************************/ static int serial_rib( - ZZ *zz, + ZZ *zz, struct Dot_Struct *dotpt, /* local dot array */ int *dotmark, /* which side of median for each dot */ int *dotlist, /* list of dots used only in find_median; @@ -1105,17 +1068,17 @@ double start_time=0., end_time; } else { - if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) + if (stats || (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME)) start_time = Zoltan_Time(zz->Timer); ierr = Zoltan_Divide_Parts(zz, zz->Obj_Weight_Dim, part_sizes, num_parts, &partlower, &partmid, fractionlo); - ierr = compute_rib_direction(zz, 0, num_geom, &valuelo, &valuehi, + ierr = compute_rib_direction(zz, 0, num_geom, &valuelo, &valuehi, dotpt, dindx, dotnum, wgtflag, cm, evec, value, MPI_COMM_SELF, proc, 1, proc); if (ierr < 0) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from compute_rib_direction"); goto End; } @@ -1135,13 +1098,13 @@ double start_time=0., end_time; start_time = end_time; } - if (!Zoltan_RB_find_median(0, value, wgts, dotpt->uniformWeight, dotmark, dotnum, proc, - fractionlo, MPI_COMM_SELF, &valuehalf, + if (!Zoltan_RB_find_median(0, value, wgts, dotpt->uniformWeight, dotmark, dotnum, proc, + fractionlo, MPI_COMM_SELF, &valuehalf, 0, zz->Num_Proc, 1, proc, num_parts, wgtflag, valuelo, valuehi, weight, &weightlo, - &weighthi, dotlist, rectilinear_blocks, + &weighthi, dotlist, rectilinear_blocks, average_cuts)) { - ZOLTAN_PRINT_ERROR(proc, yo, + ZOLTAN_PRINT_ERROR(proc, yo, "Error returned from Zoltan_RB_find_median."); ierr = ZOLTAN_FATAL; goto End; @@ -1183,7 +1146,7 @@ double start_time=0., end_time; ierr = serial_rib(zz, dotpt, dotmark, dotlist, 0, root, num_geom, weightlo, set0, new_nparts, &(dindx[0]), &(tmpdindx[0]), partlower, - proc, wgtflag, stats, gen_tree, + proc, wgtflag, stats, gen_tree, rectilinear_blocks, average_cuts, treept, value, wgts, part_sizes, timers); if (ierr < 0) { @@ -1206,7 +1169,7 @@ double start_time=0., end_time; } } } - + End: return ierr; } diff --git a/packages/zoltan/src/rcb/rib.h b/packages/zoltan/src/rcb/rib.h index 76c1ddbf26..171602cbf3 100644 --- a/packages/zoltan/src/rcb/rib.h +++ b/packages/zoltan/src/rcb/rib.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RIB_H @@ -96,7 +59,7 @@ extern void Zoltan_RIB_reduce_double(double *, double *, int, MPI_Comm, int, int extern void Zoltan_RIB_min_max(double *, double *, int, int, int, MPI_Comm); extern void Zoltan_RIB_inertial3d_all( int, double *, - int, double *cm, double (*evec)[3], + int, double *cm, double (*evec)[3], MPI_Comm , int , int , int ); #ifdef __cplusplus diff --git a/packages/zoltan/src/rcb/rib_const.h b/packages/zoltan/src/rcb/rib_const.h index df820435bd..4604a562ba 100644 --- a/packages/zoltan/src/rcb/rib_const.h +++ b/packages/zoltan/src/rcb/rib_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RIB_CONST_H diff --git a/packages/zoltan/src/rcb/rib_params.h b/packages/zoltan/src/rcb/rib_params.h index 320ca498d7..37f275461a 100644 --- a/packages/zoltan/src/rcb/rib_params.h +++ b/packages/zoltan/src/rcb/rib_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __RIB_PARAMS_H diff --git a/packages/zoltan/src/rcb/rib_util.c b/packages/zoltan/src/rcb/rib_util.c index c7c862106e..d13d32c958 100644 --- a/packages/zoltan/src/rcb/rib_util.c +++ b/packages/zoltan/src/rcb/rib_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include "zz_const.h" #include "rib.h" diff --git a/packages/zoltan/src/rcb/shared.c b/packages/zoltan/src/rcb/shared.c index f69dc3553f..acc371560e 100644 --- a/packages/zoltan/src/rcb/shared.c +++ b/packages/zoltan/src/rcb/shared.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -91,7 +54,7 @@ int Zoltan_RB_Build_Structure( in this function. */ struct Dot_Struct *dots, /* pointer to dot info */ int *num_obj, /* number of objects on this processor. */ - int *max_obj, /* number of Dots for which storage is + int *max_obj, /* number of Dots for which storage is allocated on this processor. */ int *num_geom, /* # values per object used to describe the geometry. */ @@ -100,8 +63,8 @@ int Zoltan_RB_Build_Structure( of dot array must be done. 1.0 = no extra; 1.5 = 50% extra; etc. */ int use_ids, /* true if global and local IDs are to be - kept for RCB or RIB. In all cases, the - IDs are allocated and used in Zoltan + kept for RCB or RIB. In all cases, the + IDs are allocated and used in Zoltan callback functions. Then, if use_ids is false, the IDs are deallocated before this function exits. */ @@ -109,11 +72,11 @@ int Zoltan_RB_Build_Structure( ) { /* - * Function to build the geometry-based data structures for + * Function to build the geometry-based data structures for * RCB and RIB. */ char *yo = "Zoltan_RB_Build_Structure"; -float *objs_wgt = NULL; /* Array of object weights returned by +float *objs_wgt = NULL; /* Array of object weights returned by the application. */ int *parts = NULL; int ierr = ZOLTAN_OK; @@ -123,10 +86,10 @@ int ierr = ZOLTAN_OK; */ *global_ids = NULL; *local_ids = NULL; - ierr = Zoltan_Get_Obj_List(zz, num_obj, global_ids, local_ids, wgtflag, + ierr = Zoltan_Get_Obj_List(zz, num_obj, global_ids, local_ids, wgtflag, &objs_wgt, &parts); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Zoltan_Get_Obj_List."); goto End; } @@ -142,7 +105,7 @@ int ierr = ZOLTAN_OK; num_geom, wgtflag, add_unit_weight, *max_obj); if (ierr == ZOLTAN_FATAL || ierr == ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function initialize_dot."); goto End; } @@ -150,15 +113,15 @@ int ierr = ZOLTAN_OK; End: if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - Zoltan_Multifree(__FILE__, __LINE__, 2, global_ids, + Zoltan_Multifree(__FILE__, __LINE__, 2, global_ids, local_ids); Zoltan_Free_And_Reset_Dot_Structure(dots); } if (!use_ids) { - /* + /* * Do not need IDs in RCB or RIB. Don't store, manipulate or - * communicate any IDs. + * communicate any IDs. */ ZOLTAN_FREE(global_ids); ZOLTAN_FREE(local_ids); @@ -172,20 +135,20 @@ int ierr = ZOLTAN_OK; /*****************************************************************************/ static int initialize_dot( - ZZ *zz, + ZZ *zz, int num_obj, - ZOLTAN_ID_PTR gid, - ZOLTAN_ID_PTR lid, + ZOLTAN_ID_PTR gid, + ZOLTAN_ID_PTR lid, float **wgt, int **parts, - struct Dot_Struct *dots, + struct Dot_Struct *dots, int *num_geom, int wgtflag, int add_unit_weight, int max_obj) { /* - * Function that initializes the dot data structure for RCB and RIB. - * It uses the global ID, coordinates and weight provided by the application. + * Function that initializes the dot data structure for RCB and RIB. + * It uses the global ID, coordinates and weight provided by the application. */ int ierr = ZOLTAN_OK; int i, j, np, fpart, fail, dimcoord; @@ -201,7 +164,7 @@ char *yo = "initialize_dot"; ierr = Zoltan_Get_Coordinates(zz, num_obj, gid, lid, num_geom, &geom_vec); if (ierr == ZOLTAN_FATAL || ierr == ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_Get_Coordinates."); goto End; } @@ -279,7 +242,7 @@ char *yo = "initialize_dot"; /* Object migration sizes **************************************************/ - if ((zz->Get_Obj_Size_Multi) || (zz->Get_Obj_Size)) + if ((zz->Get_Obj_Size_Multi) || (zz->Get_Obj_Size)) i = 1; else i = 0; @@ -293,7 +256,7 @@ char *yo = "initialize_dot"; ZOLTAN_PRINT_ERROR(zz->Proc, yo, "failure to allocate memory for Size"); goto End; } - + if (zz->Get_Obj_Size_Multi) { zz->Get_Obj_Size_Multi(zz->Get_Obj_Size_Multi_Data, zz->Num_GID, zz->Num_LID, num_obj, @@ -354,7 +317,7 @@ char *yo = "initialize_dot"; } End: - + return(ierr); } @@ -413,7 +376,7 @@ int Zoltan_RB_Send_Outgoing( outgoing++; else if (i < *dottop) keep++; - if ((*dotmark)[i]) + if ((*dotmark)[i]) dotpt->Part[i] = partmid; else dotpt->Part[i] = partlower; @@ -435,12 +398,12 @@ int Zoltan_RB_Send_Outgoing( goto End; } #if 0 - ierr = Zoltan_RB_Send_Dots(zz, gidpt, lidpt, dotpt, dotmark, proc_list, - outgoing, dotnum, dotmax, set, allocflag, overalloc, + ierr = Zoltan_RB_Send_Dots(zz, gidpt, lidpt, dotpt, dotmark, proc_list, + outgoing, dotnum, dotmax, set, allocflag, overalloc, stats, counters, use_ids, local_comm); #else - ierr = Zoltan_RB_Send_Dots_less_memory(zz, gidpt, lidpt, dotpt, dotmark, proc_list, - outgoing, dotnum, dotmax, set, allocflag, overalloc, + ierr = Zoltan_RB_Send_Dots_less_memory(zz, gidpt, lidpt, dotpt, dotmark, proc_list, + outgoing, dotnum, dotmax, set, allocflag, overalloc, stats, counters, use_ids, local_comm); #endif @@ -487,10 +450,10 @@ int Zoltan_RB_Send_To_Part( * processor for their part to the correct processor. * This situation arises when a processor has zero parts assigned to * it, yet has participated in the parallel partitioning and has, as a result, - * stored some dots. - * (e.g., three processors, two parts, NUM_LOCAL_PARTS = 1 on + * stored some dots. + * (e.g., three processors, two parts, NUM_LOCAL_PARTS = 1 on * procs 1 and 2. Procs 0 and 1 are in set 0 during parallel partitioning, so - * Proc 0 may have some dots after the parallel partitioning. Those dots + * Proc 0 may have some dots after the parallel partitioning. Those dots * must be sent to proc 1. * NOTE: This routine changes values in dotmark. */ @@ -507,7 +470,7 @@ int set = 0; if (zz->LB.PartDist == NULL) return ierr; /* Check is not needed for uniform k == p */ - + if (*dotnum > 0) { if (!(proc_list = (int *) ZOLTAN_MALLOC(*dotnum * sizeof(int)))) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); @@ -515,7 +478,7 @@ int set = 0; goto End; } } - + outtop = 0; outgoing = 0; for (i = 0; i < *dotnum; i++) { @@ -535,11 +498,11 @@ int set = 0; #if 0 ierr = Zoltan_RB_Send_Dots(zz, gidpt, lidpt, dotpt, dotmark, proc_list, - outgoing, dotnum, dotmax, set, allocflag, overalloc, + outgoing, dotnum, dotmax, set, allocflag, overalloc, stats, counters, use_ids, zz->Communicator); #else ierr = Zoltan_RB_Send_Dots_less_memory(zz, gidpt, lidpt, dotpt, dotmark, proc_list, - outgoing, dotnum, dotmax, set, allocflag, overalloc, + outgoing, dotnum, dotmax, set, allocflag, overalloc, stats, counters, use_ids, zz->Communicator); #endif @@ -580,7 +543,7 @@ int Zoltan_RB_Send_Dots( 5 = # of times a previous cut is re-used 6 = # of reallocs of dot array */ int use_ids, /* true if global and local IDs are to be - kept for RCB or RIB (for LB.Return_Lists + kept for RCB or RIB (for LB.Return_Lists or high Debug_Levels). The IDs must be communicated if use_ids is true. */ MPI_Comm local_comm @@ -646,7 +609,7 @@ int Zoltan_RB_Send_Dots( if (dotnew > counters[3]) counters[3] = dotnew; if (*dotmax > counters[4]) counters[4] = *dotmax; } - + /* malloc comm send buffer */ if (outgoing > 0) { @@ -665,29 +628,29 @@ int Zoltan_RB_Send_Dots( /* fill buffer with dots that are marked for sending */ /* pack down the unmarked ones */ - + keep = outgoing = 0; for (i = 0; i < *dotnum; i++) { if ((*dotmark)[i] != set) { if (use_ids) { - ZOLTAN_SET_GID(zz, &(gidbuf[outgoing*num_gid_entries]), + ZOLTAN_SET_GID(zz, &(gidbuf[outgoing*num_gid_entries]), &((*gidpt)[i*num_gid_entries])); - ZOLTAN_SET_LID(zz, &(lidbuf[outgoing*num_lid_entries]), + ZOLTAN_SET_LID(zz, &(lidbuf[outgoing*num_lid_entries]), &((*lidpt)[i*num_lid_entries])); } - memcpy((char *) &dotbuf[outgoing], (char *) &((*dotpt)[i]), + memcpy((char *) &dotbuf[outgoing], (char *) &((*dotpt)[i]), sizeof(struct Dot_Struct)); outgoing++; } else { if (use_ids) { - ZOLTAN_SET_GID(zz, &((*gidpt)[keep*num_gid_entries]), + ZOLTAN_SET_GID(zz, &((*gidpt)[keep*num_gid_entries]), &((*gidpt)[i*num_gid_entries])); - ZOLTAN_SET_LID(zz, &((*lidpt)[keep*num_lid_entries]), + ZOLTAN_SET_LID(zz, &((*lidpt)[keep*num_lid_entries]), &((*lidpt)[i*num_lid_entries])); } if (keep != i) - memcpy((char *) &((*dotpt)[keep]), (char *) &((*dotpt)[i]), + memcpy((char *) &((*dotpt)[keep]), (char *) &((*dotpt)[i]), sizeof(struct Dot_Struct)); keep++; } @@ -695,7 +658,7 @@ int Zoltan_RB_Send_Dots( if (use_ids) { /* Communicate Global IDs */ - ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) gidbuf, + ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) gidbuf, sizeof(ZOLTAN_ID_TYPE)*num_gid_entries, (char *) &((*gidpt)[keep*num_gid_entries])); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { @@ -706,7 +669,7 @@ int Zoltan_RB_Send_Dots( /* Communicate Local IDs, if any */ if (num_lid_entries) { message_tag--; - ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) lidbuf, + ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) lidbuf, sizeof(ZOLTAN_ID_TYPE)*num_lid_entries, (char *) &((*lidpt)[keep*num_lid_entries])); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { @@ -718,7 +681,7 @@ int Zoltan_RB_Send_Dots( /* Communicate Dots */ message_tag--; - ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) dotbuf, + ierr = Zoltan_Comm_Do(cobj, message_tag, (char *) dotbuf, sizeof(struct Dot_Struct), (char *) &((*dotpt)[keep])); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_Comm_Do."); @@ -736,7 +699,7 @@ int Zoltan_RB_Send_Dots( ZOLTAN_FREE(&lidbuf); } ZOLTAN_FREE(&dotbuf); - + ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); } @@ -758,7 +721,7 @@ int Zoltan_RB_Send_Dots_less_memory( ZOLTAN_ID_PTR *lidpt, /* pointer to Local_IDs array. */ struct Dot_Struct *dotpt, /* pointer to Dots info. */ int **dotmark, /* which side of median for each dot */ - int *proc_list, /* list of processors to send dots to; + int *proc_list, /* list of processors to send dots to; GETS REORDERED*/ int outgoing, /* message exchange counters */ int *dotnum, /* number of dots */ @@ -778,13 +741,13 @@ int Zoltan_RB_Send_Dots_less_memory( 5 = # of times a previous cut is re-used 6 = # of reallocs of dot array */ int use_ids, /* true if global and local IDs are to be - kept for RCB or RIB (for LB.Return_Lists + kept for RCB or RIB (for LB.Return_Lists or high Debug_Levels). The IDs must be communicated if use_ids is true. */ MPI_Comm local_comm ) { -/* Routine to send outgoing dots to their new processors. +/* Routine to send outgoing dots to their new processors. * On very large problems, * we run out of memory when allocating the entire Dot_Struct * array of outgoing dots. @@ -816,9 +779,9 @@ int Zoltan_RB_Send_Dots_less_memory( if (outgoing && !reorder){ MEMORY_ERROR; } - + firstStaying = *dotnum; /* location of first dot that is staying */ - + for (i=0,j=0; i < *dotnum; i++){ if ((*dotmark)[i] != set) { /* going */ reorder[j++] = i; @@ -857,7 +820,7 @@ int Zoltan_RB_Send_Dots_less_memory( if (verify[3] != (ZOLTAN_GNO_TYPE)dotnew){ ierr = ZOLTAN_FATAL; - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error: Number of incoming objects does not fit in an integer.\n"); goto End; } @@ -964,7 +927,7 @@ int Zoltan_RB_Send_Dots_less_memory( outgoing, *dotnum, sendbuf, firstStaying, reorder, *dotmark, set, cobj, message_tag++); - + if (ierr != ZOLTAN_OK) COMM_DO_ERROR; } @@ -973,7 +936,7 @@ int Zoltan_RB_Send_Dots_less_memory( ierr = send_receive_ints(dotpt->Proc, outgoing, *dotnum, sendbuf, firstStaying, reorder, *dotmark, set, cobj, message_tag++); - + if (ierr != ZOLTAN_OK) COMM_DO_ERROR; /***** Send/receive dot's original part *****/ @@ -981,7 +944,7 @@ int Zoltan_RB_Send_Dots_less_memory( ierr = send_receive_ints(dotpt->Input_Part, outgoing, *dotnum, sendbuf, firstStaying, reorder, *dotmark, set, cobj, message_tag++); - + if (ierr != ZOLTAN_OK) COMM_DO_ERROR; /***** Send/receive dot's new part *****/ @@ -989,7 +952,7 @@ int Zoltan_RB_Send_Dots_less_memory( ierr = send_receive_ints(dotpt->Part, outgoing, *dotnum, sendbuf, firstStaying, reorder, *dotmark, set, cobj, message_tag++); - + if (ierr != ZOLTAN_OK) COMM_DO_ERROR; /***** Send/receive dot's migration size *****/ @@ -998,7 +961,7 @@ int Zoltan_RB_Send_Dots_less_memory( ierr = send_receive_ints(dotpt->Size, outgoing, *dotnum, sendbuf, firstStaying, reorder, *dotmark, set, cobj, message_tag++); - + if (ierr != ZOLTAN_OK) COMM_DO_ERROR; } @@ -1021,7 +984,7 @@ int Zoltan_RB_Send_Dots_less_memory( void Zoltan_RB_Print_All( ZZ *zz, ZOLTAN_ID_PTR global_ids, struct Dot_Struct *dots, int dotnum, - int num_import, ZOLTAN_ID_PTR import_global_ids, + int num_import, ZOLTAN_ID_PTR import_global_ids, int *import_procs) { /* @@ -1075,7 +1038,7 @@ int Zoltan_RB_Remap( 5 = # of times a previous cut is re-used 6 = # of reallocs of dot array */ int use_ids /* true if global and local IDs are to be - kept for RCB or RIB (for LB.Return_Lists + kept for RCB or RIB (for LB.Return_Lists or high Debug_Levels). The IDs must be communicated if use_ids is true. */ ) @@ -1094,7 +1057,7 @@ int *proc_list = NULL; /* Temporary array of destinations for dots to be sent int outgoing; /* Number of dots to be sent due to remap. */ int new_map; /* Flag indicating whether a remap has occurred. */ int ierr = ZOLTAN_OK; -int i; +int i; old_part = (int *) ZOLTAN_MALLOC(2 * *dotnum * sizeof(int)); new_part = old_part + *dotnum; @@ -1118,7 +1081,7 @@ int i; ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_LB_Remap"); goto End; } - + if (new_map) { /* Parts are being remapped; need to move the dots to new procs. */ for (i = 0; i < *dotnum; i++) @@ -1134,7 +1097,7 @@ int i; ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory Error"); goto End; } - for (outgoing = 0, i = 0; i < *dotnum; i++) + for (outgoing = 0, i = 0; i < *dotnum; i++) if (proc[i] != zz->Proc) proc_list[outgoing++] = proc[i]; @@ -1177,9 +1140,9 @@ int Zoltan_RB_Return_Arguments( int *num_import, /* number of objects to be imported. */ ZOLTAN_ID_PTR *import_global_ids, /* global IDs of objects to be imported. */ ZOLTAN_ID_PTR *import_local_ids, /* local IDs of objects to be imported. */ - int **import_procs, /* processors from which objects will be + int **import_procs, /* processors from which objects will be imported. */ - int **import_to_part, /* parts to which objects will be + int **import_to_part, /* parts to which objects will be imported. */ int dotnum /* number of dots on this processor */ ) @@ -1200,7 +1163,7 @@ int num_lid_entries = zz->Num_LID; part but not processor. */ *num_import = 0; - for (i = 0; i < dotnum; i++) + for (i = 0; i < dotnum; i++) if (dotpt->Proc[i] != zz->Proc || /* imported from other processors */ dotpt->Input_Part[i] != dotpt->Part[i]) /* part change only */ (*num_import)++; @@ -1261,9 +1224,9 @@ int Zoltan_RB_Use_IDs(ZZ *zz) { /* Function that returns a flag indicating whether or not global and * local IDs should be stored, manipulated, and communicated within the - * RCB and RIB algorithms. + * RCB and RIB algorithms. * IDs are used for two purposes in RCB and RIB: - * 1. To build import lists. When LB.Return_Lists == NONE, import lists are + * 1. To build import lists. When LB.Return_Lists == NONE, import lists are * not built, so there is no need to carry along the IDs, * 2. To be printed as debugging information. Only for high debug levels are * the IDs printed; for lower levels, the IDs need not be carried along. @@ -1282,7 +1245,7 @@ int Zoltan_RB_Tree_Gatherv( processor. */ int *displ /* Output: array of displacements into recvbuf for data from each processor. */ -) +) { /* Routine to build arguments to MPI_Allgatherv for consolidating trees for KEEP_CUTS=1. Scans parts array to assign unique processor owners to @@ -1318,8 +1281,8 @@ int i, cnt; recvcount[i] = 0; displ[i] = 0; } - } - else if (ierr < 0) + } + else if (ierr < 0) break; } return ierr; @@ -1344,7 +1307,7 @@ int Zoltan_RB_check_geom_input( /* Error check the weights. */ count = 0; for (i = 0; i < dotnum * dotpt->nWeights; i++) - if (dotpt->Weight[i] < 0.0) + if (dotpt->Weight[i] < 0.0) count++; MPI_Allreduce(&count,&k,1,MPI_INT,MPI_SUM,zz->Communicator); if (k > 0) { @@ -1362,7 +1325,7 @@ int Zoltan_RB_check_geom_input( /*****************************************************************************/ int Zoltan_RB_check_geom_output( - ZZ *zz, + ZZ *zz, struct Dot_Struct *dotpt, float *part_sizes, int np, /* number of parts on processor */ @@ -1401,7 +1364,7 @@ int Zoltan_RB_check_geom_output( ierr = ZOLTAN_WARN; } } - + /* check that result is within Imbalance_Tol of part size target */ wtpp = (double *) ZOLTAN_MALLOC(2*(1+ngp)*sizeof(double)); @@ -1414,15 +1377,15 @@ int Zoltan_RB_check_geom_output( wtpp[dotpt->Part[i]] += dotpt->Weight[i*wtdim + dd]; } wtsum = wtpp + (1+ngp); - + MPI_Allreduce(wtpp, wtsum, ngp+1, MPI_DOUBLE, MPI_SUM, zz->Communicator); - + for (i = fp; i < fp + np; i++) { tolerance = part_sizes[i*wtdim+dd]*wtsum[ngp]*zz->LB.Imbalance_Tol[dd]; if (wtsum[i] > tolerance) { if (zz->Debug_Level > ZOLTAN_DEBUG_NONE) { - sprintf(msg, - "Weight of part %d = %f > tolerance %f for weight %d.", + sprintf(msg, + "Weight of part %d = %f > tolerance %f for weight %d.", i, wtsum[i], tolerance, dd); ZOLTAN_PRINT_WARN(proc, yo, msg); } @@ -1438,15 +1401,15 @@ int Zoltan_RB_check_geom_output( wtpp[dotpt->Part[i]] += dotpt->uniformWeight; } wtsum = wtpp + (1+ngp); - + MPI_Allreduce(wtpp, wtsum, ngp+1, MPI_DOUBLE, MPI_SUM, zz->Communicator); - + for (i = fp; i < fp + np; i++) { tolerance = part_sizes[i*wtdim]*wtsum[ngp]*zz->LB.Imbalance_Tol[0]; if (wtsum[i] > tolerance) { if (zz->Debug_Level > ZOLTAN_DEBUG_NONE) { - sprintf(msg, - "Weight of part %d = %f > tolerance %f for weight 0.", + sprintf(msg, + "Weight of part %d = %f > tolerance %f for weight 0.", i, wtsum[i], tolerance); ZOLTAN_PRINT_WARN(proc, yo, msg); } @@ -1456,11 +1419,11 @@ int Zoltan_RB_check_geom_output( } ZOLTAN_FREE(&wtpp); - + if (zz->LB.Method == RCB) { /* check that final set of points is inside RCB box of each proc */ - + iflag = 0; x = dotpt->X; y = dotpt->Y; @@ -1474,7 +1437,7 @@ int Zoltan_RB_check_geom_output( } } if (iflag > 0) { - sprintf(msg, "\n%d points are out-of-box on proc %d.\n" + sprintf(msg, "\n%d points are out-of-box on proc %d.\n" "Example (%g, %g, %g) is not in (%g, %g) , (%g, %g), (%g, %g)\n", iflag, proc, x[dd], (y ? y[dd] : 0.0), (z ? z[dd] : 0.0), rcbbox->lo[0], rcbbox->hi[0] , rcbbox->lo[1], rcbbox->hi[1], rcbbox->lo[2], rcbbox->hi[2]); @@ -1515,12 +1478,12 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, MPI_Comm_rank(zz->Communicator,&proc); MPI_Comm_size(zz->Communicator,&nprocs); print_proc = zz->Debug_Proc; - + /* Make certain that timetotal is the same everywhere. */ MPI_Allreduce(&timetotal,&rmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); timetotal = rmax; - if (proc == print_proc) + if (proc == print_proc) printf("Partitioning total time: %g (secs)\n", timetotal); wdim = dotpt->nWeights; @@ -1540,7 +1503,7 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, else{ weight = dotnum * dotpt->uniformWeight; } - + MPI_Allreduce(&weight,&wttot,1,MPI_DOUBLE,MPI_SUM,zz->Communicator); MPI_Allreduce(&weight,&wtmin,1,MPI_DOUBLE,MPI_MIN,zz->Communicator); MPI_Allreduce(&weight,&wtmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); @@ -1552,116 +1515,116 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, } MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d has weight = %g\n",proc,weight); if (wdim){ - for (i = 0, weight = 0.0; i < dotnum; i++) + for (i = 0, weight = 0.0; i < dotnum; i++) if (dotpt->Weight[i*wdim] > weight) weight = dotpt->Weight[i*wdim]; } else{ - weight = dotpt->uniformWeight; + weight = dotpt->uniformWeight; } MPI_Allreduce(&weight,&wtmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); - - if (proc == print_proc) + + if (proc == print_proc) printf(" Maximum weight of single dot = %g\n",wtmax); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d max weight = %g\n",proc,weight); - + /* counter info */ - + MPI_Allreduce(&counters[1],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[1],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[1],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Send count: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d send count = " ZOLTAN_GNO_SPEC "\n",proc,counters[1]); - + MPI_Allreduce(&counters[2],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[2],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[2],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Recv count: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d recv count = " ZOLTAN_GNO_SPEC "\n",proc,counters[2]); - + if (reuse) { MPI_Allreduce(&reuse_count[1],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); MPI_Allreduce(&reuse_count[1],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&reuse_count[1],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Presend count: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d presend count = " ZOLTAN_GNO_SPEC "\n",proc,reuse_count[1]); - + MPI_Allreduce(&reuse_count[2],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&reuse_count[2],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&reuse_count[2],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Prerecv count: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d prerecv count = " ZOLTAN_GNO_SPEC "\n",proc,reuse_count[2]); } - + MPI_Allreduce(&counters[3],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[3],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[3],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Max dots: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d max dots = " ZOLTAN_GNO_SPEC "\n",proc,counters[3]); - + MPI_Allreduce(&counters[4],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[4],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[4],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" Max memory: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d max memory = " ZOLTAN_GNO_SPEC "\n",proc,counters[4]); - + if (reuse) { MPI_Allreduce(&counters[5],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[5],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[5],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" # of Reuse: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d # of Reuse = " ZOLTAN_GNO_SPEC "\n",proc,counters[5]); } - + MPI_Allreduce(&counters[6],&sum,1,zoltan_gno_mpi_type,MPI_SUM,zz->Communicator); MPI_Allreduce(&counters[6],&min,1,zoltan_gno_mpi_type,MPI_MIN,zz->Communicator); MPI_Allreduce(&counters[6],&max,1,zoltan_gno_mpi_type,MPI_MAX,zz->Communicator); ave = ((double) sum)/nprocs; - if (proc == print_proc) + if (proc == print_proc) printf(" # of OverAlloc: ave = %g, min = " ZOLTAN_GNO_SPEC ", max = " ZOLTAN_GNO_SPEC "\n",ave,min,max); MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d # of OverAlloc = " ZOLTAN_GNO_SPEC "\n",proc,counters[6]); par_median_print_counts(zz->Communicator, print_proc); } /* timer info */ - + if (timetotal>0){ MPI_Allreduce(&timers[0],&rsum,1,MPI_DOUBLE,MPI_SUM,zz->Communicator); @@ -1675,9 +1638,9 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, ave/timetotal*100.0,rmin/timetotal*100.0,rmax/timetotal*100.0); } MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d start-up time = %g\n",proc,timers[0]); - + MPI_Allreduce(&timers[1],&rsum,1,MPI_DOUBLE,MPI_SUM,zz->Communicator); MPI_Allreduce(&timers[1],&rmin,1,MPI_DOUBLE,MPI_MIN,zz->Communicator); MPI_Allreduce(&timers[1],&rmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); @@ -1689,9 +1652,9 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, ave/timetotal*100.0,rmin/timetotal*100.0,rmax/timetotal*100.0); } MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d pre-median time = %g\n",proc,timers[1]); - + MPI_Allreduce(&timers[2],&rsum,1,MPI_DOUBLE,MPI_SUM,zz->Communicator); MPI_Allreduce(&timers[2],&rmin,1,MPI_DOUBLE,MPI_MIN,zz->Communicator); MPI_Allreduce(&timers[2],&rmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); @@ -1703,9 +1666,9 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, ave/timetotal*100.0,rmin/timetotal*100.0,rmax/timetotal*100.0); } MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d median time = %g\n",proc,timers[2]); - + MPI_Allreduce(&timers[3],&rsum,1,MPI_DOUBLE,MPI_SUM,zz->Communicator); MPI_Allreduce(&timers[3],&rmin,1,MPI_DOUBLE,MPI_MIN,zz->Communicator); MPI_Allreduce(&timers[3],&rmax,1,MPI_DOUBLE,MPI_MAX,zz->Communicator); @@ -1717,11 +1680,11 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, ave/timetotal*100.0,rmin/timetotal*100.0,rmax/timetotal*100.0); } MPI_Barrier(zz->Communicator); - if (stats > 1) + if (stats > 1) printf(" Proc %d comm time = %g\n",proc,timers[3]); - + } - + if (zz->LB.Method == RCB && stats > 1) { /* RCB boxes for each proc */ if (proc == print_proc) printf(" RCB sub-domain boxes:\n"); @@ -1739,7 +1702,7 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, if (stats) { int tmpmax; - for (i = 0, tmpmax=0; i < dotnum; i++) + for (i = 0, tmpmax=0; i < dotnum; i++) if (dotpt->Part[i] > tmpmax) tmpmax = dotpt->Part[i]; MPI_Allreduce(&tmpmax,&numParts,1,MPI_INT, MPI_MAX, zz->Communicator); @@ -1759,7 +1722,7 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, lpartWgt[dotpt->Part[i]] += dotpt->Weight[i*wdim]; else lpartWgt[dotpt->Part[i]] += dotpt->uniformWeight; - + if (dotpt->Input_Part[i] != dotpt->Part[i]) { if (dotpt->Size){ move += (double)dotpt->Size[i]; @@ -1770,9 +1733,9 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, } } - MPI_Reduce(lpartWgt, gpartWgt, numParts, MPI_DOUBLE, MPI_SUM, + MPI_Reduce(lpartWgt, gpartWgt, numParts, MPI_DOUBLE, MPI_SUM, print_proc, zz->Communicator); - MPI_Reduce(&move, &gmove, 1, MPI_DOUBLE, MPI_SUM, + MPI_Reduce(&move, &gmove, 1, MPI_DOUBLE, MPI_SUM, print_proc, zz->Communicator); ZOLTAN_FREE(&lpartWgt); @@ -1784,7 +1747,7 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, char *countType; max_imbal = 0.0; - + if (wttot) { for (i = 0; i < numParts; i++){ if (part_sizes[i]) { @@ -1794,9 +1757,9 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, } } } - + bal = 1.0 + max_imbal; - + if (nRuns){ if (gmove > movemax) movemax = gmove; if (gmove < movemin) movemin = gmove; @@ -1809,12 +1772,12 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, movemax = movemin = movesum = gmove; balmax = balmin = balsum = bal; } - + countType = "moveCnt"; if (zz->Get_Obj_Size_Multi || zz->Get_Obj_Size) { countType = "moveVol"; } - + nRuns++; printf(" STATS Runs %d bal CURRENT %f MAX %f MIN %f AVG %f\n", @@ -1850,7 +1813,7 @@ void Zoltan_RB_stats(ZZ *zz, double timetotal, struct Dot_Struct *dotpt, wtarr[d] += dotpt->Weight[i*wdim+d]; } } - + MPI_Allreduce(wtarr, wtarrmin, wdim, MPI_DOUBLE,MPI_MIN,zz->Communicator); MPI_Allreduce(wtarr, wtarrmax, wdim, MPI_DOUBLE,MPI_MAX,zz->Communicator); MPI_Allreduce(wtarr, wtarrsum, wdim, MPI_DOUBLE,MPI_SUM,zz->Communicator); @@ -1900,7 +1863,7 @@ static int reallocate_dot_structure(struct Dot_Struct *dots, int newsize) if (!fail && dots->Y){ if ((dots->Y = (double *) ZOLTAN_REALLOC(dots->Y, newsize * sizeof(double))) == NULL) fail = 1; - + if (!fail && dots->Z){ if ((dots->Z = (double *) ZOLTAN_REALLOC(dots->Z, newsize * sizeof(double))) == NULL) fail = 1; @@ -1928,7 +1891,7 @@ static int reallocate_dot_structure(struct Dot_Struct *dots, int newsize) if (!fail && dots->Size) if ((dots->Size = (int *) ZOLTAN_REALLOC(dots->Size, newsize * sizeof(int))) == NULL) fail = 1; - + if (fail) ierr = ZOLTAN_MEMERR; @@ -1936,9 +1899,9 @@ static int reallocate_dot_structure(struct Dot_Struct *dots, int newsize) } -static int send_receive_ids(ZOLTAN_ID_TYPE *c, int num_ids, int outgoing, - int total, char *sendbuf, int firstStaying, - int *reorder, int *dotmark, int set, +static int send_receive_ids(ZOLTAN_ID_TYPE *c, int num_ids, int outgoing, + int total, char *sendbuf, int firstStaying, + int *reorder, int *dotmark, int set, ZOLTAN_COMM_OBJ *cobj, int message_tag) { int i, j, next; @@ -1954,7 +1917,7 @@ static int send_receive_ids(ZOLTAN_ID_TYPE *c, int num_ids, int outgoing, } idval = c; - + for (i = firstStaying, next=0; i < total; i++) { if (dotmark[i] == set) { from = c + (i * num_ids); @@ -1969,7 +1932,7 @@ static int send_receive_ids(ZOLTAN_ID_TYPE *c, int num_ids, int outgoing, } return Zoltan_Comm_Do(cobj, message_tag, sendbuf, - sizeof(ZOLTAN_ID_TYPE) * num_ids, + sizeof(ZOLTAN_ID_TYPE) * num_ids, (char *)(c + (next * num_ids))); } @@ -2000,9 +1963,9 @@ static int send_receive_ints(int *c, int outgoing, int total, char *sendbuf, (char *)(c + next)); } -static int send_receive_weights(double *c, int wgtdim, int outgoing, +static int send_receive_weights(double *c, int wgtdim, int outgoing, int total, char *sendbuf, - int firstStaying, int *reorder, int *dotmark, + int firstStaying, int *reorder, int *dotmark, int set, ZOLTAN_COMM_OBJ *cobj, int message_tag) { int i, j, next; @@ -2094,7 +2057,7 @@ int num_lid_entries = zz->Num_LID; *input_gids = *input_lids = NULL; *input_procs = *input_to_part = NULL; - if (*num_input && + if (*num_input && (!Zoltan_Special_Malloc(zz, (void **)input_gids, dotnum, ZOLTAN_SPECIAL_MALLOC_GID) || !Zoltan_Special_Malloc(zz, (void **)input_lids, dotnum, @@ -2136,7 +2099,7 @@ int Zoltan_RB_Candidates_Output( int num_input, /* number of global IDs input on this proc */ ZOLTAN_ID_PTR input_gids, /* array of global IDs input on this proc */ int *num_candidate_gids, /* output: # of objs input on this proc */ - ZOLTAN_ID_PTR *candidate_gids /* output: global IDs of candidates for + ZOLTAN_ID_PTR *candidate_gids /* output: global IDs of candidates for each input obj. */ ) { @@ -2144,7 +2107,7 @@ int Zoltan_RB_Candidates_Output( * Function to build the return arguments expected by Zoltan when * RETURN_LISTS=CANDIDATE_LISTS (used in matching only). * For each part, determine a candidate among all dots assigned to the part. - * Then, for each input GID, return the candidate for its part in the + * Then, for each input GID, return the candidate for its part in the * candidate_gids array. */ char *yo = "Zoltan_RB_Candidates_Output"; @@ -2167,12 +2130,12 @@ ZOLTAN_ID_PTR current_candidate; */ MPI_Allreduce(&dotnum, &maxdotnum, 1, MPI_INT, MPI_MAX, zz->Communicator); - ierr = Zoltan_DD_Create(&dd, zz->Communicator, num_gid_entries, - 0, num_gid_entries*sizeof(ZOLTAN_ID_TYPE), + ierr = Zoltan_DD_Create(&dd, zz->Communicator, num_gid_entries, + 0, num_gid_entries*sizeof(ZOLTAN_ID_TYPE), maxdotnum, 0); /* Select candidates for each part; store them for each GID. */ - dot_candidates = (ZOLTAN_ID_PTR) + dot_candidates = (ZOLTAN_ID_PTR) ZOLTAN_MALLOC(dotnum*num_gid_entries*sizeof(ZOLTAN_ID_TYPE)); if (dindx) { int prevpart = dotpt->Part[dindx[0]]; @@ -2190,7 +2153,7 @@ ZOLTAN_ID_PTR current_candidate; current_candidate); } } - else { + else { /* dindx is NULL; all dots on this proc are in a single part */ /* use first dot as candidate */ ZOLTAN_ID_PTR current_dot_candidate = dot_candidates; @@ -2205,7 +2168,7 @@ ZOLTAN_ID_PTR current_candidate; ierr = Zoltan_DD_Update(dd, gidpt, NULL, (char*)dot_candidates, NULL, dotnum); /* Find candidates for input GIDs */ - if (num_input && + if (num_input && !Zoltan_Special_Malloc(zz, (void **)candidate_gids, num_input, ZOLTAN_SPECIAL_MALLOC_GID)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Memory error."); @@ -2214,14 +2177,14 @@ ZOLTAN_ID_PTR current_candidate; } ierr = Zoltan_DD_Find(dd, input_gids, NULL, (char*)*candidate_gids, NULL, - num_input, NULL); + num_input, NULL); End: Zoltan_DD_Destroy(&dd); ZOLTAN_FREE(&dot_candidates); - if (ierr < 0) + if (ierr < 0) Zoltan_Special_Free(zz, (void **)candidate_gids, ZOLTAN_SPECIAL_MALLOC_GID); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); diff --git a/packages/zoltan/src/rcb/shared.h b/packages/zoltan/src/rcb/shared.h index 7b7eea8437..d76bb322bc 100644 --- a/packages/zoltan/src/rcb/shared.h +++ b/packages/zoltan/src/rcb/shared.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __SHARED_CONST_H @@ -57,21 +20,21 @@ extern "C" { /* Definitions shared by parallel RCB and RIB */ #define DEFAULT_CHECK_GEOM 1 #define TINY 1.0e-6 -#define RB_MAX_WGTS 4 +#define RB_MAX_WGTS 4 /* Data structures shared by parallel RCB and RIB */ -/* dot to balance on for RCB and RIB */ +/* dot to balance on for RCB and RIB */ #if 0 struct Dot_Struct { /* dot = point in 3-space */ double X[3]; /* location of dot */ double Weight[RB_MAX_WGTS]; /* weight of dot - if used must be >= 0 */ int Proc; /* Processor ID for processor owning a dot. - For now, we'll keep it with a dot, even + For now, we'll keep it with a dot, even though the global and local ids are now stored separately. */ int Input_Part; /* Partition to which the dot is assigned initially (input). */ - int Part; /* New partition to which the dot is + int Part; /* New partition to which the dot is assigned. */ int Size; /* Migration size */ }; @@ -82,12 +45,12 @@ struct Dot_Struct { /* dot = point in 3-space */ int nWeights; /* number of weights per dot in Weight array */ double uniformWeight; /* if non-zero, then Weight is NULL and all weights are the same */ int *Proc; /* Processor ID for processor owning a dot. - For now, we'll keep it with a dot, even + For now, we'll keep it with a dot, even though the global and local ids are now stored separately. */ int *Input_Part; /* Partition to which the dot is assigned initially (input). */ - int *Part; /* New partition to which the dot is + int *Part; /* New partition to which the dot is assigned. */ int *Size; /* Migration size, NULL means all are size 1 */ }; @@ -118,12 +81,12 @@ extern int Zoltan_RB_Send_Dots_less_memory(ZZ *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR extern void Zoltan_Free_And_Reset_Dot_Structure(struct Dot_Struct *); -extern int Zoltan_RB_Remap(ZZ *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, - struct Dot_Struct *, int *, int *, int *, double, int , ZOLTAN_GNO_TYPE *, +extern int Zoltan_RB_Remap(ZZ *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, + struct Dot_Struct *, int *, int *, int *, double, int , ZOLTAN_GNO_TYPE *, int); -extern int Zoltan_RB_Return_Arguments(ZZ *, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, - struct Dot_Struct *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **, +extern int Zoltan_RB_Return_Arguments(ZZ *, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, + struct Dot_Struct *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **, int); extern int Zoltan_RB_check_geom_input(ZZ *, struct Dot_Struct *, int); @@ -131,8 +94,8 @@ extern int Zoltan_RB_check_geom_input(ZZ *, struct Dot_Struct *, int); extern int Zoltan_RB_check_geom_output(ZZ *, struct Dot_Struct *, float *, int, int, int, int, void *); -extern void Zoltan_RB_stats(ZZ *, double, struct Dot_Struct *, int , - float *, double *, ZOLTAN_GNO_TYPE *, int, +extern void Zoltan_RB_stats(ZZ *, double, struct Dot_Struct *, int , + float *, double *, ZOLTAN_GNO_TYPE *, int, ZOLTAN_GNO_TYPE *, void *, int); extern int Zoltan_RB_Use_IDs(ZZ *); @@ -143,7 +106,7 @@ extern int Zoltan_RB_Candidates_Copy_Input(ZZ *, int, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, struct Dot_Struct *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int **, int **); -extern int Zoltan_RB_Candidates_Output(ZZ *, int, int *, +extern int Zoltan_RB_Candidates_Output(ZZ *, int, int *, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR, struct Dot_Struct *, int, ZOLTAN_ID_PTR, int *, ZOLTAN_ID_PTR *); diff --git a/packages/zoltan/src/reftree/README b/packages/zoltan/src/reftree/README index 621dec008d..b0dd0bde07 100644 --- a/packages/zoltan/src/reftree/README +++ b/packages/zoltan/src/reftree/README @@ -1,27 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER REFTREE DIRECTORY -- Routines for refinement-tree partitioning. diff --git a/packages/zoltan/src/reftree/reftree.h b/packages/zoltan/src/reftree/reftree.h index c65e510e2a..4a36099b39 100644 --- a/packages/zoltan/src/reftree/reftree.h +++ b/packages/zoltan/src/reftree/reftree.h @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __REFTREE_H #define __REFTREE_H @@ -116,10 +97,10 @@ extern int Zoltan_Reftree_Coarse_Grid_Path(int nobj, int *num_vert, ZOLTAN_ID_PTR lids, char *initpath_method, ZZ *zz); -extern ZOLTAN_REFTREE* Zoltan_Reftree_hash_lookup(ZZ *zz, +extern ZOLTAN_REFTREE* Zoltan_Reftree_hash_lookup(ZZ *zz, struct Zoltan_Reftree_hash_node **hashtab, ZOLTAN_ID_PTR key, int n); -extern int Zoltan_Reftree_inthash_lookup(ZZ *zz, +extern int Zoltan_Reftree_inthash_lookup(ZZ *zz, struct Zoltan_Reftree_inthash_node **hashtab, ZOLTAN_ID_PTR key, int n); extern void Zoltan_Reftree_Hash_Insert(ZZ *zz, ZOLTAN_REFTREE *reftree_node, diff --git a/packages/zoltan/src/reftree/reftree_build.c b/packages/zoltan/src/reftree/reftree_build.c index 177723fc91..1911fc7176 100644 --- a/packages/zoltan/src/reftree/reftree_build.c +++ b/packages/zoltan/src/reftree/reftree_build.c @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -54,11 +35,11 @@ static int order_hex3d_oct(ZZ *zz, int *vert1, int *order, ZOLTAN_ID_PTR vertices, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex, ZOLTAN_REFTREE *subroot); static int hex_nshared(int elem1, int elem2, int *lvertices, int *vert1); -static int order_other_ref(ZZ *zz, ZOLTAN_REFTREE *parent, int num_child, +static int order_other_ref(ZZ *zz, ZOLTAN_REFTREE *parent, int num_child, int *num_vert, int *vert1, ZOLTAN_ID_PTR vertices, int *order, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex); -static void order_other_ref_recur(int new_entry, int level, int *order, +static void order_other_ref_recur(int new_entry, int level, int *order, int *on_path, int num_child, int *has_out, int **share_vert, int max_share, int *solved); @@ -300,7 +281,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ num_obj = zz->Get_Num_Coarse_Obj(zz->Get_Num_Coarse_Obj_Data, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Num_Coarse_Obj."); Zoltan_Reftree_Free_Structure(zz); ZOLTAN_TRACE_EXIT(zz, yo); @@ -324,7 +305,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ out_vertex = ZOLTAN_MALLOC_GID_ARRAY(zz,num_obj); num_obj -= 1; - if (local_gids == NULL || (nlid_ent > 0 && local_lids == NULL) || + if (local_gids == NULL || (nlid_ent > 0 && local_lids == NULL) || assigned == NULL || num_vert == NULL || vertices == NULL || in_vertex == NULL || out_vertex == NULL) { @@ -348,13 +329,13 @@ int num_geom = 0; /* number of dimensions in the geometry */ * Get objects via list */ - zz->Get_Coarse_Obj_List(zz->Get_Coarse_Obj_List_Data, + zz->Get_Coarse_Obj_List(zz->Get_Coarse_Obj_List_Data, ngid_ent, nlid_ent, - local_gids, local_lids, + local_gids, local_lids, assigned, num_vert, vertices, &in_order, in_vertex, out_vertex, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Coarse_Obj_List."); Zoltan_Multifree(__FILE__, __LINE__, 8, &initpath_method, &local_gids, @@ -385,7 +366,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ lid = (nlid_ent ? &(local_lids[count*nlid_ent]) : NULL); found = zz->Get_First_Coarse_Obj(zz->Get_First_Coarse_Obj_Data, ngid_ent, nlid_ent, - &local_gids[count*ngid_ent], + &local_gids[count*ngid_ent], lid, &assigned[count], &num_vert[count], @@ -395,7 +376,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ &out_vertex[count*ngid_ent], &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_First_Coarse_Obj."); Zoltan_Multifree(__FILE__, __LINE__, 8, &initpath_method, &local_gids, @@ -413,14 +394,14 @@ int num_geom = 0; /* number of dimensions in the geometry */ while (found && count <= num_obj) { count += 1; - prev_lid = (nlid_ent ? &(local_lids[(count-1)*nlid_ent]) + prev_lid = (nlid_ent ? &(local_lids[(count-1)*nlid_ent]) : NULL); lid = (nlid_ent ? &(local_lids[count*nlid_ent]) : NULL); found = zz->Get_Next_Coarse_Obj(zz->Get_Next_Coarse_Obj_Data, ngid_ent, nlid_ent, - &local_gids[(count-1)*ngid_ent], + &local_gids[(count-1)*ngid_ent], prev_lid, - &local_gids[count*ngid_ent], + &local_gids[count*ngid_ent], lid, &assigned[count], &num_vert[count], @@ -429,7 +410,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ &out_vertex[count*ngid_ent], &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Next_Coarse_Obj."); Zoltan_Multifree(__FILE__, __LINE__, 8, &initpath_method, &local_gids, @@ -548,10 +529,10 @@ int num_geom = 0; /* number of dimensions in the geometry */ } num_geom = zz->Get_Num_Geom(zz->Get_Num_Geom_Data, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Num_Geom."); ZOLTAN_TRACE_EXIT(zz, yo); - return(ierr); + return(ierr); } if (!(num_geom==2 || num_geom==3)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Geometry must be either 2D or 3D."); @@ -591,14 +572,14 @@ int num_geom = 0; /* number of dimensions in the geometry */ &coords); ZOLTAN_TRACE_EXIT(zz, yo); return(ZOLTAN_MEMERR); - } + } /* get the coordinates of each element */ - if (zz->Get_Geom) { + if (zz->Get_Geom) { for (i=0; iGet_Geom(zz->Get_Geom_Data, zz->Num_GID, zz->Num_LID, + zz->Get_Geom(zz->Get_Geom_Data, zz->Num_GID, zz->Num_LID, &(local_gids[ngid_ent*i]), &(local_lids[nlid_ent*i]), &(coords[num_geom*i]),&ierr); if (ierr) { @@ -719,7 +700,7 @@ int num_geom = 0; /* number of dimensions in the geometry */ recv_size_all[i-1] = (3*num_ass_all[i-1]+sum_ass_vert_all[i-1])*ngid_ent; displs[i] = displs[i-1] + recv_size_all[i-1]; } - recv_size_all[nproc-1] = + recv_size_all[nproc-1] = (3*num_ass_all[nproc-1]+sum_ass_vert_all[nproc-1])*ngid_ent; recv_size = displs[nproc-1] + recv_size_all[nproc-1]; @@ -759,11 +740,11 @@ int num_geom = 0; /* number of dimensions in the geometry */ sum_vert = 0; for (i=0; iGet_Child_Weight(zz->Get_Child_Weight_Data, ngid_ent, nlid_ent, &(full_gid[i*ngid_ent]), - lid, zz->Obj_Weight_Dim, + lid, zz->Obj_Weight_Dim, root->children[order[i]].weight, &ierr); } for (j=0; jchildren[order[i]].vertices[j*ngid_ent]), &(full_vertices[(sum_vert+j)*ngid_ent])); if (full_num_vert[i] > 0) sum_vert += full_num_vert[i]; @@ -1287,7 +1268,7 @@ int i; /* loop counter */ if ( (root->children[i]).known_to_me) { ierr = Zoltan_Reftree_Build_Recursive(zz,&(root->children[i])); if (ierr==ZOLTAN_FATAL || ierr==ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from Zoltan_Reftree_Build_Recursive."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -1357,11 +1338,11 @@ int existing; /* existing child that agrees with GET_CHILD data */ * Get the number of children of this node */ - num_obj = zz->Get_Num_Child(zz->Get_Num_Child_Data, + num_obj = zz->Get_Num_Child(zz->Get_Num_Child_Data, ngid_ent, nlid_ent, subroot->global_id, subroot->local_id, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Num_Child."); Zoltan_Reftree_Free_Structure(zz); return(ierr); @@ -1406,7 +1387,7 @@ int existing; /* existing child that agrees with GET_CHILD data */ svert1 = (int *) ZOLTAN_MALLOC((num_obj+1)*sizeof(int)); sorder = (int *) ZOLTAN_MALLOC(num_obj*sizeof(int)); ssize = num_obj; - if (slocal_gids == NULL || (nlid_ent > 0 && slocal_lids == NULL) || + if (slocal_gids == NULL || (nlid_ent > 0 && slocal_lids == NULL) || sassigned == NULL || snum_vert == NULL || svertices == NULL || sin_vertex == NULL || sout_vertex == NULL || svert1 == NULL) { @@ -1425,14 +1406,14 @@ int existing; /* existing child that agrees with GET_CHILD data */ return(ZOLTAN_MEMERR); } } - zz->Get_Child_List(zz->Get_Child_List_Data, + zz->Get_Child_List(zz->Get_Child_List_Data, ngid_ent, nlid_ent, - subroot->global_id, subroot->local_id, + subroot->global_id, subroot->local_id, slocal_gids, slocal_lids, sassigned, snum_vert, svertices, &ref_type, sin_vertex, sout_vertex, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Child_List."); Zoltan_Reftree_Free_Structure(zz); return(ierr); @@ -1519,7 +1500,7 @@ int existing; /* existing child that agrees with GET_CHILD data */ zz->Get_Child_Weight(zz->Get_Child_Weight_Data, ngid_ent, nlid_ent, subroot->children[i].global_id, - lid, + lid, zz->Obj_Weight_Dim, subroot->children[i].weight, &ierr); } @@ -1629,7 +1610,7 @@ int existing; /* existing child that agrees with GET_CHILD data */ zz->Get_Child_Weight(zz->Get_Child_Weight_Data, ngid_ent, nlid_ent, &(slocal_gids[i*ngid_ent]), - lid, + lid, zz->Obj_Weight_Dim, subroot->children[sorder[i]].weight, &ierr); } @@ -1690,7 +1671,7 @@ int existing; /* existing child that agrees with GET_CHILD data */ /*****************************************************************************/ -static int order_tri_bisect(ZZ *zz, int *vert1, int *order, +static int order_tri_bisect(ZZ *zz, int *vert1, int *order, ZOLTAN_ID_PTR vertices, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex, ZOLTAN_REFTREE *subroot) { @@ -2593,7 +2574,7 @@ int i,j,count,found; /*****************************************************************************/ -static int order_other_ref(ZZ *zz, ZOLTAN_REFTREE *parent, int num_child, +static int order_other_ref(ZZ *zz, ZOLTAN_REFTREE *parent, int num_child, int *num_vert, int *vert1, ZOLTAN_ID_PTR vertices, int *order, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex) @@ -2648,7 +2629,7 @@ int ngid_ent = zz->Num_GID; /* number of array entries in a global ID */ share_vert = (int **) ZOLTAN_MALLOC(num_child*sizeof(int *)); if (share_vert == NULL) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); - Zoltan_Multifree(__FILE__, __LINE__, 3, &share_vert, + Zoltan_Multifree(__FILE__, __LINE__, 3, &share_vert, &has_in, &has_out); return(ZOLTAN_MEMERR); @@ -2658,7 +2639,7 @@ int ngid_ent = zz->Num_GID; /* number of array entries in a global ID */ if (share_vert[i] == NULL) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); for (j=0; j<=i; j++) ZOLTAN_FREE(&(share_vert[j])); - Zoltan_Multifree(__FILE__, __LINE__, 3, &share_vert, + Zoltan_Multifree(__FILE__, __LINE__, 3, &share_vert, &has_in, &has_out); return(ZOLTAN_MEMERR); @@ -2701,7 +2682,7 @@ int ngid_ent = zz->Num_GID; /* number of array entries in a global ID */ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); for (j=0; jNum_GID; /* number of array entries in a global ID */ /*****************************************************************************/ -static void order_other_ref_recur(int new_entry, int level, int *order, +static void order_other_ref_recur(int new_entry, int level, int *order, int *on_path, int num_child, int *has_out, int **share_vert, int max_share, int *solved) @@ -3167,7 +3148,7 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ num_obj = zz->Get_Num_Coarse_Obj(zz->Get_Num_Coarse_Obj_Data, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Num_Coarse_Obj."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -3200,13 +3181,13 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ return(ZOLTAN_MEMERR); } - zz->Get_Coarse_Obj_List(zz->Get_Coarse_Obj_List_Data, + zz->Get_Coarse_Obj_List(zz->Get_Coarse_Obj_List_Data, ngid_ent, nlid_ent, - local_gids, local_lids, + local_gids, local_lids, assigned, num_vert, vertices, &in_order, in_vertex, out_vertex, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Coarse_Obj_List."); Zoltan_Multifree(__FILE__, __LINE__, 8, &local_gids, &local_lids, @@ -3238,7 +3219,7 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ tree_node->weight[0] = 0.0; else { lid = (nlid_ent ? &(local_lids[i*nlid_ent]) : NULL); - zz->Get_Child_Weight(zz->Get_Child_Weight_Data, + zz->Get_Child_Weight(zz->Get_Child_Weight_Data, ngid_ent, nlid_ent, &(local_gids[i*ngid_ent]), lid, @@ -3271,8 +3252,8 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ plocal_gids = ZOLTAN_MALLOC_GID(zz); plocal_lids = ZOLTAN_MALLOC_LID(zz); vertices = ZOLTAN_MALLOC_GID_ARRAY(zz,MAXVERT); - if (local_gids == NULL || (nlid_ent > 0 && local_lids == NULL) || - plocal_gids == NULL || (nlid_ent > 0 && plocal_lids == NULL) || + if (local_gids == NULL || (nlid_ent > 0 && local_lids == NULL) || + plocal_gids == NULL || (nlid_ent > 0 && plocal_lids == NULL) || in_vertex == NULL || out_vertex == NULL || vertices == NULL) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Insufficient memory."); @@ -3293,7 +3274,7 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ &inum_vert, vertices, &in_order, in_vertex, out_vertex, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_First_Coarse_Obj."); Zoltan_Multifree(__FILE__, __LINE__, 7, &local_gids, &local_lids, @@ -3319,7 +3300,7 @@ int nlid_ent = zz->Num_LID; /* number of array entries in a local ID */ if (zz->Obj_Weight_Dim == 0) tree_node->weight[0] = 0.0; else - zz->Get_Child_Weight(zz->Get_Child_Weight_Data, + zz->Get_Child_Weight(zz->Get_Child_Weight_Data, ngid_ent, nlid_ent, local_gids, local_lids, zz->Obj_Weight_Dim, tree_node->weight, &ierr); @@ -3432,7 +3413,7 @@ int i, j; void Zoltan_Reftree_Get_Child_Order(ZZ *zz, int *order, int *ierr) { -/* +/* * Return the order of the children in the refinement tree. * Upon return, order contains GIDs. It contains * sets of entries consisting of the GID of an element followed by the diff --git a/packages/zoltan/src/reftree/reftree_coarse_path.c b/packages/zoltan/src/reftree/reftree_coarse_path.c index e8a2a27b4d..670d951cfc 100644 --- a/packages/zoltan/src/reftree/reftree_coarse_path.c +++ b/packages/zoltan/src/reftree/reftree_coarse_path.c @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -118,7 +99,7 @@ static int *to_add_ptr; /* in this file the vertices are integers from 0 to nvert-1, but in the input/output arguments they are gids. vertex_gid maps from int to gid */ -static ZOLTAN_ID_PTR vertex_gid; +ZOLTAN_ID_PTR vertex_gid; /* variables for each element which define the path */ static int *prev, *next, *in, *out, *onpath; @@ -280,7 +261,7 @@ static int set_neigh(ZOLTAN_ID_PTR vertices, int *num_vert, int all_triangles, ZZ *zz) { -/* +/* * determine the neighbor relationships and list of shared vertices */ @@ -289,7 +270,7 @@ struct Zoltan_Reftree_inthash_node **hashtable; int **temp_element_list; int i, j, k, l, nvert, vert, index, element, vert_count, ierr; -/* +/* * first create a list of elements for each vertex */ @@ -550,7 +531,7 @@ int i, j, k, l, nvert, vert, index, element, vert_count, ierr; static int add_neigh_pair(int v,int e1,int e2, ZZ *zz) { -/* +/* * adds the elements e1 and e2, which share vertex v, to the neigh * and shared_vert lists */ @@ -558,7 +539,7 @@ static int add_neigh_pair(int v,int e1,int e2, ZZ *zz) char *yo = "add_neigh_pair"; int nshare, index = 0, i, j, k; -/* +/* * see if they are already listed as neighbors */ @@ -580,9 +561,9 @@ int nshare, index = 0, i, j, k; if (neigh_dim[e1][nshare+1] <= num_neigh[e1][nshare+1]) { neigh_dim[e1][nshare+1] *= 2; - neigh[e1][nshare+1] = + neigh[e1][nshare+1] = (int *) ZOLTAN_REALLOC(neigh[e1][nshare+1], sizeof(int)*neigh_dim[e1][nshare+1]); - shared_vert[e1][nshare+1] = + shared_vert[e1][nshare+1] = (int **) ZOLTAN_REALLOC(shared_vert[e1][nshare+1], sizeof(int *)*neigh_dim[e1][nshare+1]); if (neigh[e1][nshare+1] == NULL || shared_vert[e1][nshare+1] == NULL) { @@ -617,7 +598,7 @@ int nshare, index = 0, i, j, k; for (i=0; iProc, yo, "Insufficient memory."); @@ -684,7 +665,7 @@ int nshare, index = 0, i, j, k; static int add_to_to_add(int element, ZZ *zz) { -/* +/* * add all the neighbors of element that are not on the cycle to the * lists of elements that can be added to the cycle */ @@ -1860,10 +1841,10 @@ static int sfc_coarse_grid_path(int nobj, int *num_vert, ZOLTAN_ID_PTR vertices, } num_geom = zz->Get_Num_Geom(zz->Get_Num_Geom_Data, &ierr); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from user function Get_Num_Geom."); ZOLTAN_TRACE_EXIT(zz, yo); - return(ierr); + return(ierr); } if (!(num_geom==2 || num_geom==3)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Geometry must be either 2D or 3D."); @@ -1960,12 +1941,12 @@ static int sfc_coarse_grid_path(int nobj, int *num_vert, ZOLTAN_ID_PTR vertices, first_vert[0] = 0; for (i=1; iNum_GID*elem]), @@ -1984,11 +1965,11 @@ static int sfc_coarse_grid_path(int nobj, int *num_vert, ZOLTAN_ID_PTR vertices, ierr = find_inout(elem, pprev, prevprev, in_vertex, out_vertex, vertices, num_vert, first_vert, zz); if (ierr) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from find_inout."); Zoltan_Multifree(__FILE__,__LINE__, 3, &sfccoord, &ind, &first_vert); ZOLTAN_TRACE_EXIT(zz, yo); - return(ierr); + return(ierr); } } @@ -2297,7 +2278,7 @@ static int MAXLEV = 24; /*****************************************************************************/ /*****************************************************************************/ -int Zoltan_Reftree_Coarse_Grid_Path(int nobj, int *num_vert, +int Zoltan_Reftree_Coarse_Grid_Path(int nobj, int *num_vert, ZOLTAN_ID_PTR vertices, ZOLTAN_ID_PTR in_vertex, ZOLTAN_ID_PTR out_vertex, double *coords, int *order, ZOLTAN_ID_PTR gids, @@ -2331,7 +2312,7 @@ int all_triangles = 0, i, element, success, ierr; strcmp(initpath_method, "SIERPINSKI") == 0 || strcmp(initpath_method, "REFTREE_DEFAULT") == 0 ) { ierr = sfc_coarse_grid_path(nobj, num_vert, vertices, in_vertex, - out_vertex, coords, order, gids, lids, + out_vertex, coords, order, gids, lids, initpath_method, all_triangles, zz); ZOLTAN_TRACE_EXIT(zz, yo); return (ierr); diff --git a/packages/zoltan/src/reftree/reftree_const.h b/packages/zoltan/src/reftree/reftree_const.h index 56a5829a39..2387f41f81 100644 --- a/packages/zoltan/src/reftree/reftree_const.h +++ b/packages/zoltan/src/reftree/reftree_const.h @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __REFTREE_CONST_H #define __REFTREE_CONST_H diff --git a/packages/zoltan/src/reftree/reftree_hash.c b/packages/zoltan/src/reftree/reftree_hash.c index a69f7e4008..4db7f34fb0 100644 --- a/packages/zoltan/src/reftree/reftree_hash.c +++ b/packages/zoltan/src/reftree/reftree_hash.c @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -36,7 +17,7 @@ extern "C" { #include "zz_util_const.h" #include "reftree.h" -/* Zoltan_Reftree_hash_lookup uses Zoltan_Hash to lookup a key +/* Zoltan_Reftree_hash_lookup uses Zoltan_Hash to lookup a key * * Input: * zz, a Zoltan structure @@ -52,7 +33,7 @@ extern "C" { * Modified for refinement tree nodes by william.mitchell@nist.gov */ -ZOLTAN_REFTREE* Zoltan_Reftree_hash_lookup (ZZ *zz, +ZOLTAN_REFTREE* Zoltan_Reftree_hash_lookup (ZZ *zz, struct Zoltan_Reftree_hash_node **hashtab, ZOLTAN_ID_PTR key, int n) { @@ -70,7 +51,7 @@ ZOLTAN_REFTREE* Zoltan_Reftree_hash_lookup (ZZ *zz, /* second version for int instead of refinement tree node */ -int Zoltan_Reftree_inthash_lookup (ZZ *zz, +int Zoltan_Reftree_inthash_lookup (ZZ *zz, struct Zoltan_Reftree_inthash_node **hashtab, ZOLTAN_ID_PTR key, int n) { diff --git a/packages/zoltan/src/reftree/reftree_part.c b/packages/zoltan/src/reftree/reftree_part.c index 578ef30f65..c6454c1de2 100644 --- a/packages/zoltan/src/reftree/reftree_part.c +++ b/packages/zoltan/src/reftree/reftree_part.c @@ -1,30 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -62,20 +43,20 @@ extern "C" { /* Prototypes for functions internal to this file */ static int Zoltan_Reftree_Sum_Weights(ZZ *zz); -static void Zoltan_Reftree_Sum_My_Weights(ZZ *zz, ZOLTAN_REFTREE *subroot, +static void Zoltan_Reftree_Sum_My_Weights(ZZ *zz, ZOLTAN_REFTREE *subroot, int *count, int wdim); static void Zoltan_Reftree_Sum_All_Weights(ZZ *zz, ZOLTAN_REFTREE *subroot, int wdim); -static void Zoltan_Reftree_List_Other_Leaves(ZZ *zz, ZOLTAN_REFTREE *subroot, +static void Zoltan_Reftree_List_Other_Leaves(ZZ *zz, ZOLTAN_REFTREE *subroot, ZOLTAN_ID_PTR list, int *count); -static int Zoltan_Reftree_Partition(ZZ *zz, float *part_sizes, int *num_export, - ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, +static int Zoltan_Reftree_Partition(ZZ *zz, float *part_sizes, int *num_export, + ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_to_partition, int **export_procs); static int Zoltan_Reftree_Part_Recursive(ZZ *zz, ZOLTAN_REFTREE *subroot, int *part, float *current_size, int *num_exp, float *cutoff, int num_part); -static int Zoltan_Reftree_Mark_and_Count(ZOLTAN_REFTREE *subroot, int part, +static int Zoltan_Reftree_Mark_and_Count(ZOLTAN_REFTREE *subroot, int part, int *num_exp, ZZ *zz); -static int Zoltan_Reftree_Export_Lists(ZZ *zz, ZOLTAN_REFTREE *subroot, +static int Zoltan_Reftree_Export_Lists(ZZ *zz, ZOLTAN_REFTREE *subroot, int *num_export, ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_to_partition, int **export_procs); @@ -124,7 +105,7 @@ double time0 = 0, time1= 0, time2 = 0, time3 =0, time4 =0; if (zz->Debug_Level >= ZOLTAN_DEBUG_ATIME) time0 = Zoltan_Time(zz->Timer); ierr = Zoltan_Reftree_Init(zz); if (ierr==ZOLTAN_FATAL || ierr==ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned by Zoltan_Reftree_Init."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -144,7 +125,7 @@ double time0 = 0, time1= 0, time2 = 0, time3 =0, time4 =0; ierr = Zoltan_Reftree_Build(zz); if (ierr==ZOLTAN_FATAL || ierr==ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned by Zoltan_Reftree_Build."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -158,7 +139,7 @@ double time0 = 0, time1= 0, time2 = 0, time3 =0, time4 =0; ierr = Zoltan_Reftree_Sum_Weights(zz); if (ierr==ZOLTAN_FATAL || ierr==ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned by Zoltan_Reftree_Sum_Weights."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -173,7 +154,7 @@ double time0 = 0, time1= 0, time2 = 0, time3 =0, time4 =0; ierr = Zoltan_Reftree_Partition(zz, part_sizes, num_export, export_global_ids, export_local_ids, export_to_partition, export_procs); if (ierr==ZOLTAN_FATAL || ierr==ZOLTAN_MEMERR) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned by Zoltan_Reftree_Partition."); ZOLTAN_TRACE_EXIT(zz, yo); return(ierr); @@ -186,7 +167,7 @@ double time0 = 0, time1= 0, time2 = 0, time3 =0, time4 =0; Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, time1-time0, "REFTREE Time to initialize :"); } - Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, time2-time1, + Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, time2-time1, "REFTREE Time to build tree :"); Zoltan_Print_Stats(zz->Communicator, zz->Debug_Proc, time3-time2, "REFTREE Time to sum weights:"); @@ -220,9 +201,9 @@ ZOLTAN_REFTREE *root; /* Root of the refinement tree */ int wdim; /* Dimension of the weight array */ int i,j; /* loop counters */ int count; /* counter */ -ZOLTAN_ID_PTR leaf_list = NULL; +ZOLTAN_ID_PTR leaf_list = NULL; /* leaves for which some proc requests weight */ -ZOLTAN_ID_PTR all_leaflist = NULL; +ZOLTAN_ID_PTR all_leaflist = NULL; /* leaf_list from all processors */ int reqsize; /* length of leaf_list */ int *reqsize_all; /* reqsize from all processors */ @@ -367,7 +348,7 @@ int num_gid_entries = zz->Num_GID; /* Number of array entries in a global ID */ for (i=0; iNum_GID; /* Number of array entries in a global ID */ /*****************************************************************************/ /*****************************************************************************/ -static void Zoltan_Reftree_Sum_My_Weights(ZZ *zz, ZOLTAN_REFTREE *subroot, +static void Zoltan_Reftree_Sum_My_Weights(ZZ *zz, ZOLTAN_REFTREE *subroot, int *count, int wdim) { @@ -548,7 +529,7 @@ int i, j; /* loop counter */ /*****************************************************************************/ /*****************************************************************************/ -static void Zoltan_Reftree_List_Other_Leaves(ZZ *zz, ZOLTAN_REFTREE *subroot, +static void Zoltan_Reftree_List_Other_Leaves(ZZ *zz, ZOLTAN_REFTREE *subroot, ZOLTAN_ID_PTR list, int *count) { @@ -585,8 +566,8 @@ int j; /* loop counter */ /*****************************************************************************/ /*****************************************************************************/ -static int Zoltan_Reftree_Partition(ZZ *zz, float *part_sizes, int *num_export, - ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, +static int Zoltan_Reftree_Partition(ZZ *zz, float *part_sizes, int *num_export, + ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_to_partition, int **export_procs) { @@ -641,7 +622,7 @@ int wdim; /* Max(zz->Obj_Weight_Dim, 1) */ cutoff[0] = part_sizes[0]; /* TEMP SINGLE WEIGHT */ wdim = ((zz->Obj_Weight_Dim == 0) ? 1 : zz->Obj_Weight_Dim); - for (part = 1; part < num_part; part++) + for (part = 1; part < num_part; part++) cutoff[part] = cutoff[part-1] + part_sizes[part*wdim]; /* TEMP SINGLE WEIGHT */ cutoff[num_part-1] = 1.0; /* just to make sure roundoff doesn't bite us */ @@ -863,7 +844,7 @@ int ierr; /* error flag */ /*****************************************************************************/ /*****************************************************************************/ -static int Zoltan_Reftree_Mark_and_Count(ZOLTAN_REFTREE *subroot, int part, +static int Zoltan_Reftree_Mark_and_Count(ZOLTAN_REFTREE *subroot, int part, int *num_exp, ZZ *zz) { /* @@ -890,7 +871,7 @@ int i, ierr; /*****************************************************************************/ /*****************************************************************************/ -static int Zoltan_Reftree_Export_Lists(ZZ *zz, ZOLTAN_REFTREE *subroot, +static int Zoltan_Reftree_Export_Lists(ZZ *zz, ZOLTAN_REFTREE *subroot, int *num_export, ZOLTAN_ID_PTR *export_global_ids, ZOLTAN_ID_PTR *export_local_ids, int **export_to_partition, int **export_procs) diff --git a/packages/zoltan/src/simple/README b/packages/zoltan/src/simple/README index e4a7b95f35..8f2cc2c87f 100644 --- a/packages/zoltan/src/simple/README +++ b/packages/zoltan/src/simple/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER This module (directory) contains a couple very simple partitioning algorithms. They are instructional and mainly useful for testing, not for real work. diff --git a/packages/zoltan/src/simple/block.c b/packages/zoltan/src/simple/block.c index 77d8dd0c19..103095e75f 100644 --- a/packages/zoltan/src/simple/block.c +++ b/packages/zoltan/src/simple/block.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -57,7 +20,7 @@ extern "C" { #include "all_allo_const.h" /* local function prototypes */ -static void block_part(ZZ *zz, int num_obj, int wtflag, float *wgts, +static void block_part(ZZ *zz, int num_obj, int wtflag, float *wgts, float *part_sizes, int *newparts); /* Block partitioning method. @@ -86,7 +49,7 @@ int Zoltan_Block( int i, count, num_obj; int wtflag = 0; ZOLTAN_ID_PTR global_ids = NULL; - ZOLTAN_ID_PTR local_ids = NULL; + ZOLTAN_ID_PTR local_ids = NULL; int *parts = NULL; int *newparts = NULL; float *wgts = NULL; @@ -102,7 +65,7 @@ int Zoltan_Block( /* Get list of local objects. */ if (zz->Obj_Weight_Dim > 1) { ierr = ZOLTAN_FATAL; - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "OBJ_WEIGHT_DIM > 1 not supported by LB_METHOD BLOCK."); goto End; } @@ -157,7 +120,7 @@ int Zoltan_Block( /* Set new partition number. */ (*export_to_part)[count] = newparts[i]; /* Processor is derived from partition number. */ - (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, + (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, (*export_to_part)[count], &global_ids[i*zz->Num_GID]); ++count; @@ -181,7 +144,7 @@ int Zoltan_Block( /* Replace this function with your own algorithm if desired. */ /* Output: newparts contains the new partition numbers. */ -static void block_part(ZZ *zz, int num_obj, int wtflag, float *wgts, +static void block_part(ZZ *zz, int num_obj, int wtflag, float *wgts, float *part_sizes, int *newparts) { int i, part; @@ -199,26 +162,26 @@ static void block_part(ZZ *zz, int num_obj, int wtflag, float *wgts, wtsum = num_obj; /* Cumulative global wtsum */ - MPI_Allgather(&wtsum, 1, MPI_DOUBLE, &scansum[1], 1, MPI_DOUBLE, + MPI_Allgather(&wtsum, 1, MPI_DOUBLE, &scansum[1], 1, MPI_DOUBLE, zz->Communicator); /* scansum = sum of weights on lower processors, excluding self. */ scansum[0] = 0.; for (i=1; i<=zz->Num_Proc; i++) - scansum[i] += scansum[i-1]; + scansum[i] += scansum[i-1]; /* Overwrite part_sizes with cumulative sum (inclusive) part_sizes. */ /* A cleaner way is to make a copy, but this works. */ for (i=1; iLB.Num_Global_Parts; i++) - part_sizes[i] += part_sizes[i-1]; + part_sizes[i] += part_sizes[i-1]; /* Loop over objects and assign partition. */ part = 0; wtsum = scansum[zz->Proc]; for (i=0; iLB.Num_Global_Parts-1 && (wtsum+0.5*(wtflag? wgts[i]: 1.0)) + while (partLB.Num_Global_Parts-1 && (wtsum+0.5*(wtflag? wgts[i]: 1.0)) > part_sizes[part]*scansum[zz->Num_Proc]) part++; newparts[i] = part; diff --git a/packages/zoltan/src/simple/cyclic.c b/packages/zoltan/src/simple/cyclic.c index 050c0acb21..da04939ef8 100644 --- a/packages/zoltan/src/simple/cyclic.c +++ b/packages/zoltan/src/simple/cyclic.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -59,7 +22,7 @@ extern "C" { #include "all_allo_const.h" /* local function prototypes */ -static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, +static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, float *part_sizes, int *newparts); /* Cyclic (round-robin) partitioning method. @@ -87,7 +50,7 @@ int Zoltan_Cyclic( int i, count, num_obj; int wtflag = 0; ZOLTAN_ID_PTR global_ids = NULL; - ZOLTAN_ID_PTR local_ids = NULL; + ZOLTAN_ID_PTR local_ids = NULL; int *parts = NULL; int *newparts = NULL; float *wgts = NULL; @@ -103,7 +66,7 @@ int Zoltan_Cyclic( /* Get list of local objects. */ if (zz->Obj_Weight_Dim > 1) { ierr = ZOLTAN_FATAL; - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "OBJ_WEIGHT_DIM > 1 not supported by LB_METHOD BLOCK."); goto End; } @@ -158,7 +121,7 @@ int Zoltan_Cyclic( /* Set new partition number. */ (*export_to_part)[count] = newparts[i]; /* Processor is derived from partition number. */ - (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, + (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, (*export_to_part)[count], &global_ids[i*zz->Num_GID]); ++count; @@ -182,7 +145,7 @@ int Zoltan_Cyclic( /* Pure cyclic. Ignore weights! */ /* Output: newparts contains the new partition numbers. */ -static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, +static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, float *part_sizes, int *newparts) { ZOLTAN_GNO_TYPE n, scan_sum; @@ -195,7 +158,7 @@ static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, /* Compute offset for my proc */ n = (ZOLTAN_GNO_TYPE)num_obj; MPI_Scan(&n, &scan_sum, 1, gno_mpi_type, MPI_SUM, zz->Communicator); - part = (int)(scan_sum - num_obj); + part = (int)(scan_sum - num_obj); part = (part % k); /* Loop over objects and assign parts. */ @@ -204,5 +167,5 @@ static void cyclic_part(ZZ *zz, int num_obj, int wtflag, float *wgts, if (++part >= k) part= 0; } - + } diff --git a/packages/zoltan/src/simple/random.c b/packages/zoltan/src/simple/random.c index 04fd93b654..e09378732b 100644 --- a/packages/zoltan/src/simple/random.c +++ b/packages/zoltan/src/simple/random.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -94,7 +57,7 @@ int Zoltan_Random( int max_export; double rand_frac = 1.0; /* Default is to move all objects. */ ZOLTAN_ID_PTR global_ids = NULL; - ZOLTAN_ID_PTR local_ids = NULL; + ZOLTAN_ID_PTR local_ids = NULL; int *parts = NULL; float *dummy = NULL; static char *yo = "Zoltan_Random"; @@ -102,9 +65,9 @@ int Zoltan_Random( ZOLTAN_TRACE_ENTER(zz, yo); - /* Synchronize the random number generator. - * This synchronization is needed only for sanity in our nightly testing. - * If some other operation (eg., Zoltan_LB_Eval) changes the status of + /* Synchronize the random number generator. + * This synchronization is needed only for sanity in our nightly testing. + * If some other operation (eg., Zoltan_LB_Eval) changes the status of * the random number generator, the answers here will change. They won't * be wrong, but they will be different from our accepted answers. */ @@ -119,7 +82,7 @@ int Zoltan_Random( /* Get parameter values. */ Zoltan_Bind_Param(Random_params, "RANDOM_MOVE_FRACTION", (void *) &rand_frac); - Zoltan_Assign_Param_Vals(zz->Params, Random_params, zz->Debug_Level, + Zoltan_Assign_Param_Vals(zz->Params, Random_params, zz->Debug_Level, zz->Proc, zz->Debug_Proc); /* Get list of local objects. */ @@ -162,7 +125,7 @@ int Zoltan_Random( /* Randomly pick new partition number. */ (*export_to_part)[count] = Zoltan_Rand_InRange(NULL, zz->LB.Num_Global_Parts); /* Processor number is derived from partition number. */ - (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, + (*export_procs)[count] = Zoltan_LB_Part_To_Proc(zz, (*export_to_part)[count], &global_ids[i*zz->Num_GID]); /* printf("Debug: Export gid %u to part %d and proc %d.\n", (*export_global_ids)[count], (*export_to_part)[count], (*export_procs)[count]); */ @@ -204,3 +167,5 @@ char *val) /* value of variable */ return(status); } + + diff --git a/packages/zoltan/src/simple/simple_const.h b/packages/zoltan/src/simple/simple_const.h index 1223e5436e..6129099e85 100644 --- a/packages/zoltan/src/simple/simple_const.h +++ b/packages/zoltan/src/simple/simple_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __SIMPLE_CONST_H diff --git a/packages/zoltan/src/timer/README b/packages/zoltan/src/timer/README index 0c07240628..7cdd175670 100644 --- a/packages/zoltan/src/timer/README +++ b/packages/zoltan/src/timer/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER TIMER DIRECTORY -- Routines to provide access to timing utility. diff --git a/packages/zoltan/src/timer/timer_const.h b/packages/zoltan/src/timer/timer_const.h index 15576c0215..3a8b4b7289 100644 --- a/packages/zoltan/src/timer/timer_const.h +++ b/packages/zoltan/src/timer/timer_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __TIMER_CONST_H diff --git a/packages/zoltan/src/timer/timer_params.c b/packages/zoltan/src/timer/timer_params.c index a9125d5e51..b9ef1f8b07 100644 --- a/packages/zoltan/src/timer/timer_params.c +++ b/packages/zoltan/src/timer/timer_params.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus diff --git a/packages/zoltan/src/tpls/README b/packages/zoltan/src/tpls/README index 640698c2a6..a26949509a 100644 --- a/packages/zoltan/src/tpls/README +++ b/packages/zoltan/src/tpls/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER PARMETIS DIRECTORY -- Routines to providing the interface to the diff --git a/packages/zoltan/src/tpls/build_graph.c b/packages/zoltan/src/tpls/build_graph.c index f5467c44db..2d7304f1a4 100644 --- a/packages/zoltan/src/tpls/build_graph.c +++ b/packages/zoltan/src/tpls/build_graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/tpls/graph_util.h b/packages/zoltan/src/tpls/graph_util.h index 54bdda4d54..1f61501905 100644 --- a/packages/zoltan/src/tpls/graph_util.h +++ b/packages/zoltan/src/tpls/graph_util.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __COMMON_H diff --git a/packages/zoltan/src/tpls/parmetis_interface.c b/packages/zoltan/src/tpls/parmetis_interface.c index 7fc92a8274..45f6dcc1a3 100644 --- a/packages/zoltan/src/tpls/parmetis_interface.c +++ b/packages/zoltan/src/tpls/parmetis_interface.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -91,7 +54,7 @@ static int mylog2(int x) return (i-1); } -static int Zoltan_Parmetis_Parse(ZZ*, indextype *, char*, realtype*, double *, +static int Zoltan_Parmetis_Parse(ZZ*, indextype *, char*, realtype*, double *, ZOLTAN_Output_Order*); @@ -148,10 +111,8 @@ int Zoltan_ParMetis( realtype *imb_tols; indextype ncon; indextype edgecut; -#ifdef ZOLTAN_PARMETIS indextype wgtflag; indextype numflag = 0; -#endif indextype num_part = zz->LB.Num_Global_Parts; /* passed to ParMETIS. */ ZOLTAN_TRACE_ENTER(zz, yo); @@ -164,10 +125,10 @@ int Zoltan_ParMetis( int tmp = zz->LB.Num_Global_Parts * MAX(zz->Obj_Weight_Dim, 1); prt.input_part_sizes = (realtype *) ZOLTAN_MALLOC(tmp * sizeof(realtype)); - for (i = 0; i < tmp; i++) + for (i = 0; i < tmp; i++) prt.input_part_sizes[i] = (realtype) part_sizes[i]; - /* KDD 2/2014: removed re-scaling part sizes so they sum to one. + /* KDD 2/2014: removed re-scaling part sizes so they sum to one. * part_sizes are already scaled in Zoltan_LB_Get_Part_Sizes. * plus, the code here was wrong for multiple object weights. * similar scaling code did not exist in the Scotch interface. @@ -238,7 +199,7 @@ int Zoltan_ParMetis( #endif /* PARMETIS31_ALWAYS_FREES_VSIZE */ - ierr = Zoltan_Preprocess_Graph(zz, &global_ids, &local_ids, &gr, + ierr = Zoltan_Preprocess_Graph(zz, &global_ids, &local_ids, &gr, geo, &prt, &vsp); if ((ierr != ZOLTAN_OK) && (ierr != ZOLTAN_WARN)) { Zoltan_Third_Exit(&gr, geo, &prt, &vsp, &part, NULL); @@ -257,10 +218,8 @@ int Zoltan_ParMetis( /* Get ready to call ParMETIS */ edgecut = -1; -#ifdef ZOLTAN_PARMETIS wgtflag = 2*(gr.obj_wgt_dim>0) + (gr.edge_wgt_dim>0); numflag = 0; -#endif ncon = (gr.obj_wgt_dim > 0 ? gr.obj_wgt_dim : 1); if (!prt.part_sizes){ @@ -279,7 +238,7 @@ int Zoltan_ParMetis( /* if (strcmp(alg, "ADAPTIVEREPART") == 0) */ for (i = 0; i < num_part*ncon; i++) - if (prt.part_sizes[i] == 0) + if (prt.part_sizes[i] == 0) ZOLTAN_THIRD_ERROR(ZOLTAN_FATAL, "Zero-sized part(s) requested! " "ParMETIS 3.x will likely fail. Please use a " "different method, or remove the zero-sized " @@ -364,9 +323,9 @@ int Zoltan_ParMetis( /* Use default options for METIS */ #if !defined(METIS_VER_MAJOR) || METIS_VER_MAJOR < 5 options[0] = 0; - METIS_WPartGraphKway (gr.vtxdist+1, gr.xadj, gr.adjncy, + METIS_WPartGraphKway (gr.vtxdist+1, gr.xadj, gr.adjncy, gr.vwgt, gr.ewgts, &wgtflag, - &numflag, &num_part, prt.part_sizes, + &numflag, &num_part, prt.part_sizes, options, &edgecut, prt.part); #else METIS_SetDefaultOptions(options); @@ -392,7 +351,7 @@ int Zoltan_ParMetis( if (get_times) times[2] = Zoltan_Time(zz->Timer); - if (gr.final_output) { + if (gr.final_output) { /* Do final output now because after the data will not be coherent: unscatter only unscatter part data, not graph */ ierr = Zoltan_Postprocess_FinalOutput (zz, &gr, &prt, &vsp, use_timers, itr); @@ -400,10 +359,10 @@ int Zoltan_ParMetis( /* Ignore the timings of Final Ouput */ if (get_times) times[3] = Zoltan_Time(zz->Timer); - ierr = Zoltan_Postprocess_Graph(zz, global_ids, local_ids, &gr, + ierr = Zoltan_Postprocess_Graph(zz, global_ids, local_ids, &gr, geo, &prt, &vsp, NULL, &part); - Zoltan_Third_Export_User(&part, + Zoltan_Third_Export_User(&part, num_imp, imp_gids, imp_lids, imp_procs, imp_to_part, num_exp, exp_gids, exp_lids, exp_procs, exp_to_part); @@ -428,10 +387,10 @@ int Zoltan_ParMetis( static int Zoltan_Parmetis_Parse( - ZZ* zz, - indextype *options, + ZZ* zz, + indextype *options, char* alg, - realtype* itr, + realtype* itr, double *pmv3_itr, ZOLTAN_Output_Order *ord ) @@ -572,10 +531,10 @@ int Zoltan_ParMetis_Order( ZOLTAN_Third_Graph gr; #ifdef ZOLTAN_PARMETIS - MPI_Comm comm = zz->Communicator;/* don't want to risk letting external + MPI_Comm comm = zz->Communicator;/* don't want to risk letting external packages changing our communicator */ - indextype numflag = 0; #endif + indextype numflag = 0; int timer_p = 0; int get_times = 0; @@ -721,7 +680,7 @@ int Zoltan_ParMetis_Order( if (IS_GLOBAL_GRAPH(gr.graph_type)){ ZOLTAN_TRACE_DETAIL(zz, yo, "Calling the ParMETIS library"); - ParMETIS_V3_NodeND (gr.vtxdist, gr.xadj, gr.adjncy, + ParMETIS_V3_NodeND (gr.vtxdist, gr.xadj, gr.adjncy, &numflag, options, ord.rank, ord.sep_sizes, &comm); ZOLTAN_TRACE_DETAIL(zz, yo, "Returned from the ParMETIS library"); @@ -735,11 +694,11 @@ int Zoltan_ParMetis_Order( order_opt->return_args = RETURN_RANK|RETURN_IPERM; /* We provide directly all the permutations */ #if !defined(METIS_VER_MAJOR) || METIS_VER_MAJOR < 5 options[0] = 0; /* Use default options for METIS. */ - METIS_NodeND(&numobj, gr.xadj, gr.adjncy, &numflag, options, + METIS_NodeND(&numobj, gr.xadj, gr.adjncy, &numflag, options, ord.iperm, ord.rank); #else METIS_SetDefaultOptions(options); - METIS_NodeND(&numobj, gr.xadj, gr.adjncy, NULL, options, + METIS_NodeND(&numobj, gr.xadj, gr.adjncy, NULL, options, ord.iperm, ord.rank); /* NULL is vwgt -- new interface in v4 */ #endif @@ -821,7 +780,7 @@ int Zoltan_ParMetis_Order( ierr = Zoltan_Postprocess_Graph (zz, l_gids, l_lids, &gr, NULL, NULL, NULL, &ord, NULL); - ZOLTAN_FREE(&l_gids); + ZOLTAN_FREE(&l_gids); ZOLTAN_FREE(&l_lids); /* Get a time here */ diff --git a/packages/zoltan/src/tpls/parmetis_interface.h b/packages/zoltan/src/tpls/parmetis_interface.h index 81bb01a1dc..2f0b2d6e7c 100644 --- a/packages/zoltan/src/tpls/parmetis_interface.h +++ b/packages/zoltan/src/tpls/parmetis_interface.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PARMETIS_INTERFACE_H diff --git a/packages/zoltan/src/tpls/parmetis_interface_params.h b/packages/zoltan/src/tpls/parmetis_interface_params.h index d1ca7096b1..07ed7ff323 100644 --- a/packages/zoltan/src/tpls/parmetis_interface_params.h +++ b/packages/zoltan/src/tpls/parmetis_interface_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __PARMETIS_INTERFACE_PARAMS_H #define __PARMETIS_INTERFACE_PARAMS_H diff --git a/packages/zoltan/src/tpls/postprocessing.c b/packages/zoltan/src/tpls/postprocessing.c index 015bf32e5d..edd1172797 100644 --- a/packages/zoltan/src/tpls/postprocessing.c +++ b/packages/zoltan/src/tpls/postprocessing.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER @@ -223,8 +186,7 @@ Zoltan_Postprocess_Order (ZZ *zz, /* Fill in the Zoltan Order Struct */ /* EBEB: For now, discard separator info */ -#if 0 - { /* DEBUG: Print separator sizes to file */ + if (0){ /* DEBUG: Print separator sizes to file */ FILE *fp; fp = fopen("separators.txt", "w"); fprintf(fp, "%i\n", ord->num_part); @@ -238,7 +200,6 @@ Zoltan_Postprocess_Order (ZZ *zz, fprintf(fp, "\n"); fclose(fp); } -#endif return (ierr); } @@ -527,14 +488,14 @@ Zoltan_Postprocess_FinalOutput (ZZ* zz, ZOLTAN_Third_Graph *gr, nRuns++; if (zz->Proc == 0) { - for (i = 0; i < vdim; i++) + for (i = 0; i < vdim; i++) printf("STATS Runs %d bal[%d] CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, i, bal[i], balmax[i], balmin[i], balsum[i]/nRuns); printf("STATS Runs %d cutl CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, cutl, cutlmax, cutlmin, cutlsum/nRuns); printf("STATS Runs %d cutn CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, cutn, cutnmax, cutnmin, cutnsum/nRuns); - for (i = 0; i < edim; i++) + for (i = 0; i < edim; i++) printf("STATS Runs %d cute[%d] CURRENT %f MAX %f MIN %f AVG %f\n", nRuns, i, cute[i], cutemax[i], cutemin[i], cutesum[i]/nRuns); printf("STATS Runs %d %s CURRENT %f MAX %f MIN %f AVG %f\n", @@ -657,12 +618,12 @@ int dim = zz->Edge_Weight_Dim; /* For now, use only first weight per edge. */ float maxewgt = 0.; if (ewgts) - for (j = xadj[i]; j < xadj[i+1]; j++) + for (j = xadj[i]; j < xadj[i+1]; j++) if (ewgts[j*dim] > maxewgt) maxewgt = ewgts[j*dim]; for (j = xadj[i]; j < xadj[i+1]; j++) if (parts[i] != nborparts[j]) { - cutn += (ewgts ? maxewgt : 1.); + cutn += (ewgts ? maxewgt : 1.); break; } } @@ -699,14 +660,14 @@ int dim = zz->Edge_Weight_Dim; /* For now, use only first weight per edge. */ float maxewgt = 0.; if (ewgts) - for (j = xadj[i]; j < xadj[i+1]; j++) + for (j = xadj[i]; j < xadj[i+1]; j++) if (ewgts[j*dim] > maxewgt) maxewgt = ewgts[j*dim]; used[parts[i]] = i; for (j = xadj[i]; j < xadj[i+1]; j++) if (used[nborparts[j]] < i) { used[nborparts[j]] = i; - cutl += (ewgts ? maxewgt : 1.); + cutl += (ewgts ? maxewgt : 1.); } } ZOLTAN_FREE(&used); @@ -721,7 +682,7 @@ static int Compute_Adjpart( ZZ *zz, int nvtx, /* Input: # vtxs in this processor */ indextype *vtxdist, /* Input: Distribution of vertices across processors */ - indextype *xadj, /* Input: Index of adjncy: adjncy[xadj[i]] to + indextype *xadj, /* Input: Index of adjncy: adjncy[xadj[i]] to adjncy[xadj[i]+1] are all edge nbors of vtx i. */ indextype *adjncy, /* Input: Array of nbor vertices. */ int *adjproc, /* Input: adjproc[j] == processor owning adjncy[j]. */ @@ -729,7 +690,7 @@ static int Compute_Adjpart( int *adjpart /* Output: adjpart[j] == partition owning adjncy[j] */ ) { -/* Given an adjacency list adjncy, find the partition number of each +/* Given an adjacency list adjncy, find the partition number of each * vertex in adjncy. Return it in adjpart. */ ZOLTAN_COMM_OBJ *plan; diff --git a/packages/zoltan/src/tpls/preprocessing.c b/packages/zoltan/src/tpls/preprocessing.c index 7b5e895542..2c74eb63fb 100644 --- a/packages/zoltan/src/tpls/preprocessing.c +++ b/packages/zoltan/src/tpls/preprocessing.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -80,7 +43,7 @@ static int Zoltan_Preprocess_Add_Weight (ZZ*, ZOLTAN_Third_Graph * gr, char * add_obj_weight); -static int Zoltan_Preprocess_Scale_Weights(ZOLTAN_Third_Graph *, float *, +static int Zoltan_Preprocess_Scale_Weights(ZOLTAN_Third_Graph *, float *, weighttype**, int, int, int, ZZ*, char *, indextype); static int Zoltan_Preprocess_Extract_Geom(ZZ *zz, @@ -154,7 +117,7 @@ int Zoltan_Preprocess_Graph( #else printf("Third party library weight type is %lu-byte floating point value\n", (unsigned long) (sizeof(weighttype))); -#endif +#endif #if __parmetis__ + __metis__ + __ptscotch__ + __scotch__ > 1 printf("Zoltan was compiled with support for: "); @@ -276,7 +239,7 @@ int Zoltan_Preprocess_Graph( if (sizeof(indextype) != sizeof(ZOLTAN_GNO_TYPE)){ /* Zoltan uses data type ZOLTAN_GNO_TYPE, third party library uses indextype */ - + j = zz->Num_Proc + 1; gr->vtxdist = (indextype *)ZOLTAN_MALLOC(sizeof(indextype) * j); if (!gr->vtxdist) @@ -288,7 +251,7 @@ int Zoltan_Preprocess_Graph( j = (int)gr->xadj[gr->num_obj]; - gr->adjncy = (indextype *)ZOLTAN_MALLOC(sizeof(indextype) * (j+1)); + gr->adjncy = (indextype *)ZOLTAN_MALLOC(sizeof(indextype) * (j+1)); /* KDD 10/7/14 ParMETIS 4 doesn't like NULL adjncy array when j (number of adjacencies) is 0; force non-NULL */ if ((j+1) && !gr->adjncy) @@ -344,7 +307,7 @@ int Zoltan_Preprocess_Graph( ierr = Zoltan_ZG_Vertex_Info(zz, graph, global_ids, local_ids, &float_vwgt, NULL); } - FIELD_DO_NOT_FREE_WHEN_DONE(graph->mtx.delete_flag, FIELD_YGID); + FIELD_DO_NOT_FREE_WHEN_DONE(graph->mtx.delete_flag, FIELD_YGID); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN){ ZOLTAN_PARMETIS_ERROR(ierr, "Zoltan_Preprocess_Graph returned error."); @@ -367,7 +330,7 @@ int Zoltan_Preprocess_Graph( if (sizeof(indextype) != sizeof(int)){ /* Zoltan query function gets int data type, but TPL structures store indextype */ prt->input_part = (indextype *) ZOLTAN_MALLOC(gr->num_obj*sizeof(indextype)); - if (gr->num_obj > 0 && prt->input_part == NULL) + if (gr->num_obj > 0 && prt->input_part == NULL) ZOLTAN_PARMETIS_ERROR(ZOLTAN_MEMERR, "Out of memory."); for (i=0; i < gr->num_obj; i++){ @@ -510,7 +473,7 @@ int Zoltan_Preprocess_Graph( else flag = 0; /* No output */ - ierr = Zoltan_Verify_Graph(zz->Communicator, gr->vtxdist, gr->xadj, + ierr = Zoltan_Verify_Graph(zz->Communicator, gr->vtxdist, gr->xadj, gr->adjncy, gr->vwgt, gr->ewgts, gr->obj_wgt_dim, gr->edge_wgt_dim, gr->graph_type, gr->check_graph, flag); @@ -573,7 +536,7 @@ Zoltan_Preprocess_Add_Weight (ZZ *zz, else if (add_type==2) /* weight is vertex degree (EBEB should we add +1?) */ /* vwgt_new[i*(gr->obj_wgt_dim+1)+gr->obj_wgt_dim] = 10*(gr->xadj[i+1] -gr->xadj[i]) + 1; */ - vwgt_new[i*(gr->obj_wgt_dim+1)+gr->obj_wgt_dim] = + vwgt_new[i*(gr->obj_wgt_dim+1)+gr->obj_wgt_dim] = gr->xadj[i+1] - gr->xadj[i]; } /* Use new vwgt array */ @@ -612,7 +575,7 @@ static int Zoltan_Preprocess_Scale_Weights( for (i99=0; i99 < (number <3 ? number : 3); i99++){ for (k=0; kobj_wgt_dim; k++) sprintf(msg+10*k, "%.9f ", flt_wgt[i99*gr->obj_wgt_dim+k]); - printf("[%1d] Debug: before scaling weights for %s " TPL_IDX_SPEC + printf("[%1d] Debug: before scaling weights for %s " TPL_IDX_SPEC " = %s\n", zz->Proc, name, offset+i99, msg); } } @@ -624,7 +587,7 @@ static int Zoltan_Preprocess_Scale_Weights( } ierr = scale_round_weights(flt_wgt, *rnd_wgt, number, ndim, mode, - MAX_WGT_SUM, zz->Debug_Level, + MAX_WGT_SUM, zz->Debug_Level, zz->Communicator); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN){ @@ -1018,9 +981,9 @@ void Zoltan_Third_DisplayTime(ZZ* zz, double* times) /****************************************************************************/ static int give_proc( - indextype vertex, - const indextype *vtxdist, - int numProc, + indextype vertex, + const indextype *vtxdist, + int numProc, int *myproc ) { @@ -1033,13 +996,13 @@ static int give_proc( } /* Assume that vertices are balanced */ - currentproc = (int)(vertex / (vtxdist[1]-vtxdist[0])); + currentproc = (int)(vertex / (vtxdist[1]-vtxdist[0])); if (currentproc >= numProc) currentproc = numProc - 1; if ((vertex < vtxdist[0])||( vertex >= vtxdist[numProc])) { - ZOLTAN_PRINT_WARN ((*myproc), "Symmetrize Graph problem (1)", + ZOLTAN_PRINT_WARN ((*myproc), "Symmetrize Graph problem (1)", "Unknown vertex"); return (-1); } @@ -1086,8 +1049,8 @@ static int Zoltan_LB_Add_Part_Sizes_Weight( /* Function to add one entry per part to part_sizes array. Returns a new * array with the added entry. * The added entry for a part is set by default to the zeroth part_sizes entry - * for the part. - * This function is invoked when parameter ADD_OBJ_WEIGHT is used. + * for the part. + * This function is invoked when parameter ADD_OBJ_WEIGHT is used. */ realtype *part_sizes; /* New part_sizes array */ int i, j; @@ -1098,7 +1061,7 @@ int ierr = ZOLTAN_OK; goto End; } - /* new_part_dim will equal old_part_dim if obj_weight_dim = 0 + /* new_part_dim will equal old_part_dim if obj_weight_dim = 0 and add_obj_weight != NONE */ if (old_part_dim == new_part_dim) { *new_part_sizes = old_part_sizes; @@ -1144,7 +1107,7 @@ int64_t maxindextype = (int64_t)(((uint64_t) 1<<((sizeof(indextype)<<3)-1))-1); char msg[500]; sprintf(msg, "Graph TPL is built with integer type that is too small for " "the partitioning problem. Max number of objects supported is " - "2^%lu-1; global number of objects is " ZOLTAN_GNO_SPEC "\n", + "2^%lu-1; global number of objects is " ZOLTAN_GNO_SPEC "\n", ((sizeof(indextype)<<3)-1), global_num_obj); ZOLTAN_PRINT_ERROR(zz->Proc, "check_data_sizes", msg); ierr = ZOLTAN_FATAL; diff --git a/packages/zoltan/src/tpls/scatter_graph.c b/packages/zoltan/src/tpls/scatter_graph.c index 917390ac43..f50be8c30e 100644 --- a/packages/zoltan/src/tpls/scatter_graph.c +++ b/packages/zoltan/src/tpls/scatter_graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -58,9 +21,9 @@ extern "C" { /* * Scatter a ParMetis-style graph to all processors such that each proc - * gets an even chunk of vertices and corresponding edges. + * gets an even chunk of vertices and corresponding edges. * The entire graph structure is shuffled around; no attempt is made - * to keep data local. Processor i receives nodes i*n/p through (i+1)*n/p. + * to keep data local. Processor i receives nodes i*n/p through (i+1)*n/p. * This routine is only useful if the distribution is highly imbalanced! * * The input graph structure is lost and fresh memory is allocated @@ -69,7 +32,7 @@ extern "C" { * This routine can also handle geometry data. The graph data may be NULL. * * The vertex communication plan is returned so it may be used to compute - * the export lists after partitioning. + * the export lists after partitioning. * * Currently the number of weights are inferred from zz->Obj_Weight_Dim * and zz->Edge_Weight_Dim. Perhaps these values should be input parameters. @@ -127,8 +90,8 @@ int Zoltan_Scatter_Graph( if (xyz) old_xyz = *xyz; - old_num_obj = (int)(old_vtxdist[zz->Proc+1] - old_vtxdist[zz->Proc]); - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + old_num_obj = (int)(old_vtxdist[zz->Proc+1] - old_vtxdist[zz->Proc]); + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: Old number of objects = %d\n", zz->Proc, old_num_obj); /* Compute new distribution, *vtxdist */ @@ -142,8 +105,8 @@ int Zoltan_Scatter_Graph( MPI_Allreduce(&i, &use_graph, 1, MPI_INT, MPI_LOR, zz->Communicator); j = (old_vsize != NULL); MPI_Allreduce(&j, &use_vsize, 1, MPI_INT, MPI_LOR, zz->Communicator); - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) - printf("[%1d] Debug: use_graph = %1d, use_vsize = %1d\n", zz->Proc, + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + printf("[%1d] Debug: use_graph = %1d, use_vsize = %1d\n", zz->Proc, use_graph, use_vsize); /* Reset all data pointers to NULL for now */ @@ -162,7 +125,7 @@ int Zoltan_Scatter_Graph( /* Allocate new space for vertex data */ num_obj = (int)((*vtxdist)[zz->Proc+1] - (*vtxdist)[zz->Proc]); - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: New number of objects = %d\n", zz->Proc, num_obj); if (use_graph) *xadj = (indextype *) ZOLTAN_MALLOC((num_obj+1)*sizeof(indextype)); @@ -198,12 +161,12 @@ int Zoltan_Scatter_Graph( } /* Do the communication. To save memory, we do not pack all the data into - * a buffer, but send directly from the old arrays to the new arrays. + * a buffer, but send directly from the old arrays to the new arrays. * We use the vertex communication plan for all the vertex-based arrays * and the edge communication plan for all the edge-based arrays. */ - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: Starting vertex-based communication.\n", zz->Proc); if (use_graph){ @@ -218,7 +181,7 @@ int Zoltan_Scatter_Graph( if (ndims){ Zoltan_Comm_Do( *plan, TAG5, (char *) old_xyz, ndims*sizeof(realtype), (char *) *xyz); } - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: Finished vertex-based communication.\n", zz->Proc); if (use_graph){ @@ -229,27 +192,27 @@ int Zoltan_Scatter_Graph( for (i=num_obj; i>0; i--) (*xadj)[i] = (*xadj)[i-1]; (*xadj)[0] = 0; - + /* Allocate space for new edge data structures */ num_edges = (*xadj)[num_obj]; *adjncy = (indextype *) ZOLTAN_MALLOC(num_edges*sizeof(indextype)); - + if (ewgt_dim) *adjwgt = (weighttype *) ZOLTAN_MALLOC(ewgt_dim*num_edges*sizeof(weighttype)); - + /* Set up the communication plan for the edge data. */ ptr = proclist2 = (int *) ZOLTAN_MALLOC(old_xadj[old_num_obj] * sizeof(int)); for (i=0; iDebug_Level >= ZOLTAN_DEBUG_ALL) { - printf("[%1d] Debug: Allocated proclist of length " TPL_IDX_SPEC " for edges.\n", + printf("[%1d] Debug: Allocated proclist of length " TPL_IDX_SPEC " for edges.\n", zz->Proc, old_xadj[old_num_obj]); } - Zoltan_Comm_Create(&plan2, (int)old_xadj[old_num_obj], proclist2, zz->Communicator, + Zoltan_Comm_Create(&plan2, (int)old_xadj[old_num_obj], proclist2, zz->Communicator, TAG1, &nrecv); - + if (nrecv != num_edges){ sprintf(msg,"Proc %d received %d edges but expected %d.", zz->Proc, nrecv, num_edges); @@ -267,19 +230,19 @@ int Zoltan_Scatter_Graph( ZOLTAN_TRACE_EXIT(zz, yo); return ZOLTAN_FATAL; } - - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: Starting edge-based communication.\n", zz->Proc); - + /* Do the communication. */ Zoltan_Comm_Do( plan2, TAG2, (char *) old_adjncy, sizeof(indextype), (char *) *adjncy); if (ewgt_dim){ Zoltan_Comm_Do( plan2, TAG3, (char *) old_adjwgt, ewgt_dim*sizeof(weighttype), (char *) *adjwgt); } - - if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) + + if (zz->Debug_Level >= ZOLTAN_DEBUG_ALL) printf("[%1d] Debug: Finished edge-based communication.\n", zz->Proc); - + /* Free the comm. plan for edge data */ Zoltan_Comm_Destroy(&plan2); diff --git a/packages/zoltan/src/tpls/scotch_interface.c b/packages/zoltan/src/tpls/scotch_interface.c index e77313a027..46aef4921b 100644 --- a/packages/zoltan/src/tpls/scotch_interface.c +++ b/packages/zoltan/src/tpls/scotch_interface.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/tpls/scotch_interface.h b/packages/zoltan/src/tpls/scotch_interface.h index f45548438c..4ad7bbeba0 100644 --- a/packages/zoltan/src/tpls/scotch_interface.h +++ b/packages/zoltan/src/tpls/scotch_interface.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __SCOTCH_INTERFACE_H diff --git a/packages/zoltan/src/tpls/scotch_interface_params.h b/packages/zoltan/src/tpls/scotch_interface_params.h index b8479b5c9f..e06168562d 100644 --- a/packages/zoltan/src/tpls/scotch_interface_params.h +++ b/packages/zoltan/src/tpls/scotch_interface_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __SCOTCH_INTERFACE_PARAMS_H #define __SCOTCH_INTERFACE_PARAMS_H diff --git a/packages/zoltan/src/tpls/third_library.c b/packages/zoltan/src/tpls/third_library.c index f5d7fb8aef..695f003eaf 100644 --- a/packages/zoltan/src/tpls/third_library.c +++ b/packages/zoltan/src/tpls/third_library.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -60,9 +23,6 @@ extern "C" { #include "third_library.h" #include "third_library_params.h" -#if __metis__ || __parmetis__ -#include "parmetis_interface.h" -#endif /**********************************************************/ /* Interface routine for Graph methods. */ /**********************************************************/ @@ -141,7 +101,7 @@ int rc; num_exp, exp_gids, exp_lids, exp_procs, exp_to_part); } else{ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Invalid value for GRAPH_PACKAGE parameter\n"); rc = ZOLTAN_FATAL; } @@ -204,7 +164,7 @@ void Zoltan_Third_Exit(ZOLTAN_Third_Graph *gr, ZOLTAN_Third_Geom *geo, MEMFREE(gr->ewgts); MEMFREE(gr->float_ewgts); MEMFREE(gr->adjproc); - + Zoltan_ZG_Free(&gr->graph); } @@ -299,7 +259,7 @@ float *wgts; fprintf(stderr,"Options: local %d, final_output %d, symmetrize %d keep_distribution %d speed %s\n", m->opts.local, m->opts.final_output, m->opts.symmetrize, m->opts.keep_distribution, ((m->opts.speed == 0) ? "full dd" : ((m->opts.speed == 1) ? "fast" : "no redist"))); - + fprintf(stderr,"redist %d, completed %d, bipartite %d\n", m->redist, m->completed, m->bipartite); fprintf(stderr,"globalX " ZOLTAN_GNO_SPEC ", globalY " ZOLTAN_GNO_SPEC ", nY %d, nY_ori %d, ywgtdim %d, nPins %d\n", @@ -312,11 +272,11 @@ float *wgts; for (j=m->ystart[i]; j < m->ystart[i+1]; j++){ fprintf(stderr, ZOLTAN_GNO_SPEC " ", m->pinGNO[j]); if (wgts && (m->pinwgtdim > 0)){ - fprintf(stderr,"("); + fprintf(stderr,"("); for (k=0; k < m->pinwgtdim; k++){ fprintf(stderr,"%f ",*wgts++); } - fprintf(stderr,") "); + fprintf(stderr,") "); } } fprintf(stderr,"\n"); @@ -364,14 +324,14 @@ int nproc_y = m2d->comm->nProc_y; } Zoltan_matrix_Print(m, NULL); - + fflush(stderr); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); return ZOLTAN_OK; } int Zoltan_Third_Graph_Print(ZZ *zz, ZOLTAN_Third_Graph *gr, char *s) @@ -389,7 +349,7 @@ me = zz->Proc; gr->scatter_min, gr->get_data, gr->obj_wgt_dim, gr->edge_wgt_dim); fprintf(stderr,"num obj %d, num obj orig %d, num edges %d\n", gr->num_obj, gr->num_obj_orig, gr->num_edges); - + if (gr->vtxdist){ numvtx = gr->vtxdist[proc+1] - gr->vtxdist[proc]; offset = gr->vtxdist[proc]; @@ -416,14 +376,14 @@ me = zz->Proc; fprintf(stderr,"\n"); } } - + fflush(stderr); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); return ZOLTAN_OK; } @@ -433,20 +393,20 @@ me = zz->Proc; #define CHECK_ZOLTAN_FREE(ptr) do { if ((ptr) != NULL) ZOLTAN_FREE(&(ptr)); } while (0) int Zoltan_TPL_Order_Init_Tree (struct Zoltan_TPL_Order_Struct *order, indextype blocknbr, indextype leavesnbr) -{ +{ Zoltan_TPL_Order_Free_Struct(order); order->ancestor = (indextype *) ZOLTAN_MALLOC(blocknbr*sizeof(indextype)); order->start = (indextype *) ZOLTAN_MALLOC((blocknbr+1)*sizeof(indextype)); order->leaves = (indextype *) ZOLTAN_MALLOC((leavesnbr+1)*sizeof(indextype)); - + order->needfree = 1; if ((order->ancestor == NULL) || (order->start == NULL) || (order->leaves == NULL)) { Zoltan_TPL_Order_Free_Struct(order); return (ZOLTAN_MEMERR); } return (ZOLTAN_OK); -} +} void Zoltan_TPL_Order_Free_Struct(struct Zoltan_TPL_Order_Struct *order) { @@ -460,7 +420,7 @@ void Zoltan_TPL_Order_Free_Struct(struct Zoltan_TPL_Order_Struct *order) order->needfree = 0; } - + #ifdef __cplusplus diff --git a/packages/zoltan/src/tpls/third_library.h b/packages/zoltan/src/tpls/third_library.h index 7012061f0b..f5fd69a259 100644 --- a/packages/zoltan/src/tpls/third_library.h +++ b/packages/zoltan/src/tpls/third_library.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __THIRD_LIBRARY_H diff --git a/packages/zoltan/src/tpls/third_library_const.h b/packages/zoltan/src/tpls/third_library_const.h index 3940ebb6cb..95e50e2754 100644 --- a/packages/zoltan/src/tpls/third_library_const.h +++ b/packages/zoltan/src/tpls/third_library_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __THIRD_LIBRARY_CONST_H @@ -96,7 +59,7 @@ extern "C" { * "indextype" is the type used for global numbers and indices in the graph * data structure. * "weighttype" is the type used for weights. - * + * * If there are no third party graph/ordering libraries, let indextype be * ZOLTAN_GNO_TYPE and let "weighttype" be float. * diff --git a/packages/zoltan/src/tpls/third_library_params.h b/packages/zoltan/src/tpls/third_library_params.h index ffe966dc68..4807ff3422 100644 --- a/packages/zoltan/src/tpls/third_library_params.h +++ b/packages/zoltan/src/tpls/third_library_params.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __THIRD_LIBRARY_PARAMS_H #define __THIRD_LIBRARY_PARAMS_H diff --git a/packages/zoltan/src/tpls/third_library_tools.h b/packages/zoltan/src/tpls/third_library_tools.h index dfba46f428..8bc9027d08 100644 --- a/packages/zoltan/src/tpls/third_library_tools.h +++ b/packages/zoltan/src/tpls/third_library_tools.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __THIRD_LIBRARY_TOOLS_H diff --git a/packages/zoltan/src/tpls/verify_graph.c b/packages/zoltan/src/tpls/verify_graph.c index 5684a99654..5633096a82 100644 --- a/packages/zoltan/src/tpls/verify_graph.c +++ b/packages/zoltan/src/tpls/verify_graph.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -95,16 +58,16 @@ static int Zoltan_Compare_Indextypes(const void *key, const void *arg); /* */ /*********************************************************************/ -int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, - indextype *adjncy, weighttype *vwgt, weighttype *adjwgt, - int vwgt_dim, int ewgt_dim, +int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, + indextype *adjncy, weighttype *vwgt, weighttype *adjwgt, + int vwgt_dim, int ewgt_dim, int graph_type, int check_graph, int output_level) { int flag, cross_edges = 0, mesg_size, sum; int ierr; /* Error in the graph; always return the worst ierr found */ int runerr;/* Error running this routine */ int nprocs, proc, *proclist, errors, global_errors; - int *perm=NULL; + int *perm=NULL; int free_adjncy_sort=0; ZOLTAN_COMM_OBJ *comm_plan; static char *yo = "Zoltan_Verify_Graph"; @@ -151,7 +114,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, sum = 0; for (k=0; k adjncy[ii+1]){ flag = 1; /* Not sorted. */ - break; + break; } } } @@ -249,27 +212,27 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, perm[k] = k; } if (sizeof(indextype) == sizeof(short)){ - for (i=0; i= vtxdist[nprocs]))) - || (IS_LOCAL_GRAPH(graph_type) && + || (IS_LOCAL_GRAPH(graph_type) && ((global_j < 0) || (global_j >= num_obj)))){ sprintf(msg, "Edge to invalid vertex " TPL_IDX_SPEC " detected.", global_j); ZOLTAN_PRINT_ERROR(proc, yo, msg); @@ -344,7 +307,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, /* EBEB For now, don't compare weights if we sorted edge lists. */ flag = 0; for (k=0; k= vtxdist[proc+1])){ /* Add to list */ - k=0; + k=0; while (global_j >= vtxdist[k+1]) k++; proclist[nedges++] = k; /* Copy (global_i,global_j) and corresponding weights to sendgno */ @@ -459,7 +422,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, runerr = Zoltan_Comm_Create(&comm_plan, cross_edges, proclist, comm, TAG1, &nrecv); if (runerr != ZOLTAN_OK && runerr != ZOLTAN_WARN) { - sprintf(msg, "Error %s returned from Zoltan_Comm_Create.", + sprintf(msg, "Error %s returned from Zoltan_Comm_Create.", (runerr == ZOLTAN_MEMERR ? "ZOLTAN_MEMERR" : "ZOLTAN_FATAL")); Zoltan_Comm_Destroy(&comm_plan); ZOLTAN_PRINT_ERROR(proc, yo, msg); @@ -470,7 +433,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, ZOLTAN_PRINT_ERROR(proc, yo, msg); ierr = ZOLTAN_FATAL; } - + runerr = Zoltan_Comm_Do(comm_plan, TAG2, (char *)sendgno, mesg_size, (char *)recvgno); Zoltan_Comm_Destroy(&comm_plan); @@ -480,7 +443,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, ZOLTAN_PRINT_ERROR(proc, yo, msg); } else { - + /* Third pass: Compare on-proc data to off-proc data we received */ /* sendgno and recvgno should contain the same data except (i,j) is */ /* (j,i) */ @@ -509,7 +472,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, } if (!flag){ sprintf(msg, "Graph is not symmetric. " - "Edge (" TPL_IDX_SPEC "," TPL_IDX_SPEC ") exists, but not (" TPL_IDX_SPEC "," TPL_IDX_SPEC ").", + "Edge (" TPL_IDX_SPEC "," TPL_IDX_SPEC ") exists, but not (" TPL_IDX_SPEC "," TPL_IDX_SPEC ").", ptr1[0], ptr1[1], ptr1[1], ptr1[0]); ZOLTAN_PRINT_ERROR(proc, yo, msg); ierr = ZOLTAN_FATAL; @@ -551,7 +514,7 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, } else { if (proc==0 && output_level>0){ - printf("ZOLTAN %s: The graph is valid with check_graph = %1d\n", + printf("ZOLTAN %s: The graph is valid with check_graph = %1d\n", yo, check_graph); } return ZOLTAN_OK; @@ -562,8 +525,8 @@ int Zoltan_Verify_Graph(MPI_Comm comm, indextype *vtxdist, indextype *xadj, /* comparison routine for bsearch */ static int Zoltan_Compare_Indextypes(const void *key, const void *arg) { - if ( *(const indextype*) key > (*(const indextype*) arg)) return 1; - if ( *(const indextype*) key < (*(const indextype*) arg)) return -1; + if ( *(indextype*) key > (*(indextype*) arg)) return 1; + if ( *(indextype*) key < (*(indextype*) arg)) return -1; return 0; /* equal */ } diff --git a/packages/zoltan/src/util/generate_miniFElike_grids.cpp b/packages/zoltan/src/util/generate_miniFElike_grids.cpp index 51d7d97af3..983ec45bfb 100644 --- a/packages/zoltan/src/util/generate_miniFElike_grids.cpp +++ b/packages/zoltan/src/util/generate_miniFElike_grids.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER // Program to generate uniform-grid input files for Zoltan's zdrive program. // Compile: // c++ generate_miniFElike_grids.cpp @@ -50,7 +13,7 @@ // a.out x y z filename // where x,y,z are the number of grid points in the x, y, and z directions, // respectively, and filename is the base filename to be used for the output. -// +// // Output files are in Chaco and Matrix-Market format. // Output files include filename.coords, filename.graph and filename.mtx. // @@ -140,7 +103,7 @@ int main(int narg, char *arg[]) int ny_m_two = ny - 2; int nz_m_two = nz - 2; - int64_t nedge = + int64_t nedge = // interior vertices 27 * nx_gt_one * ny_gt_one * nz_gt_one * nx_m_two * ny_m_two * nz_m_two // face vertices @@ -152,7 +115,7 @@ int main(int narg, char *arg[]) + 12 * (nx_gt_one+nz_gt_one) * (nx_gt_one+nz_gt_one) * ny_gt_one * ny_m_two + 12 * (nx_gt_one+ny_gt_one) * (nx_gt_one+ny_gt_one) * nz_gt_one * nz_m_two // corner vertices - + (1+nx_gt_one) * (1+nx_gt_one) * (1+ny_gt_one) * (1+ny_gt_one) + + (1+nx_gt_one) * (1+nx_gt_one) * (1+ny_gt_one) * (1+ny_gt_one) * (1+nz_gt_one) * (1+nz_gt_one); char *basename = arg[4]; diff --git a/packages/zoltan/src/util/git_notes.txt b/packages/zoltan/src/util/git_notes.txt index f1fe9f99ed..c0e53b86d2 100644 --- a/packages/zoltan/src/util/git_notes.txt +++ b/packages/zoltan/src/util/git_notes.txt @@ -7,7 +7,7 @@ File file states: Remotes and branches: - origin -- server you cloned from -- master -- main development trunk in local repository; +- master -- main development trunk in local repository; master pointer moves forward with each commit to main. - HEAD -- pointer to local branch you're currently on. - origin/master -- pointer to master branch on server. @@ -52,7 +52,7 @@ Commands: - git diff master...branchname See all changes done on branchname; compares with first common ancestor between master and branchname. - Shows only the work the current topic branch has introduced since + Shows only the work the current topic branch has introduced since its common ancestor with master. - git diff origin..master @@ -62,7 +62,7 @@ Commands: - git diff origin.. See all changes between origin/HEAD and what is committed in my repo. -- git whatchanged --since="12 hours ago" -p +- git whatchanged --since="12 hours ago" -p See what changes were made to the repository in the last 12 hours Can use other timeframes, such as "1 day ago." @@ -100,7 +100,7 @@ Commands: Get back (revert) to a previously committed repo I needed this sequence of commands when "git pull --rebase" hit conflicts and my repo was messed up. The checkout reverts to the commits before - the pull; I got the SHA from .git/logs/HEAD, but Siva says it is in gitk, + the pull; I got the SHA from .git/logs/HEAD, but Siva says it is in gitk, too. The checkout restored my files, but I wasn't on any branch. I thought the reset would put me back on a branch, but it didn't. Hmmm. Maybe I should have just done the reset instead of the checkout?? @@ -124,9 +124,9 @@ Commands: - git pull --rebase Gets all new work pushed to server since last fetch/clone. - Applies the new work so it precedes (instead of follows) the work + Applies the new work so it precedes (instead of follows) the work you have committed but not pushed yet. Preferred way to push committed work. - + - git push [remote] [branch] Push committed work to server. @@ -189,7 +189,7 @@ Commands: - git rebase Another way to merge. - Replays changes from into HEAD in order they were done, + Replays changes from into HEAD in order they were done, rather than merging the endpoints of and HEAD. !! Do not rebase commits that you have pushed to a public repository. !! !! only rebase commits that have never been available publicly. !! @@ -210,7 +210,7 @@ after that date. Unfortunately, I need to cherry-pick each one. :( git cherry-pick --no-commit -x hash -where hash is one of the hash keys from above. +where hash is one of the hash keys from above. The -x appends the original commit message, which is nice. The --no-commit prevent automatic commit if no conflicts. I like to see what happened. @@ -247,7 +247,7 @@ Brent's tutorial How to get off a branch - Check out a certain hash code. Make changes and commit. Pull rebase. -- Pull rebase, fix conflicts. Make more changes. Pull rebase again. +- Pull rebase, fix conflicts. Make more changes. Pull rebase again. Have to re-resolve conflicts. - Some branch problems... @@ -337,7 +337,7 @@ Karen thinks all her problems were from the following... git commit make edits git commit - git pull + git pull resolve conflicts git add git commit (creates a merge commit) @@ -347,12 +347,12 @@ Karen thinks all her problems were from the following... git commit git pull --rebase NOW HAVE TO FIX THE SAME CONFLICTS AGAIN -- EEK! - + Can try git rebase --abort Might leave your commits in a very weird state...they are not attached to anything. Brent and Jim will prototype to see what happens in this case. - + Safe ways to use rebase reorder commits since origin/HEAD @@ -360,7 +360,7 @@ Safe ways to use rebase drop a commit change the commit message split commits apart -Doing "git rebase -i SHA" puts you in an editor with instructions; +Doing "git rebase -i SHA" puts you in an editor with instructions; change the lines in the file. @@ -368,11 +368,11 @@ change the lines in the file. Finding lost commits: git fsck --lost-found Resoring is easy once you know the SHA; then do - git cherry-pick SHA + git cherry-pick SHA to put the commit back. ------------ -When fall off a branch (e.g., because of a rebase or merge), +When fall off a branch (e.g., because of a rebase or merge), due to a conflict, fix conflict, git add, git commit (but need a special command that will be in the original error message), then git rebase --continue @@ -389,3 +389,4 @@ Then git log HEAD..bad_state (shows all differences between master and bad_state) or git log bad_state (and visually determine what the differences are) git cherry-pick SHA (using SHA from the log command) + diff --git a/packages/zoltan/src/util/integerRisks.txt b/packages/zoltan/src/util/integerRisks.txt index f24c2a2565..26df66abef 100644 --- a/packages/zoltan/src/util/integerRisks.txt +++ b/packages/zoltan/src/util/integerRisks.txt @@ -8,7 +8,7 @@ short 16 16 16 16 16 _int32 32 int 16 32 64 32 32 long 32 32 64 32 64 -long long 64 +long long 64 pointer 32 32 64 64 64 @@ -70,3 +70,4 @@ To print longs: "%ld" or macros in inttypes.yh To print long longs: "%Ld" or macros in inttypes.yh Especially important in scanf's. + diff --git a/packages/zoltan/src/util/memory_usage/README b/packages/zoltan/src/util/memory_usage/README index fc4a556965..67259ae317 100644 --- a/packages/zoltan/src/util/memory_usage/README +++ b/packages/zoltan/src/util/memory_usage/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Utilities to measure memory usage. diff --git a/packages/zoltan/src/util/memory_usage/commdup.c b/packages/zoltan/src/util/memory_usage/commdup.c index 7e20e8f349..f532856e2f 100644 --- a/packages/zoltan/src/util/memory_usage/commdup.c +++ b/packages/zoltan/src/util/memory_usage/commdup.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /////////////////////////////////////////////////////////////// // Program to test MPI_Comm_dup memory usage on thunderbird. // @@ -60,32 +23,32 @@ size_t total_leak = 0; void test_function() { MPI_Comm local_comm; -int myproc, nprocs; // MPI info wrt MPI_COMM_WORLD. +int myproc, nprocs; // MPI info wrt comm from zoltan_get_global_comm(). size_t oldheap, newheap; size_t used, freed; static int itercnt = 0; int ierr; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); - // Duplicate MPI_COMM_WORLD to local communicator. + // Duplicate zoltan_get_global_comm() to local communicator. oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE Comm_dup: " << oldheap << std::endl; - ierr = MPI_Comm_dup(MPI_COMM_WORLD,&local_comm); + ierr = MPI_Comm_dup(zoltan_get_global_comm(),&local_comm); newheap = get_heap_usage(); used = newheap - oldheap; if (ierr != MPI_SUCCESS) std::cout << " ERROR DUP " << ierr << std::endl; - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt - << " AFTER Comm_dup: " << newheap + << " AFTER Comm_dup: " << newheap << " Used: " << used << std::endl; // Free local_comm. oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE final Comm_free: " << oldheap << std::endl; @@ -93,10 +56,10 @@ int ierr; if (ierr != MPI_SUCCESS) std::cout << " ERROR FREE " << ierr << std::endl; newheap = get_heap_usage(); freed = oldheap - newheap; - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " AFTER final Comm_free: " << newheap - << " Freed: " << freed + << " Freed: " << freed << " Leaked: " << used-freed << std::endl; if (itercnt) total_leak += (used - freed); @@ -120,33 +83,34 @@ main(int argc, char *argv[]) size_t finalheap = get_heap_usage(); int myproc; - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); int localmax, globalmax; localmax = total_leak; - MPI_Allreduce(&localmax, &globalmax, 1, MPI_INTEGER, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&localmax, &globalmax, 1, MPI_INTEGER, MPI_MAX, zoltan_get_global_comm()); MPI_Finalize(); size_t ending = get_heap_usage(); - std::cout << "KDDEND " << myproc + std::cout << "KDDEND " << myproc << " First MPI_Comm_dup leaked " << firstiteraft - firstiterbef << std::endl; - std::cout << "KDDEND " << myproc - << " Subsequent MPI_Comm_dups leaked (total) " + std::cout << "KDDEND " << myproc + << " Subsequent MPI_Comm_dups leaked (total) " << finalheap - initheap << " = " << total_leak << std::endl; - std::cout << "KDDEND " << myproc - << " Avg per Subsequent MPI_Comm_dup " + std::cout << "KDDEND " << myproc + << " Avg per Subsequent MPI_Comm_dup " << (finalheap - initheap) / NUM_ITER << std::endl; - std::cout << "KDDEND " << myproc - << " Max per Subsequent MPI_Comm_dup " + std::cout << "KDDEND " << myproc + << " Max per Subsequent MPI_Comm_dup " << globalmax << std::endl; - std::cout << "KDDEND " << myproc - << " Total Leak " + std::cout << "KDDEND " << myproc + << " Total Leak " << (ending - beginning) << std::endl; - return(0); + return(0); } + diff --git a/packages/zoltan/src/util/memory_usage/commsplit.c b/packages/zoltan/src/util/memory_usage/commsplit.c index f8aed1ff19..b4bc785e79 100644 --- a/packages/zoltan/src/util/memory_usage/commsplit.c +++ b/packages/zoltan/src/util/memory_usage/commsplit.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER ///////////////////////////////////////////////////////////////// // Program to test MPI_Comm_split memory usage on thunderbird. // @@ -61,36 +24,36 @@ size_t total_leak = 0; void test_function() { MPI_Comm local_comm; -int myproc, nprocs; // MPI info wrt MPI_COMM_WORLD. +int myproc, nprocs; // MPI info wrt comm from zoltan_get_global_comm(). int set; size_t oldheap, newheap; size_t used, freed; static int itercnt = 0; int ierr; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); - // Split MPI_COMM_WORLD to half-sized local communicator. + // Split zoltan_get_global_comm() to half-sized local communicator. if (myproc < nprocs/2) set = 0; // set = LOWERHALF; else set = 1; // set = UPPERHALF; oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE Comm_split: " << oldheap << std::endl; - ierr = MPI_Comm_split(MPI_COMM_WORLD, set, myproc, &local_comm); + ierr = MPI_Comm_split(zoltan_get_global_comm(), set, myproc, &local_comm); newheap = get_heap_usage(); used = newheap - oldheap; if (ierr != MPI_SUCCESS) std::cout << " ERROR SPLIT " << ierr << std::endl; - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt - << " AFTER Comm_split: " << newheap + << " AFTER Comm_split: " << newheap << " Used: " << used << std::endl; // Free local_comm. oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE final Comm_free: " << oldheap << std::endl; @@ -98,7 +61,7 @@ int ierr; newheap = get_heap_usage(); freed = oldheap - newheap; if (ierr != MPI_SUCCESS) std::cout << " ERROR FREE " << ierr << std::endl; - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " AFTER final Comm_free: " << newheap << " Freed: " << freed @@ -125,11 +88,11 @@ main(int argc, char *argv[]) size_t finalheap = get_heap_usage(); int myproc; - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); int localmax, globalmax; localmax = total_leak; - MPI_Allreduce(&localmax, &globalmax, 1, MPI_INTEGER, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&localmax, &globalmax, 1, MPI_INTEGER, MPI_MAX, zoltan_get_global_comm()); MPI_Finalize(); size_t ending = get_heap_usage(); @@ -150,10 +113,11 @@ main(int argc, char *argv[]) << std::endl; std::cout << "KDDEND " << myproc << " Total Leak " - << (ending - beginning) + << (ending - beginning) << std::endl; - return(0); + return(0); } + diff --git a/packages/zoltan/src/util/memory_usage/get_heap_usage.h b/packages/zoltan/src/util/memory_usage/get_heap_usage.h index 602de65fc6..dadfe4dd07 100644 --- a/packages/zoltan/src/util/memory_usage/get_heap_usage.h +++ b/packages/zoltan/src/util/memory_usage/get_heap_usage.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER ////////////////////////////////////////////////////////////////////// // Subroutine to measure heap usage on several different platforms. // @@ -67,7 +30,7 @@ static size_t get_heap_usage() #elif defined(__APPLE__) malloc_statistics_t t = {0,0,0,0}; malloc_zone_statistics(NULL, &t); - heap_size = t.size_in_use; + heap_size = t.size_in_use; #elif defined(__sun) pstatus_t proc_status; diff --git a/packages/zoltan/src/util/memory_usage/rcblike.c b/packages/zoltan/src/util/memory_usage/rcblike.c index 42fad7fa80..196394f481 100644 --- a/packages/zoltan/src/util/memory_usage/rcblike.c +++ b/packages/zoltan/src/util/memory_usage/rcblike.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER /* Program to test MPI_Comm_split, etc., on thunderbird */ @@ -57,35 +20,35 @@ void test_function() { MPI_Comm local_comm, tmp_comm; -int myproc, nprocs; // MPI info wrt MPI_COMM_WORLD. +int myproc, nprocs; // MPI info wrt comm form zoltan_get_global_comm(). int local_myproc, local_nprocs; // MPI info wrt local_comm. int set, procmid; int commcnt = 0; size_t oldheap, newheap; static int itercnt = 0; - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Comm_size(zoltan_get_global_comm(), &nprocs); + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); - // Duplicate MPI_COMM_WORLD to local communicator. + // Duplicate zoltan_get_global_comm() to local communicator. oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE Comm_dup: " << oldheap << std::endl; - MPI_Comm_dup(MPI_COMM_WORLD,&local_comm); + MPI_Comm_dup(zoltan_get_global_comm(),&local_comm); newheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt - << " AFTER Comm_dup: " << newheap + << " AFTER Comm_dup: " << newheap << " Used: " << newheap - oldheap << std::endl; commcnt++; // Set up loop for split. local_nprocs = nprocs; local_myproc = myproc; - while (local_nprocs > 1) { + while (local_nprocs > 1) { - std::cout << "KDD " << myproc << "(" << local_myproc << ")" + std::cout << "KDD " << myproc << "(" << local_myproc << ")" << " In main loop: local_nprocs = " << local_nprocs << std::endl; // Split communicator in half. @@ -94,23 +57,23 @@ static int itercnt = 0; else set = 1; /* set = UPPERHALF; */ oldheap = get_heap_usage(); - std::cout << "KDD " << myproc << "(" << local_myproc << ")" + std::cout << "KDD " << myproc << "(" << local_myproc << ")" << " BEFORE Comm_split: " << oldheap << std::endl; MPI_Comm_split(local_comm,set,local_myproc,&tmp_comm); commcnt++; // Free old local_comm; keep new one. newheap = get_heap_usage(); - std::cout << "KDD " << myproc << "(" << local_myproc << ")" - << " AFTER Comm_split: " << newheap + std::cout << "KDD " << myproc << "(" << local_myproc << ")" + << " AFTER Comm_split: " << newheap << " Used: " << newheap - oldheap << std::endl; oldheap = get_heap_usage(); - std::cout << "KDD " << myproc << "(" << local_myproc << ")" + std::cout << "KDD " << myproc << "(" << local_myproc << ")" << " BEFORE local Comm_free: " << oldheap << std::endl; MPI_Comm_free(&local_comm); commcnt--; newheap = get_heap_usage(); - std::cout << "KDD " << myproc << "(" << local_myproc << ")" + std::cout << "KDD " << myproc << "(" << local_myproc << ")" << " AFTER local Comm_free: " << newheap << " Freed: " << oldheap - newheap << std::endl; local_comm = tmp_comm; @@ -122,17 +85,17 @@ static int itercnt = 0; // Free local_comm. oldheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " BEFORE final Comm_free: " << oldheap << std::endl; MPI_Comm_free(&local_comm); commcnt--; newheap = get_heap_usage(); - std::cout << "KDD " << myproc + std::cout << "KDD " << myproc << " ITER " << itercnt << " AFTER final Comm_free: " << newheap - << " Freed: " << oldheap - newheap + << " Freed: " << oldheap - newheap << " commcnt = " << commcnt << std::endl; itercnt++; @@ -148,13 +111,14 @@ main(int argc, char *argv[]) size_t finalheap = get_heap_usage(); int myproc; - MPI_Comm_rank(MPI_COMM_WORLD, &myproc); - std::cout << "KDDEND " << myproc + MPI_Comm_rank(zoltan_get_global_comm(), &myproc); + std::cout << "KDDEND " << myproc << " Total leaked " << finalheap - initheap << " Avg per iteration " << (finalheap - initheap) / NUM_ITER << std::endl; MPI_Finalize(); - return(0); + return(0); } + diff --git a/packages/zoltan/src/util/network_topology/MPI/README b/packages/zoltan/src/util/network_topology/MPI/README index 61b3adb43f..1704ac9495 100644 --- a/packages/zoltan/src/util/network_topology/MPI/README +++ b/packages/zoltan/src/util/network_topology/MPI/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER August 10, 2010 lriesen@sandia.gov diff --git a/packages/zoltan/src/util/network_topology/MPI/test32.c b/packages/zoltan/src/util/network_topology/MPI/test32.c index ac9787a8f5..804bb2a284 100644 --- a/packages/zoltan/src/util/network_topology/MPI/test32.c +++ b/packages/zoltan/src/util/network_topology/MPI/test32.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include #include @@ -68,18 +31,18 @@ comm_group level_info[NLEVELS]; rc = MPI_Comm_size(comm[i], nprocs + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } - + rc = MPI_Comm_rank(comm[i], me + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %s communicator, size %d, my rank %d\n",me[0],commName[i],nprocs[i],me[i]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif } @@ -95,7 +58,7 @@ comm_group level_info[NLEVELS]; /* * classes[k] contains the rank (in level i) of the rank 0 element of element k's subcommunicator */ - level_down(i, classes, me, nprocs); + level_down(i, classes, me, nprocs); /* * my sub communicator will create which parts in the final partitioning? @@ -104,19 +67,19 @@ comm_group level_info[NLEVELS]; } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); for (i=0; i < nprocs[0]; i++){ if (i == me[0]){ - printf("(%d) ranges: %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) \n", + printf("(%d) ranges: %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) \n", me[0], - commName[0], level_part_range[0][0], level_part_range[0][1], level_part_range[0][0] + me[0], + commName[0], level_part_range[0][0], level_part_range[0][1], level_part_range[0][0] + me[0], commName[1], level_part_range[1][0], level_part_range[1][1], level_part_range[1][0] + me[1], commName[2], level_part_range[2][0], level_part_range[2][1], level_part_range[2][0] + me[2], commName[3], level_part_range[3][0], level_part_range[3][1], level_part_range[3][0] + me[3]); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); } #endif @@ -134,7 +97,7 @@ comm_group level_info[NLEVELS]; lval=0; /* meaningful level in hierarchy */ } - MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gval < nprocs[0]){ /* next level in hierarchy is significant for at least some processes */ @@ -143,10 +106,10 @@ comm_group level_info[NLEVELS]; } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %d significant levels %d %d %d %d\n",me[0], num_significant_levels, level_number[0], level_number[1], level_number[2], level_number[3]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif /* Save global info about topology */ @@ -155,13 +118,13 @@ comm_group level_info[NLEVELS]; my_part_number = level_part_range[level][0] + me[level]; - MPI_Allgather(&my_part_number, 1, MPI_INT, procToPart, 1, MPI_INT, MPI_COMM_WORLD); + MPI_Allgather(&my_part_number, 1, MPI_INT, procToPart, 1, MPI_INT, zoltan_get_global_comm()); for (i=0; i < nprocs[0]; i++){ partToProc[procToPart[i]] = i; } - level_info[0].comm = MPI_COMM_WORLD; + level_info[0].comm = zoltan_get_global_comm(); level_info[0].name = commName[0]; level_info[0].nGroups = 1; level_info[0].myGroup = 0; @@ -177,7 +140,7 @@ comm_group level_info[NLEVELS]; memset((void *)&level_info[i], 0, sizeof(comm_group)); mine = 0; - MPI_Allgather(&(level_part_range[level][0]), 1, MPI_INT, buf, 1, MPI_INT, MPI_COMM_WORLD); + MPI_Allgather(&(level_part_range[level][0]), 1, MPI_INT, buf, 1, MPI_INT, zoltan_get_global_comm()); memset(classes, 0, sizeof(int) * nprocs[0]); for (j=0; j < nprocs[0]; j++){ classes[buf[j]]++; @@ -234,7 +197,7 @@ comm_group level_info[NLEVELS]; level_info[i].name, 0, level_info[i].offsets[1]-1); } - ping_pong_test(MPI_COMM_WORLD, me[0], sender, receiver, 100); + ping_pong_test(zoltan_get_global_comm(), me[0], sender, receiver, 100); /* ping pong across an entity */ @@ -246,7 +209,7 @@ comm_group level_info[NLEVELS]; sender = partToProc[0]; receiver = partToProc[level_info[i].offsets[1]]; - ping_pong_test(MPI_COMM_WORLD, me[0], sender, receiver, 100); + ping_pong_test(zoltan_get_global_comm(), me[0], sender, receiver, 100); } MPI_Finalize(); @@ -308,7 +271,7 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, fflush(stdout); } -/* Communications between nodes +/* Communications between nodes * - Blocking sends and recvs * - No guarantee of prepost, so might pass through comm buffer */ @@ -381,20 +344,20 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, if (myproc == senderRank) { - MPI_Recv(NULL, 0, MPI_CHAR, receiverRank, 99, MPI_COMM_WORLD, &status); /* ok to start */ + MPI_Recv(NULL, 0, MPI_CHAR, receiverRank, 99, zoltan_get_global_comm(), &status); /* ok to start */ MPI_Irecv(b, size/8, MPI_DOUBLE, other_proc, j, comm, &request); - + t0 = MPI_Wtime(); MPI_Send(a, size/8, MPI_DOUBLE, other_proc, j, comm); MPI_Wait(&request, &status); tsum += MPI_Wtime() - t0; - + } else if (myproc == receiverRank) { MPI_Irecv(b, size/8, MPI_DOUBLE, other_proc, j, comm, &request); - MPI_Send(NULL, 0, MPI_CHAR, senderRank, 99, MPI_COMM_WORLD); /* ok to start */ - + MPI_Send(NULL, 0, MPI_CHAR, senderRank, 99, zoltan_get_global_comm()); /* ok to start */ + MPI_Wait(&request, &status); MPI_Send(b, size/8, MPI_DOUBLE, other_proc, j, comm); @@ -442,14 +405,14 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, t0 = MPI_Wtime(); MPI_Send(a, size/8, MPI_DOUBLE, other_proc, 0, comm); MPI_Wait(&request_b, &status); - + b[0] += 1.0; if (last != 0) b[last] += 1.0; - + MPI_Send(b, size/8, MPI_DOUBLE, other_proc, 0, comm); MPI_Wait(&request_a, &status); - + t1 = MPI_Wtime(); time = 1.e6 * (t1 - t0); } @@ -478,3 +441,5 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, printf("\n Max rate = %f MB/sec Min latency = %f usec\n", max_rate, min_latency); } + + diff --git a/packages/zoltan/src/util/network_topology/MPI/topologyTest-Glory.txt b/packages/zoltan/src/util/network_topology/MPI/topologyTest-Glory.txt index c296c43ae2..e762b10ce0 100644 --- a/packages/zoltan/src/util/network_topology/MPI/topologyTest-Glory.txt +++ b/packages/zoltan/src/util/network_topology/MPI/topologyTest-Glory.txt @@ -1,7 +1,7 @@ Tue Aug 10 12:44:28 MDT 2010 -Level 0 (world) has 1 groups: +Level 0 (world) has 1 groups: Group 0 has parts 0 through 63 -Level 1 (node) has 4 groups: +Level 1 (node) has 4 groups: Group 0 has parts 0 through 15 Group 1 has parts 16 through 31 Group 2 has parts 32 through 47 diff --git a/packages/zoltan/src/util/network_topology/MPI/topologyTest.c b/packages/zoltan/src/util/network_topology/MPI/topologyTest.c index be144e7ece..692f0f684a 100644 --- a/packages/zoltan/src/util/network_topology/MPI/topologyTest.c +++ b/packages/zoltan/src/util/network_topology/MPI/topologyTest.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include #include @@ -55,7 +18,7 @@ #define NLEVELS 4 MPI_Comm comm[NLEVELS] = { -MPI_COMM_WORLD, +zoltan_get_global_comm(), MPI_COMM_NODE, MPI_COMM_SOCKET, MPI_COMM_CACHE @@ -101,18 +64,18 @@ comm_group level_info[NLEVELS]; rc = MPI_Comm_size(comm[i], nprocs + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } - + rc = MPI_Comm_rank(comm[i], me + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %s communicator, size %d, my rank %d\n",me[0],commName[i],nprocs[i],me[i]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif } @@ -128,7 +91,7 @@ comm_group level_info[NLEVELS]; /* * classes[k] contains the rank (in level i) of the rank 0 element of element k's subcommunicator */ - level_down(i, classes, me, nprocs); + level_down(i, classes, me, nprocs); /* * my sub communicator will create which parts in the final partitioning? @@ -137,19 +100,19 @@ comm_group level_info[NLEVELS]; } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); for (i=0; i < nprocs[0]; i++){ if (i == me[0]){ - printf("(%d) ranges: %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) \n", + printf("(%d) ranges: %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) \n", me[0], - commName[0], level_part_range[0][0], level_part_range[0][1], level_part_range[0][0] + me[0], + commName[0], level_part_range[0][0], level_part_range[0][1], level_part_range[0][0] + me[0], commName[1], level_part_range[1][0], level_part_range[1][1], level_part_range[1][0] + me[1], commName[2], level_part_range[2][0], level_part_range[2][1], level_part_range[2][0] + me[2], commName[3], level_part_range[3][0], level_part_range[3][1], level_part_range[3][0] + me[3]); } - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); + MPI_Barrier(zoltan_get_global_comm()); } #endif @@ -167,7 +130,7 @@ comm_group level_info[NLEVELS]; lval=0; /* meaningful level in hierarchy */ } - MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gval < nprocs[0]){ /* next level in hierarchy is significant for at least some processes */ @@ -176,10 +139,10 @@ comm_group level_info[NLEVELS]; } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %d significant levels %d %d %d %d\n",me[0], num_significant_levels, level_number[0], level_number[1], level_number[2], level_number[3]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif /* Save global info about topology */ @@ -188,13 +151,13 @@ comm_group level_info[NLEVELS]; my_part_number = level_part_range[level][0] + me[level]; - MPI_Allgather(&my_part_number, 1, MPI_INT, procToPart, 1, MPI_INT, MPI_COMM_WORLD); + MPI_Allgather(&my_part_number, 1, MPI_INT, procToPart, 1, MPI_INT, zoltan_get_global_comm()); for (i=0; i < nprocs[0]; i++){ partToProc[procToPart[i]] = i; } - level_info[0].comm = MPI_COMM_WORLD; + level_info[0].comm = zoltan_get_global_comm(); level_info[0].name = commName[0]; level_info[0].nGroups = 1; level_info[0].myGroup = 0; @@ -210,7 +173,7 @@ comm_group level_info[NLEVELS]; memset((void *)&level_info[i], 0, sizeof(comm_group)); mine = 0; - MPI_Allgather(&(level_part_range[level][0]), 1, MPI_INT, buf, 1, MPI_INT, MPI_COMM_WORLD); + MPI_Allgather(&(level_part_range[level][0]), 1, MPI_INT, buf, 1, MPI_INT, zoltan_get_global_comm()); memset(classes, 0, sizeof(int) * nprocs[0]); for (j=0; j < nprocs[0]; j++){ classes[buf[j]]++; @@ -267,7 +230,7 @@ comm_group level_info[NLEVELS]; level_info[i].name, 0, level_info[i].offsets[1]-1); } - ping_pong_test(MPI_COMM_WORLD, me[0], sender, receiver, 100); + ping_pong_test(zoltan_get_global_comm(), me[0], sender, receiver, 100); /* ping pong across an entity */ @@ -279,7 +242,7 @@ comm_group level_info[NLEVELS]; sender = partToProc[0]; receiver = partToProc[level_info[i].offsets[1]]; - ping_pong_test(MPI_COMM_WORLD, me[0], sender, receiver, 100); + ping_pong_test(zoltan_get_global_comm(), me[0], sender, receiver, 100); } MPI_Finalize(); @@ -354,7 +317,7 @@ int i, numClasses, myClass, myClassLeader, rangeStart; for (i=0; i < nprocs; i++){ if ((buf[i] > 0) && (i == myClassLeader)) break; rangeStart += buf[i]; - } + } rangeNext[0] = rangeCurrent[0] + rangeStart; rangeNext[1] = rangeNext[0] + buf[myClassLeader] - 1; @@ -416,7 +379,7 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, fflush(stdout); } -/* Communications between nodes +/* Communications between nodes * - Blocking sends and recvs * - No guarantee of prepost, so might pass through comm buffer */ @@ -489,20 +452,20 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, if (myproc == senderRank) { - MPI_Recv(NULL, 0, MPI_CHAR, receiverRank, 99, MPI_COMM_WORLD, &status); /* ok to start */ + MPI_Recv(NULL, 0, MPI_CHAR, receiverRank, 99, zoltan_get_global_comm(), &status); /* ok to start */ MPI_Irecv(b, size/8, MPI_DOUBLE, other_proc, j, comm, &request); - + t0 = MPI_Wtime(); MPI_Send(a, size/8, MPI_DOUBLE, other_proc, j, comm); MPI_Wait(&request, &status); tsum += MPI_Wtime() - t0; - + } else if (myproc == receiverRank) { MPI_Irecv(b, size/8, MPI_DOUBLE, other_proc, j, comm, &request); - MPI_Send(NULL, 0, MPI_CHAR, senderRank, 99, MPI_COMM_WORLD); /* ok to start */ - + MPI_Send(NULL, 0, MPI_CHAR, senderRank, 99, zoltan_get_global_comm()); /* ok to start */ + MPI_Wait(&request, &status); MPI_Send(b, size/8, MPI_DOUBLE, other_proc, j, comm); @@ -550,14 +513,14 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, t0 = MPI_Wtime(); MPI_Send(a, size/8, MPI_DOUBLE, other_proc, 0, comm); MPI_Wait(&request_b, &status); - + b[0] += 1.0; if (last != 0) b[last] += 1.0; - + MPI_Send(b, size/8, MPI_DOUBLE, other_proc, 0, comm); MPI_Wait(&request_a, &status); - + t1 = MPI_Wtime(); time = 1.e6 * (t1 - t0); } @@ -586,3 +549,5 @@ void ping_pong_test(MPI_Comm comm, int myproc, int senderRank, int receiverRank, printf("\n Max rate = %f MB/sec Min latency = %f usec\n", max_rate, min_latency); } + + diff --git a/packages/zoltan/src/util/network_topology/MPI/topologyVis-Glory.txt b/packages/zoltan/src/util/network_topology/MPI/topologyVis-Glory.txt index 37371710e8..3ea5ce8a1b 100644 --- a/packages/zoltan/src/util/network_topology/MPI/topologyVis-Glory.txt +++ b/packages/zoltan/src/util/network_topology/MPI/topologyVis-Glory.txt @@ -1,9 +1,9 @@ Mon Aug 9 19:03:48 MDT 2010 Part numbers in process rank order: - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 - 51 52 53 54 55 56 57 58 59 60 61 62 63 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 + 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 + 51 52 53 54 55 56 57 58 59 60 61 62 63 Parts in each subcommunicator: Level world: [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ] diff --git a/packages/zoltan/src/util/network_topology/MPI/topologyVis.c b/packages/zoltan/src/util/network_topology/MPI/topologyVis.c index 2758372c2d..625d2519fe 100644 --- a/packages/zoltan/src/util/network_topology/MPI/topologyVis.c +++ b/packages/zoltan/src/util/network_topology/MPI/topologyVis.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #include #include #include @@ -53,7 +16,7 @@ #define NUM_LEVELS 4 MPI_Comm comm[NUM_LEVELS] = { -MPI_COMM_WORLD, +zoltan_get_global_comm(), MPI_COMM_NODE, MPI_COMM_SOCKET, MPI_COMM_CACHE @@ -85,17 +48,17 @@ char *errorstr; rc = MPI_Comm_size(comm[i], nprocs + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } rc = MPI_Comm_rank(comm[i], me + i); if (rc != MPI_SUCCESS){ MPI_Error_string(rc, errorstr, &len); - fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); + fprintf(stderr,"(%d) MPI_Comm_size %s : %s\n",me[0],commName[i],errorstr); } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %s communicator, size %d, my rank %d\n",me[0],commName[i],nprocs[i],me[i]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif } @@ -109,7 +72,7 @@ char *errorstr; /* * classes[k] contains the rank (in level i) of the rank 0 element of element k's subcommunicator */ - level_down(i, classes, me, nprocs); + level_down(i, classes, me, nprocs); /* * my sub communicator will create which parts in the final partitioning? @@ -118,14 +81,14 @@ char *errorstr; } #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) ranges: %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) %s (%d %d iam %d) \n", me[0], commName[0], level_part_range[0][0], level_part_range[0][1], level_part_range[0][0] + me[0], commName[1], level_part_range[1][0], level_part_range[1][1], level_part_range[1][0] + me[1], commName[2], level_part_range[2][0], level_part_range[2][1], level_part_range[2][0] + me[2], commName[3], level_part_range[3][0], level_part_range[3][1], level_part_range[3][0] + me[3]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif /* Figure out which levels are significant */ @@ -143,7 +106,7 @@ char *errorstr; lval=0; /* meaningful level in hierarchy */ } - MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(&lval, &gval, 1, MPI_INT, MPI_SUM, zoltan_get_global_comm()); if (gval < nprocs[0]){ /* next level in hierarchy is significant for at least some processes */ @@ -158,10 +121,10 @@ char *errorstr; #endif #ifdef DEBUG_ME - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); printf("(%d) %d significant levels %d %d %d %d \n",me[0], num_significant_levels, level_number[0], level_number[1], level_number[2], level_number[3]); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); #endif last_level = level_number[num_significant_levels-1]; @@ -170,7 +133,7 @@ char *errorstr; /* Visualize hierarchy */ - MPI_Gather(&my_part_number, 1, MPI_INT, buf, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Gather(&my_part_number, 1, MPI_INT, buf, 1, MPI_INT, 0, zoltan_get_global_comm()); if (me[0] == 0){ @@ -185,7 +148,7 @@ char *errorstr; for (i=0; i < num_significant_levels; i++){ printf("Level %s:\n", commName[level_number[i]]); - MPI_Gather(&(level_part_range[level_number[i]][0]), 1, MPI_INT, buf, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Gather(&(level_part_range[level_number[i]][0]), 1, MPI_INT, buf, 1, MPI_INT, 0, zoltan_get_global_comm()); memset(classes, 0, sizeof(int) * nprocs[0]); for (j=0; j < nprocs[0]; j++){ classes[buf[j]]++; @@ -208,7 +171,7 @@ char *errorstr; } else{ for (i=0; i < num_significant_levels; i++){ - MPI_Gather(&(level_part_range[level_number[i]][0]), 1, MPI_INT, buf, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Gather(&(level_part_range[level_number[i]][0]), 1, MPI_INT, buf, 1, MPI_INT, 0, zoltan_get_global_comm()); } } @@ -287,8 +250,9 @@ int i, numClasses, myClass, myClassLeader, rangeStart; for (i=0; i < nprocs; i++){ if ((buf[i] > 0) && (i == myClassLeader)) break; rangeStart += buf[i]; - } + } rangeNext[0] = rangeCurrent[0] + rangeStart; rangeNext[1] = rangeNext[0] + buf[myClassLeader] - 1; } + diff --git a/packages/zoltan/src/util/network_topology/hwloc/README b/packages/zoltan/src/util/network_topology/hwloc/README index b97c9cf5a9..32e091c26a 100644 --- a/packages/zoltan/src/util/network_topology/hwloc/README +++ b/packages/zoltan/src/util/network_topology/hwloc/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Discover hardware topology using hwloc. Tested with hwloc 1.0.2: http://www.open-mpi.org/software/hwloc diff --git a/packages/zoltan/src/util/network_topology/hwloc/node_topology.c b/packages/zoltan/src/util/network_topology/hwloc/node_topology.c index 46709b6e63..ffa0dabbb0 100644 --- a/packages/zoltan/src/util/network_topology/hwloc/node_topology.c +++ b/packages/zoltan/src/util/network_topology/hwloc/node_topology.c @@ -1,54 +1,17 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ -/* +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER +/* * Discover hardware topology using hwloc. * Tested with hwloc 1.0.2: http://www.open-mpi.org/software/hwloc * * Print out topology and which MPI processes are where. - * Printing out the MPI ranks may not be possible + * Printing out the MPI ranks may not be possible * if hwloc_get_cpubind() doesn't work or if it * works but gives us a cpuset containing more than one cpu. * @@ -96,8 +59,8 @@ int i, j, p; int rc, num; MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(zoltan_get_global_comm(), &size); + MPI_Comm_rank(zoltan_get_global_comm(), &rank); /* allocate & initialize topology object */ @@ -116,7 +79,7 @@ int rc, num; support = hwloc_topology_get_support((struct hwloc_topology *)topology); - /* + /* * Get the depth of topology and the root. * The root typically is a node on a multi-node machine, not the collection of nodes * in the application. @@ -124,7 +87,7 @@ int rc, num; depth = hwloc_topology_get_depth(topology); - /* + /* * Which cpu am I running on? * * HWLOC_CPUBIND_STRICT - says assume each process is running on one processor and won't be moved @@ -139,13 +102,13 @@ int rc, num; } else{ rc = hwloc_get_cpubind(topology, binding, HWLOC_CPUBIND_STRICT); - + if ((rc < 0) || (hwloc_cpuset_weight(binding) > 1)){ have_my_cpu = 0; } } - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if (!have_my_cpu && (rank == 0)){ printf("Warning: Unable to identify each MPI process with its CPU\n"); @@ -161,8 +124,8 @@ int rc, num; if (have_my_cpu){ hwloc_cpuset_snprintf(mask, MAX_NAME_LEN-1, binding); - MPI_Gather(mask, MAX_NAME_LEN, MPI_CHAR, recvbuf, MAX_NAME_LEN, MPI_CHAR, 0, MPI_COMM_WORLD); - + MPI_Gather(mask, MAX_NAME_LEN, MPI_CHAR, recvbuf, MAX_NAME_LEN, MPI_CHAR, 0, zoltan_get_global_comm()); + if (rank == 0){ cpuset = (hwloc_cpuset_t*)malloc(sizeof(hwloc_cpuset_t) * size); @@ -183,17 +146,17 @@ int rc, num; for (i=0; i < depth; i++){ num = hwloc_get_nbobjs_by_depth(topology, i); - + for (j = 0; j < num; j++){ obj = hwloc_get_obj_by_depth(topology, i, j); if (j==0){ hwloc_obj_type_snprintf(type_name, MAX_NAME_LEN-1, obj, 1); - printf("\n%d %s%s:\n",num,type_name, ((num> 1) ? "s" : "")); + printf("\n%d %s%s:\n",num,type_name, ((num> 1) ? "s" : "")); } - hwloc_cpuset_snprintf(mask, MAX_NAME_LEN - 1, obj->cpuset); + hwloc_cpuset_snprintf(mask, MAX_NAME_LEN - 1, obj->cpuset); local_memory = obj->memory.local_memory; total_memory= obj->memory.total_memory; @@ -260,3 +223,4 @@ char *info=NULL; return info; } + diff --git a/packages/zoltan/src/util/network_topology/hwloc/zoltan_get_topology.c b/packages/zoltan/src/util/network_topology/hwloc/zoltan_get_topology.c index 6f36c6e7c0..6f3d928599 100644 --- a/packages/zoltan/src/util/network_topology/hwloc/zoltan_get_topology.c +++ b/packages/zoltan/src/util/network_topology/hwloc/zoltan_get_topology.c @@ -1,49 +1,12 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ -/* +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER +/* * Discover hardware topology using hwloc. * Tested with hwloc 1.0.2: http://www.open-mpi.org/software/hwloc * @@ -85,18 +48,18 @@ } \ } -/* +/* * Define BUILD_MAIN to create a test application */ -#define BUILD_MAIN +#define BUILD_MAIN #define MAX_NAME_LEN 64 /* what should this be? */ #define MAX_NUM_LEVELS 12 /* ditto */ -int Zoltan_Get_Topology(int **branch_degree, - int **num_cpus, - char ***level_name, - uint64_t **total_memory, +int Zoltan_Get_Topology(int **branch_degree, + int **num_cpus, + char ***level_name, + uint64_t **total_memory, uint64_t **local_memory) { hwloc_topology_t topology; @@ -114,8 +77,8 @@ hwloc_cpuset_t ancestor_cpuset[MAX_NUM_LEVELS]; /* mask representing cpus in th uint64_t lmem[MAX_NUM_LEVELS]; /* memory owned by this object */ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its children */ - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(zoltan_get_global_comm(), &size); + MPI_Comm_rank(zoltan_get_global_comm(), &rank); /* allocate & initialize topology object */ @@ -135,7 +98,7 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi hwloc_topology_load(topology); - /* + /* * Get the depth of topology and the root. */ @@ -145,17 +108,17 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi ancestor_cpuset[i] = hwloc_cpuset_alloc(); } - /* + /* * Get topology information. We'll use sibling 0 at each level of the topology. * - * The root object typically is a node on a multi-node machine, not the + * The root object typically is a node on a multi-node machine, not the * collection of nodes in the application. */ rootobj = hwloc_get_root_obj(topology); hwloc_obj_type_snprintf(type_name[0], MAX_NAME_LEN, rootobj, 1); - hwloc_cpuset_copy(ancestor_cpuset[0], rootobj->cpuset); + hwloc_cpuset_copy(ancestor_cpuset[0], rootobj->cpuset); type_size[0] = 1; lmem[0] = rootobj->memory.local_memory; /*0 if not available */ tmem[0] = rootobj->memory.total_memory; @@ -170,13 +133,13 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi type_size[i] = prev_obj->arity; /* parent's number of children */ if ( (type_size[i] > 1) || (i == depth-1)){ - /* + /* * Significant levels are processing units (the leaf nodes) and levels * that are genuine branches - not the only child of parent. */ real_level[next++] = i; } - + obj = prev_obj->children[0]; hwloc_obj_type_snprintf(type_name[i], MAX_NAME_LEN, obj, 1); hwloc_cpuset_copy(ancestor_cpuset[i], obj->cpuset); @@ -217,7 +180,7 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi to = real_level[i+1]; else to = 0; /* leaf node */ - + /* Total number of CPUs within this object */ @@ -237,7 +200,7 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi } } - /* + /* * name of this level in the topology and the succession of children * level that have only one parent. */ @@ -259,7 +222,7 @@ uint64_t tmem[MAX_NUM_LEVELS]; /* owned by this object and all its chi else{ strcat(description, type_name[from]); } - + (*level_name)[i] = (char *)malloc(strlen(description) +1); MEMORY_ERROR((*level_name)[i]); strcpy((*level_name)[i], description); @@ -309,11 +272,11 @@ uint64_t *local_memory=NULL, *total_memory=NULL; char **type_name=NULL; MPI_Init(&argc, &argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(zoltan_get_global_comm(), &rank); depth = Zoltan_Get_Topology(&branching_degree, &num_cpus, &type_name, &total_memory, &local_memory); - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); if (rank == 0){ @@ -325,7 +288,7 @@ char **type_name=NULL; printf(" %d %s (%d total CPUs) %swith\n", branching_degree[i-1], type_name[i],num_cpus[i], ((num_cpus[i] > 1) ? "each " : "")); - } + } else{ printf(" %d %s\n", branching_degree[i-1], type_name[i]); } @@ -346,7 +309,7 @@ char **type_name=NULL; for (i=0; i < depth; i++){ printf("Memory at level %s: (%f10.0KB, %f10.0KB)\n", type_name[i],(float)total_memory[i]/1024.0,(float)local_memory[i]/1024.0); - } + } } else{ printf("Memory available at each level is not available\n"); @@ -355,7 +318,7 @@ char **type_name=NULL; /* Allocated cpusets can be freed with hwloc_cpuset_free() */ - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(zoltan_get_global_comm()); MPI_Finalize(); return 0; diff --git a/packages/zoltan/src/util/nofortran.txt b/packages/zoltan/src/util/nofortran.txt index c04a85460b..05334a6fb4 100644 --- a/packages/zoltan/src/util/nofortran.txt +++ b/packages/zoltan/src/util/nofortran.txt @@ -22,7 +22,7 @@ The below link points to a "no-fortran" serial nightly build. You will see what packages can be built without Fortran there. http://software.sandia.gov/trilinos/developer/test_harness/results/build.html?mid=51=1172 - + Also, this only works on the dev branch. diff --git a/packages/zoltan/src/util/vtk_view.cpp b/packages/zoltan/src/util/vtk_view.cpp index 6edf1777e9..1b09122ed9 100644 --- a/packages/zoltan/src/util/vtk_view.cpp +++ b/packages/zoltan/src/util/vtk_view.cpp @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER //-------------------------------------------------------------------------- // This source file builds two applications: vtk_view and vtk_write. @@ -59,29 +22,29 @@ // incorporate into a web page or report or mail to a friend. It uses // Mesa to do off screen rendering so it can be run in places where // vtk_view can not be run. -// -// Both can run with more or fewer processes than zdrive ran. Choose -// the size of your vtk_view/vtk_write application based only on the +// +// Both can run with more or fewer processes than zdrive ran. Choose +// the size of your vtk_view/vtk_write application based only on the // computational demands of reading and rendering the Chaco or Nemesis files. -// +// // The inputs to vtk_view/vtk_write are: -// -// The Chaco or Nemesis files used by the zdrive test. -// -// The zdrive output files describing the calculated partitioning. -// -// An input file similar to the input file used by zdrive, naming the +// +// The Chaco or Nemesis files used by the zdrive test. +// +// The zdrive output files describing the calculated partitioning. +// +// An input file similar to the input file used by zdrive, naming the // Chaco or Nemesis files. In fact, you can use the zdrive parameter // file since it named those input files. When visualizing parallel -// ExodusII/Nemesis files, it helps if you add the parameter "Zdrive Count" -// to tell vtk_view how many zdrive processes there were. If you omit +// ExodusII/Nemesis files, it helps if you add the parameter "Zdrive Count" +// to tell vtk_view how many zdrive processes there were. If you omit // this, vtk_view will try to figure it out by searching for the -// zdrive output files. -// -// vtk_view requires that you obtain and compile VTK (the Visualization +// zdrive output files. +// +// vtk_view requires that you obtain and compile VTK (the Visualization // Toolkit, available for free from Kitware, Inc. at www.vtk.org), version -// 5.0 or later. In the Config.{arch} file that directed your compilation -// of Zoltan, add directives to indicate where the VTK, GL and X libraries +// 5.0 or later. In the Config.{arch} file that directed your compilation +// of Zoltan, add directives to indicate where the VTK, GL and X libraries // are. See "Config.generic" for an example of these directives. // // vtk_write must be compiled with a version of VTK libraries that were @@ -200,9 +163,9 @@ static char *suffix[6] = { // parameters from zdrive-style input file #define LINELEN 80 - + static char *vis_opt_names[UNDEFINED_LIST_MAX]={ - "zdrive count", // number of zdrive processes + "zdrive count", // number of zdrive processes "image height", // pixel height of image "image width", // pixel width of image "output partition number", // visualize this partition number @@ -248,7 +211,7 @@ static char vis_opt_values[UNDEFINED_LIST_MAX][UNDEFINED_LENGTH_MAX]; // default option values -static int zdriveCount = 0; +static int zdriveCount = 0; static int imageHeight = 300; static int imageWidth= 300; static int showPartitionNumber = -1; @@ -272,15 +235,15 @@ static float outputViewUp[3] = {0, 1, 0}; static char filePattern[ZMAXPATH]; // "printf"-like pattern: "%s/basename.0016.%04d" static char filePrefix[ZMAXPATH]; // root directory for pattern static int fileRange[2]; // file numbers for pattern -static char **fileNames; // OR list of all file names +static char **fileNames; // OR list of all file names static char **fileNamesBase; static int specialSingleFile = 0; -static int numNemesisFiles = 0; -static int lastPartition = 0; +static int numNemesisFiles = 0; +static int lastPartition = 0; static int read_broadcast_input_options(int &argc, char **argv); static int read_mesh(vtkUnstructuredGrid *ug); -static int create_field_array(vtkUnstructuredGrid *ug, char *ca, char *pa, +static int create_field_array(vtkUnstructuredGrid *ug, char *ca, char *pa, double *range); static int set_number_of_zdrive_processes(char *fname, char **disks); static int set_nemesis_file_names_or_pattern(char *baseName, @@ -350,7 +313,7 @@ int main(int argc, char **argv) rc = set_nemesis_file_names_or_pattern(fname_opts.pexo_fname, fname_opts.num_dsk_ctrlrs, fname_opts.dsk_list_cnt, fname_opts.dsk_list, - fname_opts.pdsk_add_fact, fname_opts.zeros, + fname_opts.pdsk_add_fact, fname_opts.zeros, fname_opts.pdsk_root, fname_opts.pdsk_subdir); @@ -359,9 +322,9 @@ int main(int argc, char **argv) } if (rc > 0){ - Controller->Finalize(); + Controller->Finalize(); Controller->Delete(); - + return 1; } } @@ -371,19 +334,19 @@ int main(int argc, char **argv) // The chaco base name is in fname_opts.pexo_fname, but if we // are to read the zdrive output files, we need to know how many // zdrive processes there were. - + if (zdriveCount == 0){ - + if (Proc == 0){ rc = set_number_of_zdrive_processes(fname_opts.pexo_fname, NULL); } - + if (NumProcs > 1){ int vals[2]; vals[0] = rc; vals[1] = zdriveCount; Comm->Broadcast(vals, 2, 0); - + if (Proc > 0){ rc = vals[0]; zdriveCount = vals[1]; @@ -391,7 +354,7 @@ int main(int argc, char **argv) } if (rc){ - return 1; + return 1; } } } @@ -435,7 +398,7 @@ static void Run(vtkMultiProcessController *c, void *arg) // If we were processing zdrive output files, we'll visualize the // partition number assigned by zdrive. If not, and there are - // point or cell arrays other than global ID arrays, we'll visualize + // point or cell arrays other than global ID arrays, we'll visualize // one of those. If all else fails, we'll visualize the global element ID. char cellArray[128], pointArray[128]; @@ -449,8 +412,8 @@ static void Run(vtkMultiProcessController *c, void *arg) } // Redistribute the cells for more load balanced rendering. This - // also creates ghost cells on each process if required for - // correct rendering. For a single process application with + // also creates ghost cells on each process if required for + // correct rendering. For a single process application with // distributed Exodus files, it removes duplicate points from // the vtkUnstructuredGrid output. @@ -506,7 +469,7 @@ static void Run(vtkMultiProcessController *c, void *arg) for (vtkIdType i=0; iSetTableValue(i, r0 + i*rdiff, g0 + i*gdiff, b0 + i*bdiff); } - + mapper->SetLookupTable(lut); #endif @@ -520,7 +483,7 @@ static void Run(vtkMultiProcessController *c, void *arg) #else vtkScalarBarActor *sb = NULL; vtkTextActor *capActor = NULL; - + if (Proc == 0){ if (!omitScalarBar){ sb = vtkScalarBarActor::New(); @@ -534,7 +497,7 @@ static void Run(vtkMultiProcessController *c, void *arg) sb->SetLookupTable(mapper->GetLookupTable()); sb->SetNumberOfLabels(4); } - + if (!omitCaption || addCaption[0]){ capActor = vtkTextActor::New(); char *info = captionText(pointArray, cellArray); @@ -542,7 +505,7 @@ static void Run(vtkMultiProcessController *c, void *arg) if (info){ capActor->SetInput(info); delete [] info; - + capActor->SetAlignmentPoint(0); capActor->GetTextProperty()->SetVerticalJustificationToBottom(); capActor->GetTextProperty()->SetJustificationToLeft(); @@ -555,7 +518,7 @@ static void Run(vtkMultiProcessController *c, void *arg) } } } - + vtkActor *actor = vtkActor::New(); actor->SetMapper(mapper); @@ -618,7 +581,7 @@ static void Run(vtkMultiProcessController *c, void *arg) if (Proc == 0){ char fname[128]; int skipFrames = outputStride - 1; - int i, ii; + int i, ii; vtkWindowToImageFilter *wif = vtkWindowToImageFilter::New(); wif->SetInput(renWin); @@ -645,12 +608,12 @@ static void Run(vtkMultiProcessController *c, void *arg) if (outputStop == outputStart){ sprintf(fname, "%s.%s", outputName, vis_opt_values[option_format]); - } + } vtkCamera *camera = renderer->GetActiveCamera(); camera->SetViewUp(outputViewUp[0], outputViewUp[1], outputViewUp[2]); camera->UpdateViewport(renderer); - + for (i=0, ii=skipFrames; i<=outputStop; i++) { if (i >= outputStart) { if (ii == skipFrames) { @@ -661,7 +624,7 @@ static void Run(vtkMultiProcessController *c, void *arg) wif->Modified(); if (outputStop > outputStart){ - sprintf(fname, "%s.%03d.%s", outputName, i, + sprintf(fname, "%s.%03d.%s", outputName, i, vis_opt_values[option_format]); } @@ -687,7 +650,7 @@ static void Run(vtkMultiProcessController *c, void *arg) #else - renWin->SetPosition(0, 360*Proc); + renWin->SetPosition(0, 360*Proc); prm->ResetCamera(renderer); prm->ResetCameraClippingRange(renderer); prm->StartInteractor(); // now you can interact with window @@ -715,8 +678,8 @@ static int read_mesh(vtkUnstructuredGrid *ug) vtkPChacoReader *rdr = vtkPChacoReader::New(); rdr->SetBaseName(fname_opts.pexo_fname); - rdr->GenerateGlobalElementIdArrayOn(); - rdr->GenerateGlobalNodeIdArrayOn(); + rdr->GenerateGlobalElementIdArrayOn(); + rdr->GenerateGlobalNodeIdArrayOn(); rdr->GetOutput()->SetUpdatePiece(Proc); rdr->GetOutput()->SetUpdateNumberOfPieces(NumProcs); @@ -752,13 +715,13 @@ static int read_mesh(vtkUnstructuredGrid *ug) rdr->SetFileNames(numNemesisFiles, (const char **)fileNames); } else{ - rdr->SetFilePrefix(filePrefix); + rdr->SetFilePrefix(filePrefix); rdr->SetFilePattern(filePattern); rdr->SetFileRange(fileRange); } - rdr->GenerateGlobalElementIdArrayOn(); - rdr->GenerateGlobalNodeIdArrayOn(); + rdr->GenerateGlobalElementIdArrayOn(); + rdr->GenerateGlobalNodeIdArrayOn(); rdr->GetOutput()->SetUpdatePiece(Proc); rdr->GetOutput()->SetUpdateNumberOfPieces(NumProcs); rdr->SetTimeStep(0); @@ -769,12 +732,12 @@ static int read_mesh(vtkUnstructuredGrid *ug) int nparrays = rdr->GetNumberOfPointArrays(); if (nparrays > 0){ - rdr->SetPointArrayStatus(0, 1); + rdr->SetPointArrayStatus(0, 1); } else{ int ncarrays = rdr->GetNumberOfCellArrays(); if (ncarrays > 0){ - rdr->SetCellArrayStatus(0, 1); + rdr->SetCellArrayStatus(0, 1); } } @@ -800,7 +763,7 @@ static int read_mesh(vtkUnstructuredGrid *ug) } return 0; } -static int create_field_array(vtkUnstructuredGrid *ug, +static int create_field_array(vtkUnstructuredGrid *ug, char *ca, char *pa, double *range) { int rc = 0; @@ -820,25 +783,25 @@ static int create_field_array(vtkUnstructuredGrid *ug, } rc = assign_partition_numbers(ug); - + if (NumProcs > 1){ rc = checkAllrc(rc, Comm); } - + if (rc > 0){ return 1; } - + rc = check_partition_numbers(ug); - + if (rc){ cout << Proc << " failed to obtain all partition numbers" << endl; } - + if (NumProcs > 1){ rc = checkAllrc(rc, Comm); } - + if (rc > 0){ return 1; } @@ -900,10 +863,10 @@ int read_broadcast_input_options(int &argc, char **argv) { // Options (same meaning as zdrive parameters): // "File Type" NemesisI or Chaco - // "File Name" base name of Nemesis (base.p.n) or + // "File Name" base name of Nemesis (base.p.n) or // Chaco (base.coords, base.graph) files // "Parallel Disk Info" - // "Parallel file location" + // "Parallel file location" // // Special vtk_view options: // See the "usage" functions in this source file. @@ -937,11 +900,11 @@ int read_broadcast_input_options(int &argc, char **argv) return 1; } fname_opts.dsk_list_cnt = -1; - fname_opts.num_dsk_ctrlrs = -1; - fname_opts.pdsk_add_fact = -1; + fname_opts.num_dsk_ctrlrs = -1; + fname_opts.pdsk_add_fact = -1; fname_opts.zeros = -1; - fname_opts.file_type = -1; - fname_opts.pdsk_root[0] = '\0'; + fname_opts.file_type = -1; + fname_opts.pdsk_root[0] = '\0'; fname_opts.pdsk_subdir[0] = '\0'; fname_opts.pexo_fname[0] = '\0'; @@ -953,7 +916,7 @@ int read_broadcast_input_options(int &argc, char **argv) if (Proc == 0){ input_ok = read_cmd_file(cmd_file, &prob_opts, &fname_opts, &extra_options); - + if (input_ok){ if (extra_options.list_size > 0){ for (int i=0; input_ok && (i 1){ Comm->Broadcast(&input_ok, 1, 0); } - + if (!input_ok){ if (Proc == 0){ usage(); } return 1; } - + if (NumProcs > 1){ Comm->Broadcast((char *)&fname_opts, sizeof(fname_opts), 0); - + if (fname_opts.dsk_list_cnt > 0){ if (Proc != 0){ fname_opts.dsk_list = new int[fname_opts.dsk_list_cnt]; @@ -1062,7 +1025,7 @@ int read_broadcast_input_options(int &argc, char **argv) sscanf(vis_opt_values[option_width], "%d", &imageWidth); } if (vis_opt_values[option_partition_number][0]){ - sscanf(vis_opt_values[option_partition_number], "%d", + sscanf(vis_opt_values[option_partition_number], "%d", &showPartitionNumber); notPartitionNumber = (showPartitionNumber ? 0 : 1); } @@ -1104,7 +1067,7 @@ int read_broadcast_input_options(int &argc, char **argv) } return 1; - } + } } strcpy(vis_opt_values[option_format], suffix[outputFormat]); @@ -1123,7 +1086,7 @@ int read_broadcast_input_options(int &argc, char **argv) sscanf(vis_opt_values[option_frame_stride], "%d", &outputStride); } if (vis_opt_values[option_view_up][0]){ - int nvals = sscanf(vis_opt_values[option_view_up], "%f %f %f", + int nvals = sscanf(vis_opt_values[option_view_up], "%f %f %f", outputViewUp, outputViewUp + 1, outputViewUp + 2); if (nvals != 3){ @@ -1217,7 +1180,7 @@ static void write_option_ignored(int option) #endif static int set_nemesis_file_names_or_pattern(char *baseName, - int numDisks, int diskListSize, int *diskList, + int numDisks, int diskListSize, int *diskList, int diskOffset, int useZeros, char *dirRoot, char *subDir) { @@ -1233,7 +1196,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, filePrefix[0] = '\0'; fileRange[0] = fileRange[1] = -1; - if ((numDisks > 0) || (diskListSize > 0)){ // get list of directory names + if ((numDisks > 0) || (diskListSize > 0)){ // get list of directory names int ndisks = (numDisks > 0) ? numDisks : diskListSize; @@ -1243,7 +1206,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, else{ nzeros = 0; } - + len = strlen(dirRoot) + 32; if (subDir) len += strlen(subDir); @@ -1259,7 +1222,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, } if (zdriveCount == 0){ - + if (Proc == 0){ // also sets numNemesisFiles, which is usually the same rc = set_number_of_zdrive_processes(baseName, disks); @@ -1278,7 +1241,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, zdriveCount = counts[1]; numNemesisFiles = counts[2]; specialSingleFile = counts[3]; - } + } } if (rc){ @@ -1298,7 +1261,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, else if (numDisks > 1){ // We need to provide the VTK reader with a list of all file names. - + fileNames = new char *[numNemesisFiles]; fileNamesBase = new char *[numNemesisFiles]; len += (sizeof(baseName) + 64); @@ -1313,7 +1276,7 @@ static int set_nemesis_file_names_or_pattern(char *baseName, else{ // Sufficient to provide just the file name prefix, pattern and range. - + fileRange[0] = 0; fileRange[1] = numNemesisFiles - 1; @@ -1384,7 +1347,7 @@ static int set_number_of_zdrive_processes(char *fname, char **disks) } // find the rightmost slash, which separates directory from file name - + char *c = strrchr(dn, slash); if (c==NULL){ strcpy(dn, "."); @@ -1437,16 +1400,16 @@ static int set_number_of_zdrive_processes(char *fname, char **disks) while ((de = readdir(dir)) != NULL){ if (strncmp(fn, de->d_name, len) == 0){ char *c = de->d_name + len; - + if (*c == '.'){ int nmatches = sscanf(c, ".%d.%d", &count, &fileno); - + if (nmatches == 2){ break; } } else if (!*c){ - /* + /* * The name given was not the base name for a distributed * file, it was the whole name of a single file. */ @@ -1547,7 +1510,7 @@ static void debug_partition_ids(vtkUnstructuredGrid *ug, vtkIntArray *partids) vtkCell *c = ug->GetCell(i); int subId = c->GetParametricCenter(pcoords); c->EvaluateLocation(subId, pcoords, center, weights); - + cout << center[0] << " " << center[1] << " " << center[2] << ", "; cout << partids->GetTuple(i) << endl; } @@ -1620,7 +1583,7 @@ int g, p, nvals; } fclose(fp); } - + update_partition_id_map(); return 0; @@ -1754,13 +1717,13 @@ int assign_partition_numbers(vtkUnstructuredGrid *ug) hasCells = new int[NumProcs]; procs = new int[NumProcs]; me = ((ncells > 0) ? 1 : 0); - + Comm->AllGather(&me, hasCells, 1); - + nprocs = 0; myrank = -1; group->Initialize(Controller); - + for (int i=0; i 0){ partids->Delete(); partids = NULL; @@ -1949,41 +1912,41 @@ static char *captionText(char *pnm, char *cnm) int dtype = fname_opts.init_dist_type; if ((fname_opts.file_type != NEMESIS_FILE) && (dtype != INITIAL_FILE)) { snprintf(buf1, LINELEN, "Chaco: %s, %s initial distribution, %s", - fname_opts.pexo_fname, - (dtype == INITIAL_LINEAR ? - "linear" : + fname_opts.pexo_fname, + (dtype == INITIAL_LINEAR ? + "linear" : (dtype == INITIAL_CYCLIC ? "cyclic" : "owner")), prob_opts.method); } else{ snprintf(buf1, LINELEN, "%s: %s, %s", (fname_opts.file_type != NEMESIS_FILE ? "Chaco" : "Exodus/Nemesis"), - fname_opts.pexo_fname, + fname_opts.pexo_fname, prob_opts.method); } - + used = snprintf(c, LINELEN+1, "%s\n", buf1); - + c += used; lenleft -= used; linelen = 0; - + if (prob_opts.num_params > 0) { for (int i=0; i= lenleft){ + + if (used >= lenleft){ snprintf(c, lenleft, "..."); break; // that's all we have room for } - + if (linelen + used >= LINELEN){ *c++ = '\n'; linelen = 0; lenleft--; } - + strcpy(c, buf1); c += used; lenleft -= used; @@ -1993,13 +1956,13 @@ static char *captionText(char *pnm, char *cnm) char *nm = get_zdrive_output_file_name(); used = strlen(nm) + 1; - + if (lenleft > used){ sprintf(c, "\n%s", nm); lenleft -= used; c += used; } - + delete [] nm; } @@ -2106,7 +2069,7 @@ static void usage() #endif } - + //---------------------------------------------------------------- // We link in one source file from zdrive. It references some // of the globals defined in another file. We define the globals @@ -2115,7 +2078,7 @@ static void usage() int Debug_Driver = 1; int Number_Iterations = 1; -int Driver_Action = 1; +int Driver_Action = 1; int Chaco_In_Assign_Inv = 0; struct Test_Flags Test; struct Output_Flags Output; diff --git a/packages/zoltan/src/zz/README b/packages/zoltan/src/zz/README index 00417ee4bc..c0fa7c6b07 100644 --- a/packages/zoltan/src/zz/README +++ b/packages/zoltan/src/zz/README @@ -1,46 +1,3 @@ -# @HEADER -# -######################################################################## -# -# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring -# Copyright 2012 Sandia Corporation -# -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the Corporation nor the names of the -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Questions? Contact Karen Devine kddevin@sandia.gov -# Erik Boman egboman@sandia.gov -# -######################################################################## -# -# @HEADER Directory zz Zoltan Interface Routines Includes general Zoltan interface, callback registry, and utilities. diff --git a/packages/zoltan/src/zz/zz_back_trace.c b/packages/zoltan/src/zz/zz_back_trace.c index 75def02867..99d538a581 100644 --- a/packages/zoltan/src/zz/zz_back_trace.c +++ b/packages/zoltan/src/zz/zz_back_trace.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ diff --git a/packages/zoltan/src/zz/zz_const.h b/packages/zoltan/src/zz/zz_const.h index 0f52c16b43..eda62194c2 100644 --- a/packages/zoltan/src/zz/zz_const.h +++ b/packages/zoltan/src/zz/zz_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_CONST_H @@ -102,7 +65,7 @@ struct Param_List; /* * Define the debug levels allowed. * ZOLTAN_DEBUG_NONE = 0 - quiet mode; no debugging information. - * ZOLTAN_DEBUG_PARAMS = 1 - print values of all parameters used + * ZOLTAN_DEBUG_PARAMS = 1 - print values of all parameters used * plus backtrace on Zoltan error. * ZOLTAN_DEBUG_ZTIME = 2 - print Zoltan timing information. * ZOLTAN_DEBUG_ATIME = 3 - print algorithm's timing info, if the @@ -110,17 +73,17 @@ struct Param_List; * ZOLTAN_DEBUG_TRACE_ZERO = 5 - print trace info on processor 0 only. * ZOLTAN_DEBUG_TRACE_ALL = 6 - print trace info on all processors. * ZOLTAN_DEBUG_TRACE_DETAIL = 7 - print detailed trace info on all processors. - * ZOLTAN_DEBUG_LIST = 8 - print lists of objects to be imported + * ZOLTAN_DEBUG_LIST = 8 - print lists of objects to be imported * and exported. * ZOLTAN_DEBUG_ALL = 10 - print all debug information available. */ -#define ZOLTAN_DEBUG_NONE 0 +#define ZOLTAN_DEBUG_NONE 0 #define ZOLTAN_DEBUG_PARAMS 1 #define ZOLTAN_DEBUG_ZTIME 2 #define ZOLTAN_DEBUG_ATIME 3 #define ZOLTAN_DEBUG_TRACE_SINGLE 5 #define ZOLTAN_DEBUG_TRACE_ALL 6 -#define ZOLTAN_DEBUG_TRACE_DETAIL 7 +#define ZOLTAN_DEBUG_TRACE_DETAIL 7 #define ZOLTAN_DEBUG_LIST 8 #define ZOLTAN_DEBUG_ALL 10 @@ -155,7 +118,7 @@ struct Zoltan_TPL_Order_Struct; /*****************************************************************************/ /*****************************************************************************/ - + /**************************************************************************/ /* The data structure below for hetero. machines is not being used yet! */ /* The structure will almost certainly change in the next release. */ @@ -219,7 +182,7 @@ typedef struct { /* * Define a Zoltan structure. It will contain pointers to the - * appropriate functions for interfacing with applications and + * appropriate functions for interfacing with applications and * pointers to the data structure used for load balancing. */ @@ -233,21 +196,21 @@ struct Zoltan_Struct { int Num_LID; /* The number of entries in Local IDs. */ int Debug_Level; /* Debug level for this instance of load balancing. */ - int Debug_Proc; /* Print from this processor any debugging - info that is printed from only one + int Debug_Proc; /* Print from this processor any debugging + info that is printed from only one processor. */ int Fortran; /* 1 if created from Fortran, 0 otherwise */ int Tflops_Special; /* Flag to indicate if we should use some MPI constructs (0) or not (1) on tflops*/ - unsigned int Seed; /* Zoltan_Rand seed: default or provided + unsigned int Seed; /* Zoltan_Rand seed: default or provided by user. */ struct Param_List *Params; /* List of parameter names & new vals */ int Deterministic; /* Flag indicating whether algorithms used should be forced to be deterministic. Default = TRUE. */ - int Obj_Weight_Dim; /* Dimension of the object weights, + int Obj_Weight_Dim; /* Dimension of the object weights, usually 0 (no weights) or 1 */ - int Edge_Weight_Dim; /* Dimension of the edge weights, + int Edge_Weight_Dim; /* Dimension of the edge weights, usually 0 (no weights) or 1 */ int Timer; /* Timer type that is currently active */ struct Zoltan_Timer *ZTime; /* Timer structure for persistent timing. */ @@ -256,7 +219,7 @@ struct Zoltan_Struct { part assignments. */ ZOLTAN_PART_MULTI_FORT_FN *Get_Part_Multi_Fort; /* Fortran version */ - void *Get_Part_Multi_Data; /* Ptr to user defined data to be + void *Get_Part_Multi_Data; /* Ptr to user defined data to be passed to Get_Part_Multi() */ ZOLTAN_PART_FN *Get_Part; /* Fn ptr to get an object's part assignment. */ @@ -270,7 +233,7 @@ struct Zoltan_Struct { /* Fortran version */ void *Get_Num_Edges_Data; /* Ptr to user defined data to be passed to Get_Num_Edges() */ - ZOLTAN_NUM_EDGES_MULTI_FN *Get_Num_Edges_Multi; + ZOLTAN_NUM_EDGES_MULTI_FN *Get_Num_Edges_Multi; /* Fn ptr to get multiple objects' number of edges. */ ZOLTAN_NUM_EDGES_MULTI_FORT_FN *Get_Num_Edges_Multi_Fort; @@ -283,7 +246,7 @@ struct Zoltan_Struct { /* Fortran version */ void *Get_Edge_List_Data; /* Ptr to user defined data to be passed to Get_Edge_List() */ - ZOLTAN_EDGE_LIST_MULTI_FN *Get_Edge_List_Multi; + ZOLTAN_EDGE_LIST_MULTI_FN *Get_Edge_List_Multi; /* Fn ptr to get an object's edge list.*/ ZOLTAN_EDGE_LIST_MULTI_FORT_FN *Get_Edge_List_Multi_Fort; /* Fortran version */ @@ -292,15 +255,15 @@ struct Zoltan_Struct { /***************************************************************************/ ZOLTAN_NUM_GEOM_FN *Get_Num_Geom; /* Fn ptr to get an object's number of geometry values. */ - ZOLTAN_NUM_GEOM_FORT_FN *Get_Num_Geom_Fort; + ZOLTAN_NUM_GEOM_FORT_FN *Get_Num_Geom_Fort; /* Fortran version */ void *Get_Num_Geom_Data; /* Ptr to user defined data to be passed to Get_Num_Geom() */ /***************************************************************************/ - ZOLTAN_GEOM_MULTI_FN *Get_Geom_Multi; + ZOLTAN_GEOM_MULTI_FN *Get_Geom_Multi; /* Fn ptr to get all objects' geometry values. */ - ZOLTAN_GEOM_MULTI_FORT_FN *Get_Geom_Multi_Fort; + ZOLTAN_GEOM_MULTI_FORT_FN *Get_Geom_Multi_Fort; /* Fortran version */ void *Get_Geom_Multi_Data; /* Ptr to user defined data to be passed to Get_Geom_Multi() */ @@ -310,64 +273,64 @@ struct Zoltan_Struct { void *Get_Geom_Data; /* Ptr to user defined data to be passed to Get_Geom() */ /***************************************************************************/ - ZOLTAN_NUM_OBJ_FN *Get_Num_Obj; /* Fn ptr to get a proc's + ZOLTAN_NUM_OBJ_FN *Get_Num_Obj; /* Fn ptr to get a proc's number of local objects. */ - ZOLTAN_NUM_OBJ_FORT_FN *Get_Num_Obj_Fort; + ZOLTAN_NUM_OBJ_FORT_FN *Get_Num_Obj_Fort; /* Fortran version */ void *Get_Num_Obj_Data; /* Ptr to user defined data to be passed to Get_Num_Obj() */ /***************************************************************************/ ZOLTAN_OBJ_LIST_FN *Get_Obj_List; /* Fn ptr to get all local objects on a proc. */ - ZOLTAN_OBJ_LIST_FORT_FN *Get_Obj_List_Fort; + ZOLTAN_OBJ_LIST_FORT_FN *Get_Obj_List_Fort; /* Fortran version */ void *Get_Obj_List_Data; /* Ptr to user defined data to be passed to Get_Obj_List() */ - ZOLTAN_FIRST_OBJ_FN *Get_First_Obj; /* Fn ptr to get the first + ZOLTAN_FIRST_OBJ_FN *Get_First_Obj; /* Fn ptr to get the first local obj on a proc. */ ZOLTAN_FIRST_OBJ_FORT_FN *Get_First_Obj_Fort; /* Fortran version */ void *Get_First_Obj_Data; /* Ptr to user defined data to be passed to Get_First_Obj() */ - ZOLTAN_NEXT_OBJ_FN *Get_Next_Obj; /* Fn ptr to get the next + ZOLTAN_NEXT_OBJ_FN *Get_Next_Obj; /* Fn ptr to get the next local obj on a proc. */ - ZOLTAN_NEXT_OBJ_FORT_FN *Get_Next_Obj_Fort; + ZOLTAN_NEXT_OBJ_FORT_FN *Get_Next_Obj_Fort; /* Fortran version */ void *Get_Next_Obj_Data; /* Ptr to user defined data to be passed to Get_Next_Obj() */ /***************************************************************************/ ZOLTAN_NUM_BORDER_OBJ_FN *Get_Num_Border_Obj; - /* Fn ptr to get a proc's + /* Fn ptr to get a proc's number of border objs wrt a given processor. */ - ZOLTAN_NUM_BORDER_OBJ_FORT_FN *Get_Num_Border_Obj_Fort; - /* Fortran version */ + ZOLTAN_NUM_BORDER_OBJ_FORT_FN *Get_Num_Border_Obj_Fort; + /* Fortran version */ void *Get_Num_Border_Obj_Data; /* Ptr to user defined data to be passed to Get_Num_Border_Obj() */ - ZOLTAN_BORDER_OBJ_LIST_FN *Get_Border_Obj_List; + ZOLTAN_BORDER_OBJ_LIST_FN *Get_Border_Obj_List; /* Fn ptr to get all objects sharing a border with a given processor. */ - ZOLTAN_BORDER_OBJ_LIST_FORT_FN *Get_Border_Obj_List_Fort; + ZOLTAN_BORDER_OBJ_LIST_FORT_FN *Get_Border_Obj_List_Fort; /* Fortran version */ void *Get_Border_Obj_List_Data; /* Ptr to user defined data to be passed to Get_Border_Obj_List() */ ZOLTAN_FIRST_BORDER_OBJ_FN *Get_First_Border_Obj; - /* Fn ptr to get the first - object sharing a border + /* Fn ptr to get the first + object sharing a border with a given processor. */ - ZOLTAN_FIRST_BORDER_OBJ_FORT_FN *Get_First_Border_Obj_Fort; + ZOLTAN_FIRST_BORDER_OBJ_FORT_FN *Get_First_Border_Obj_Fort; /* Fortran version */ void *Get_First_Border_Obj_Data; /* Ptr to user defined data to be passed to Get_First_Border_Obj() */ - ZOLTAN_NEXT_BORDER_OBJ_FN *Get_Next_Border_Obj; - /* Fn ptr to get the next - object sharing a border + ZOLTAN_NEXT_BORDER_OBJ_FN *Get_Next_Border_Obj; + /* Fn ptr to get the next + object sharing a border with a given processor. */ - ZOLTAN_NEXT_BORDER_OBJ_FORT_FN *Get_Next_Border_Obj_Fort; + ZOLTAN_NEXT_BORDER_OBJ_FORT_FN *Get_Next_Border_Obj_Fort; /* Fortran version */ void *Get_Next_Border_Obj_Data; /* Ptr to user defined data to be passed to @@ -376,16 +339,16 @@ struct Zoltan_Struct { ZOLTAN_NUM_COARSE_OBJ_FN *Get_Num_Coarse_Obj; /* Fn ptr to get the number of elements in the coarse grid*/ - ZOLTAN_NUM_COARSE_OBJ_FORT_FN *Get_Num_Coarse_Obj_Fort; + ZOLTAN_NUM_COARSE_OBJ_FORT_FN *Get_Num_Coarse_Obj_Fort; /* Fortran version */ void *Get_Num_Coarse_Obj_Data; /* Ptr to user defined data to be passed to Get_Num_Coarse_Obj() */ /***************************************************************************/ - ZOLTAN_COARSE_OBJ_LIST_FN *Get_Coarse_Obj_List; + ZOLTAN_COARSE_OBJ_LIST_FN *Get_Coarse_Obj_List; /* Fn ptr to get all elements in the coarse grid*/ - ZOLTAN_COARSE_OBJ_LIST_FORT_FN *Get_Coarse_Obj_List_Fort; + ZOLTAN_COARSE_OBJ_LIST_FORT_FN *Get_Coarse_Obj_List_Fort; /* Fortran version */ void *Get_Coarse_Obj_List_Data; /* Ptr to user defined data to be passed to @@ -393,15 +356,15 @@ struct Zoltan_Struct { ZOLTAN_FIRST_COARSE_OBJ_FN *Get_First_Coarse_Obj; /* Fn ptr to get the first coarse obj on a proc. */ - ZOLTAN_FIRST_COARSE_OBJ_FORT_FN *Get_First_Coarse_Obj_Fort; + ZOLTAN_FIRST_COARSE_OBJ_FORT_FN *Get_First_Coarse_Obj_Fort; /* Fortran version */ void *Get_First_Coarse_Obj_Data; /* Ptr to user defined data to be passed to Get_First_Coarse_Obj() */ - ZOLTAN_NEXT_COARSE_OBJ_FN *Get_Next_Coarse_Obj; + ZOLTAN_NEXT_COARSE_OBJ_FN *Get_Next_Coarse_Obj; /* Fn ptr to get the next coarse obj on a proc. */ - ZOLTAN_NEXT_COARSE_OBJ_FORT_FN *Get_Next_Coarse_Obj_Fort; + ZOLTAN_NEXT_COARSE_OBJ_FORT_FN *Get_Next_Coarse_Obj_Fort; /* Fortran version */ void *Get_Next_Coarse_Obj_Data; /* Ptr to user defined data to be passed to @@ -415,25 +378,25 @@ struct Zoltan_Struct { to be passed to Get_Num_Child() */ /***************************************************************************/ - ZOLTAN_CHILD_LIST_FN *Get_Child_List; + ZOLTAN_CHILD_LIST_FN *Get_Child_List; /* Fn ptr to get all children of an element */ - ZOLTAN_CHILD_LIST_FORT_FN *Get_Child_List_Fort; + ZOLTAN_CHILD_LIST_FORT_FN *Get_Child_List_Fort; /* Fortran version */ void *Get_Child_List_Data; /* Ptr to user defined data to be passed to Get_Child_List() */ /***************************************************************************/ - ZOLTAN_CHILD_WEIGHT_FN *Get_Child_Weight; + ZOLTAN_CHILD_WEIGHT_FN *Get_Child_Weight; /* Fn ptr to get the weight of an element */ - ZOLTAN_CHILD_WEIGHT_FORT_FN *Get_Child_Weight_Fort; + ZOLTAN_CHILD_WEIGHT_FORT_FN *Get_Child_Weight_Fort; /* Fortran version */ void *Get_Child_Weight_Data; /* Ptr to user defined data to be passed to Get_Child_Weight() */ /***************************************************************************/ - ZOLTAN_HG_SIZE_CS_FN *Get_HG_Size_CS; + ZOLTAN_HG_SIZE_CS_FN *Get_HG_Size_CS; /* Fn ptr to get size and format of hypergraph compressed storage. */ ZOLTAN_HG_SIZE_CS_FORT_FN *Get_HG_Size_CS_Fort; @@ -441,7 +404,7 @@ struct Zoltan_Struct { void *Get_HG_Size_CS_Data; /* Ptr to user defined data to be passed to Get_HG_Size_CS() */ /***************************************************************************/ - ZOLTAN_HG_CS_FN *Get_HG_CS; + ZOLTAN_HG_CS_FN *Get_HG_CS; /* Fn ptr to get hypergraph pins in a compressed storage format. */ ZOLTAN_HG_CS_FORT_FN *Get_HG_CS_Fort; @@ -449,7 +412,7 @@ struct Zoltan_Struct { void *Get_HG_CS_Data; /* Ptr to user defined data to be passed to Get_HG_CS() */ /***************************************************************************/ - ZOLTAN_HG_SIZE_EDGE_WTS_FN *Get_HG_Size_Edge_Wts; + ZOLTAN_HG_SIZE_EDGE_WTS_FN *Get_HG_Size_Edge_Wts; /* Fn ptr to get size of hypergraph edge weights to be returned. */ ZOLTAN_HG_SIZE_EDGE_WTS_FORT_FN *Get_HG_Size_Edge_Wts_Fort; @@ -457,7 +420,7 @@ struct Zoltan_Struct { void *Get_HG_Size_Edge_Wts_Data; /* Ptr to user defined data to be passed to Get_HG_Size_Edge_Wts() */ /***************************************************************************/ - ZOLTAN_HG_EDGE_WTS_FN *Get_HG_Edge_Wts; + ZOLTAN_HG_EDGE_WTS_FN *Get_HG_Edge_Wts; /* Fn ptr to get hyperedge weights */ ZOLTAN_HG_EDGE_WTS_FORT_FN *Get_HG_Edge_Wts_Fort; /* Fortran version */ @@ -467,7 +430,7 @@ struct Zoltan_Struct { ZOLTAN_NUM_FIXED_OBJ_FN *Get_Num_Fixed_Obj; /* Fn ptr to get a processor's number of fixed objects. */ - ZOLTAN_NUM_FIXED_OBJ_FORT_FN *Get_Num_Fixed_Obj_Fort; + ZOLTAN_NUM_FIXED_OBJ_FORT_FN *Get_Num_Fixed_Obj_Fort; /* Fortran version */ void *Get_Num_Fixed_Obj_Data; /* Ptr to user defined data to be passed to Get_Num_Fixed_Obj() */ @@ -475,14 +438,14 @@ struct Zoltan_Struct { ZOLTAN_FIXED_OBJ_LIST_FN *Get_Fixed_Obj_List; /* Fn ptr to get a processor's number of fixed objects. */ - ZOLTAN_FIXED_OBJ_LIST_FORT_FN *Get_Fixed_Obj_List_Fort; + ZOLTAN_FIXED_OBJ_LIST_FORT_FN *Get_Fixed_Obj_List_Fort; /* Fortran version */ void *Get_Fixed_Obj_List_Data; /* Ptr to user defined data to be passed to Get_Fixed_Obj_List()*/ /***************************************************************************/ ZOLTAN_HIER_NUM_LEVELS_FN *Get_Hier_Num_Levels; /* Function that returns the number - of levels for hierarchical + of levels for hierarchical partitioning */ ZOLTAN_HIER_NUM_LEVELS_FORT_FN *Get_Hier_Num_Levels_Fort; /* Fortran version */ @@ -499,7 +462,7 @@ struct Zoltan_Struct { /***************************************************************************/ ZOLTAN_HIER_METHOD_FN *Get_Hier_Method; /* Function that allows app to set the - LB method and params for process + LB method and params for process at a given level in hierarchical partitioning */ ZOLTAN_HIER_METHOD_FORT_FN *Get_Hier_Method_Fort; @@ -559,7 +522,7 @@ struct Zoltan_Struct { void *Unpack_Obj_Multi_Data; /* Ptr to user defined data to be passed to Unpack_Obj_Multi() */ /***************************************************************************/ - ZOLTAN_PROC_NAME_FN *Get_Processor_Name; + ZOLTAN_PROC_NAME_FN *Get_Processor_Name; /* Fn ptr to get proc name */ void *Get_Processor_Name_Data; /* Ptr to user defined data */ @@ -603,9 +566,9 @@ typedef struct Zoltan_Transform_Struct ZZ_Transform; * that are not included in the load-balancing communicator. */ -#define ZOLTAN_PROC_NOT_IN_COMMUNICATOR(zz) ((zz)->Proc == -1) +#define ZOLTAN_PROC_NOT_IN_COMMUNICATOR(zz) ((zz)->Proc == -1) -/* +/* * Print trace information. */ @@ -661,10 +624,10 @@ typedef struct Zoltan_Transform_Struct ZZ_Transform; /* * Debugging macro for Tflop architecture. * ZOLTAN_HEAP_INFO(proc_number, string) prints information about the heap, - * such as number of fragments, total free memory, largest free chunk + * such as number of fragments, total free memory, largest free chunk * of memory, and total used memory. The processor number and provided * string are printed to help instrument the code. - * On architectures other than Tflop, ZOLTAN_HEAP_INFO compiles + * On architectures other than Tflop, ZOLTAN_HEAP_INFO compiles * but has no effect. */ #ifdef TFLOP @@ -683,9 +646,9 @@ typedef struct Zoltan_Transform_Struct ZZ_Transform; /*****************************************************************************/ /*****************************************************************************/ /* PROTOTYPES */ -extern int Zoltan_Get_Obj_List(ZZ *, int *, +extern int Zoltan_Get_Obj_List(ZZ *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int, float**, int **); -extern int Zoltan_Get_Obj_List_Special_Malloc(ZZ *, int *, +extern int Zoltan_Get_Obj_List_Special_Malloc(ZZ *, int *, ZOLTAN_ID_PTR *, ZOLTAN_ID_PTR *, int, float**, int **); extern int Zoltan_Print_Obj_List( ZZ *zz, ZOLTAN_ID_PTR Gids, ZOLTAN_ID_PTR Lids, diff --git a/packages/zoltan/src/zz/zz_coord.c b/packages/zoltan/src/zz/zz_coord.c index b6bb5de55f..d31da18acc 100644 --- a/packages/zoltan/src/zz/zz_coord.c +++ b/packages/zoltan/src/zz/zz_coord.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -63,7 +26,7 @@ extern "C" { /*****************************************************************************/ /*****************************************************************************/ -/* +/* * This function gets a list of coordinates one way or the other, * i.e., by calling either Get_Geom_Multi or Get_Geom for each object. * @@ -80,9 +43,9 @@ static PARAM_VARS Reduce_Dim_Params[] = { { "DEGENERATE_RATIO", NULL, "DOUBLE", 0 }, { NULL, NULL, NULL, 0 } }; -static void inertial_matrix2D(ZZ *zz, double *X, int num_obj, +static void inertial_matrix2D(ZZ *zz, double *X, int num_obj, double *cm, double (*im)[3]) ; -static void inertial_matrix3D(ZZ *zz, double *X, int num_obj, +static void inertial_matrix3D(ZZ *zz, double *X, int num_obj, double *cm, double (*im)[3]) ; static int eigenvectors(double (*m)[3], double (*evecs)[3], int dim); static void projected_distances(ZZ *zz, double *coords, int num_obj, @@ -90,13 +53,13 @@ static void projected_distances(ZZ *zz, double *coords, int num_obj, static void order_decreasing(double *d, int *order); static void transform_coordinates(double *coords, int num_obj, int d, ZZ_Transform *tr); -static int get_target_dimension(double *dist, int *order, +static int get_target_dimension(double *dist, int *order, double deg_ratio, int d); #define NEAR_ONE(x) ((x >= .9999) && (x <= 1.0001)) int Zoltan_Get_Coordinates( - ZZ *zz, + ZZ *zz, int num_obj, /* Input: number of objects */ ZOLTAN_ID_PTR global_ids, /* Input: global IDs of objects */ ZOLTAN_ID_PTR local_ids, /* Input: local IDs of objects; may be NULL. */ @@ -110,7 +73,7 @@ int Zoltan_Get_Coordinates( int num_gid_entries = zz->Num_GID; int num_lid_entries = zz->Num_LID; int alloced_coords = 0; - ZOLTAN_ID_PTR lid; /* Temporary pointers to local IDs; used to pass + ZOLTAN_ID_PTR lid; /* Temporary pointers to local IDs; used to pass NULL to query functions when NUM_LID_ENTRIES == 0. */ double dist[3]; double im[3][3] = {{0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}}; @@ -127,7 +90,7 @@ int Zoltan_Get_Coordinates( /* Error check -- make sure needed callback functions are registered. */ - if (zz->Get_Num_Geom == NULL || + if (zz->Get_Num_Geom == NULL || (zz->Get_Geom == NULL && zz->Get_Geom_Multi == NULL)) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Must register ZOLTAN_NUM_GEOM_FN and " "either ZOLTAN_GEOM_MULTI_FN or ZOLTAN_GEOM_FN"); @@ -138,13 +101,13 @@ int Zoltan_Get_Coordinates( *num_dim = zz->Get_Num_Geom(zz->Get_Num_Geom_Data, &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from ZOLTAN_GET_NUM_GEOM_FN"); goto End; } if (*num_dim < 0 || *num_dim > 3) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Invalid dimension returned from ZOLTAN_NUM_GEOM_FN"); goto End; } @@ -166,7 +129,7 @@ int Zoltan_Get_Coordinates( num_obj, global_ids, local_ids, *num_dim, *coords, &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from ZOLTAN_GET_GEOM_MULTI_FN"); goto End; } @@ -175,10 +138,10 @@ int Zoltan_Get_Coordinates( for (i = 0; i < num_obj; i++) { lid = (num_lid_entries ? &(local_ids[i*num_lid_entries]) : NULL); zz->Get_Geom(zz->Get_Geom_Data, num_gid_entries, num_lid_entries, - global_ids + i*num_gid_entries, lid, + global_ids + i*num_gid_entries, lid, (*coords) + i*(*num_dim), &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from ZOLTAN_GET_GEOM_FN"); goto End; } @@ -188,11 +151,11 @@ int Zoltan_Get_Coordinates( /* * For RCB, RIB, and HSFC: if REDUCE_DIMENSIONS was selected, compute the - * center of mass and inertial matrix of the coordinates. + * center of mass and inertial matrix of the coordinates. * * For 3D problems: If the geometry is "flat", transform the points so the - * two primary directions lie along the X and Y coordinate axes and project - * to the Z=0 plane. If in addition the geometry is "skinny", project to + * two primary directions lie along the X and Y coordinate axes and project + * to the Z=0 plane. If in addition the geometry is "skinny", project to * the X axis. (This creates a 2D or 1D problem respectively.) * * For 2D problems: If the geometry is essentially a line, transform it's @@ -200,14 +163,14 @@ int Zoltan_Get_Coordinates( * 1D problem. * * Return these points to the partitioning algorithm, in effect partitioning - * in only the 2 (or 1) significant dimensions. + * in only the 2 (or 1) significant dimensions. */ - if (((*num_dim == 3) || (*num_dim == 2)) && + if (((*num_dim == 3) || (*num_dim == 2)) && ((zz->LB.Method==RCB) || (zz->LB.Method==RIB) || (zz->LB.Method==HSFC))){ Zoltan_Bind_Param(Reduce_Dim_Params, "KEEP_CUTS", (void *)&i); - Zoltan_Bind_Param(Reduce_Dim_Params, "REDUCE_DIMENSIONS", + Zoltan_Bind_Param(Reduce_Dim_Params, "REDUCE_DIMENSIONS", (void *)&reduce_dimensions); Zoltan_Bind_Param(Reduce_Dim_Params, "DEGENERATE_RATIO", (void *)°_ratio); @@ -231,7 +194,7 @@ int Zoltan_Get_Coordinates( if (zz->LB.Method == RCB){ tran = &(((RCB_STRUCT *)(zz->LB.Data_Structure))->Tran); - } + } else if (zz->LB.Method == RIB){ tran = &(((RIB_STRUCT *)(zz->LB.Data_Structure))->Tran); } @@ -244,9 +207,9 @@ int Zoltan_Get_Coordinates( if (tran->Target_Dim >= 0){ /* * On a previous load balancing call, we determined whether - * or not the geometry was degenerate. If the geometry was - * determined to be not degenerate, then we assume it is still - * not degenerate, and we skip the degeneracy calculation. + * or not the geometry was degenerate. If the geometry was + * determined to be not degenerate, then we assume it is still + * not degenerate, and we skip the degeneracy calculation. */ if (tran->Target_Dim > 0){ /* @@ -254,11 +217,11 @@ int Zoltan_Get_Coordinates( * of the geometry along the principal directions determined * last time to determine if it is still degenerate with that * orientation. If so, we transform the coordinates using the - * same transformation we used last time. If not, we do the + * same transformation we used last time. If not, we do the * entire degeneracy calculation again. */ - - if ((tran->Axis_Order[0] >= 0) && + + if ((tran->Axis_Order[0] >= 0) && (tran->Axis_Order[1] >= 0) && (tran->Axis_Order[2] >= 0)){ axis_aligned = 1; } @@ -266,8 +229,8 @@ int Zoltan_Get_Coordinates( axis_aligned = 0; } - projected_distances(zz, *coords, num_obj, tran->CM, - tran->Evecs, dist, d, axis_aligned, tran->Axis_Order); + projected_distances(zz, *coords, num_obj, tran->CM, + tran->Evecs, dist, d, axis_aligned, tran->Axis_Order); target_dim = get_target_dimension(dist, order, deg_ratio, d); @@ -298,7 +261,7 @@ int Zoltan_Get_Coordinates( /* * The inertial matrix is a 3x3 or 2x2 real symmetric matrix. Get its - * three or two orthonormal eigenvectors. These usually indicate the + * three or two orthonormal eigenvectors. These usually indicate the * orientation of the geometry. */ @@ -308,7 +271,7 @@ int Zoltan_Get_Coordinates( if (zz->Proc == 0){ ZOLTAN_PRINT_WARN(0, yo, "REDUCE_DIMENSIONS calculation failed"); } - goto End; + goto End; } /* @@ -339,7 +302,7 @@ int Zoltan_Get_Coordinates( } } - if ((tran->Axis_Order[0] >= 0) && + if ((tran->Axis_Order[0] >= 0) && (tran->Axis_Order[1] >= 0) && (tran->Axis_Order[2] >= 0)){ axis_aligned = 1; } @@ -349,8 +312,8 @@ int Zoltan_Get_Coordinates( * by the direction of the eigenvectors through the center of mass. */ - projected_distances(zz, *coords, num_obj, tran->CM, tran->Evecs, dist, - d, axis_aligned, tran->Axis_Order); + projected_distances(zz, *coords, num_obj, tran->CM, tran->Evecs, dist, + d, axis_aligned, tran->Axis_Order); /* * Decide whether these distances indicate the geometry is @@ -393,12 +356,12 @@ int Zoltan_Get_Coordinates( } else{ /* - * Reorder the eigenvectors (they're the columns of evecs) from + * Reorder the eigenvectors (they're the columns of evecs) from * longest projected distance to shorted projected distance. Compute * the transpose (the inverse) of the matrix. This will transform - * the geometry to align along the X-Y plane, or along the X axis. + * the geometry to align along the X-Y plane, or along the X axis. */ - + for (i=0; i< target_dim; i++){ tran->Transformation[i][2] = 0.0; for (j=0; jPermutation[i] = -1; tr->CM[i] = 0.0; tr->Axis_Order[i] = 0; - } + } } /* * Decide whether the relative lengths of the edges of the oriented * bounding box indicate the geometry is very flat in one or two directions. */ -static int get_target_dimension(double *dist, int *order, +static int get_target_dimension(double *dist, int *order, double deg_ratio, int d) { int target_dim = 0; double flat; - + if (d == 2){ if (dist[0] < dist[1]){ order[0] = 1; order[1] = 0; @@ -474,14 +437,14 @@ static int get_target_dimension(double *dist, int *order, order_decreasing(dist, order); flat = dist[order[0]] / deg_ratio; - + if (dist[order[2]] < flat){ /* * We'll rotate geometry so it's aligned with the X/Y plane * and project to Z=0. */ target_dim = 2; - + if (dist[order[1]] < flat){ /* * We'll rotate geometry so it's aligned with the X-axis @@ -521,18 +484,18 @@ static void transform_coordinates(double *coords, int num_obj, int d, } else{ for (i=0; iTransformation[0][0]*coords[0] + + + x = tr->Transformation[0][0]*coords[0] + tr->Transformation[0][1]*coords[1]; if (d == 3) x += tr->Transformation[0][2]*coords[2]; - + if (tr->Target_Dim == 2){ - y = tr->Transformation[1][0]*coords[0] + - tr->Transformation[1][1]*coords[1]; + y = tr->Transformation[1][0]*coords[0] + + tr->Transformation[1][1]*coords[1]; if (d == 3) y += tr->Transformation[1][2]*coords[2]; - } - + } + coords[0] = x; coords[1] = y; if (d == 3) coords[2] = 0.0; @@ -543,7 +506,7 @@ static void transform_coordinates(double *coords, int num_obj, int d, * Calculate a 2x2 inertial matrix representing the * locations of the 2-dimensional coordinates. */ -static void inertial_matrix2D(ZZ *zstruct, double *X, +static void inertial_matrix2D(ZZ *zstruct, double *X, int num_obj, double *cm, double (*im)[3]) { double tmp1[3], tmp2[3]; @@ -560,7 +523,7 @@ static void inertial_matrix2D(ZZ *zstruct, double *X, int proclower = 0; num_coords = (double)num_obj; - cm[0] = cm[1] = 0.0; + cm[0] = cm[1] = 0.0; for (j = 0, c = X; j < num_obj; j++, c += 2) { cm[0] += c[0]; cm[1] += c[1]; @@ -590,12 +553,12 @@ static void inertial_matrix2D(ZZ *zstruct, double *X, } if (zstruct->Tflops_Special) { - tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = xy; + tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = xy; Zoltan_RIB_reduce_double(tmp1, tmp2, 3, comm, nproc, rank, proc, 1); - xxt = tmp2[0]; yyt = tmp2[1]; xyt = tmp2[2]; + xxt = tmp2[0]; yyt = tmp2[1]; xyt = tmp2[2]; } else { - tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = xy; + tmp1[0] = xx; tmp1[1] = yy; tmp1[2] = xy; MPI_Allreduce(tmp1, tmp2, 3, MPI_DOUBLE, MPI_SUM, comm); xxt = tmp2[0]; yyt = tmp2[1]; xyt = tmp2[2]; } @@ -610,7 +573,7 @@ static void inertial_matrix2D(ZZ *zstruct, double *X, * Calculate a 3x3 inertial matrix representing the * locations of the 3-dimensional coordinates. */ -static void inertial_matrix3D(ZZ *zstruct, double *X, +static void inertial_matrix3D(ZZ *zstruct, double *X, int num_obj, double *cm, double (*im)[3]) { double tmp1[6], tmp2[6]; @@ -629,7 +592,7 @@ static void inertial_matrix3D(ZZ *zstruct, double *X, /* Much of this was taken from Zoltan_RIB_inertial3d() */ - cm[0] = cm[1] = cm[2] = 0.0; + cm[0] = cm[1] = cm[2] = 0.0; for (j = 0, c = X; j < num_obj; j++, c += 3) { cm[0] += c[0]; cm[1] += c[1]; @@ -734,7 +697,7 @@ MPI_Comm local_comm; /* distance along the j'th eigenvector */ d[j] = max[order[j]] - min[order[j]]; } - + return; } @@ -810,12 +773,13 @@ static void order_decreasing(double *d, int *order) } } } -/* +/* * Given a real symmetric matrix "m", find its eigenvectors. Put * the orthonormal eigenvectors in the columns of the matrix "evecs". * Assume dim is 2 or 3. */ +#define SIGN(a,b) ((b) < 0 ? -fabs(a) : fabs(a)) static int eigenvectors(double (*m)[3], double (*evecs)[3], int dim) { double temp[2][2]; diff --git a/packages/zoltan/src/zz/zz_gen_files.c b/packages/zoltan/src/zz/zz_gen_files.c index 96a8ee4be5..1c0e725dbd 100644 --- a/packages/zoltan/src/zz/zz_gen_files.c +++ b/packages/zoltan/src/zz/zz_gen_files.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ extern "C" { @@ -60,13 +23,13 @@ extern "C" { /* Temporary prototypes. These functions are HG routines currently not compiled into Zoltan, but duplicated in this file. */ static ZOLTAN_GNO_TYPE Zoltan_HG_Get_Pins(ZZ *zz, int *nEdges, int **edgeSize, - ZOLTAN_ID_PTR *edgeIds, ZOLTAN_ID_PTR *vtxIds, + ZOLTAN_ID_PTR *edgeIds, ZOLTAN_ID_PTR *vtxIds, int *nEwgts, ZOLTAN_ID_PTR *eWgtIds, float **eWgts); static int turn_off_reduce_dimensions(ZZ *zz); static ZOLTAN_GNO_TYPE merge_gids(ZZ *zz, ZOLTAN_ID_PTR *merged_egids, ZOLTAN_GNO_TYPE size_merged, ZOLTAN_ID_PTR idbuf, ZOLTAN_GNO_TYPE numIds, void *htptr, ZOLTAN_GNO_TYPE htSize); static int augment_search_structure(ZZ *zz, void *htptr, - ZOLTAN_GNO_TYPE maxEdges, ZOLTAN_ID_PTR merged_egids, ZOLTAN_GNO_TYPE size_merged, + ZOLTAN_GNO_TYPE maxEdges, ZOLTAN_ID_PTR merged_egids, ZOLTAN_GNO_TYPE size_merged, ZOLTAN_GNO_TYPE prev_size_merged); static ZOLTAN_GNO_TYPE fan_in_edge_global_ids(ZZ *zz, int numEdges, ZOLTAN_ID_PTR egids); @@ -74,7 +37,7 @@ static ZOLTAN_GNO_TYPE fan_in_edge_global_ids(ZZ *zz, int numEdges, ZOLTAN_ID_PT /*****************************************************************************/ /* * This file contains routines for generating output files - * from Zoltan that describe the data given to Zoltan. These + * from Zoltan that describe the data given to Zoltan. These * functions are all callable by the application, and can be * invoked independent of load-balancing (Zoltan_LB_Balance). */ @@ -96,9 +59,9 @@ int gen_geom, int gen_graph, int gen_hg) * fname, the basename for the output files * base_index, first vertex (object) is labelled 0 or 1? * ignored for hypergraphs, Matrix Market standard says "1". - * gen_geom, generate geometry file? - * gen_graph, generate graph file? - * gen_hg, generate hypergraph file? + * gen_geom, generate geometry file? + * gen_graph, generate graph file? + * gen_hg, generate hypergraph file? * * The output is serialized, such that each processor * will open and close each output file in turn. @@ -176,7 +139,7 @@ int gen_geom, int gen_graph, int gen_hg) else{ /* Compute global number of vertices. */ gno_val = (ZOLTAN_GNO_TYPE)num_obj; - MPI_Allreduce(&gno_val, &glob_nvtxs, 1, zoltan_gno_mpi_type, MPI_SUM, zz->Communicator); + MPI_Allreduce(&gno_val, &glob_nvtxs, 1, zoltan_gno_mpi_type, MPI_SUM, zz->Communicator); } /* Local number of edges. */ @@ -187,7 +150,7 @@ int gen_geom, int gen_graph, int gen_hg) /* Compute global number of edges. */ gno_val = (ZOLTAN_GNO_TYPE)num_edges; - MPI_Reduce(&gno_val, &glob_edges, 1, zoltan_gno_mpi_type, MPI_SUM, 0, zz->Communicator); + MPI_Reduce(&gno_val, &glob_edges, 1, zoltan_gno_mpi_type, MPI_SUM, 0, zz->Communicator); /* Assume no self-edges! */ glob_edges /= 2; @@ -208,11 +171,11 @@ int gen_geom, int gen_graph, int gen_hg) * Edge weights are not necessarily for edges of my pins. */ glob_hedges = Zoltan_HG_Get_Pins(zz, &nEdges, &edgeSize, - &edgeIds, &vtxIds, + &edgeIds, &vtxIds, &nEwgts, &eWgtIds, &eWgts); if (glob_hedges < 0){ - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error calling hypergraph pin query functions.\n"); error = ZOLTAN_FATAL; goto End; @@ -225,7 +188,7 @@ int gen_geom, int gen_graph, int gen_hg) numPins = 0; } - /* Get the global number of pins for process 0. + /* Get the global number of pins for process 0. */ gno_val = (ZOLTAN_GNO_TYPE)numPins; MPI_Reduce(&gno_val, &glob_pins, 1, zoltan_gno_mpi_type, MPI_SUM, 0, zz->Communicator); @@ -261,7 +224,7 @@ int gen_geom, int gen_graph, int gen_hg) if ( ((maxVtxId - minVtxId + 1) != glob_nvtxs) || ((maxEdgeId - minEdgeId + 1) != glob_hedges)){ - + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Edge or Vertex IDs not consecutive."); error = ZOLTAN_FATAL; goto End; @@ -280,7 +243,7 @@ int gen_geom, int gen_graph, int gen_hg) if (gen_geom){ if (zz->Get_Num_Geom == NULL || (zz->Get_Geom == NULL && zz->Get_Geom_Multi == NULL)) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Geometry output requested, but no corresponding query function was found.\n"); error = ZOLTAN_FATAL; goto End; @@ -303,7 +266,7 @@ int gen_geom, int gen_graph, int gen_hg) } } - Zoltan_Print_Sync_Start(zz->Communicator, 0); + Zoltan_Print_Sync_Start(zz->Communicator, 0); /* Do we need this if we have pin callbacks? Vertex assignment * is in the hypergraph file. @@ -337,9 +300,8 @@ int gen_geom, int gen_graph, int gen_hg) goto End; } for (i=0; iProc == 0){ fprintf(fp, "%% First line: #vertices #edges weight_flag\n"); - fprintf(fp, ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC " %1d%1d%1d", glob_nvtxs, glob_edges, + fprintf(fp, ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC " %1d%1d%1d", glob_nvtxs, glob_edges, print_vtx_num, (zz->Obj_Weight_Dim>0), (zz->Edge_Weight_Dim>0)); if (zz->Obj_Weight_Dim>1 || zz->Edge_Weight_Dim>1) fprintf(fp, " %d %d", zz->Obj_Weight_Dim, zz->Edge_Weight_Dim); @@ -415,7 +377,7 @@ int gen_geom, int gen_graph, int gen_hg) fclose(fp); } - Zoltan_Print_Sync_End(zz->Communicator, 0); + Zoltan_Print_Sync_End(zz->Communicator, 0); /* Separate synchronization for hypergraphs; this could be merged into the previous synchronization. */ @@ -426,7 +388,7 @@ int gen_geom, int gen_graph, int gen_hg) if (gen_hg){ /* PLEASE READ: If you change the format of this "matrixmarket plus" - * file, please change dr_hg_io.c:process_mtxp_file(), which + * file, please change dr_hg_io.c:process_mtxp_file(), which * reads the file for zdrive. * * This format is our own extension of the NIST Matrix Market file @@ -438,12 +400,12 @@ int gen_geom, int gen_graph, int gen_hg) * 3. numeric data on a line is separated by one or more blanks * 4. real data is in floating-point decimal format, can use "e" notation * 5. all indices are 1-based - * 6. character data may be upper or lower case. + * 6. character data may be upper or lower case. */ sprintf(full_fname, "%s.mtxp", fname); /* matrixmarket plus */ - Zoltan_Print_Sync_Start(zz->Communicator, 0); + Zoltan_Print_Sync_Start(zz->Communicator, 0); if (zz->Proc == 0) fp = fopen(full_fname, "w"); else @@ -452,29 +414,29 @@ int gen_geom, int gen_graph, int gen_hg) if (fp==NULL){ ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Could not open file for writing.\n"); error = ZOLTAN_FATAL; - Zoltan_Print_Sync_End(zz->Communicator, 0); + Zoltan_Print_Sync_End(zz->Communicator, 0); goto End; } /* If proc 0, write first line. */ if (zz->Proc == 0){ - fprintf(fp, + fprintf(fp, "%%%%MatrixMarket+ distributed-matrix coordinate real general\n%%\n"); - fprintf(fp, + fprintf(fp, "%%rows = hyperedges, columns = vertices\n%%\n"); - fprintf(fp, + fprintf(fp, "%%#rows #columns #pins #procs dim-vertex-weights " "#edge-weight-entries dim-edge-weights\n%%\n"); - fprintf(fp, ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC - " %d %d " ZOLTAN_GNO_SPEC " %d\n", - glob_hedges, glob_nvtxs, glob_pins, + fprintf(fp, ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC " " ZOLTAN_GNO_SPEC + " %d %d " ZOLTAN_GNO_SPEC " %d\n", + glob_hedges, glob_nvtxs, glob_pins, zz->Num_Proc, zz->Obj_Weight_Dim, glob_ewgts, zz->Edge_Weight_Dim); - fprintf(fp, + fprintf(fp, "%%\n%%========================================================\n"); - fprintf(fp, + fprintf(fp, "%% Edge ID, Vertex ID, 1.0, Process ID\n%%\n"); - fprintf(fp, + fprintf(fp, "%% Edge and Vertex IDs are 1-based, process IDs are zero-based.\n%%\n"); } @@ -491,12 +453,12 @@ int gen_geom, int gen_graph, int gen_hg) } fflush(fp); fclose(fp); - Zoltan_Print_Sync_End(zz->Communicator, 0); + Zoltan_Print_Sync_End(zz->Communicator, 0); MPI_Barrier(zz->Communicator); /* Each proc prints its vertices and vertex weights. */ - Zoltan_Print_Sync_Start(zz->Communicator, 0); + Zoltan_Print_Sync_Start(zz->Communicator, 0); vptr = global_ids; wptr = float_vwgt; @@ -504,9 +466,9 @@ int gen_geom, int gen_graph, int gen_hg) fp = fopen(full_fname, "a"); if (zz->Proc == 0){ - fprintf(fp, + fprintf(fp, "%%\n%%========================================================\n"); - fprintf(fp, + fprintf(fp, "%% Vertex ID, Vertex weights, Process ID\n%%\n"); } @@ -520,14 +482,14 @@ int gen_geom, int gen_graph, int gen_hg) } fflush(fp); fclose(fp); - Zoltan_Print_Sync_End(zz->Communicator, 0); + Zoltan_Print_Sync_End(zz->Communicator, 0); MPI_Barrier(zz->Communicator); /* Each proc prints its edge weights. */ if (zz->Edge_Weight_Dim > 0){ - Zoltan_Print_Sync_Start(zz->Communicator, 0); + Zoltan_Print_Sync_Start(zz->Communicator, 0); eptr = eWgtIds; wptr = eWgts; @@ -535,9 +497,9 @@ int gen_geom, int gen_graph, int gen_hg) fp = fopen(full_fname, "a"); if (zz->Proc == 0){ - fprintf(fp, + fprintf(fp, "%%\n%%========================================================\n"); - fprintf(fp, + fprintf(fp, "%% Edge ID, Edge weights, Process ID\n%%\n"); } @@ -552,7 +514,7 @@ int gen_geom, int gen_graph, int gen_hg) fflush(fp); fclose(fp); - Zoltan_Print_Sync_End(zz->Communicator, 0); + Zoltan_Print_Sync_End(zz->Communicator, 0); MPI_Barrier(zz->Communicator); } } @@ -568,7 +530,7 @@ int gen_geom, int gen_graph, int gen_hg) ZOLTAN_FREE(&float_vwgt); ZOLTAN_FREE(&ewgts); ZOLTAN_FREE(&part); - + if (have_pin_callbacks){ ZOLTAN_FREE(&edgeSize); ZOLTAN_FREE(&edgeIds); @@ -600,7 +562,7 @@ static int turn_off_reduce_dimensions(ZZ *zz) } static ZOLTAN_GNO_TYPE Zoltan_HG_Get_Pins(ZZ *zz, int *nEdges, int **edgeSize, - ZOLTAN_ID_PTR *edgeIds, ZOLTAN_ID_PTR *vtxIds, + ZOLTAN_ID_PTR *edgeIds, ZOLTAN_ID_PTR *vtxIds, int *nEwgts, ZOLTAN_ID_PTR *eWgtIds, float **eWgts) { char *yo = "Zoltan_HG_Get_Pins"; @@ -696,7 +658,7 @@ struct _gidht{ struct _gidht *next; } *gidNode, *gidNext; struct _gidht **ht=NULL; -int proc, myrank, nprocs, mask, i; +int proc, myrank, nprocs, mask, i; unsigned int ui; unsigned int nbits; ZOLTAN_ID_PTR merged_egids, idbuf; @@ -718,7 +680,7 @@ MPI_Datatype zoltan_gno_mpi_type; /* * The processes have possibly overlapping lists of edge global IDs. * We will fan in the lists, with each process merging its - * IDs with the IDs it received. Normally we wouldn't want to + * IDs with the IDs it received. Normally we wouldn't want to * allocate storage for all possible edges on one process, because * in general this won't fit. But Zoltan_Generate_Files is used * in a debugging mode, so hopefully this won't be a problem. @@ -726,7 +688,7 @@ MPI_Datatype zoltan_gno_mpi_type; nEdges = (ZOLTAN_GNO_TYPE)numEdges; - MPI_Allreduce(&nEdges, &maxEdges, 1, zoltan_gno_mpi_type, MPI_MAX, zz->Communicator); + MPI_Allreduce(&nEdges, &maxEdges, 1, zoltan_gno_mpi_type, MPI_MAX, zz->Communicator); if (maxEdges == 0){ return 0; @@ -747,7 +709,7 @@ MPI_Datatype zoltan_gno_mpi_type; /* Do the fan in (bit switching logarithmic fan-in) */ myrank = zz->Proc; - nprocs = zz->Num_Proc; + nprocs = zz->Num_Proc; for (nbits=0; nbits<(sizeof(int)*8); nbits++){ if ((nprocs >> nbits) == 0) break; @@ -768,7 +730,7 @@ MPI_Datatype zoltan_gno_mpi_type; MPI_Send(merged_egids, size_merged * lenGID, ZOLTAN_ID_MPI_TYPE, proc, gidTag, zz->Communicator); } } - + else{ MPI_Recv(&numIds, 1, zoltan_gno_mpi_type, proc, sizeTag, zz->Communicator, &stat); @@ -817,7 +779,7 @@ MPI_Datatype zoltan_gno_mpi_type; return allEdges; } static int augment_search_structure(ZZ *zz, void *htptr, - ZOLTAN_GNO_TYPE maxEdges, ZOLTAN_ID_PTR merged_egids, ZOLTAN_GNO_TYPE size_merged, + ZOLTAN_GNO_TYPE maxEdges, ZOLTAN_ID_PTR merged_egids, ZOLTAN_GNO_TYPE size_merged, ZOLTAN_GNO_TYPE prev_size_merged) { struct _gidht{ @@ -883,7 +845,7 @@ ZOLTAN_ID_PTR newIds, mergedPtr, inPtr; gidNode = ht[j]; while (gidNode){ if (ZOLTAN_EQ_GID(zz, inPtr, newIds + (gidNode->gidIdx * lenGID))){ - break; + break; } gidNode = gidNode->next; } diff --git a/packages/zoltan/src/zz/zz_hash.c b/packages/zoltan/src/zz/zz_hash.c index 1fdb26bc41..ac5b7645f9 100644 --- a/packages/zoltan/src/zz/zz_hash.c +++ b/packages/zoltan/src/zz/zz_hash.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -62,7 +25,7 @@ extern "C" { /*****************************************************************************/ /*****************************************************************************/ -/* Zoltan_Hash is a hash function for Zoltan ids (local or global). +/* Zoltan_Hash is a hash function for Zoltan ids (local or global). * * Input: * key: a key to hash of type ZOLTAN_ID_PTR @@ -92,7 +55,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) */ uint32_t k; - MurmurHash3_x86_32((void *)key, sizeof(ZOLTAN_ID_TYPE)*num_id_entries, + MurmurHash3_x86_32((void *)key, sizeof(ZOLTAN_ID_TYPE)*num_id_entries, 1, (void *)&k); return(k % n); } @@ -101,7 +64,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) #ifdef ZZ_NEW_HASH /* Let phi be the golden ratio = 1.618033887 */ -#define MAXINT_DIV_PHI 2654435761U +#define MAXINT_DIV_PHI 2654435761U /* =2^32/phi, best for 32 bit machines */ /* #define MAXINT_DIV_PHI 11400714819323198485U */ /* =2^64/phi, best for 64 bit machines */ @@ -113,25 +76,25 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) that the new hash function changes some answers, therefore we have not yet replaced the old version. We should consider even stronger hash (like MD5) if we think good hashing is - very important. + very important. */ -/* Algorithm: +/* Algorithm: * This hash function is a variation of Fibonacci hashing, * a multiplicative method. See e.g. Don Knuth's TAOCP, - * volume 3, for background information. Bitwise xor is used for - * keys longer than an int. + * volume 3, for background information. Bitwise xor is used for + * keys longer than an int. * * This hash function should be replaced with a stronger method, * like MD5, if high-quality hashing is important. * - * Author: - * Erik Boman, eboman@cs.sandia.gov + * Author: + * Erik Boman, eboman@cs.sandia.gov */ unsigned int h, rest, *p, bytes, num_bytes; char *byteptr; unsigned int low_order_id[10]; - /* We want the same hash value for 64 bit ZOLTAN_ID_TYPE that we get for + /* We want the same hash value for 64 bit ZOLTAN_ID_TYPE that we get for * 32 bit ZOLTAN_ID_TYPE so that test answers do not change. For 64 bit * ZOLTAN_ID_TYPE, we still get a good spread of hash values. */ @@ -145,7 +108,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) /* First hash the int-sized portions of the key */ h = 0; for (p = (unsigned int *)low_order_id, bytes=num_bytes; - bytes >= (unsigned int) sizeof(int); + bytes >= (unsigned int) sizeof(int); bytes-=sizeof(int), p++){ h = (h^(*p))*MAXINT_DIV_PHI; } @@ -164,7 +127,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) /* At this point h is a good hash value but it's not in the range (0,n-1). * We would like to return (h*n/INT_MAX), but this is difficult to compute * due to overflow. A simple alternative is to return (h%n) but this - * is not quite satisfactory since the leading bits are more evenly + * is not quite satisfactory since the leading bits are more evenly * distributed than the trailing bits. Therefore we first shift * the bits around. */ @@ -187,7 +150,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) { /* EBEB Old hash function that is compatible with the answer files. */ -/* Algorithm: +/* Algorithm: * This hash function is based on Don Knuth's golden ratio * multiplicative method. Bitwise xor is used for keys * longer than an int. The method works well for keys @@ -196,14 +159,14 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) * This hash function should be replaced with a stronger method * if good hashing of a large number of keys is important. * - * Author: + * Author: * Erik Boman, eboman@cs.sandia.gov (SNL 9226) */ unsigned int h, rest, *p, bytes, num_bytes; char *byteptr; unsigned int low_order_id[10]; - /* We want the same hash value for 64 bit ZOLTAN_ID_TYPE that we get for + /* We want the same hash value for 64 bit ZOLTAN_ID_TYPE that we get for * 32 bit ZOLTAN_ID_TYPE so that test answers do not change. For 64 bit * ZOLTAN_ID_TYPE, we still get a good spread of hash values. */ @@ -217,7 +180,7 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) /* First hash the int-sized portions of the key */ h = 0; for (p = (unsigned int *)low_order_id, bytes=num_bytes; - bytes >= (unsigned int) sizeof(int); + bytes >= (unsigned int) sizeof(int); bytes-=sizeof(int), p++){ h = (h*2654435761U) ^ (*p); } @@ -241,12 +204,12 @@ unsigned int Zoltan_Hash(ZOLTAN_ID_PTR key, int num_id_entries, unsigned int n) /* Zoltan_Recommended_Hash_Size recommends a hash table size that can be used * with Zoltan_Hash. * - * Input : #entries that will be stored in the hash table. - * - * Output : recommended size for the the hash table. This is also the range for - * Zoltan_Hash. This is a simple - * implementation that tries to bring the collisons to almost zero. The - * recommeded hash size is the next largest prime number that is approximately + * Input : #entries that will be stored in the hash table. + * + * Output : recommended size for the the hash table. This is also the range for + * Zoltan_Hash. This is a simple + * implementation that tries to bring the collisons to almost zero. The + * recommeded hash size is the next largest prime number that is approximately * in the middle of 2^x and 2^(x+1) for some x. * */ unsigned int Zoltan_Recommended_Hash_Size (unsigned int n) @@ -262,7 +225,7 @@ unsigned int Zoltan_Recommended_Hash_Size (unsigned int n) 805306457, 1610612741 } ; int i, hsize ; - /* SRSR : err on the side of performance and choose the next largest prime + /* SRSR : err on the side of performance and choose the next largest prime * number. One can also choose primes[i-1] below to cut the memory by half. */ hsize = primes[29] ; @@ -283,3 +246,4 @@ unsigned int Zoltan_Recommended_Hash_Size (unsigned int n) #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/zz/zz_hash.h b/packages/zoltan/src/zz/zz_hash.h index 3dc8f4d1c1..468418d52c 100644 --- a/packages/zoltan/src/zz/zz_hash.h +++ b/packages/zoltan/src/zz/zz_hash.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_HASH_H diff --git a/packages/zoltan/src/zz/zz_heap.c b/packages/zoltan/src/zz/zz_heap.c index 39cb525080..120c0c7b2a 100644 --- a/packages/zoltan/src/zz/zz_heap.c +++ b/packages/zoltan/src/zz/zz_heap.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -282,3 +245,4 @@ int Zoltan_Heap_Extract (HEAP *h, int element) #ifdef __cplusplus } /* closing bracket for extern "C" */ #endif + diff --git a/packages/zoltan/src/zz/zz_heap.h b/packages/zoltan/src/zz/zz_heap.h index daf2b9d61f..21d50972b3 100644 --- a/packages/zoltan/src/zz/zz_heap.h +++ b/packages/zoltan/src/zz/zz_heap.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_HEAP_H #define ZOLTAN_HEAP_H @@ -66,7 +29,7 @@ typedef struct { #define Zoltan_Heap_Empty(H) (((H)->n)==0) #define Zoltan_Heap_Not_Empty(H) (((H)->n)!=0) #define Zoltan_Heap_Has_Elem(H,e) (((H)->pos[e])!=-1) -#define Zoltan_Heap_Value(H,e) ((H)->value[e]) +#define Zoltan_Heap_Value(H,e) ((H)->value[e]) #define Zoltan_Heap_Max_Value(H) ((H)->value[(H)->ele[0]]) #define Zoltan_Heap_Peek_Max(H) ((H)->ele[0]) #define Zoltan_Heap_Count(H) ((H)->n) diff --git a/packages/zoltan/src/zz/zz_id_const.h b/packages/zoltan/src/zz/zz_id_const.h index f245b42bdc..1812b3b8b7 100644 --- a/packages/zoltan/src/zz/zz_id_const.h +++ b/packages/zoltan/src/zz/zz_id_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_ID_CONST_H #define __ZOLTAN_ID_CONST_H diff --git a/packages/zoltan/src/zz/zz_init.c b/packages/zoltan/src/zz/zz_init.c index e460a5076c..a502dbe348 100644 --- a/packages/zoltan/src/zz/zz_init.c +++ b/packages/zoltan/src/zz/zz_init.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -58,7 +21,7 @@ extern "C" { /*****************************************************************************/ /* * This file contains routines for initializing Zoltan. - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ @@ -74,7 +37,7 @@ int Zoltan_Initialize(int argc, char **argv, float *ver) int mpi_flag; - /* + /* * Test whether MPI is already initialized. If not, call MPI_Init. */ diff --git a/packages/zoltan/src/zz/zz_map.c b/packages/zoltan/src/zz/zz_map.c index 744adb0e6b..23c44f2617 100644 --- a/packages/zoltan/src/zz/zz_map.c +++ b/packages/zoltan/src/zz/zz_map.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -369,7 +332,7 @@ int Zoltan_Map_Find_Add(ZZ *zz, ZOLTAN_MAP* map, char *key, intptr_t datain, int } /***************************************************************** - * Find the key in the map. If found, set data to the key value. + * Find the key in the map. If found, set data to the key value. * If not found, the data is set to an invalid value. * (Return ZOLTAN_OK, etc.) */ diff --git a/packages/zoltan/src/zz/zz_obj_list.c b/packages/zoltan/src/zz/zz_obj_list.c index 08a3ae112c..2be571431f 100644 --- a/packages/zoltan/src/zz/zz_obj_list.c +++ b/packages/zoltan/src/zz/zz_obj_list.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -59,10 +22,10 @@ extern "C" { /*****************************************************************************/ /*****************************************************************************/ -/* +/* * This function gets a list of objects one way or the other, * i.e., by calling either Get_Obj_List or Get_First_Obj+Get_Next_Obj. - * It also retrieves object weights and initial partition assignments. + * It also retrieves object weights and initial partition assignments. * * It is called through either Zoltan_Get_Obj_List or * Zoltan_Get_Obj_List_Special_Malloc. In the second case, the @@ -71,11 +34,11 @@ extern "C" { */ static int _Zoltan_Get_Obj_List( - ZZ *zz, + ZZ *zz, int *num_obj, - ZOLTAN_ID_PTR *global_ids, - ZOLTAN_ID_PTR *local_ids, - int wdim, + ZOLTAN_ID_PTR *global_ids, + ZOLTAN_ID_PTR *local_ids, + int wdim, float **objwgts, int **parts, int special_malloc @@ -87,8 +50,8 @@ static int _Zoltan_Get_Obj_List( int num_lid_entries = zz->Num_LID; int alloced_gids = 0, alloced_lids = 0; int gid_off, lid_off; - ZOLTAN_ID_PTR lid, next_lid; /* Temporary pointers to local IDs; used to pass - NULL to query functions when + ZOLTAN_ID_PTR lid, next_lid; /* Temporary pointers to local IDs; used to pass + NULL to query functions when NUM_LID_ENTRIES == 0. */ float *next_objwgt; /* Temporarry pointer to an object weight; used to pass NULL to query functions when wdim=0 */ @@ -114,8 +77,8 @@ static int _Zoltan_Get_Obj_List( if (*num_obj > 0) { - /* - * Test global_ids and local_ids for NULL. + /* + * Test global_ids and local_ids for NULL. * Should be NULL for doing partitioning. * Should not be NULL if doing ordering. */ @@ -159,29 +122,29 @@ static int _Zoltan_Get_Obj_List( if (zz->Get_Obj_List != NULL){ /* Get object list directly */ - zz->Get_Obj_List(zz->Get_Obj_List_Data, + zz->Get_Obj_List(zz->Get_Obj_List_Data, num_gid_entries, num_lid_entries, - *global_ids, *local_ids, + *global_ids, *local_ids, wdim, *objwgts, &ierr); } else if ((zz->Get_First_Obj != NULL) && (zz->Get_Next_Obj != NULL)){ /* Use iterator functions to loop through object list */ - if (zz->Get_First_Obj(zz->Get_First_Obj_Data, - num_gid_entries, num_lid_entries, - *global_ids, *local_ids, + if (zz->Get_First_Obj(zz->Get_First_Obj_Data, + num_gid_entries, num_lid_entries, + *global_ids, *local_ids, wdim, *objwgts, &ierr)){ n = *num_obj; i = 0; - while (!ierr && (iGet_Next_Obj(zz->Get_Next_Obj_Data, - num_gid_entries, num_lid_entries, - &((*global_ids)[gid_off]), lid, + zz->Get_Next_Obj(zz->Get_Next_Obj_Data, + num_gid_entries, num_lid_entries, + &((*global_ids)[gid_off]), lid, &((*global_ids)[gid_off+num_gid_entries]), next_lid, wdim, next_objwgt, &ierr); @@ -198,17 +161,17 @@ static int _Zoltan_Get_Obj_List( /* Get partition information for objects. */ /* Call user-callback if provided; otherwise, all parts == zz->Proc */ - + if (zz->Get_Part == NULL && zz->Get_Part_Multi == NULL) { - for (i = 0; i < *num_obj; i++) + for (i = 0; i < *num_obj; i++) (*parts)[i] = zz->Proc; } else if (zz->Get_Part_Multi) { - zz->Get_Part_Multi(zz->Get_Part_Multi_Data, + zz->Get_Part_Multi(zz->Get_Part_Multi_Data, num_gid_entries, num_lid_entries, *num_obj, *global_ids, *local_ids, *parts, &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from ZOLTAN_PART_MULTI_FN"); goto End; } @@ -220,7 +183,7 @@ static int _Zoltan_Get_Obj_List( num_gid_entries, num_lid_entries, &((*global_ids)[i*num_gid_entries]), lid, &ierr); if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { - ZOLTAN_PRINT_ERROR(zz->Proc, yo, + ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error returned from ZOLTAN_PART_FN"); goto End; } @@ -232,9 +195,9 @@ static int _Zoltan_Get_Obj_List( if (ierr != ZOLTAN_OK && ierr != ZOLTAN_WARN) { ZOLTAN_PRINT_ERROR(zz->Proc, yo, "Error found; no lists returned."); if (special_malloc){ - if (alloced_gids) + if (alloced_gids) Zoltan_Special_Free(zz, (void **)global_ids, ZOLTAN_SPECIAL_MALLOC_GID); - if (alloced_lids) + if (alloced_lids) Zoltan_Special_Free(zz, (void **)local_ids, ZOLTAN_SPECIAL_MALLOC_LID); Zoltan_Special_Free(zz, (void **)parts, ZOLTAN_SPECIAL_MALLOC_INT); } @@ -249,11 +212,11 @@ static int _Zoltan_Get_Obj_List( return ierr; } int Zoltan_Get_Obj_List( - ZZ *zz, + ZZ *zz, int *num_obj, - ZOLTAN_ID_PTR *global_ids, - ZOLTAN_ID_PTR *local_ids, - int wdim, + ZOLTAN_ID_PTR *global_ids, + ZOLTAN_ID_PTR *local_ids, + int wdim, float **objwgts, int **parts ) @@ -269,11 +232,11 @@ int Zoltan_Get_Obj_List( return rc; } int Zoltan_Get_Obj_List_Special_Malloc( - ZZ *zz, + ZZ *zz, int *num_obj, - ZOLTAN_ID_PTR *global_ids, - ZOLTAN_ID_PTR *local_ids, - int wdim, + ZOLTAN_ID_PTR *global_ids, + ZOLTAN_ID_PTR *local_ids, + int wdim, float **objwgts, int **parts ) @@ -291,7 +254,7 @@ int Zoltan_Get_Obj_List_Special_Malloc( /*****************************************************************************/ /*****************************************************************************/ -/* +/* * For debugging purposes, print out object information. */ @@ -309,7 +272,7 @@ int Zoltan_Print_Obj_List( int num_obj=0; int lidSize = zz->Num_LID; int gidSize = zz->Num_GID; - + if (zz->Get_Num_Obj != NULL) { num_obj = zz->Get_Num_Obj(zz->Get_Num_Obj_Data, &ierr); } @@ -334,7 +297,7 @@ int Zoltan_Print_Obj_List( } printf("\n"); } - + if (Lids && lidSize){ printf("Local ID's \n"); for(i=0; iProc, yo, msg); ierr = ZOLTAN_WARN; } @@ -297,7 +258,7 @@ int Zoltan_Get_Fn(ZZ *zz, ZOLTAN_FN_TYPE fn_type, * fn_type -- Enum type indicating the function to be retrieved. * Output: * fn -- Pointer to the function retrieved. - * data -- Pointer to data associated with the retrieved + * data -- Pointer to data associated with the retrieved * function. May be NULL. */ @@ -486,11 +447,9 @@ int ierr = ZOLTAN_OK; *fn = (ZOLTAN_VOID_FN *) zz->Get_Hier_Method; *data = zz->Get_Hier_Method_Data; break; - case ZOLTAN_PROC_NAME_FN_TYPE: - case ZOLTAN_MAX_FN_TYPES: default: sprintf(msg, "ZOLTAN_FN_TYPE %d is invalid.\n" - "Value must be in range 0 to %d.", fn_type, ZOLTAN_MAX_FN_TYPES - 1); + "Value must be in range 0 to %d.", fn_type, ZOLTAN_MAX_FN_TYPES); *fn = NULL; *data = NULL; ZOLTAN_PRINT_ERROR(zz->Proc, yo, msg); @@ -505,7 +464,7 @@ int ierr = ZOLTAN_OK; /*****************************************************************************/ /* * Callback registration functions that are specific to a given function - * type. Each callback function type must have a related registration + * type. Each callback function type must have a related registration * function. Using these functions enables more type-checking between the * application and Zoltan. */ @@ -514,8 +473,8 @@ int ierr = ZOLTAN_OK; /*****************************************************************************/ int Zoltan_Set_Part_Multi_Fn( - ZZ *zz, - ZOLTAN_PART_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_PART_MULTI_FN *fn, void *data ) { @@ -529,8 +488,8 @@ int Zoltan_Set_Part_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Part_Fn( - ZZ *zz, - ZOLTAN_PART_FN *fn, + ZZ *zz, + ZOLTAN_PART_FN *fn, void *data ) { @@ -544,8 +503,8 @@ int Zoltan_Set_Part_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Edges_Multi_Fn( - ZZ *zz, - ZOLTAN_NUM_EDGES_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_NUM_EDGES_MULTI_FN *fn, void *data ) { @@ -559,8 +518,8 @@ int Zoltan_Set_Num_Edges_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Edges_Fn( - ZZ *zz, - ZOLTAN_NUM_EDGES_FN *fn, + ZZ *zz, + ZOLTAN_NUM_EDGES_FN *fn, void *data ) { @@ -574,8 +533,8 @@ int Zoltan_Set_Num_Edges_Fn( /*****************************************************************************/ int Zoltan_Set_Edge_List_Multi_Fn( - ZZ *zz, - ZOLTAN_EDGE_LIST_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_EDGE_LIST_MULTI_FN *fn, void *data ) { @@ -589,8 +548,8 @@ int Zoltan_Set_Edge_List_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Edge_List_Fn( - ZZ *zz, - ZOLTAN_EDGE_LIST_FN *fn, + ZZ *zz, + ZOLTAN_EDGE_LIST_FN *fn, void *data ) { @@ -604,8 +563,8 @@ int Zoltan_Set_Edge_List_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Geom_Fn( - ZZ *zz, - ZOLTAN_NUM_GEOM_FN *fn, + ZZ *zz, + ZOLTAN_NUM_GEOM_FN *fn, void *data ) { @@ -617,8 +576,8 @@ int Zoltan_Set_Num_Geom_Fn( /*****************************************************************************/ int Zoltan_Set_Geom_Multi_Fn( - ZZ *zz, - ZOLTAN_GEOM_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_GEOM_MULTI_FN *fn, void *data ) { @@ -632,8 +591,8 @@ int Zoltan_Set_Geom_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Geom_Fn( - ZZ *zz, - ZOLTAN_GEOM_FN *fn, + ZZ *zz, + ZOLTAN_GEOM_FN *fn, void *data ) { @@ -647,8 +606,8 @@ int Zoltan_Set_Geom_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Obj_Fn( - ZZ *zz, - ZOLTAN_NUM_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NUM_OBJ_FN *fn, void *data ) { @@ -660,8 +619,8 @@ int Zoltan_Set_Num_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Obj_List_Fn( - ZZ *zz, - ZOLTAN_OBJ_LIST_FN *fn, + ZZ *zz, + ZOLTAN_OBJ_LIST_FN *fn, void *data ) { @@ -673,8 +632,8 @@ int Zoltan_Set_Obj_List_Fn( /*****************************************************************************/ int Zoltan_Set_First_Obj_Fn( - ZZ *zz, - ZOLTAN_FIRST_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_FIRST_OBJ_FN *fn, void *data ) { @@ -686,8 +645,8 @@ int Zoltan_Set_First_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Next_Obj_Fn( - ZZ *zz, - ZOLTAN_NEXT_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NEXT_OBJ_FN *fn, void *data ) { @@ -699,8 +658,8 @@ int Zoltan_Set_Next_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Border_Obj_Fn( - ZZ *zz, - ZOLTAN_NUM_BORDER_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NUM_BORDER_OBJ_FN *fn, void *data ) { @@ -712,8 +671,8 @@ int Zoltan_Set_Num_Border_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Border_Obj_List_Fn( - ZZ *zz, - ZOLTAN_BORDER_OBJ_LIST_FN *fn, + ZZ *zz, + ZOLTAN_BORDER_OBJ_LIST_FN *fn, void *data ) { @@ -725,8 +684,8 @@ int Zoltan_Set_Border_Obj_List_Fn( /*****************************************************************************/ int Zoltan_Set_First_Border_Obj_Fn( - ZZ *zz, - ZOLTAN_FIRST_BORDER_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_FIRST_BORDER_OBJ_FN *fn, void *data ) { @@ -738,8 +697,8 @@ int Zoltan_Set_First_Border_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Next_Border_Obj_Fn( - ZZ *zz, - ZOLTAN_NEXT_BORDER_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NEXT_BORDER_OBJ_FN *fn, void *data ) { @@ -751,8 +710,8 @@ int Zoltan_Set_Next_Border_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Obj_Size_Fn( - ZZ *zz, - ZOLTAN_OBJ_SIZE_FN *fn, + ZZ *zz, + ZOLTAN_OBJ_SIZE_FN *fn, void *data ) { @@ -766,8 +725,8 @@ int Zoltan_Set_Obj_Size_Fn( /*****************************************************************************/ int Zoltan_Set_Obj_Size_Multi_Fn( - ZZ *zz, - ZOLTAN_OBJ_SIZE_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_OBJ_SIZE_MULTI_FN *fn, void *data ) { @@ -781,8 +740,8 @@ int Zoltan_Set_Obj_Size_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Pack_Obj_Fn( - ZZ *zz, - ZOLTAN_PACK_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_PACK_OBJ_FN *fn, void *data ) { @@ -796,8 +755,8 @@ int Zoltan_Set_Pack_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Pack_Obj_Multi_Fn( - ZZ *zz, - ZOLTAN_PACK_OBJ_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_PACK_OBJ_MULTI_FN *fn, void *data ) { @@ -811,8 +770,8 @@ int Zoltan_Set_Pack_Obj_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Unpack_Obj_Fn( - ZZ *zz, - ZOLTAN_UNPACK_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_UNPACK_OBJ_FN *fn, void *data ) { @@ -826,8 +785,8 @@ int Zoltan_Set_Unpack_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Unpack_Obj_Multi_Fn( - ZZ *zz, - ZOLTAN_UNPACK_OBJ_MULTI_FN *fn, + ZZ *zz, + ZOLTAN_UNPACK_OBJ_MULTI_FN *fn, void *data ) { @@ -841,8 +800,8 @@ int Zoltan_Set_Unpack_Obj_Multi_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Coarse_Obj_Fn( - ZZ *zz, - ZOLTAN_NUM_COARSE_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NUM_COARSE_OBJ_FN *fn, void *data ) { @@ -854,8 +813,8 @@ int Zoltan_Set_Num_Coarse_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Coarse_Obj_List_Fn( - ZZ *zz, - ZOLTAN_COARSE_OBJ_LIST_FN *fn, + ZZ *zz, + ZOLTAN_COARSE_OBJ_LIST_FN *fn, void *data ) { @@ -867,8 +826,8 @@ int Zoltan_Set_Coarse_Obj_List_Fn( /*****************************************************************************/ int Zoltan_Set_First_Coarse_Obj_Fn( - ZZ *zz, - ZOLTAN_FIRST_COARSE_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_FIRST_COARSE_OBJ_FN *fn, void *data ) { @@ -880,8 +839,8 @@ int Zoltan_Set_First_Coarse_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Next_Coarse_Obj_Fn( - ZZ *zz, - ZOLTAN_NEXT_COARSE_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NEXT_COARSE_OBJ_FN *fn, void *data ) { @@ -893,8 +852,8 @@ int Zoltan_Set_Next_Coarse_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Child_Fn( - ZZ *zz, - ZOLTAN_NUM_CHILD_FN *fn, + ZZ *zz, + ZOLTAN_NUM_CHILD_FN *fn, void *data ) { @@ -906,8 +865,8 @@ int Zoltan_Set_Num_Child_Fn( /*****************************************************************************/ int Zoltan_Set_Child_List_Fn( - ZZ *zz, - ZOLTAN_CHILD_LIST_FN *fn, + ZZ *zz, + ZOLTAN_CHILD_LIST_FN *fn, void *data ) { @@ -919,8 +878,8 @@ int Zoltan_Set_Child_List_Fn( /*****************************************************************************/ int Zoltan_Set_Child_Weight_Fn( - ZZ *zz, - ZOLTAN_CHILD_WEIGHT_FN *fn, + ZZ *zz, + ZOLTAN_CHILD_WEIGHT_FN *fn, void *data ) { @@ -932,8 +891,8 @@ int Zoltan_Set_Child_Weight_Fn( /*****************************************************************************/ int Zoltan_Set_HG_Size_CS_Fn( - ZZ *zz, - ZOLTAN_HG_SIZE_CS_FN *fn, + ZZ *zz, + ZOLTAN_HG_SIZE_CS_FN *fn, void *data ) { @@ -944,8 +903,8 @@ int Zoltan_Set_HG_Size_CS_Fn( /*****************************************************************************/ int Zoltan_Set_HG_CS_Fn( - ZZ *zz, - ZOLTAN_HG_CS_FN *fn, + ZZ *zz, + ZOLTAN_HG_CS_FN *fn, void *data ) { @@ -956,8 +915,8 @@ int Zoltan_Set_HG_CS_Fn( /*****************************************************************************/ int Zoltan_Set_HG_Size_Edge_Wts_Fn( - ZZ *zz, - ZOLTAN_HG_SIZE_EDGE_WTS_FN *fn, + ZZ *zz, + ZOLTAN_HG_SIZE_EDGE_WTS_FN *fn, void *data ) { @@ -969,8 +928,8 @@ int Zoltan_Set_HG_Size_Edge_Wts_Fn( /*****************************************************************************/ int Zoltan_Set_HG_Edge_Wts_Fn( - ZZ *zz, - ZOLTAN_HG_EDGE_WTS_FN *fn, + ZZ *zz, + ZOLTAN_HG_EDGE_WTS_FN *fn, void *data ) { @@ -982,8 +941,8 @@ int Zoltan_Set_HG_Edge_Wts_Fn( /*****************************************************************************/ int Zoltan_Set_Num_Fixed_Obj_Fn( - ZZ *zz, - ZOLTAN_NUM_FIXED_OBJ_FN *fn, + ZZ *zz, + ZOLTAN_NUM_FIXED_OBJ_FN *fn, void *data ) { @@ -995,8 +954,8 @@ int Zoltan_Set_Num_Fixed_Obj_Fn( /*****************************************************************************/ int Zoltan_Set_Fixed_Obj_List_Fn( - ZZ *zz, - ZOLTAN_FIXED_OBJ_LIST_FN *fn, + ZZ *zz, + ZOLTAN_FIXED_OBJ_LIST_FN *fn, void *data ) { @@ -1008,8 +967,8 @@ int Zoltan_Set_Fixed_Obj_List_Fn( /*****************************************************************************/ int Zoltan_Set_Hier_Num_Levels_Fn( - ZZ *zz, - ZOLTAN_HIER_NUM_LEVELS_FN *fn, + ZZ *zz, + ZOLTAN_HIER_NUM_LEVELS_FN *fn, void *data ) { @@ -1021,8 +980,8 @@ int Zoltan_Set_Hier_Num_Levels_Fn( /*****************************************************************************/ int Zoltan_Set_Hier_Part_Fn( - ZZ *zz, - ZOLTAN_HIER_PART_FN *fn, + ZZ *zz, + ZOLTAN_HIER_PART_FN *fn, void *data ) { @@ -1034,8 +993,8 @@ int Zoltan_Set_Hier_Part_Fn( /*****************************************************************************/ int Zoltan_Set_Hier_Method_Fn( - ZZ *zz, - ZOLTAN_HIER_METHOD_FN *fn, + ZZ *zz, + ZOLTAN_HIER_METHOD_FN *fn, void *data ) { diff --git a/packages/zoltan/src/zz/zz_sort.c b/packages/zoltan/src/zz/zz_sort.c index d13d795888..572a6d78a0 100644 --- a/packages/zoltan/src/zz/zz_sort.c +++ b/packages/zoltan/src/zz/zz_sort.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus /* if C++, define the rest of this header file as extern C */ @@ -283,7 +246,7 @@ static void quickpart_pointer_inc_gno_int( { int i, next; int key2, key2_next; -ZOLTAN_GNO_TYPE key1, key1_next; +ZOLTAN_GNO_TYPE key1, key1_next; i = (end + start) / 2; key1 = val1 ? val1[sorted[i]] : 1; diff --git a/packages/zoltan/src/zz/zz_sort.h b/packages/zoltan/src/zz/zz_sort.h index fb92893e8f..a78a4bda31 100644 --- a/packages/zoltan/src/zz/zz_sort.h +++ b/packages/zoltan/src/zz/zz_sort.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef ZOLTAN_SORT_H #define ZOLTAN_SORT_H diff --git a/packages/zoltan/src/zz/zz_struct.c b/packages/zoltan/src/zz/zz_struct.c index 0012d59601..0ec92a8cb3 100644 --- a/packages/zoltan/src/zz/zz_struct.c +++ b/packages/zoltan/src/zz/zz_struct.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -62,9 +25,9 @@ extern "C" { /*****************************************************************************/ /*****************************************************************************/ /* - * This file contains routines that create, copy, and destroy load-balancing + * This file contains routines that create, copy, and destroy load-balancing * structures (struct Zoltan_Struct). - * These functions are all callable by the application. + * These functions are all callable by the application. */ /*****************************************************************************/ /*****************************************************************************/ @@ -114,7 +77,7 @@ int proc; if (communicator == MPI_COMM_NULL) { /* * The processor is not in the communicator for the load-balancing - * structure. Set zz->Communicator to MPI_COMM_NULL and give dummy + * structure. Set zz->Communicator to MPI_COMM_NULL and give dummy * values to zz->Proc and zz->Num_Proc. */ zz->Communicator = MPI_COMM_NULL; @@ -155,7 +118,7 @@ ZZ *Zoltan_Copy(ZZ const *from) Zoltan_Destroy(&to); } - return to; + return to; } /****************************************************************************/ @@ -165,7 +128,7 @@ ZZ *Zoltan_Copy(ZZ const *from) int Zoltan_Copy_To(ZZ *to, ZZ const *from) { /* - * Copy one Zoltan_Struct to another. "to" must be a valid + * Copy one Zoltan_Struct to another. "to" must be a valid * Zoltan_Struct. */ @@ -175,7 +138,7 @@ int Zoltan_Copy_To(ZZ *to, ZZ const *from) *to = *from; MPI_Comm_dup(from->Communicator, &(to->Communicator)); - + to->Params = NULL; Zoltan_Copy_Params(&(to->Params), from->Params); @@ -236,7 +199,7 @@ static void Zoltan_Free_Structures( */ /* Free load-balancing data */ - if (zz->LB.Free_Structure != NULL) + if (zz->LB.Free_Structure != NULL) zz->LB.Free_Structure(zz); /* Add calls to additional module-specific free routines here. */ @@ -352,7 +315,7 @@ static void Zoltan_Init(ZZ* zz) zz->Pack_Obj_Multi = NULL; zz->Unpack_Obj_Multi = NULL; zz->Get_Obj_Size_Multi = NULL; - + zz->Pack_Obj_Fort = NULL; zz->Unpack_Obj_Fort = NULL; zz->Get_Obj_Size_Fort = NULL; @@ -378,7 +341,7 @@ static void Zoltan_Init(ZZ* zz) /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ -size_t Zoltan_Serialize_Size(struct Zoltan_Struct const *zz) +size_t Zoltan_Serialize_Size(struct Zoltan_Struct const *zz) { /* Compute size of buffer needed to serialize Zoltan_Struct */ size_t bufSize = 0; @@ -403,7 +366,7 @@ int Zoltan_Serialize(ZZ const *zz, size_t bufSize, char *buf) *intptr = zz->Debug_Proc; intptr++; *intptr = zz->Fortran; intptr++; *intptr = zz->Tflops_Special; intptr++; - *intptr = *((const int*) &(zz->Seed)); intptr++; + *intptr = *((int*) &(zz->Seed)); intptr++; *intptr = zz->Deterministic; intptr++; *intptr = zz->Obj_Weight_Dim; intptr++; *intptr = zz->Edge_Weight_Dim; intptr++; @@ -417,7 +380,7 @@ int Zoltan_Serialize(ZZ const *zz, size_t bufSize, char *buf) Zoltan_LB_Serialize(zz, &bufptr); if (bufptr - buf > bufSize) { - ZOLTAN_PRINT_ERROR(zz->Proc, "Zoltan_Serialize", + ZOLTAN_PRINT_ERROR(zz->Proc, "Zoltan_Serialize", "Buffer provided is too small; Zoltan just overwrote " "your memory."); ierr = ZOLTAN_MEMERR; @@ -430,7 +393,7 @@ int Zoltan_Deserialize(struct Zoltan_Struct *zz, size_t bufSize, char *buf) { int ierr = ZOLTAN_OK; char *bufptr = buf; - + /* Copy 11 integers */ int *intptr = (int *) bufptr; zz->Num_GID = *intptr; intptr++; @@ -447,7 +410,7 @@ int Zoltan_Deserialize(struct Zoltan_Struct *zz, size_t bufSize, char *buf) bufptr = (char *) intptr; /* Consistent with Zoltan defaults, set default LB_METHOD to RCB; doing so - * sets the various function pointers for RCB. + * sets the various function pointers for RCB. * Method and function pointers will be reset if parameter LB_METHOD has * been provided by user. */ Zoltan_Set_Param(zz, "LB_METHOD", "RCB"); @@ -457,7 +420,7 @@ int Zoltan_Deserialize(struct Zoltan_Struct *zz, size_t bufSize, char *buf) Zoltan_LB_Deserialize(zz, &bufptr); if (bufptr - buf > bufSize) { - ZOLTAN_PRINT_ERROR(zz->Proc, "Zoltan_Deserialize", + ZOLTAN_PRINT_ERROR(zz->Proc, "Zoltan_Deserialize", "Buffer provided is too small; Zoltan just copied " "garbage memory."); ierr = ZOLTAN_MEMERR; diff --git a/packages/zoltan/src/zz/zz_util.c b/packages/zoltan/src/zz/zz_util.c index a202ce4943..96b53c4191 100644 --- a/packages/zoltan/src/zz/zz_util.c +++ b/packages/zoltan/src/zz/zz_util.c @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012, 2023 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifdef __cplusplus @@ -360,7 +323,7 @@ MPI_Datatype Zoltan_mpi_gno_type(void) if (!zz_mpi_gno_name){ /* should never happen */ fprintf(stderr,"Zoltan_mpi_gno_type: It happened\n"); - MPI_Abort(MPI_COMM_WORLD,99); + MPI_Abort(zoltan_get_global_comm(),99); } return zz_mpi_gno_type; @@ -435,7 +398,7 @@ void Zoltan_write_linux_meminfo(int append, char *msg, int committedOnly) char *c=NULL, *next=NULL, *c_end; char fbuf[64],buf[2048],label[64],value[64],units[64]; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(zoltan_get_global_comm(), &rank); f = open("/proc/meminfo", O_RDONLY); if (f == -1) return; diff --git a/packages/zoltan/src/zz/zz_util_const.h b/packages/zoltan/src/zz/zz_util_const.h index 62cced279d..cf18f160c0 100644 --- a/packages/zoltan/src/zz/zz_util_const.h +++ b/packages/zoltan/src/zz/zz_util_const.h @@ -1,48 +1,11 @@ -/* - * @HEADER - * - * *********************************************************************** - * - * Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring - * Copyright 2012 Sandia Corporation - * - * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - * the U.S. Government retains certain rights in this software. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Corporation nor the names of the - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Questions? Contact Karen Devine kddevin@sandia.gov - * Erik Boman egboman@sandia.gov - * - * *********************************************************************** - * - * @HEADER - */ +// @HEADER +// ***************************************************************************** +// Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring +// +// Copyright 2012 NTESS and the Zoltan contributors. +// SPDX-License-Identifier: BSD-3-Clause +// ***************************************************************************** +// @HEADER #ifndef __ZOLTAN_UTIL_CONST_H @@ -72,9 +35,9 @@ extern int Zoltan_Clean_String(const char *, char **); extern char *Zoltan_Strdup(const char *); void Zoltan_Transform_Point( double *p, double (*m)[3], int *a, int d, int ndims, double *v); -void Zoltan_Transform_Box(double *lo, double *hi, double (*m)[3], int *a, +void Zoltan_Transform_Box(double *lo, double *hi, double (*m)[3], int *a, int d, int ndims); -void Zoltan_Transform_Box_Points(double *lo, double *hi, double (*m)[3], +void Zoltan_Transform_Box_Points(double *lo, double *hi, double (*m)[3], int *a, int d, int ndims, double (*v)[3]); int Zoltan_AllReduceInPlace(void *, int , MPI_Datatype , MPI_Op , MPI_Comm ); void Zoltan_write_linux_meminfo(int append, char *msg, int committedOnly);