Skip to content

Commit

Permalink
Use updated domain_decomp naming scheme (#652)
Browse files Browse the repository at this point in the history
# Use updated `domain_decomp` naming scheme

Linked PR: nextsimhub/domain_decomp#33.
  • Loading branch information
jwallwork23 authored Aug 21, 2024
2 parents 740b4a0 + 6efca3f commit fcd23f8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 48 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/clang-compile-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: clang-format
run: |
sudo apt-get update
sudo apt update
sudo apt install clang-format
cd core/src
clang-format --dry-run -Werror *cpp include/*hpp
Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
- name: run serial tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
- name: run MPI tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
Expand Down
14 changes: 7 additions & 7 deletions core/src/ModelMetadata.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @file ModelMetadata.cpp
*
* @date Jun 29, 2022
* @date 21 August 2024
* @author Tim Spain <timothy.spain@nersc.no>
*/

Expand Down Expand Up @@ -49,14 +49,14 @@ void ModelMetadata::getPartitionMetadata(std::string partitionFile)
+ std::to_string(nBoxes) + "\n";
throw std::runtime_error(errorMsg);
}
globalExtentX = ncFile.getDim("globalX").getSize();
globalExtentY = ncFile.getDim("globalY").getSize();
globalExtentX = ncFile.getDim("NX").getSize();
globalExtentY = ncFile.getDim("NY").getSize();
netCDF::NcGroup bboxGroup(ncFile.getGroup(bboxName));
std::vector<size_t> index(1, mpiMyRank);
bboxGroup.getVar("global_x").getVar(index, &localCornerX);
bboxGroup.getVar("global_y").getVar(index, &localCornerY);
bboxGroup.getVar("local_extent_x").getVar(index, &localExtentX);
bboxGroup.getVar("local_extent_y").getVar(index, &localExtentY);
bboxGroup.getVar("domain_x").getVar(index, &localCornerX);
bboxGroup.getVar("domain_y").getVar(index, &localCornerY);
bboxGroup.getVar("domain_extent_x").getVar(index, &localExtentX);
bboxGroup.getVar("domain_extent_y").getVar(index, &localExtentY);
ncFile.close();
}

Expand Down
20 changes: 10 additions & 10 deletions core/test/partition_metadata_2.cdl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
netcdf partition_metadata_2 {
dimensions:
globalX = 10 ;
globalY = 9 ;
NX = 10 ;
NY = 9 ;
P = 2 ;
T = 1 ;
B = 1 ;
Expand All @@ -10,19 +10,19 @@ dimensions:

group: bounding_boxes {
variables:
int global_x(P) ;
int global_y(P) ;
int local_extent_x(P) ;
int local_extent_y(P) ;
int domain_x(P) ;
int domain_y(P) ;
int domain_extent_x(P) ;
int domain_extent_y(P) ;
data:

global_x = 0, 4 ;
domain_x = 0, 4 ;

global_y = 0, 0 ;
domain_y = 0, 0 ;

local_extent_x = 4, 6 ;
domain_extent_x = 4, 6 ;

local_extent_y = 9, 9 ;
domain_extent_y = 9, 9 ;
} // group bounding_boxes

group: connectivity {
Expand Down
20 changes: 10 additions & 10 deletions core/test/partition_metadata_3.cdl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
netcdf partition_metadata_3 {
dimensions:
globalX = 5 ;
globalY = 7 ;
NX = 5 ;
NY = 7 ;
P = 3 ;
T = 2 ;
B = 2 ;
Expand All @@ -10,19 +10,19 @@ dimensions:

group: bounding_boxes {
variables:
int global_x(P) ;
int global_y(P) ;
int local_extent_x(P) ;
int local_extent_y(P) ;
int domain_x(P) ;
int domain_y(P) ;
int domain_extent_x(P) ;
int domain_extent_y(P) ;
data:

global_x = 0, 0, 3 ;
domain_x = 0, 0, 3 ;

global_y = 0, 3, 0 ;
domain_y = 0, 3, 0 ;

local_extent_x = 3, 3, 2 ;
domain_extent_x = 3, 3, 2 ;

local_extent_y = 3, 4, 7 ;
domain_extent_y = 3, 4, 7 ;
} // group bounding_boxes

group: connectivity {
Expand Down
20 changes: 10 additions & 10 deletions run/partition.cdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ netcdf partition {
dimensions:
P = 1 ;
L = 1 ;
globalX = 30 ;
globalY = 30 ;
NX = 30 ;
NY = 30 ;

group: bounding_boxes {
variables:
int global_x(P) ;
int global_y(P) ;
int local_extent_x(P) ;
int local_extent_y(P) ;
int domain_x(P) ;
int domain_y(P) ;
int domain_extent_x(P) ;
int domain_extent_y(P) ;
data:

global_x = 0 ;
domain_x = 0 ;

global_y = 0 ;
domain_y = 0 ;

local_extent_x = 30 ;
domain_extent_x = 30 ;

local_extent_y = 30 ;
domain_extent_y = 30 ;
} // group bounding_boxes
}

20 changes: 10 additions & 10 deletions run/partition_metadata_2.cdl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// partition_metadata_2.cdl
netcdf partition_metadata_2 {
dimensions:
globalX = 30 ;
globalY = 30 ;
NX = 30 ;
NY = 30 ;
P = 2 ;
T = UNLIMITED ; // (0 currently)
B = UNLIMITED ; // (0 currently)
Expand All @@ -11,19 +11,19 @@ dimensions:

group: bounding_boxes {
variables:
int global_x(P) ;
int global_y(P) ;
int local_extent_x(P) ;
int local_extent_y(P) ;
int domain_x(P) ;
int domain_y(P) ;
int domain_extent_x(P) ;
int domain_extent_y(P) ;
data:

global_x = 0, 0 ;
domain_x = 0, 0 ;

global_y = 0, 16 ;
domain_y = 0, 16 ;

local_extent_x = 30, 30 ;
domain_extent_x = 30, 30 ;

local_extent_y = 16, 14 ;
domain_extent_y = 16, 14 ;
} // group bounding_boxes

group: connectivity {
Expand Down

0 comments on commit fcd23f8

Please sign in to comment.