Commit e8b85490 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

changed tabs to spaces and pulled dsm to a separate folder under core

parent 6e0d6c9b
...@@ -49,6 +49,10 @@ option(XDMF_WRAP_JAVA OFF) ...@@ -49,6 +49,10 @@ option(XDMF_WRAP_JAVA OFF)
# Test for DSM # Test for DSM
option(XDMF_BUILD_DSM OFF) option(XDMF_BUILD_DSM OFF)
if(XDMF_BUILD_DSM)
option(XDMF_BUILD_DSM_THREADS ON)
endif(XDMF_BUILD_DSM)
# If we are wrapping either, we need swig # If we are wrapping either, we need swig
if(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA) if(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA)
find_package(SWIG REQUIRED) find_package(SWIG REQUIRED)
...@@ -214,7 +218,7 @@ if(XDMF_WRAP_JAVA) ...@@ -214,7 +218,7 @@ if(XDMF_WRAP_JAVA)
endif(XDMF_WRAP_JAVA) endif(XDMF_WRAP_JAVA)
add_subdirectory(core) add_subdirectory(core)
include_directories(${XdmfCore_INCLUDE_DIRS}) include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS}) link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF) option(XDMF_BUILD_CORE_ONLY OFF)
...@@ -244,7 +248,11 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -244,7 +248,11 @@ if(NOT XDMF_BUILD_CORE_ONLY)
XdmfUnstructuredGrid) XdmfUnstructuredGrid)
add_library(Xdmf ${XdmfSources}) add_library(Xdmf ${XdmfSources})
target_link_libraries(Xdmf XdmfCore) if(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore XdmfDSM)
else(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore)
endif(XDMF_BUILD_DSM)
if(WIN32) if(WIN32)
set_target_properties(Xdmf PROPERTIES set_target_properties(Xdmf PROPERTIES
...@@ -264,7 +272,7 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -264,7 +272,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
endif(XDMF_WRAP_JAVA) endif(XDMF_WRAP_JAVA)
if(XDMF_WRAP_PYTHON) if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(Xdmf XdmfCore) XDMF_SWIG_PYTHON(Xdmf XdmfCore XdmfDSM)
endif(XDMF_WRAP_PYTHON) endif(XDMF_WRAP_PYTHON)
if(BUILD_TESTING) if(BUILD_TESTING)
......
...@@ -135,6 +135,11 @@ ...@@ -135,6 +135,11 @@
#undef XDMFCORE_TEMPLATE #undef XDMFCORE_TEMPLATE
#define XDMFCORE_TEMPLATE extern #define XDMFCORE_TEMPLATE extern
#undef XDMFDSM_EXPORT
#define XDMFDSM_EXPORT __declspec(dllimport)
#undef XDMFDSM_TEMPLATE
#define XDMFDSM_TEMPLATE extern
#ifdef Xdmf_EXPORTS #ifdef Xdmf_EXPORTS
#define XDMF_EXPORT __declspec(dllexport) #define XDMF_EXPORT __declspec(dllexport)
#define XDMF_TEMPLATE #define XDMF_TEMPLATE
...@@ -158,8 +163,10 @@ ...@@ -158,8 +163,10 @@
#else /* _WIN32 */ #else /* _WIN32 */
/* We don't need to export/import since there are no dlls */ /* We don't need to export/import since there are no dlls */
#define XDMFCORE_EXPORT #define XDMFCORE_EXPORT
#define XDMFDSM_EXPORT
#define XDMF_EXPORT #define XDMF_EXPORT
#define XDMFCORE_TEMPLATE #define XDMFCORE_TEMPLATE
#define XDMFDSM_TEMPLATE
#define XDMF_TEMPLATE #define XDMF_TEMPLATE
#endif /* _WIN32 */ #endif /* _WIN32 */
#endif /* _XDMF_HPP */ #endif /* _XDMF_HPP */
......
...@@ -62,8 +62,11 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i ...@@ -62,8 +62,11 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
#include <XdmfTopology.hpp> #include <XdmfTopology.hpp>
#include <XdmfTopologyType.hpp> #include <XdmfTopologyType.hpp>
#include <XdmfUnstructuredGrid.hpp> #include <XdmfUnstructuredGrid.hpp>
%} %}
%import XdmfDSM.i
#else #else
%module Xdmf %module Xdmf
%{ %{
...@@ -254,6 +257,15 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i ...@@ -254,6 +257,15 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
from XdmfCore import * from XdmfCore import *
} }
#ifdef XDMF_BUILD_DSM
%pythoncode {
from XdmfDSM import *
}
#endif /* XDMF_BUILD_DSM */
%fragment("XdmfItemCast", "header") { %fragment("XdmfItemCast", "header") {
#include <XdmfSharedPtr.hpp> #include <XdmfSharedPtr.hpp>
PyObject * XdmfItemCast(shared_ptr<XdmfItem> obj) { PyObject * XdmfItemCast(shared_ptr<XdmfItem> obj) {
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
* @skipline #//initialization * @skipline #//initialization
* @until #//initialization * @until #//initialization
* *
* @return Constructed XdmfAttribute. * @return Constructed XdmfAttribute.
*/ */
static shared_ptr<XdmfAttribute> New(); static shared_ptr<XdmfAttribute> New();
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
* @skipline #//getCenter * @skipline #//getCenter
* @until #//getCenter * @until #//getCenter
* *
* @return XdmfAttributeCenter of the attribute. * @return XdmfAttributeCenter of the attribute.
*/ */
shared_ptr<const XdmfAttributeCenter> getCenter() const; shared_ptr<const XdmfAttributeCenter> getCenter() const;
...@@ -129,7 +129,7 @@ public: ...@@ -129,7 +129,7 @@ public:
* @skipline #//getName * @skipline #//getName
* @until #//getName * @until #//getName
* *
* @return A string containing the name of the attribute. * @return A string containing the name of the attribute.
*/ */
std::string getName() const; std::string getName() const;
...@@ -158,7 +158,7 @@ public: ...@@ -158,7 +158,7 @@ public:
* @skipline #//getType * @skipline #//getType
* @until #//getType * @until #//getType
* *
* @return XdmfAttributeType of the attribute. * @return XdmfAttributeType of the attribute.
*/ */
shared_ptr<const XdmfAttributeType> getType() const; shared_ptr<const XdmfAttributeType> getType() const;
...@@ -183,7 +183,7 @@ public: ...@@ -183,7 +183,7 @@ public:
* @skipline #//setCenter * @skipline #//setCenter
* @until #//setCenter * @until #//setCenter
* *
* @param center The XdmfAttributeCenter to set. * @param center The XdmfAttributeCenter to set.
*/ */
void setCenter(const shared_ptr<const XdmfAttributeCenter> center); void setCenter(const shared_ptr<const XdmfAttributeCenter> center);
...@@ -208,7 +208,7 @@ public: ...@@ -208,7 +208,7 @@ public:
* @skipline #//setName * @skipline #//setName
* @until #//setName * @until #//setName
* *
* @param name A string containing the name to set. * @param name A string containing the name to set.
*/ */
void setName(const std::string & name); void setName(const std::string & name);
...@@ -233,7 +233,7 @@ public: ...@@ -233,7 +233,7 @@ public:
* @skipline #//setType * @skipline #//setType
* @until #//setType * @until #//setType
* *
* @param type XdmfAttributeType to set. * @param type XdmfAttributeType to set.
*/ */
void setType(const shared_ptr<const XdmfAttributeType> type); void setType(const shared_ptr<const XdmfAttributeType> type);
......
...@@ -93,7 +93,7 @@ protected: ...@@ -93,7 +93,7 @@ protected:
* construct XdmfAttributeCenters - * construct XdmfAttributeCenters -
* i.e. XdmfAttributeCenter::Node(). * i.e. XdmfAttributeCenter::Node().
* *
* @param name The name of the XdmfAttributeCenter to construct. * @param name The name of the XdmfAttributeCenter to construct.
*/ */
XdmfAttributeCenter(const std::string & name); XdmfAttributeCenter(const std::string & name);
......
...@@ -96,7 +96,7 @@ protected: ...@@ -96,7 +96,7 @@ protected:
* accessed through more specific static methods that construct * accessed through more specific static methods that construct
* XdmfAttributeTypes - i.e. XdmfAttributeType::Scalar(). * XdmfAttributeTypes - i.e. XdmfAttributeType::Scalar().
* *
* @param name The name of the XdmfAttributeType to construct. * @param name The name of the XdmfAttributeType to construct.
*/ */
XdmfAttributeType(const std::string & name); XdmfAttributeType(const std::string & name);
......
...@@ -65,10 +65,10 @@ public: ...@@ -65,10 +65,10 @@ public:
* @skipline #//constructor2 * @skipline #//constructor2
* @until #//constructor2 * @until #//constructor2
* *
* @param xNumPoints The number of points in the x direction. * @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction. * @param yNumPoints The number of points in the y direction.
* *
* @return Constructed curvilinear grid. * @return Constructed curvilinear grid.
*/ */
static shared_ptr<XdmfCurvilinearGrid> static shared_ptr<XdmfCurvilinearGrid>
New(const unsigned int xNumPoints, New(const unsigned int xNumPoints,
...@@ -93,11 +93,11 @@ public: ...@@ -93,11 +93,11 @@ public:
* @skipline #//constructor3 * @skipline #//constructor3
* @until #//constructor3 * @until #//constructor3
* *
* @param xNumPoints The number of points in the x direction. * @param xNumPoints The number of points in the x direction.
* @param yNumPoints The number of points in the y direction. * @param yNumPoints The number of points in the y direction.
* @param zNumPoints The number of points in the z direction. * @param zNumPoints The number of points in the z direction.
* *
* @return Constructed curvilinear grid. * @return Constructed curvilinear grid.
*/ */
static shared_ptr<XdmfCurvilinearGrid> static shared_ptr<XdmfCurvilinearGrid>
New(const unsigned int xNumPoints, New(const unsigned int xNumPoints,
...@@ -123,9 +123,9 @@ public: ...@@ -123,9 +123,9 @@ public:
* @skipline #//constructorvector * @skipline #//constructorvector
* @until #//constructorvector * @until #//constructorvector
* *
* @param numPoints The number of points in each direction. * @param numPoints The number of points in each direction.
* *
* @return Constructed curvilinear grid. * @return Constructed curvilinear grid.
*/ */
static shared_ptr<XdmfCurvilinearGrid> static shared_ptr<XdmfCurvilinearGrid>
New(const shared_ptr<XdmfArray> numPoints); New(const shared_ptr<XdmfArray> numPoints);
...@@ -163,7 +163,7 @@ public: ...@@ -163,7 +163,7 @@ public:
* @skipline #//getDimensions * @skipline #//getDimensions
* @until #//getDimensions * @until #//getDimensions
* *
* @return XdmfArray containing dimensions of this grid. * @return XdmfArray containing dimensions of this grid.
*/ */
shared_ptr<XdmfArray> getDimensions(); shared_ptr<XdmfArray> getDimensions();
...@@ -185,7 +185,7 @@ public: ...@@ -185,7 +185,7 @@ public:
* *
* Python: Python doesn't have a constant version * Python: Python doesn't have a constant version
* *
* @return XdmfArray containing the dimensions of this grid. * @return XdmfArray containing the dimensions of this grid.
*/ */
shared_ptr<const XdmfArray> getDimensions() const; shared_ptr<const XdmfArray> getDimensions() const;
...@@ -216,7 +216,7 @@ public: ...@@ -216,7 +216,7 @@ public:
* @skipline #//getGeometry * @skipline #//getGeometry
* @until #//getGeometry * @until #//getGeometry
* *
* @return The geometry associated with this grid. * @return The geometry associated with this grid.
*/ */
shared_ptr<XdmfGeometry> getGeometry(); shared_ptr<XdmfGeometry> getGeometry();
...@@ -244,7 +244,7 @@ public: ...@@ -244,7 +244,7 @@ public:
* @skipline #//setDimensions * @skipline #//setDimensions
* @until #//setDimensions * @until #//setDimensions
* *
* @param dimensions The dimension of the grid. * @param dimensions The dimension of the grid.
*/ */
void setDimensions(const shared_ptr<XdmfArray> dimensions); void setDimensions(const shared_ptr<XdmfArray> dimensions);
...@@ -271,7 +271,7 @@ public: ...@@ -271,7 +271,7 @@ public:
* @skipline #//setGeometry * @skipline #//setGeometry
* @until #//setGeometry * @until #//setGeometry
* *
* @param geometry An XdmfGeometry to associate with this grid. * @param geometry An XdmfGeometry to associate with this grid.
*/ */
void setGeometry(const shared_ptr<XdmfGeometry> geometry); void setGeometry(const shared_ptr<XdmfGeometry> geometry);
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
* @skipline #//initialization * @skipline #//initialization
* @until #//initialization * @until #//initialization
* *
* @return Constructed XdmfDomain. * @return Constructed XdmfDomain.
*/ */
static shared_ptr<XdmfDomain> New(); static shared_ptr<XdmfDomain> New();
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
* @skipline #//initialization * @skipline #//initialization
* @until #//initialization * @until #//initialization
* *
* @return Constructed XdmfGeometry. * @return Constructed XdmfGeometry.
*/ */
static shared_ptr<XdmfGeometry> New(); static shared_ptr<XdmfGeometry> New();
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
* @skipline #//getType * @skipline #//getType
* @until #//getType * @until #//getType
* *
* @return XdmfGeometryType of this geometry. * @return XdmfGeometryType of this geometry.
*/ */
shared_ptr<const XdmfGeometryType> getType() const; shared_ptr<const XdmfGeometryType> getType() const;
...@@ -142,7 +142,7 @@ public: ...@@ -142,7 +142,7 @@ public:
* @skipline #//setType * @skipline #//setType
* @until #//setType * @until #//setType
* *
* @param type The XdmfGeometryType to set. * @param type The XdmfGeometryType to set.
*/ */
void setType(const shared_ptr<const XdmfGeometryType> type); void setType(const shared_ptr<const XdmfGeometryType> type);
......
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
* @skipline #//getDimensions * @skipline #//getDimensions
* @until #//getDimensions * @until #//getDimensions
* *
* @return An int containing number of dimensions. * @return An int containing number of dimensions.
*/ */
virtual unsigned int getDimensions() const; virtual unsigned int getDimensions() const;
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
* @skipline #//getName * @skipline #//getName
* @until #//getName * @until #//getName
* *
* @return The name of this geometry type. * @return The name of this geometry type.
*/ */
std::string getName() const; std::string getName() const;
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
* *
* @param numberNodes number of nodes in graph. * @param numberNodes number of nodes in graph.
* *
* @return Constructed XdmfGraph. * @return Constructed XdmfGraph.
*/ */
static shared_ptr<XdmfGraph> New(const unsigned int numberNodes); static shared_ptr<XdmfGraph> New(const unsigned int numberNodes);
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
* @skipline #//getGeometry * @skipline #//getGeometry
* @until #//getGeometry * @until #//getGeometry
* *
* @return The geometry associated with this grid. * @return The geometry associated with this grid.
*/ */
shared_ptr<const XdmfGeometry> getGeometry() const; shared_ptr<const XdmfGeometry> getGeometry() const;
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
* @skipline #//getName * @skipline #//getName
* @until #//getName * @until #//getName
* *
* @return The name of the grid. * @return The name of the grid.
*/ */
std::string getName() const; std::string getName() const;
...@@ -146,8 +146,8 @@ public: ...@@ -146,8 +146,8 @@ public:
* @skipline #//getTime * @skipline #//getTime
* @until #//getTime * @until #//getTime
* *
* @return Pointer to the XdmfTime attached to this grid. If no * @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer. * XdmfTime is attached, return a NULL pointer.
*/ */
shared_ptr<XdmfTime> getTime(); shared_ptr<XdmfTime> getTime();
...@@ -168,8 +168,8 @@ public: ...@@ -168,8 +168,8 @@ public:
* *
* Python: Python doesn't have a constant version * Python: Python doesn't have a constant version
* *
* @return Pointer to the XdmfTime attached to this grid. If no * @return Pointer to the XdmfTime attached to this grid. If no
* XdmfTime is attached, return a NULL pointer. * XdmfTime is attached, return a NULL pointer.
*/ */
shared_ptr<const XdmfTime> getTime() const; shared_ptr<const XdmfTime> getTime() const;
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
* @skipline #//getTopology * @skipline #//getTopology
* @until #//getTopology * @until #//getTopology
* *
* @return The topology associated with this grid. * @return The topology associated with this grid.
*/ */
shared_ptr<const XdmfTopology> getTopology() const; shared_ptr<const XdmfTopology> getTopology() const;
...@@ -221,7 +221,7 @@ public: ...@@ -221,7 +221,7 @@ public:
* @skipline #//setName * @skipline #//setName
* @until #//setName * @until #//setName
* *
* @param name Name of the grid to set. * @param name Name of the grid to set.
*/ */
void setName(const std::string & name); void setName(const std::string & name);
...@@ -246,7 +246,7 @@ public: ...@@ -246,7 +246,7 @@ public:
* @skipline #//setTime * @skipline #//setTime
* @until #//setTime * @until #//setTime
* *
* @param time An XdmfTime to associate with this grid. * @param time An XdmfTime to associate with this grid.
*/ */
void setTime(const shared_ptr<XdmfTime> time); void setTime(const shared_ptr<XdmfTime> time);
......
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
* @skipline #//initalization * @skipline #//initalization
* @until #//initalization * @until #//initalization
* *
* @return Constructed XdmfGridCollection. * @return Constructed XdmfGridCollection.
*/ */
static shared_ptr<XdmfGridCollection> New(); static shared_ptr<XdmfGridCollection> New();
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
* @skipline #//getType * @skipline #//getType
* @until #//getType * @until #//getType
* *
* @return XdmfGridCollectionType of this collection. * @return XdmfGridCollectionType of this collection.
*/ */
shared_ptr<const XdmfGridCollectionType> getType() const; shared_ptr<const XdmfGridCollectionType> getType() const;
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
* @skipline #//insert * @skipline #//insert
* @until #//insert * @until #//insert
* *
* @param information An XdmfInformation to attach to this item. * @param information An XdmfInformation to attach to this item.
*/ */
void insert(const shared_ptr<XdmfInformation> information); void insert(const shared_ptr<XdmfInformation> information);
...@@ -153,7 +153,7 @@ public: ...@@ -153,7 +153,7 @@ public:
* @skipline #//setType * @skipline #//setType
* @until #//setType * @until #//setType
* *
* @param type The XdmfGridCollectionType to set. * @param type The XdmfGridCollectionType to set.
*/ */
void setType(const shared_ptr<const XdmfGridCollectionType> type); void setType(const shared_ptr<const XdmfGridCollectionType> type);
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
* @skipline #//initialization * @skipline #//initialization
* @until #//initialization * @until #//initialization
* *
* @return Constructed XdmfItemFactory. * @return Constructed XdmfItemFactory.
*/ */
static shared_ptr<XdmfItemFactory> New(); static shared_ptr<XdmfItemFactory> New();
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
* @skipline #//initialization * @skipline #//initialization
* @until #//initialization * @until #//initialization
* *
* @return Constructed XdmfMap. * @return Constructed XdmfMap.
*/ */
static shared_ptr<XdmfMap> New(); static shared_ptr<XdmfMap> New();
...@@ -102,12 +102,12 @@ public: ...@@ -102,12 +102,12 @@ public:
* @skipline #//initializationnode * @skipline #//initializationnode
* @until #//initializationnode * @until #//initializationnode
* *
* @param globalNodeIds A vector of attributes containing globalNodeId * @param globalNodeIds A vector of attributes containing globalNodeId
* values for each partition to be mapped. * values for each partition to be mapped.
* *
* @return Constructed XdmfMaps for each partition. The * @return Constructed XdmfMaps for each partition. The
* size of the vector will be the same as the * size of the vector will be the same as the
* globalNodeIds vector. * globalNodeIds vector.
*/ */
static std::vector<shared_ptr<XdmfMap> > static std::vector<shared_ptr<XdmfMap> >
New(const std::vector<shared_ptr<XdmfAttribute> > & globalNodeIds); New(const std::vector<shared_ptr<XdmfAttribute> > & globalNodeIds);
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
* @skipline #//getMap * @skipline #//getMap
* @until #//getMap * @until #//getMap
* *
* @return Stored boundary communicator map. * @return Stored boundary communicator map.
*/ */
std::map<task_id, node_id_map> getMap() const; std::map<task_id, node_id_map> getMap() const;
...@@ -169,7 +169,7 @@ public: ...@@ -169,7 +169,7 @@ public:
* @skipline #//getName * @skipline #//getName
* @until #//getName * @until #//getName
* *
* @return Name of boundary communicator map. * @return Name of boundary communicator map.
*/ */
std::string getName() const; std::string getName() const;
...@@ -195,10 +195,10 @@ public: ...@@ -195,10 +195,10 @@ public:
* @skipline #//getRemoteNodeIds * @skipline #//getRemoteNodeIds
* @until #//getRemoteNodeIds * @until #//getRemoteNodeIds
* *
* @param remoteTaskId Task id to retrieve mapping for. * @param remoteTaskId Task id to retrieve mapping for.
* *
* @return A map of local node ids to a vector of * @return A map of local node ids to a vector of
* remote node ids on remoteTaskId.