Skip to content

Commit

Permalink
(squash) begin implementing yalta plan
Browse files Browse the repository at this point in the history
Merge branch 'master' into yalta

still need a dummy apfArray.h

move apf::Array to vas::Array

    fun fact. every single one of our source
    files was getting assert() from an
    unnecessary #include in apfArray.h

moving the instrumented malloc into noto

changing pcu_memory.c to pcu_buffer.c

moving pcu_protect into reel.c

    this actually depended on opening
    parallel files for the traces...
    I now have them all going to stderr...
    We'll see how much worse that is

moving thread functionality into reel.c

adding vas and reel headers to PCU HEADERS

actually remove pcu_common.h

break up the MIN/MAX macros, remove pcu_common.h

update mds_smb.c to use reel_fail

moving ceil/floor_log2 into pcu_coll.c

    it is the only user of those functions,
    they are not so common

removing now-unneeded includes

moving pcu_fail into reel.c

moving pcu_malloc and friends into vas_malloc.c
  • Loading branch information
ibaned committed Sep 4, 2015
1 parent bd18f67 commit f04a5a2
Show file tree
Hide file tree
Showing 135 changed files with 777 additions and 627 deletions.
5 changes: 4 additions & 1 deletion apf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if(NOT BUILD_IN_TRILINOS)
find_package(gmi PATHS ${CMAKE_BINARY_DIR})
set(APF_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/vas
${PCU_INCLUDE_DIRS}
${GMI_INCLUDE_DIRS})
set(DEP_LIBS ${PCU_LIBS} ${GMI_LIBS})
Expand Down Expand Up @@ -78,7 +79,9 @@ set(APF_HEADERS
apfNumbering.h
apfPartition.h
apfConvert.h
apfGeometry.h)
apfGeometry.h
vas/vasArray.h
)

if(BUILD_IN_TRILINOS)
# THIS IS WHERE TRIBITS GETS HEADERS
Expand Down
1 change: 1 addition & 0 deletions apf/apf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "apfUserData.h"
#include <cstdio>
#include <cstdlib>
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfAdjReorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "apfShape.h"

#include <list>
#include <cassert>

