/* Copyright 2016-2020 Andrew Myers, Ann Almgren, Axel Huebl * David Grote, Jean-Luc Vay, Remi Lehe * Revathi Jambunathan, Weiqun Zhang * * This file is part of WarpX. * * License: BSD-3-Clause-LBNL */ #include "WarpX.H" #include "Initialization/WarpXAMReXInit.H" #include "Utils/MPIInitHelpers.H" #include "Utils/WarpXUtil.H" #include "Utils/WarpXProfilerWrapper.H" #include #include #include #include #include #include #include #include #if defined(AMREX_USE_MPI) # include #endif #if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) // cstddef: work-around for ROCm/rocFFT <=4.3.0 // https://github.com/ROCmSoftwarePlatform/rocFFT/blob/rocm-4.3.0/library/include/rocfft.h#L36-L42 # include # include #endif int main(int argc, char* argv[]) { using namespace amrex; utils::warpx_mpi_init(argc, argv); warpx_amrex_init(argc, argv); #if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) rocfft_setup(); #endif ParseGeometryInput(); ConvertLabParamsToBoost(); ReadBCParams(); #ifdef WARPX_DIM_RZ CheckGriddingForRZSpectral(); #endif { WARPX_PROFILE_VAR("main()", pmain); const auto strt_total = static_cast(amrex::second()); WarpX warpx; warpx.InitData(); warpx.Evolve(); //Print warning messages at the end of the simulation ablastr::warn_manager::GetWMInstance().PrintGlobalWarnings("THE END"); if (warpx.Verbose()) { auto end_total = static_cast(amrex::second()) - strt_total; ParallelDescriptor::ReduceRealMax(end_total, ParallelDescriptor::IOProcessorNumber()); Print() << "Total Time : " << end_total << '\n'; } WARPX_PROFILE_VAR_STOP(pmain); } #if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) rocfft_cleanup(); #endif Finalize(); #if defined(AMREX_USE_MPI) MPI_Finalize(); #endif }