XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
simpleFOM.hpp
Go to the documentation of this file.
1 #ifndef SIMPLEFOM_HPP
2 #define SIMPLEFOM_HPP
3 
4 #include <iostream>
5 #include "plasma.hpp"
6 #include "globals.hpp"
7 #include "timer_macro.hpp"
8 
9 extern "C" int get_sml_mype();
10 extern "C" int get_sml_totalpe();
11 
12 // Simple performance figure-of-merit (FOM)
13 
14 template <class DeviceType>
16 {
17  double loop_time = 0;
18  GPTLget_wallclock("MAIN_LOOP", -1, &loop_time);
19  double total_ptl = plasma.all_species[0].n_ptl * pol_decomp.mpi.nranks; // 0 = electrons; assume all species have same particle count
20  if (is_rank_zero()) {
21  std::cout << "SimpleFOM = 1/(loop_time/(total_ptl * sml.mstep)) = 1/(" << loop_time << "/(" << total_ptl << " * " << sml.mstep << ")) = "
22  << 1.0/(loop_time/(total_ptl * sml.mstep)) << std::endl;
23  }
24 
25  return;
26 }
27 
28 #endif
bool is_rank_zero()
Definition: globals.hpp:26
Definition: sml.hpp:8
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1235
void simpleFOM(Plasma &plasma, DomainDecomposition< DeviceType > &pol_decomp, Simulation< DeviceType > &sml)
Definition: simpleFOM.hpp:15
int get_sml_totalpe()
std::vector< Species< DeviceType > > all_species
Every particle species in the simulation.
Definition: plasma.hpp:24
int get_sml_mype()
int mstep
Max number of time steps.
Definition: sml.hpp:46
Definition: plasma.hpp:15