Skip to content

Commit

Permalink
Merge branch 'AMReX-Codes:development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ruohai0925 authored Feb 14, 2024
2 parents 4b33c61 + 392d068 commit ba46b85
Show file tree
Hide file tree
Showing 49 changed files with 1,017 additions and 674 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dependencies/dependencies_codeplay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
sudo wget -qO - https://developer.codeplay.com/apt/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/codeplay-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/codeplay-keyring.gpg] https://developer.codeplay.com/apt all main" | sudo tee /etc/apt/sources.list.d/codeplay.list

sudo apt-get clean
sudo apt-get update

# try apt install up to five times, to avoid connection splits
Expand All @@ -23,7 +24,7 @@ for itry in {1..5}
do
sudo apt-get install -y --no-install-recommends \
$1 \
&& { sudo apt-get clean; status=0; break; } \
&& { sudo apt-get clean; sudo apt-get update; status=0; break; } \
|| { sleep 10; }
done
if [[ ${status} -ne 0 ]]; then exit 1; fi
2 changes: 0 additions & 2 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
tests-oneapi-sycl-eb-nvidia:
name: oneAPI SYCL for Nvidia GPUs [tests w/ EB]
runs-on: ubuntu-latest
if: 0
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -144,7 +143,6 @@ jobs:
no-tests-oneapi-sycl-amd:
name: oneAPI SYCL for AMD GPUs
runs-on: ubuntu-20.04
if: 0
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down
6 changes: 3 additions & 3 deletions Docs/sphinx_documentation/source/AmrCore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ interface to a Fortran routine that tags cells (in this case, :fortran:`state_er
const int* thi = tilebox.hiVect();

// tag cells for refinement
state_error(tptr, ARLIM_3D(tlo), ARLIM_3D(thi),
state_error(tptr, AMREX_ARLIM_3D(tlo), AMREX_ARLIM_3D(thi),
BL_TO_FORTRAN_3D(state[mfi]),
&tagval, &clearval,
ARLIM_3D(tilebox.loVect()), ARLIM_3D(tilebox.hiVect()),
ZFILL(dx), ZFILL(prob_lo), &time, &phierr[lev]);
AMREX_ARLIM_3D(tilebox.loVect()), AMREX_ARLIM_3D(tilebox.hiVect()),
AMREX_ZFILL(dx), AMREX_ZFILL(prob_lo), &time, &phierr[lev]);
//
// Now update the tags in the TagBox in the tilebox region
// to be equal to itags
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx_documentation/source/AmrLevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ the :cpp:`AmrLevelAdv` class, e.g.,
int lo_bc[BL_SPACEDIM];
int hi_bc[BL_SPACEDIM];
for (int i = 0; i < BL_SPACEDIM; ++i) {
lo_bc[i] = hi_bc[i] = INT_DIR; // periodic boundaries
lo_bc[i] = hi_bc[i] = amrex::BCType::int_dir; // periodic boundaries
}

BCRec bc(lo_bc, hi_bc);
Expand Down
4 changes: 3 additions & 1 deletion Src/Base/AMReX_Arena.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ inline std::size_t aligned_size (std::size_t align_requirement, std::size_t size

inline bool is_aligned (const void* p, std::size_t alignment) noexcept
{
return (reinterpret_cast<std::size_t>(p) % alignment) == 0;
auto* q = const_cast<void*>(p);
auto space = alignment;
return std::align(alignment, alignment, q, space) == p;
}

class Arena;
Expand Down
162 changes: 2 additions & 160 deletions Src/Base/AMReX_ArrayLim.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,6 @@

#include <AMReX_Array.H>

/*
** C++ stuff ...
*/

#ifndef AMREX_XSDK

#if AMREX_SPACEDIM==1
#define ARLIM_P(x) const int&
#define ARLIM(x) (x)[0]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], 0, 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], 0., 0.}.data()
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#elif AMREX_SPACEDIM==2
#define ARLIM_P(x) const int&,const int&
#define ARLIM(x) (x)[0],(x)[1]
#define ARLIM_3D(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ARLIM_ANYD(x) amrex::GpuArray<int,3>{(x)[0], (x)[1], 0}.data()
#define ZFILL(x) amrex::GpuArray<amrex::Real,3>{(x)[0], (x)[1], 0.}.data()
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#elif AMREX_SPACEDIM==3
#define ARLIM_P(x) const int&,const int&,const int&
#define ARLIM(x) (x)[0],(x)[1],(x)[2]
#define ARLIM_3D(x) x
#define ARLIM_ANYD(x) x
#define ZFILL(x) x
#define AMREX_REAL_ANYD(x) AMREX_ZFILL(x)
#endif

#endif /* ndef AMREX_XSDK */

#if AMREX_SPACEDIM==1
#define AMREX_ARLIM_P(x) const int&
#define AMREX_ARLIM(x) (x)[0]
Expand Down Expand Up @@ -81,133 +50,6 @@

#define BL_TO_FORTRAN_BOX(x) AMREX_ARLIM_3D((x).loVect()), AMREX_ARLIM_3D((x).hiVect())

#else

#if !defined(BL_LANG_FORT)

#ifndef AMREX_XSDK

/* C stuff */
#if AMREX_SPACEDIM == 1
#define ARLIM_P(x) const int*
#elif AMREX_SPACEDIM == 2
#define ARLIM_P(x) const int*, const int*
#else
#define ARLIM_P(x) const int*, const int*, const int*
#endif

#endif /* ndef AMREX_XSDK */

#if AMREX_SPACEDIM == 1
#define AMREX_ARLIM_P(x) const int*
#elif AMREX_SPACEDIM == 2
#define AMREX_ARLIM_P(x) const int*, const int*
#else
#define AMREX_ARLIM_P(x) const int*, const int*, const int*
#endif

#else

#ifndef AMREX_XSDK

/*
** Fortran stuff ...
*/

#if __STDC__==1 || defined(__INTEL_COMPILER)

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a##_l1, a##_h1
#define DIMDEC(a) a##_l1, a##_h1
#define DIMV(a) a##_l1:a##_h1
#define DIM1(a) a##_l1:a##_h1
#define ARG_L1(a) a##_l1
#define ARG_H1(a) a##_h1
#define DIMARG(a) a##(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMDEC(a) a##_l1, a##_l2, a##_h1, a##_h2
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define DIMARG(a) a##(1),a##(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMDEC(a) a##_l1, a##_l2, a##_l3, a##_h1, a##_h2, a##_h3
#define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2, a##_l3:a##_h3
#define DIM1(a) a##_l1:a##_h1
#define DIM2(a) a##_l2:a##_h2
#define DIM3(a) a##_l3:a##_h3
#define DIM12(a) a##_l1:a##_h1, a##_l2:a##_h2
#define DIM23(a) a##_l2:a##_h2, a##_l3:a##_h3
#define DIM13(a) a##_l1:a##_h1, a##_l3:a##_h3
#define ARG_L1(a) a##_l1
#define ARG_L2(a) a##_l2
#define ARG_L3(a) a##_l3
#define ARG_H1(a) a##_h1
#define ARG_H2(a) a##_h2
#define ARG_H3(a) a##_h3
#define DIMARG(a) a##(1),a##(2),a##(3)
#endif

#else

#if (AMREX_SPACEDIM == 1)
#define DIMS(a) a/**/_l1, a/**/_h1
#define DIMDEC(a) a/**/_l1, a/**/_h1
#define DIMV(a) a/**/_l1:a/**/_h1
#define DIM1(a) a/**/_l1:a/**/_h1
#define ARG_L1(a) a/**/_l1
#define ARG_H1(a) a/**/_h1
#define DIMARG(a) a/**/(1)
#endif

#if (AMREX_SPACEDIM == 2)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_h1, a/**/_h2
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define DIMARG(a) a/**/(1),a/**/(2)
#endif

#if (AMREX_SPACEDIM == 3)
#define DIMS(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMDEC(a) a/**/_l1, a/**/_l2, a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3
#define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM1(a) a/**/_l1:a/**/_h1
#define DIM2(a) a/**/_l2:a/**/_h2
#define DIM3(a) a/**/_l3:a/**/_h3
#define DIM12(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2
#define DIM23(a) a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3
#define DIM13(a) a/**/_l1:a/**/_h1, a/**/_l3:a/**/_h3
#define ARG_L1(a) a/**/_l1
#define ARG_L2(a) a/**/_l2
#define ARG_L3(a) a/**/_l3
#define ARG_H1(a) a/**/_h1
#define ARG_H2(a) a/**/_h2
#define ARG_H3(a) a/**/_h3
#define DIMARG(a) a/**/(1),a/**/(2),a/**/(3)
#endif

#endif /*__STDC__==1*/

#endif /* ndef AMREX_XSDK */

#endif /*else of !defined(BL_LANG_FORT)*/

#endif /*else of __cplusplus*/
#endif /* __cplusplus */

#endif /*BL_ARRAYLIM_H*/
#endif /* AMREX_ARRAYLIM_H_ */
22 changes: 0 additions & 22 deletions Src/Base/AMReX_BC_TYPES.H
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,4 @@ enum mathematicalBndryTypes : int {
}
#endif

#ifndef AMREX_XSDK

#define BOGUS_BC (-666)

#define REFLECT_ODD (-1)
#define INT_DIR 0
#define REFLECT_EVEN 1
#define FOEXTRAP 2
#define EXT_DIR 3
#define HOEXTRAP 4
#define HOEXTRAPCC 5
#define EXT_DIR_CC 6

#define Interior 0
#define Inflow 1
#define Outflow 2
#define Symmetry 3
#define SlipWall 4
#define NoSlipWall 5

#endif

#endif
38 changes: 2 additions & 36 deletions Src/Base/AMReX_CONSTANTS.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,7 @@

#include <AMReX_REAL.H>


#ifdef BL_LANG_FORT

#ifndef AMREX_XSDK

#define bigreal BL_REAL_E(1.0,30)
#define zero BL_REAL(0.0)
#define one BL_REAL(1.0)
#define two BL_REAL(2.0)
#define three BL_REAL(3.0)
#define four BL_REAL(4.0)
#define five BL_REAL(5.0)
#define six BL_REAL(6.0)
#define seven BL_REAL(7.0)
#define eight BL_REAL(8.0)
#define nine BL_REAL(9.0)
#define ten BL_REAL(10.0)
#define twelve BL_REAL(12.0)
#define fifteen BL_REAL(15.0)
#define sixteen BL_REAL(16.0)
#define twenty BL_REAL(20.0)
#define seventy BL_REAL(70.0)
#define ninety BL_REAL(90.0)
#define tenth BL_REAL(0.1)
#define eighth BL_REAL(0.125)
#define sixth BL_REAL(0.16666666666666667)
#define fifth BL_REAL(0.2)
#define fourth BL_REAL(0.25)
#define third BL_REAL(0.33333333333333333)
#define half BL_REAL(0.5)
#define two3rd BL_REAL(0.66666666666666667)
#define Pi BL_REAL(3.1415926535897932)

#endif /* ndef AMREX_XSDK */

#endif /*BL_LANG_FORT*/
/* Maybe in the future we will add some constants here. */
/* If we do, make sure this file is Fortran safe. */

#endif /*BL_CONSTANTS_H*/
44 changes: 0 additions & 44 deletions Src/Base/AMReX_FILCC_1D.F90

This file was deleted.

Loading

0 comments on commit ba46b85

Please sign in to comment.