Skip to content

Commit 65464f5

Browse files
authored
Merge pull request #17 from GEOSX/feature/settgast/separateCoreIntoComponents
Feature/settgast/separate core into components
2 parents 6b79e25 + ba14c0c commit 65464f5

File tree

71 files changed

+526
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+526
-339
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
[submodule "src/cmake/blt"]
1010
path = src/cmake/blt
11-
url = [email protected]:LLNL/blt.git
11+
url = ../../LLNL/blt.git

src/components/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
message( "Entering /src/components/CMakeLists.txt")
2-
blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT -I${CMAKE_SOURCE_DIR}/components/core/src)
3-
blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT -I${PROJECT_BINARY_DIR}/include )
42

53

64
# Python config

src/components/core/src/CMakeLists.txt

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,36 @@ set(geosx_headers "" )
99
#
1010

1111
set(geosx_core_sources "" )
12-
13-
add_subdirectory(codingUtilities)
14-
add_subdirectory(common)
15-
add_subdirectory(constitutive)
16-
add_subdirectory(dataRepository)
17-
add_subdirectory(fileIO)
18-
add_subdirectory(finiteElement)
19-
#add_subdirectory(legacy)
20-
add_subdirectory(math)
21-
add_subdirectory(mesh)
22-
add_subdirectory(schema)
23-
add_subdirectory(managers)
24-
add_subdirectory(MeshUtilities)
25-
add_subdirectory(MPI_Communications)
26-
add_subdirectory(PhysicsSolvers)
27-
add_subdirectory(python)
28-
add_subdirectory(systemSolverInterface)
12+
13+
14+
15+
16+
set( coreLibs
17+
codingUtilities
18+
common
19+
constitutive
20+
dataRepository
21+
fileIO
22+
finiteElement
23+
math
24+
mesh
25+
managers
26+
meshUtilities
27+
MPI_Communications
28+
physicsSolvers
29+
python
30+
systemSolverInterface
31+
)
32+
33+
34+
set( coreLibLinkLine "")
35+
foreach( lib ${coreLibs} )
36+
add_subdirectory(${lib})
37+
if( NOT ( ${lib} STREQUAL "math" OR ${lib} STREQUAL "python" ) )
38+
set( coreLibLinkLine ${coreLibLinkLine} ${GEOSX_LINK_PREPEND_FLAG} ${lib} ${GEOSX_LINK_POSTPEND_FLAG} )
39+
endif()
40+
endforeach()
41+
2942

3043

3144
# Python config
@@ -49,14 +62,19 @@ endif()
4962
#message( "extraComponentsListLink = ${extraComponentsListLink}" )
5063
message("adding geosx_core library")
5164

52-
blt_add_library( NAME geosx_core
53-
SOURCES ${geosx_core_sources}
54-
HEADERS ${geosx_headers}
55-
DEPENDS_ON optionparser cxx-utilities pugixml
56-
${extraComponentsListLink}
57-
${thirdPartyLibs}
58-
SHARED TRUE
59-
)
60-
65+
#blt_add_library( NAME geosx_core
66+
# SOURCES ${geosx_core_sources}
67+
# HEADERS ${geosx_headers}
68+
# DEPENDS_ON ${coreLibs}
69+
# ${extraComponentsListLink}
70+
# ${thirdPartyLibs}
71+
# SHARED TRUE
72+
# )
73+
74+
75+
message( "coreLibLinkLine = ${coreLibLinkLine}" )
76+
add_library ( geosx_core SHARED ${coreLibs} )
77+
target_link_libraries(geosx_core ${coreLibLinkLine})
78+
6179
geosx_add_code_checks(PREFIX core )
6280

src/components/core/src/MPI_Communications/CMakeLists.txt

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,39 @@
22
#
33
# Specify all headers
44
#
5-
set(geosx_headers
6-
${geosx_headers}
7-
MPI_Communications/CommBufferOps.hpp
8-
MPI_Communications/CommBufferOps_inline.hpp
9-
MPI_Communications/CommunicationTools.hpp
10-
MPI_Communications/NeighborCommunicator.hpp
11-
MPI_Communications/NeighborCommunication.hpp
12-
MPI_Communications/PartitionBase.hpp
13-
MPI_Communications/SpatialPartition.hpp
14-
PARENT_SCOPE )
5+
set(MPI_Communications_headers
6+
CommunicationTools.hpp
7+
NeighborCommunicator.hpp
8+
NeighborCommunication.hpp
9+
PartitionBase.hpp
10+
SpatialPartition.hpp
11+
)
1512

1613

