Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/local_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: OP2_refactor
token: ${{ github.token }}

# 2. Debug info ---------------------------------------
- name: Print runner info
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Major changes since `v1.1.0` (high-level).
- `op_get_global_set_offset` return type changed from `int` to `idx_g_t`.
- `SafeLong` debug wrapper (`op2/include/SafeLong.h`, `op2/src/core/SafeLong.cpp`): optional arithmetic overflow/underflow checker for `idx_g_t`, enabled via `-DUSE_SAFELONG`.
- `op_arg_idx` / `op_arg_info` support in C (previously Fortran only); 2-dim map variant added for Fortran.
- `op_timing2`: improved timing and instrumentation API (`op2/include/op_timing2.h`).
- **`op_profile`**: tree-based timing and instrumentation API (`op2/include/op_profile.h`), replacing the interim `op_timing2` name. Functions: `op_profile_start`, `op_profile_enter`, `op_profile_enter_kernel`, `op_profile_next`, `op_profile_exit`, `op_profile_end`, `op_profile_output`, `op_profile_output_json`. Controlled by `OP_PROFILE_LEVEL` (0–3) and `OP_PROFILE_JSON_OUTPUT` environment variables. Fortran bindings provided with identical names.
- `op_mpi_probe_halo_index`, `op_force_part`: new MPI utility routines.
- `op_reset_data_ptr` `real(4)` variants added (Fortran).
- `op_get_global_set_offset` and Fortran bindings for `op_mpi_get_data`.
Expand Down
2 changes: 1 addition & 1 deletion CODEBASE_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ OP2-Common/
| `op_mpi_core.h` | MPI halo data structures: `halo_list`, import/export lists, MPI comms |
| `op_lib_mpi.h` | MPI runtime state: exec/non-exec halo lists, partition tables |
| `op_hdf5.h` | Parallel HDF5 I/O API |
| `op_timing2.h` | Tree-based timing instrumentation (JSON output, 4 detail levels) |
| `op_profile.h` | Tree-based timing instrumentation (JSON output, 4 detail levels) |
| `op_util.h` | Utility functions |
| `SafeLong.h` | Debug wrapper type `SafeLong` for `idx_g_t` — detects integer overflow/underflow at runtime (enabled via `-DUSE_SAFELONG`) |
| `fortran/` | Fortran C-interop headers |
Expand Down
9 changes: 4 additions & 5 deletions apps/c/aero/aero_hdf5/aero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ double gm1, gm1i, wtg1[2], xi1[2], Ng1[4], Ng1_xi[4], wtg2[4], Ng2[16],
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand Down Expand Up @@ -202,8 +203,7 @@ int main(int argc, char **argv) {
ncell = op_get_size(cells);
nbnodes = op_get_size(bnodes);

double cpu_t1, cpu_t2, wall_t1, wall_t2;
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Aero");

// main time-marching loop

Expand Down Expand Up @@ -324,8 +324,7 @@ int main(int argc, char **argv) {
}
}

