Skip to content

Commit b7c660a

Browse files
committed
Added amrex profiling instermentation.
1 parent d0f7a80 commit b7c660a

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

swm_AMReX/GNUmakefile

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ USE_OMP = FALSE
88
COMP = gnu
99
DIM = 2
1010

11+
TINY_PROFILE = FALSE
12+
PROFILE = FALSE
13+
1114
LIBRARIES += -lstdc++ -lm
1215

1316
#USE_HDF5=TRUE

swm_AMReX/main.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ int main (int argc, char* argv[])
1414
{
1515
amrex::Initialize(argc,argv);
1616
{
17+
BL_PROFILE("main()");
1718

1819
// ***********************************************************************
1920
// Simulation Parameters Set Via Input File
@@ -138,6 +139,8 @@ int main (int argc, char* argv[])
138139

139140
for (int time_step = 1; time_step <= n_time_steps; ++time_step)
140141
{
142+
BL_PROFILE("TimeSteppingLoop()");
143+
141144
// Sets: cu, cv, h, z
142145
UpdateIntermediateVariables(dx, dy, geom,
143146
p, u, v,

swm_AMReX/plotting_utils/GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AMREX_HOME ?= PROVIDE_YOUR_OWN_PATH_TO_AMREX_HERE
33
HDF5_HOME ?= PROVIDE_YOUR_OWN_PATH_TO_HDF5_HERE
44

55
DEBUG = FALSE
6-
USE_MPI = TRUE # Dont really nedd MPI for the program but I am using an hdf5 that needs MPI
6+
USE_MPI = TRUE # Dont really need MPI for the program but I am using an hdf5 that needs MPI
77
USE_OMP = FALSE
88
COMP = gnu
99
DIM = 2

swm_AMReX/swm_mini_app_utils.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void DefineCellCenteredMultiFab(const int nx, const int ny,
6262
// assigns processor to each box in the box array
6363
amrex::DistributionMapping distribution_mapping(cell_box_array);
6464

65+
//amrex::Print() << "max_chunk_size: " << max_chunk_size << std::endl;
66+
//amrex::Print() << "cell_box_array: " << cell_box_array << std::endl;
67+
//amrex::Print() << "distribution mapping: " << distribution_mapping << std::endl;
68+
6569
// number of components for each array
6670
int Ncomp = 1;
6771

@@ -324,6 +328,8 @@ void UpdateIntermediateVariables(amrex::Real dx, amrex::Real dy, const amrex::Ge
324328
const amrex::MultiFab& p, const amrex::MultiFab& u, const amrex::MultiFab& v,
325329
amrex::MultiFab& cu, amrex::MultiFab& cv, amrex::MultiFab& h, amrex::MultiFab& z)
326330
{
331+
BL_PROFILE("UpdateIntermediateVariables()");
332+
327333
const double fsdx = 4.0/dx;
328334
const double fsdy = 4.0/dy;
329335

@@ -363,6 +369,7 @@ void UpdateNewVariables(const double dx, const double dy, const double tdt, cons
363369
const amrex::MultiFab& cu, const amrex::MultiFab& cv, const amrex::MultiFab& h, const amrex::MultiFab& z,
364370
amrex::MultiFab& p_new, amrex::MultiFab& u_new, amrex::MultiFab& v_new)
365371
{
372+
BL_PROFILE("UpdateNewVariables()");
366373

367374
// defined here because tdt changes after first time step
368375
const double tdtsdx = tdt / dx;
@@ -410,6 +417,7 @@ void UpdateOldVariables(const double alpha, const int time_step, const amrex::Ge
410417
const amrex::MultiFab& p_new, const amrex::MultiFab& u_new, const amrex::MultiFab& v_new,
411418
amrex::MultiFab& p_old, amrex::MultiFab& u_old, amrex::MultiFab& v_old)
412419
{
420+
BL_PROFILE("UpdateOldVariables()");
413421
if (time_step > 0) {
414422
for (amrex::MFIter mfi(p); mfi.isValid(); ++mfi)
415423
{
@@ -455,6 +463,7 @@ void UpdateVariables(const amrex::Geometry& geom,
455463
const amrex::MultiFab& u_new, const amrex::MultiFab& v_new, const amrex::MultiFab& p_new,
456464
amrex::MultiFab& u, amrex::MultiFab& v, amrex::MultiFab& p)
457465
{
466+
BL_PROFILE("UpdateVariables()");
458467
Copy(u_new, u);
459468
Copy(v_new, v);
460469
Copy(p_new, p);

0 commit comments

Comments
 (0)