1714
#
1815
# Specify all sources
1916
#
20-
set(geosx_core_sources
21-
${geosx_core_sources}
22-
MPI_Communications/CommBufferOps.cpp
23-
MPI_Communications/CommunicationTools.cpp
24-
MPI_Communications/NeighborCommunicator.cpp
25-
MPI_Communications/NeighborCommunication.cpp
26-
MPI_Communications/PartitionBase.cpp
27-
MPI_Communications/SpatialPartition.cpp
28-
PARENT_SCOPE )
17+
set(MPI_Communications_sources
18+
CommunicationTools.cpp
19+
NeighborCommunicator.cpp
20+
NeighborCommunication.cpp
21+
PartitionBase.cpp
22+
SpatialPartition.cpp
23+
)
24+
25+
set( dependencyList fileIO common )
26+
set( dependencyList2 trilinos )
27+
foreach( lib ${dependencyList} )
28+
set( dependencyList2 ${dependencyList2} ${GEOSX_LINK_PREPEND_FLAG} ${lib} ${GEOSX_LINK_POSTPEND_FLAG} )
29+
endforeach()
30+
message( "dependencyList2 = ${dependencyList2}" )
31+
32+
blt_add_library( NAME MPI_Communications
33+
SOURCES ${MPI_Communications_sources}
34+
HEADERS ${MPI_Communications_headers}
35+
DEPENDS_ON ${dependencyList2}
36+
SHARED FALSE
37+
)
38+
39+
target_include_directories( MPI_Communications PUBLIC ${CMAKE_SOURCE_DIR}/components/core/src)
40+
geosx_add_code_checks(PREFIX MPI_Communications )

src/components/core/src/MeshUtilities/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/components/core/src/PhysicsSolvers/CMakeLists.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/components/core/src/codingUtilities/CMakeLists.txt

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@
22
#
33
# Specify all headers
44
#
5-
set(geosx_headers
6-
${geosx_headers}
7-
codingUtilities/StringUtilities.hpp
8-
codingUtilities/IOUtilities.hpp
9-
PARENT_SCOPE )
5+
set( codingUtilities_headers
6+
StringUtilities.hpp
7+
IOUtilities.hpp
8+
)
109

1110
#
1211
# Specify all sources
1312
#
14-
set(geosx_core_sources
15-
${geosx_core_sources}
16-
codingUtilities/StringUtilities.cpp
17-
PARENT_SCOPE )
13+
set( codingUtilities_sources
14+
StringUtilities.cpp
15+
)
16+
17+
set( dependencyList common )
18+
set( dependencyList2 RAJA )
19+
foreach( lib ${dependencyList} )
20+
set( dependencyList2 ${dependencyList2} ${GEOSX_LINK_PREPEND_FLAG} ${lib} ${GEOSX_LINK_POSTPEND_FLAG} )
21+
endforeach()
22+
message( "dependencyList2 = ${dependencyList2}" )
23+
24+
blt_add_library( NAME codingUtilities
25+
SOURCES ${codingUtilities_sources}
26+
HEADERS ${codingUtilities_headers}
27+
DEPENDS_ON ${dependencyList2}
28+
SHARED FALSE
29+
)
30+
31+
target_include_directories( codingUtilities PUBLIC ${CMAKE_SOURCE_DIR}/components/core/src)
32+
geosx_add_code_checks(PREFIX codingUtilities )

src/components/core/src/common/CMakeLists.txt

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,37 @@
22
#
33
# Specify all headers
44
#
5-
set(geosx_headers
6-
${geosx_headers}
7-
common/integer_conversion.hpp
8-
common/DataTypes.hpp
9-
common/InterObjectRelation.hpp
10-
common/Logger.hpp
11-
common/SortedArray.hpp
12-
PARENT_SCOPE )
5+
set(common_headers
6+
integer_conversion.hpp
7+
DataTypes.hpp
8+
InterObjectRelation.hpp
9+
Logger.hpp
10+
SortedArray.hpp )
1311

1412
#
1513
# Specify all sources
1614
#
17-
set(geosx_core_sources
18-
${geosx_core_sources}
19-
common/Logger.cpp
20-
PARENT_SCOPE )
15+
set(common_sources
16+
Logger.cpp )
17+
18+
19+
set( dependencyList cxx-utilities )
20+
set( dependencyList2 mpi )
21+
foreach( lib ${dependencyList} )
22+
set( dependencyList2 ${dependencyList2} ${GEOSX_LINK_PREPEND_FLAG} ${lib} ${GEOSX_LINK_POSTPEND_FLAG} )
23+
endforeach()
24+
message( "dependencyList2 = ${dependencyList2}" )
25+
26+
27+
blt_add_library( NAME common
28+
SOURCES ${common_sources}
29+
HEADERS ${common_headers}
30+
DEPENDS_ON ${dependencyList2}
31+
SHARED FALSE
32+
)
33+
34+
35+
36+
target_include_directories( common PUBLIC ${CMAKE_SOURCE_DIR}/components/core/src)
37+
38+
geosx_add_code_checks(PREFIX common )

src/components/core/src/common/Logger.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ void geos_abort( std::string message )
1818
{
1919
std::cerr<<message<<std::endl;
2020
cxx_utilities::handler1(EXIT_FAILURE);
21-
//#if USE_MPI == 1
22-
// int mpi = 0;
23-
// MPI_Initialized( &mpi );
24-
// if ( mpi )
25-
// {
26-
// MPI_Abort( MPI_COMM_WORLD, EXIT_FAILURE );
27-
// }
28-
// else
29-
//#endif
30-
// {
31-
// exit( EXIT_FAILURE );
32-
// }
21+
#if USE_MPI == 1
22+
int mpi = 0;
23+
MPI_Initialized( &mpi );
24+
if ( mpi )
25+
{
26+
MPI_Abort( MPI_COMM_WORLD, EXIT_FAILURE );
27+
}
28+
else
29+
#endif
30+
{
31+
exit( EXIT_FAILURE );
32+
}
3333
}
3434

3535
}

0 commit comments

Comments
 (0)