op_timing_output();
op_timers(&cpu_t2, &wall_t2);
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_end();
op_profile_output();
op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/aero/aero_plain/aero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ double gm1, gm1i, wtg1[2], xi1[2], Ng1[4], Ng1_xi[4], wtg2[4], Ng2[16],
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand Down Expand Up @@ -263,8 +264,7 @@ int main(int argc, char **argv) {

op_diagnostic_output();

double cpu_t1, cpu_t2, wall_t1, wall_t2;
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Aero");

// main fixpoint iteration loop

Expand Down Expand Up @@ -387,8 +387,7 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_end();
op_profile_output();
op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/aero/aero_plain/aero_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ double gm1, gm1i, wtg1[2], xi1[2], Ng1[4], Ng1_xi[4], wtg2[4], Ng2[16],

#include "op_lib_mpi.h"
#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand Down Expand Up @@ -147,7 +148,6 @@ int main(int argc, char **argv) {
MPI_Comm_size(MPI_COMM_WORLD, &comm_size);

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

int *bnode, *cell, *g_bnode, *g_cell;
double *xm, *g_xm;
Expand Down Expand Up @@ -369,7 +369,7 @@ int main(int argc, char **argv) {

niter = 20;
// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Aero");
for (int iter = 1; iter <= niter; iter++) {

op_par_loop(res_calc, "res_calc", cells,
Expand Down Expand Up @@ -486,8 +486,7 @@ int main(int argc, char **argv) {
}
}
}
op_timers(&cpu_t2, &wall_t2);
op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_end();
op_profile_output();
op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/airfoil/airfoil_hdf5/dp/airfoil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ double gam, gm1, cfl, eps, mach, alpha, qinf[4];
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand Down Expand Up @@ -83,7 +84,6 @@ int main(int argc, char **argv) {
double rms;

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

// set constants and initialise flow field and residual
op_printf("initialising flow field \n");
Expand Down Expand Up @@ -158,7 +158,7 @@ int main(int argc, char **argv) {
int g_ncell = op_get_size(cells);

// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Airfoil");

// main time-marching loop

Expand Down Expand Up @@ -240,7 +240,7 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_profile_end();

// write given op_dat's indicated segment of data to a memory block in the
// order it was originally
Expand All @@ -262,7 +262,6 @@ int main(int argc, char **argv) {
// compress using
// ~/hdf5/bin/h5repack -f GZIP=9 new_grid.h5 new_grid_pack.h5

op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_output();
op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/airfoil/airfoil_hdf5/sp/airfoil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ float gam, gm1, cfl, eps, mach, alpha, qinf[4];
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand All @@ -76,7 +77,6 @@ int main(int argc, char **argv) {
float rms;

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

// set constants and initialise flow field and residual
op_printf("initialising flow field \n");
Expand Down Expand Up @@ -129,7 +129,7 @@ int main(int argc, char **argv) {
int g_ncell = op_get_size(cells);

// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Airfoil");

// main time-marching loop

Expand Down Expand Up @@ -210,9 +210,8 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_profile_end();

op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_output();
op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/airfoil/airfoil_plain/dp/airfoil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ double gam, gm1, cfl, eps, mach, alpha, qinf[4];
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand All @@ -79,7 +80,6 @@ int main(int argc, char **argv) {
double rms, maxerr;

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

// read in grid

Expand Down Expand Up @@ -212,7 +212,7 @@ int main(int argc, char **argv) {
op_diagnostic_output();

// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Airfoil");

// main time-marching loop

Expand Down Expand Up @@ -296,7 +296,7 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_profile_end();

// output the result dat array to files
op_print_dat_to_txtfile(p_q, "out_grid_seq.dat"); // ASCI
Expand All @@ -309,8 +309,7 @@ int main(int argc, char **argv) {
op_fetch_data_idx(p_q, q_part, 0, op_get_size(cells) - 1);
free(q_part);

op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_output();

op_exit();
}
13 changes: 4 additions & 9 deletions apps/c/airfoil/airfoil_plain/dp/airfoil_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ double gam, gm1, cfl, eps, mach, alpha, qinf[4];

#include "op_lib_mpi.h"
#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand Down Expand Up @@ -154,7 +155,6 @@ int main(int argc, char **argv) {
MPI_Comm_size(MPI_COMM_WORLD, &comm_size);

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

int *becell, *ecell, *bound, *bedge, *edge, *cell;
double *x, *q, *qold, *adt, *res;
Expand All @@ -164,7 +164,7 @@ int main(int argc, char **argv) {

/**------------------------BEGIN I/O and PARTITIONING -------------------**/

op_timers(&cpu_t1, &wall_t1);
op_profile_start("Airfoil");

/* read in grid from disk on root processor */
FILE *fp;
Expand Down Expand Up @@ -310,9 +310,6 @@ int main(int argc, char **argv) {
free(g_res);
}

op_timers(&cpu_t2, &wall_t2);
op_printf("Max total file read time = %f\n", wall_t2 - wall_t1);

/**------------------------END I/O and PARTITIONING -----------------------**/

// declare sets, pointers, datasets and global constants
Expand Down Expand Up @@ -361,7 +358,6 @@ int main(int argc, char **argv) {
op_partition("PARMETIS", "KWAY", cells, pecell, p_x);

// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);

niter = 1000;
for (int iter = 1; iter <= niter; iter++) {
Expand Down Expand Up @@ -440,7 +436,7 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_profile_end();

// output the result dat array to files
op_print_dat_to_txtfile(p_q, "out_grid_mpi.dat"); // ASCI
Expand All @@ -453,8 +449,7 @@ int main(int argc, char **argv) {
op_fetch_data_idx(p_q, q_part, 0, op_get_size(cells) - 1);
free(q_part);

op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_output();

op_exit();
}
9 changes: 4 additions & 5 deletions apps/c/airfoil/airfoil_plain/sp/airfoil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ float gam, gm1, cfl, eps, mach, alpha, qinf[4];
//

#include "op_seq.h"
#include <op_profile.h>

//
// kernel routines for parallel loops
Expand All @@ -79,7 +80,6 @@ int main(int argc, char **argv) {
float rms;

// timer
double cpu_t1, cpu_t2, wall_t1, wall_t2;

// read in grid

Expand Down Expand Up @@ -212,7 +212,7 @@ int main(int argc, char **argv) {
op_diagnostic_output();

// initialise timers for total execution wall time
op_timers(&cpu_t1, &wall_t1);
op_profile_start("Airfoil");

// main time-marching loop

Expand Down Expand Up @@ -291,9 +291,8 @@ int main(int argc, char **argv) {
}
}

op_timers(&cpu_t2, &wall_t2);
op_timing_output();
op_printf("Max total runtime = %f\n", wall_t2 - wall_t1);
op_profile_end();
op_profile_output();

op_exit();
}
Loading
Loading