namespace apf {

Expand Down
45 changes: 5 additions & 40 deletions apf/apfArray.h
Original file line number Diff line number Diff line change
@@ -1,54 +1,19 @@
/*
* Copyright 2011 Scientific Computation Research Center
* Copyright 2015 Scientific Computation Research Center
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/

#ifndef APFARRAY_H
#define APFARRAY_H
#ifndef APF_ARRAY_H
#define APF_ARRAY_H

/** \file apfArray.h
\brief APF compile-time size array */

#include <cstddef>
#include <cassert>
#include <vasArray.h>

namespace apf {

/** \brief an array of N items of type T */
template <class T, std::size_t N>
class Array
{
public:
/** \brief type::size for convenience */
enum { size = N };
/** \brief constructor: no default values */
Array() {}
/** \brief copy constructor */
Array(Array<T,N> const& other) {copy(other);}
/** \brief element destruction already automatic */
~Array() {}
/** \brief copy array contents.
\details this is one of the advantages
of apf::Array over C arrays: they are
copy-constructible and assignable */
Array<T,N>& operator=(Array<T,N> const& other)
{
copy(other);
return *this;
}
/** \brief mutable index operator */
T& operator[](std::size_t i) {return elements[i];}
/** \brief immutable index operator */
T const& operator[](std::size_t i) const {return elements[i];}
protected:
void copy(Array<T,N> const& other)
{
for (std::size_t i=0; i < N; ++i)
elements[i] = other.elements[i];
}
T elements[N];
class Array : public vas::Array<T, N> {
};

}
Expand Down
1 change: 1 addition & 0 deletions apf/apfBoundaryToElementXi.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "apf.h"
#include "apfMesh.h"
#include "apfShape.h"
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfConvert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "apfMesh2.h"
#include "apfShape.h"
#include <map>
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfFieldData.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <PCU.h>
#include "apfFieldData.h"
#include "apfShape.h"
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfGradientByVolume.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <apfCavityOp.h>
#include <apf.h>
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "apfNumbering.h"
#include "apfTagData.h"
#include <gmi.h>
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfMigrate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "apfMesh2.h"
#include "apfCavityOp.h"
#include "apf.h"
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfNumbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "apfMesh.h"
#include "apfShape.h"
#include "apfTagData.h"
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfShape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "apfIntegrate.h"
#include "apfVector.h"
#include "apfMatrix.h"
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfVerify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <gmi.h>
#include <sstream>
#include <apfGeometry.h>
#include <cassert>

namespace apf {

Expand Down
1 change: 1 addition & 0 deletions apf/apfVtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "apfFieldData.h"
#include <sstream>
#include <fstream>
#include <cassert>

namespace apf {

Expand Down
55 changes: 55 additions & 0 deletions apf/vas/vasArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2011 Scientific Computation Research Center
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/

#ifndef VAS_ARRAY_H
#define VAS_ARRAY_H

/** \file vasArray.h
\brief compile-time size array */

#include <cstddef>

namespace vas {

/** \brief an array of N items of type T */
template <class T, std::size_t N>
class Array
{
public:
/** \brief type::size for convenience */
enum { size = N };
/** \brief constructor: no default values */
Array() {}
/** \brief copy constructor */
Array(Array<T,N> const& other) {copy(other);}
/** \brief element destruction already automatic */
~Array() {}
/** \brief copy array contents.
\details this is one of the advantages
of vas::Array over C arrays: they are
copy-constructible and assignable */
Array<T,N>& operator=(Array<T,N> const& other)
{
copy(other);
return *this;
}
/** \brief mutable index operator */
T& operator[](std::size_t i) {return elements[i];}
/** \brief immutable index operator */
T const& operator[](std::size_t i) const {return elements[i];}
protected:
void copy(Array<T,N> const& other)
{
for (std::size_t i=0; i < N; ++i)
elements[i] = other.elements[i];
}
T elements[N];
};

}

#endif
1 change: 1 addition & 0 deletions crv/crvBezierPoints.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "crvBezier.h"
#include "crvTables.h"
#include <cassert>

namespace crv {

Expand Down
1 change: 1 addition & 0 deletions crv/crvCurveMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*******************************************************************************/
#include "crv.h"
#include "crvSnap.h"
#include <cassert>

namespace crv {

Expand Down
1 change: 1 addition & 0 deletions crv/crvVtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "apfFieldData.h"
#include <sstream>
#include <fstream>
#include <cassert>

namespace crv {

Expand Down
1 change: 1 addition & 0 deletions dsp/dspGraphDistance.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "dspGraphDistance.h"
#include <PCU.h>
#include <cassert>

namespace dsp {

Expand Down
1 change: 1 addition & 0 deletions ma/maAdapt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "maLayer.h"
#include <apf.h>
#include <cfloat>
#include <cassert>
#include <stdarg.h>

namespace ma {
Expand Down
1 change: 1 addition & 0 deletions ma/maCoarsen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "maAdapt.h"
#include "maCollapse.h"
#include "maOperator.h"
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maCollapse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "maAdapt.h"
#include "maShape.h"
#include <apfCavityOp.h>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maDoubleSplitCollapse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "maDoubleSplitCollapse.h"
#include "maAdapt.h"
#include "maShape.h"
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maEdgeSwap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "maShape.h"
#include "maShapeHandler.h"
#include <cstdio>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maInput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "maInput.h"
#include <apfShape.h>
#include <cstdio>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "maRefine.h"
#include "maShape.h"
#include <sstream>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maLayerCoarsen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "maCoarsen.h"
#include "maCrawler.h"
#include "maLayerCollapse.h"
#include <cassert>

/* see maCoarsen.cc for the unstructured equivalent. */
namespace ma {
Expand Down
1 change: 1 addition & 0 deletions ma/maLayerCollapse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "maShape.h"

#include <cstdio>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maLayerRefine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "maCrawler.h"
#include "maRefine.h"
#include "maLayer.h"
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maLayerSnap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "maLayer.h"
#include "maSnap.h"
#include "maShape.h"
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maLayerTemplates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <cstdio>
#include <sstream>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "maTables.h"
#include <algorithm>
#include <cfloat>
#include <cassert>
#include <apf.h>

namespace ma {
Expand Down
1 change: 1 addition & 0 deletions ma/maQuality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*******************************************************************************/

#include <cfloat>
#include <cassert>
#include "maMesh.h"
#include "maSize.h"
#include "maAdapt.h"
Expand Down
1 change: 1 addition & 0 deletions ma/maRefine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "maSnap.h"
#include "maLayer.h"
#include <apf.h>
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maShape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "maDoubleSplitCollapse.h"
#include "maShortEdgeRemover.h"
#include "maShapeHandler.h"
#include <cassert>

namespace ma {

Expand Down
1 change: 1 addition & 0 deletions ma/maShapeHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "maShape.h"
#include "maAdapt.h"
#include <apfShape.h>
#include <cassert>

namespace ma {

Expand Down
Loading

0 comments on commit f04a5a2

Please sign in to comment.