File tree Expand file tree Collapse file tree 6 files changed +482
-4
lines changed Expand file tree Collapse file tree 6 files changed +482
-4
lines changed Original file line number Diff line number Diff line change 37
37
set (NSDG_NetCDF_Library "netcdf-cxx4" )
38
38
else ()
39
39
set (NSDG_NetCDF_Library "netcdf_c++4" )
40
+ set (NSDG_NetCDF_Library "netcdf-cxx4" )
40
41
endif ()
41
42
endif ()
42
43
target_include_directories (nextsimlib PUBLIC "${netCDF_INCLUDE_DIR} " )
Original file line number Diff line number Diff line change @@ -100,11 +100,11 @@ class ModelArraySlice {
100
100
}
101
101
102
102
ModelArray& copyToModelArray (ModelArray& target) const ;
103
- template <typename T> T& copyToBuffer (T& buffer)
103
+ template <typename T> T& copyToBuffer (T& buffer, size_t startIndex = 0 )
104
104
{
105
105
// make no especial attempt at efficiency here
106
106
SliceIter thisIter (slice, data.dimensions ());
107
- auto biter = buffer.begin ();
107
+ auto biter = std::next ( buffer.begin (), startIndex );
108
108
109
109
while (!thisIter.isEnd ()) {
110
110
// If the buffer ends before the slice, throw an exception
Original file line number Diff line number Diff line change @@ -142,7 +142,18 @@ class Slice {
142
142
}
143
143
std::ostream& print (std::ostream& os) const
144
144
{
145
- return os << start << " :" << stop << " :" << step;
145
+ // TODO remove me before merging into develop
146
+ // this is for debugging purposes only
147
+ if (start.isAll ()) {
148
+ os << " :*:" ;
149
+ } else {
150
+ os << start << " :" ;
151
+ }
152
+ if (stop.isAll ()) {
153
+ return os << " *:" << step;
154
+ } else {
155
+ return os << stop << " :" << step;
156
+ }
146
157
}
147
158
friend SliceIter;
148
159
};
Original file line number Diff line number Diff line change @@ -77,6 +77,28 @@ if(ENABLE_MPI)
77
77
)
78
78
target_link_libraries (testModelMetadata_MPI3 PRIVATE nextsimlib doctest::doctest)
79
79
80
+ # set(ModelArrayStructure "discontinuousgalerkin")
81
+ set (CoreDir "../../core/src/" )
82
+
83
+ # set(MODEL_INCLUDE_DIR "./testmodelarraydetails")
84
+ add_executable (testHaloExchange_MPI4
85
+ "HaloExchange_test.cpp"
86
+ "MainMPI.cpp"
87
+ "../src/ModelArray.cpp"
88
+ "../src/ModelArraySlice.cpp"
89
+ "${MODEL_INCLUDE_DIR} /ModelArrayDetails.cpp"
90
+ )
91
+ target_compile_definitions (testHaloExchange_MPI4 PRIVATE USE_MPI)
92
+ target_include_directories (
93
+ testHaloExchange_MPI4 PRIVATE
94
+ "../src"
95
+ "../../dynamics/src"
96
+ ${MODEL_INCLUDE_DIR}
97
+ )
98
+ target_link_libraries (testHaloExchange_MPI4 PRIVATE doctest::doctest Eigen3::Eigen)
99
+
100
+ set (MODEL_INCLUDE_DIR "../../core/src/discontinuousgalerkin" )
101
+
80
102
add_executable (testParaGrid_MPI2 "ParaGrid_test.cpp" "MainMPI.cpp" )
81
103
target_compile_definitions (
82
104
testParaGrid_MPI2
You can’t perform that action at this time.
0 commit comments