Skip to content

Commit

Permalink
Merge branch 'development' into submod-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 authored Sep 6, 2024
2 parents 304970d + 29cf8df commit cde9e2c
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 130 deletions.
142 changes: 142 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: PeleAnalysis-CI

on:
workflow_dispatch:
push:
branches: [development]
pull_request:
branches: [development]

concurrency:
group: ${{github.ref}}-${{github.head_ref}}-ci
cancel-in-progress: true

jobs:

# This is mostly just copied from the PelePhysics CI
# and pruned somewhat. Stuff to add back indicated
# with TODOs
#
## TODO:
#
# Formatting:
# runs-on: ubuntu-latest
# steps:
# - name: Clone
# uses: actions/checkout@v4
# - name: Check formatting
# uses: DoozyX/[email protected]
# with:
# source: './Source ./Testing ./Mechanisms'
# exclude: '.'
# extensions: 'H,h,cpp'
# clangFormatVersion: 18
#
# Codespell:
# runs-on: ubuntu-latest
# steps:
# - name: Clone
# uses: actions/checkout@v4
# with:
# submodules: false
# - name: Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# - name: Dependencies
# run: |
# # Install Python packages
# python -m pip install --upgrade pip
# pip install codespell
# - name: Run codespell
# run: codespell

TestAnalysisCodes:
runs-on: ubuntu-latest
strategy:
matrix:
comp: [gnu, llvm] # TODO: cuda, hip, sycl
python-version: ['3.11']
poetry-version: ['1.4.2']
include:
- comp: gnu
amrex_build_args: 'COMP=gnu'
dependency_cmds:
- comp: gnu-debug
amrex_build_args: 'COMP=gnu DEBUG=TRUE'
dependency_cmds:
- comp: llvm
amrex_build_args: 'COMP=llvm'
dependency_cmds:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Clone PeleAnalysis
uses: actions/checkout@v4
with:
path: PeleAnalysis-${{matrix.comp}}
submodules: recursive
- name: Set Environment Variables
run: |
echo "PELE_ANALYSIS_HOME=${{github.workspace}}/PeleAnalysis-${{matrix.comp}}" >> $GITHUB_ENV
echo "BASE_WORKING_DIRECTORY=${{github.workspace}}/PeleAnalysis-${{matrix.comp}}/Src" >> $GITHUB_ENV
echo "MODELSPECIFIC_WORKING_DIRECTORY=${{github.workspace}}/PeleAnalysis-${{matrix.comp}}/Src/ModelSpecificAnalysis" >> $GITHUB_ENV
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.comp}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-${{matrix.comp}}-git-
- name: Dependency (qslim)
working-directory: ${{env.BASE_WORKING_DIRECTORY}}
run: |
cmake --version
sudo apt-get update && sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
make qslim EBASE=decimateMEF ${{matrix.amrex_build_args}};
- name: Dependency (sundials)
working-directory: ${{env.MODELSPECIFIC_WORKING_DIRECTORY}}
run: |
cmake --version
make TPL ${{matrix.amrex_build_args}};
- name: Test (Src)
working-directory: ${{env.BASE_WORKING_DIRECTORY}}
run: |
ccache -z
for TYPE in template avgPlotfiles isosurface decimateMEF partStream; do \
printf "\n-------- ${TYPE} --------\n";
make -j ${{env.NPROCS}} EBASE=${TYPE} USE_CCACHE=TRUE ${{matrix.amrex_build_args}}; \
make realclean; \
if [ $? -ne 0 ]; then exit 1; fi; \
done
- name: Src ccache report
working-directory: ${{env.BASE_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
- name: Test (ModelSpecificAnalysis)
working-directory: ${{env.MODELSPECIFIC_WORKING_DIRECTORY}}
run: |
ccache -z
for TYPE in plotTransportCoeff plotTYtoLe; do \
make -j ${{env.NPROCS}} EBASE=${TYPE} USE_CCACHE=TRUE ${{matrix.amrex_build_args}}; \
make realclean; \
if [ $? -ne 0 ]; then exit 1; fi; \
done
- name: ModelSpecificAnalysis ccache report
working-directory: ${{env.MODELSPECIFIC_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
2 changes: 1 addition & 1 deletion Src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ EBASE = template
CEXE_sources += $(EBASE).cpp

ifeq ($(EBASE),partStream)
NEED_PARTICLES = TRUE
USE_PARTICLES = TRUE
CEXE_headers += StreamData.H StreamPC.H
CEXE_sources += StreamData.cpp StreamPC.cpp
endif
Expand Down
2 changes: 1 addition & 1 deletion Src/ModelSpecificAnalysis/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBUG = FALSE

# Compiler
COMP = gnu
USE_MPI = TRUE
USE_MPI = FALSE
USE_OMP = FALSE
USE_CUDA = FALSE
USE_HIP = FALSE
Expand Down
8 changes: 4 additions & 4 deletions Src/StreamData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static void DoIt(const Vector<int>& comps,
for (int n=0; n<comps.size(); ++n) {
const FArrayBox& stream_fab = *(Cstream.getFab(node->amr_lev,node->box_idx,comps[n]));
for (int j=stream.StreamIdxLo(); j<=stream.StreamIdxHi(); ++j) {
IntVect iv(D_DECL(local_node_id,j,0));
IntVect iv(AMREX_D_DECL(local_node_id,j,0));
senddata[offsets[to_proc]++] = stream_fab(iv,0);
}
}
Expand All @@ -714,8 +714,8 @@ static void DoIt(const Vector<int>& comps,

if (num_recv_nodes>0) {

Box d_box(IntVect(D_DECL(0,stream.StreamIdxLo(),0)),
IntVect(D_DECL(num_recv_nodes-1,stream.StreamIdxHi(),0)));
Box d_box(IntVect(AMREX_D_DECL(0,stream.StreamIdxLo(),0)),
IntVect(AMREX_D_DECL(num_recv_nodes-1,stream.StreamIdxHi(),0)));

for (int n=0; n<comps.size(); ++n) {
dest[comps[n]]->resize(d_box,1);
Expand All @@ -738,7 +738,7 @@ static void DoIt(const Vector<int>& comps,
int local_node_id = global_to_local_node_ids[it1->first];
for (int n=0; n<comps.size(); ++n) {
for (int j=d_box.smallEnd()[1]; j<=d_box.bigEnd()[1]; ++j) {
IntVect idx(D_DECL(local_node_id,j,0));
IntVect idx(AMREX_D_DECL(local_node_id,j,0));
(*dest[comps[n]])(idx,0) = *dest_loc++;
}
}
Expand Down
8 changes: 4 additions & 4 deletions Src/avgToPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ main (int argc,
pp.getarr("box",inBox,0,nx);
int d=BL_SPACEDIM;
BL_ASSERT(inBox.size()==2*d);
subbox=Box(IntVect(D_DECL(inBox[0],inBox[1],inBox[2])),
IntVect(D_DECL(inBox[d],inBox[d+1],inBox[d+2])),
subbox=Box(IntVect(AMREX_D_DECL(inBox[0],inBox[1],inBox[2])),
IntVect(AMREX_D_DECL(inBox[d],inBox[d+1],inBox[d+2])),
IndexType::TheCellType());
}

Expand Down Expand Up @@ -248,7 +248,7 @@ void pixelizeData(const FArrayBox& data, int slicedir, int sliceloc,

Print() << Box(se,be) << std::endl;

IntVect img(D_DECL(box.length(d[0]) - 1,box.length(d[1]) - 1,0));
IntVect img(AMREX_D_DECL(box.length(d[0]) - 1,box.length(d[1]) - 1,0));
image.resize(Box(IntVect::TheZeroVector(),img),1);

IntVect div;
Expand All @@ -259,7 +259,7 @@ void pixelizeData(const FArrayBox& data, int slicedir, int sliceloc,
for (int j=se[d[1]]; j<=be[d[1]]; ++j) {
div[d[0]] = i;
div[d[1]] = j;
image(IntVect(D_DECL(i - se[d[0]],j - se[d[1]],0)),0) =
image(IntVect(AMREX_D_DECL(i - se[d[0]],j - se[d[1]],0)),0) =
std::max(0,(int)(nvm1*std::min( (data(div,0) - data_min)/del,1.0)));
}
}
Expand Down
4 changes: 2 additions & 2 deletions Src/binMEF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,11 @@ main (int argc,
Box box;
if (nc==1)
{
box = Box(IntVect::TheZeroVector(),IntVect(D_DECL(nBins[0]-1,0,0)));
box = Box(IntVect::TheZeroVector(),IntVect(AMREX_D_DECL(nBins[0]-1,0,0)));
}
else
{
box = Box(IntVect::TheZeroVector(),IntVect(D_DECL(nBins[0]-1,nBins[1]-1,0)));
box = Box(IntVect::TheZeroVector(),IntVect(AMREX_D_DECL(nBins[0]-1,nBins[1]-1,0)));
}

FArrayBox outFab(box,1);
Expand Down
20 changes: 10 additions & 10 deletions Src/buildDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ main (int argc,

int nCell = 64; pp.query("nCell",nCell);
int max_grid_size = 32; pp.query("max_grid_size",max_grid_size);
Box domain(IntVect(D_DECL(0,0,0)),
//IntVect(D_DECL(nCell-1,nCell-1,nCell-1)));
IntVect(D_DECL(64-1,64-1,192-1)));
Box domain(IntVect(AMREX_D_DECL(0,0,0)),
//IntVect(AMREX_D_DECL(nCell-1,nCell-1,nCell-1)));
IntVect(AMREX_D_DECL(64-1,64-1,192-1)));
BoxArray grids(domain);
grids.maxSize(max_grid_size);
//RealBox probDomain({D_DECL(0,0,0)},{D_DECL(1,1,1)});
//RealBox probDomain({D_DECL(-0.0033,-0.0033,-0.0099)},{D_DECL(0.0033,0.0033,.0099)});
RealBox probDomain({D_DECL(0,0,0)},{D_DECL(0.03,0.03,.09)});
//RealBox probDomain({AMREX_D_DECL(0,0,0)},{AMREX_D_DECL(1,1,1)});
//RealBox probDomain({AMREX_D_DECL(-0.0033,-0.0033,-0.0099)},{AMREX_D_DECL(0.0033,0.0033,.0099)});
RealBox probDomain({AMREX_D_DECL(0,0,0)},{AMREX_D_DECL(0.03,0.03,.09)});

Array<int,AMREX_SPACEDIM> is_periodic = {D_DECL(0,0,0)};
Array<int,AMREX_SPACEDIM> is_periodic = {AMREX_D_DECL(0,0,0)};
Geometry geom(domain,probDomain,0,is_periodic);
const Real* dx = geom.CellSize();
const Real* plo = geom.ProbLo();
Expand All @@ -129,12 +129,12 @@ main (int argc,
std::vector<Vec3ui> faceList;

for (int node=0; node<nNodes; ++node) {
const IntVect iv(D_DECL(node,0,0));
vertList.push_back(Vec3f(D_DECL(nodes(iv,0),nodes(iv,1),nodes(iv,2))));
const IntVect iv(AMREX_D_DECL(node,0,0));
vertList.push_back(Vec3f(AMREX_D_DECL(nodes(iv,0),nodes(iv,1),nodes(iv,2))));
}
for (int elt=0; elt<nElts; ++elt) {
int offset = elt * nodesPerElt;
faceList.push_back(Vec3ui(D_DECL(faceData[offset]-1,faceData[offset+1]-1,faceData[offset+2]-1)));
faceList.push_back(Vec3ui(AMREX_D_DECL(faceData[offset]-1,faceData[offset+1]-1,faceData[offset+2]-1)));
}

const Box& vbox = distance[mfi].box();
Expand Down
6 changes: 3 additions & 3 deletions Src/partStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GetSeedLocations (const StreamParticleContainer& spc)
for (MFIter mfi = spc.MakeMFIter(lev); mfi.isValid(); ++mfi)
{
const Box& tile_box = mfi.tilebox();
if (BL_SPACEDIM<3 || tile_box.contains(IntVect(D_DECL(0,50,107)))) {
if (BL_SPACEDIM<3 || tile_box.contains(IntVect(AMREX_D_DECL(0,50,107)))) {

mask.resize(tile_box,1);
mask.setVal(1);
Expand Down Expand Up @@ -127,7 +127,7 @@ main (int argc,
ParmParse pp;

std::string infile; pp.get("infile",infile);
Vector<std::string> inVarNames = {D_DECL("x_velocity", "y_velocity", "z_velocity")};
Vector<std::string> inVarNames = {AMREX_D_DECL("x_velocity", "y_velocity", "z_velocity")};

PlotFileData pf(infile);
int finestLevel = pf.finestLevel();
Expand All @@ -136,7 +136,7 @@ main (int argc,
Vector<DistributionMapping> dms(finestLevel+1);
Vector<int> ratios(finestLevel);

Array<int,AMREX_SPACEDIM> is_per = {D_DECL(0, 0, 0)};
Array<int,AMREX_SPACEDIM> is_per = {AMREX_D_DECL(0, 0, 0)};
RealBox rb(pf.probLo(),pf.probHi());

int Nlev = finestLevel + 1;
Expand Down
2 changes: 1 addition & 1 deletion Src/regridPlt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ main (int argc,
levelSteps[lev] = 666;
if (lev < Nlev-1) {
int r = amrData.RefRatio()[lev];
refRatio[lev] = IntVect(D_DECL(r,r,r));
refRatio[lev] = IntVect(AMREX_D_DECL(r,r,r));
}
dat[lev] = fileData[lev];
}
Expand Down
2 changes: 1 addition & 1 deletion Src/sampleStreamlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ find_containing_box(const FArrayBox& XYZ,
{
for (int j=1; j<XYZ.box().length(0); ++j)
{
strIV = IntVect(D_DECL(j,0,0));
strIV = IntVect(AMREX_D_DECL(j,0,0));
Real loc = XYZ(strIV,idXYZ[d]);
locL[d] = std::min(locL[d], loc);
locH[d] = std::max(locH[d], loc);
Expand Down
4 changes: 2 additions & 2 deletions Src/slicePlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void pixelizeData(const FArrayBox& data, int slicedir, int sliceloc,

Print() << Box(se,be) << std::endl;

IntVect img(D_DECL(box.length(d[0]) - 1,box.length(d[1]) - 1,0));
IntVect img(AMREX_D_DECL(box.length(d[0]) - 1,box.length(d[1]) - 1,0));
image.resize(Box(IntVect::TheZeroVector(),img),1);

IntVect div;
Expand All @@ -121,7 +121,7 @@ void pixelizeData(const FArrayBox& data, int slicedir, int sliceloc,
for (int j=se[d[1]]; j<=be[d[1]]; ++j) {
div[d[0]] = i;
div[d[1]] = j;
image(IntVect(D_DECL(i - se[d[0]],j - se[d[1]],0)),0) =
image(IntVect(AMREX_D_DECL(i - se[d[0]],j - se[d[1]],0)),0) =
std::max(0,(int)(nvm1*std::min( (data(div,0) - data_min)/del,1.0)));
}
}
Expand Down
Loading

0 comments on commit cde9e2c

Please sign in to comment.