Rosetta Utilities  2014.35
Classes | Namespaces | Macros | Enumerations | Functions | Variables
prof.hh File Reference
#include <utility/vector1.hh>
#include <basic/Tracer.hh>
#include <string>
#include <platform/types.hh>
#include <utility/Bound.fwd.hh>
#include <utility/Bound.hh>
#include <utility/down_cast.hh>
#include <utility/exit.hh>
#include <utility/vector1.fwd.hh>
#include <utility/vector1_bool.hh>
#include <utility/vectorL.fwd.hh>
#include <utility/vectorL.hh>
#include <utility/vectorL_Selector.hh>
#include <utility/vectorL_bool.hh>
#include <utility/file/FileName.fwd.hh>
#include <utility/file/FileName.hh>
#include <utility/file/PathName.fwd.hh>
#include <utility/file/PathName.hh>
#include <utility/keys/AutoKey.fwd.hh>
#include <utility/keys/AutoKey.hh>
#include <utility/keys/Key.fwd.hh>
#include <utility/keys/Key.hh>
#include <utility/keys/KeyLess.fwd.hh>
#include <utility/keys/KeyLookup.fwd.hh>
#include <utility/keys/KeyLookup.hh>
#include <utility/keys/NoClient.fwd.hh>
#include <utility/keys/NoClient.hh>
#include <utility/keys/SmallKeyVector.fwd.hh>
#include <utility/keys/SmallKeyVector.hh>
#include <utility/keys/UserKey.fwd.hh>
#include <utility/keys/VariantKey.fwd.hh>
#include <utility/keys/VariantKey.hh>
#include <utility/options/AnyOption.fwd.hh>
#include <utility/options/AnyOption.hh>
#include <utility/options/AnyVectorOption.fwd.hh>
#include <utility/options/AnyVectorOption.hh>
#include <utility/options/BooleanOption.fwd.hh>
#include <utility/options/BooleanOption.hh>
#include <utility/options/BooleanVectorOption.fwd.hh>
#include <utility/options/BooleanVectorOption.hh>
#include <utility/options/FileOption.fwd.hh>
#include <utility/options/FileOption.hh>
#include <utility/options/FileVectorOption.fwd.hh>
#include <utility/options/FileVectorOption.hh>
#include <utility/options/IntegerOption.fwd.hh>
#include <utility/options/IntegerOption.hh>
#include <utility/options/IntegerVectorOption.fwd.hh>
#include <utility/options/IntegerVectorOption.hh>
#include <utility/options/Option.fwd.hh>
#include <utility/options/Option.hh>
#include <utility/options/OptionCollection.fwd.hh>
#include <utility/options/OptionCollection.hh>
#include <utility/options/PathOption.fwd.hh>
#include <utility/options/PathOption.hh>
#include <utility/options/PathVectorOption.fwd.hh>
#include <utility/options/PathVectorOption.hh>
#include <utility/options/RealOption.fwd.hh>
#include <utility/options/RealOption.hh>
#include <utility/options/RealVectorOption.fwd.hh>
#include <utility/options/RealVectorOption.hh>
#include <utility/options/ScalarOption.fwd.hh>
#include <utility/options/ScalarOption.hh>
#include <utility/options/ScalarOption_T_.fwd.hh>
#include <utility/options/ScalarOption_T_.hh>
#include <utility/options/StringOption.fwd.hh>
#include <utility/options/StringOption.hh>
#include <utility/options/StringVectorOption.fwd.hh>
#include <utility/options/StringVectorOption.hh>
#include <utility/options/VariantOption.fwd.hh>
#include <utility/options/VariantOption.hh>
#include <utility/options/VectorOption.fwd.hh>
#include <utility/options/VectorOption.hh>
#include <utility/options/VectorOption_T_.fwd.hh>
#include <utility/options/VectorOption_T_.hh>
#include <utility/options/mpi_stderr.hh>
#include <utility/options/keys/AnyOptionKey.fwd.hh>
#include <utility/options/keys/AnyOptionKey.hh>
#include <utility/options/keys/AnyVectorOptionKey.fwd.hh>
#include <utility/options/keys/AnyVectorOptionKey.hh>
#include <utility/options/keys/BooleanOptionKey.fwd.hh>
#include <utility/options/keys/BooleanOptionKey.hh>
#include <utility/options/keys/BooleanVectorOptionKey.fwd.hh>
#include <utility/options/keys/BooleanVectorOptionKey.hh>
#include <utility/options/keys/FileOptionKey.fwd.hh>
#include <utility/options/keys/FileOptionKey.hh>
#include <utility/options/keys/FileVectorOptionKey.fwd.hh>
#include <utility/options/keys/FileVectorOptionKey.hh>
#include <utility/options/keys/IntegerOptionKey.fwd.hh>
#include <utility/options/keys/IntegerOptionKey.hh>
#include <utility/options/keys/IntegerVectorOptionKey.fwd.hh>
#include <utility/options/keys/IntegerVectorOptionKey.hh>
#include <utility/options/keys/OptionKey.fwd.hh>
#include <utility/options/keys/OptionKey.hh>
#include <utility/options/keys/OptionKeys.hh>
#include <utility/options/keys/PathOptionKey.fwd.hh>
#include <utility/options/keys/PathOptionKey.hh>
#include <utility/options/keys/PathVectorOptionKey.fwd.hh>
#include <utility/options/keys/PathVectorOptionKey.hh>
#include <utility/options/keys/RealOptionKey.fwd.hh>
#include <utility/options/keys/RealOptionKey.hh>
#include <utility/options/keys/RealVectorOptionKey.fwd.hh>
#include <utility/options/keys/RealVectorOptionKey.hh>
#include <utility/options/keys/ScalarOptionKey.fwd.hh>
#include <utility/options/keys/ScalarOptionKey.hh>
#include <utility/options/keys/StringOptionKey.fwd.hh>
#include <utility/options/keys/StringOptionKey.hh>
#include <utility/options/keys/StringVectorOptionKey.fwd.hh>
#include <utility/options/keys/StringVectorOptionKey.hh>
#include <utility/options/keys/VectorOptionKey.fwd.hh>
#include <utility/options/keys/VectorOptionKey.hh>
#include <utility/options/keys/all.hh>
#include <ObjexxFCL/TypeTraits.hh>
#include <ObjexxFCL/char.functions.hh>
#include <ObjexxFCL/string.functions.hh>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include <iomanip>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <time.h>
#include <utility>
#include <vector>
#include <basic/options/keys/OptionKeys.hh>
#include <basic/options/keys/run.OptionKeys.gen.hh>
#include <basic/options/option.hh>

Classes

class  basic::ProfileThis
 
class  basic::DynamicProfileThis
 

Namespaces

 basic
 

Macros

#define PROF_START(expr)   ( prof_start_function_body( expr) )
 
#define PROF_STOP(expr)   ( prof_stop_function_body( expr ) )
 

Enumerations

enum  basic::ProfTag {
  basic::TEST1 = 1, basic::TEST2, basic::TEST3, basic::TEST4,
  basic::TEST5, basic::ATOM_TREE_UPDATE_INTERNAL_COORDS, basic::ATOM_TREE_UPDATE_XYZ_COORDS, basic::UPDATE_RESIDUE_TORSIONS,
  basic::UPDATE_RESIDUE_COORDINATES, basic::ROTAMER_TRIALS, basic::PACK_ROTAMERS, basic::UPDATE_RESIDUE_NEIGHBORS,
  basic::SETUP_NBLIST, basic::CONSTRAINT_SCORE, basic::CONSTRAINT_SET_COPY, basic::SCORE,
  basic::SCORE_SETUP, basic::SCORE_FINALIZE, basic::SCORE_ONEBODY_ENERGIES, basic::SCORE_NEIGHBOR_ENERGIES,
  basic::SCORE_LONG_RANGE_ENERGIES, basic::SCORE_DOT, basic::SCORE_END_NOTIFY, basic::SCORE_BEGIN_NOTIFY,
  basic::VDW_ENERGY, basic::ENERGY_ENVPAIR_POTENTIAL, basic::SECONDARY_STRUCTURE_ENERGY, basic::SECONDARY_STRUCTURE_SSPAIR_ENERGY,
  basic::SECONDARY_STRUCTURE_HSPAIR_ENERGY, basic::SECONDARY_STRUCTURE_SHEETS_FROM_DIMERS_ENERGY, basic::POSE_COPY, basic::ENERGY_GRAPH_COPY,
  basic::ENERGIES_COPY, basic::CONFORMATION_DETECT_DISULF, basic::CONFORMATION_FIX_DISULF, basic::CONFORMATION_COPY,
  basic::CHEMICAL_MAKE_POSE, basic::CCD_CLOSE, basic::FUNC, basic::DFUNC,
  basic::GET_ENERGIES, basic::SIMANNEALING, basic::INSERT_FRAGS, basic::MC_ACCEPT,
  basic::GB_SETUP_FOR_PACKING, basic::GB_GET_ALL_BORN_RADII, basic::GEN_BORN_ROTAMER_PAIR_ENERGIES, basic::GEN_BORN_ROTAMER_BACKGROUND_ENERGIES,
  basic::FACTS_SETUP_FOR_PACKING, basic::FACTS_GET_ALL_BORN_RADII, basic::FACTS_ROTAMER_PAIR_ENERGIES, basic::FACTS_ROTAMER_BACKGROUND_ENERGIES,
  basic::ABINITIO, basic::STAGE1, basic::STAGE2, basic::STAGE3,
  basic::STAGE4, basic::STAGE5, basic::FRAGMENT_MOVER, basic::MINMOVER_APPLY,
  basic::BACKRUB_MOVER, basic::FIND_SUGAR_AND_SUITE_FRAGS_I, basic::FIND_SUGAR_AND_SUITE_FRAGS_II, basic::MAKE_BASE_PAIR_MOVE,
  basic::MAKE_BASE_STEP_MOVE, basic::RG, basic::RG_LOCAL, basic::SEQUENCE_COMPARISON,
  basic::KDTREE_CONSTRUCT, basic::KDTREE_SEARCH, basic::CONSTRUCT_DISTANCE_MATRIX, basic::DALPHABALL,
  basic::DALPHABALL_DERIV, basic::MPI_FILE_BUF, basic::JD2, basic::JD2_OUTPUT,
  basic::JD2_SILENT_OUTPUTTER, basic::JD2_INIT_MOVER, basic::ARCHIVE_SYNC_BATCHES, basic::ARCHIVE_JOBSCOMPLETE,
  basic::ARCHIVE_BLOCK_FILE, basic::SAVE_ARCHIVE, basic::ARCHIVE_CRITICAL_JOBSCOMPLETE, basic::ARCHIVE_GEN_BATCH,
  basic::ARCHIVE_READ_DECOYS, basic::ARCHIVE_EVAL_DECOYS, basic::ARCHIVE_FILL_POSE, basic::ARCHIVE_SCORE_POSE,
  basic::ARCHIVE_EVALUATORS, basic::MPI_JD2_WAITS_FOR_ARCHIVE, basic::MPI_NOTIFY_ARCHIVE, basic::SILENT_READ_TAG_TEST,
  basic::CA_RMSD_EVALUATION, basic::CA_DME_EVALUATION, basic::TRUNCATED_SCORE_EVALUATOR, basic::SAXS,
  basic::FRAGMENTPICKING_CS_SCORE, basic::FRAGMENTPICKING_PROFILE_SCORE, basic::FRAGMENTPICKING_PROFILE_CAHING, basic::FRAGMENTPICKING_SECONDARY_SCORE,
  basic::FRAGMENTPICKING_READ_VALL, basic::FRAGMENTPICKING, basic::FRAGMENTPICKING_CANDIDATES_COLLECTING, basic::FRAGMENTPICKING_ATOMPAIR_SCORE,
  basic::FRAGMENTPICKING_PHIPSI_SCORE, basic::FRAGMENTPICKING_DIHEDRALCONSTR_SCORE, basic::MPICANONICALSAMPLING, basic::MPIPOOLCOMMUNICATION,
  basic::MPICOMMCREATION, basic::MPIBARRIER, basic::MPIBARRIER_BEGIN, basic::MPIBARRIER_END,
  basic::MPI_GATHER_BARRIER, basic::FARRAY_MANIPULATION, basic::MPI_SLAVE_REPORT_NEW_COORDS, basic::MPI_SLAVE_REPORT_SIZES,
  basic::MPI_SEND_UPDATE, basic::MPI_SYNC_POOL_DIFF, basic::MPI_SEND_ACCEPTED, basic::POOL_RMSD_ADD_STRUCTURE,
  basic::POOL_RMSD_EVALUATE, basic::POOL_RMSD_MASTER_EVALUATE, basic::MPI_MASTER_BCAST_COORDS, basic::MPI_MASTER_BCAST_WINNING_RANKS,
  basic::MPI_MASTER_BCAST_WINNING_STRUCTURES, basic::MPI_MASTER_BCAST_NEW_COMM_SIZE, basic::MPI_MASTER_BCAST_NEW_POOL_RANKS, basic::MPI_MASTER_BCAST_NUM_STRUCTURES_TO_ADD,
  basic::MPI_POOL_MASTER_THINKS, basic::MPI_POOL_SLAVE_THINKS, basic::SIDECHAINMCMOVER, basic::SIMPLEINTGRAPH,
  basic::SIDECHAINMOVER, basic::INITIALIZE, basic::COMM_REDUCE_SIZE, basic::CANONICALMOVER_WRITE_TO_FILE,
  basic::WRITE_TO_FILE, basic::CHECK_COMM_SIZE, basic::APPLY_MOVE, basic::DATA_STORAGE,
  basic::MASTER_PROCESS_NEW_STRUCTURES, basic::COPY_COORDS, basic::APPLY_SC_MOVE, basic::APPLY_BB_MOVE,
  basic::HIERARCHICAL_EVALUATE, basic::HIERARCHICAL_ADD, basic::LOAD_HIERARCHY, basic::HIERARCHY_SEND_COORDS,
  basic::HIERARCHY_RECV_COORDS, basic::INITIALIZE_HIERARCHY, basic::HIERARCHY_SETUP_TO_RECV, basic::WRITE_DECOYS_TO_HIERARCHY,
  basic::HIERARCHY_GET_NEXT_CANDIDATE, basic::HIERARCHY_FIND_ADDRESS, basic::MPIH_EVAL_CHECK_PROGRESS, basic::MPIH_EVAL_COMMUNICATE_NEW,
  basic::MPIH_EVAL_AGAINST_NBR, basic::MPIH_PREPARE_WRITE_STRUCTURES, basic::MPIH_UPDATE_EVAL, basic::MPIH_ADD_FIRST_STRUCTURE,
  basic::MPIH_WRITE_STRUCT, basic::FINALIZE, basic::SORT_POOL, basic::HIERARCHICAL_FIND,
  basic::HIERARCHICAL_FIND_ADDRESS, basic::HIERARCHICAL_SORT_ADDRESSES, basic::HIERARCHICAL_ROUND, basic::HIERARCHICAL_POOL_SIZE,
  basic::HIERARCHICAL_ADD_ELEM_TO_CACHE, basic::LIB_FULL_PATH, basic::NOESY_ASSIGN_TOTAL, basic::NOESY_ASSIGN_INITIAL,
  basic::NOESY_ASSIGN_DIAGONAL, basic::NOESY_ASSIGN_CHEMSHIFT, basic::NOESY_ASSIGN_SYMMETRY, basic::NOESY_ASSIGN_DISTANCE,
  basic::NOESY_ASSIGN_DECOY_COMP, basic::NOESY_ASSIGN_NETWORK_TOTAL, basic::NOESY_ASSIGN_NETWORK, basic::NOESY_ASSIGN_NETWORK_FIND_RAW_ASSIGN,
  basic::NOESY_ASSIGN_NETWORK_FILL_COV_GAMMA, basic::NOESY_ASSIGN_NETWORK_RETRIEVE_ASSIGN, basic::NOESY_ASSIGN_NETWORK_COMPUTE_NK, basic::NOESY_ASSIGN_NETWORK_PEAK_COUNT,
  basic::NOESY_ASSIGN_NETWORK_PEAK_COUNT_EVAL, basic::NOESY_ASSIGN_NETWORK_INVALIDATE_SEQ_NOE, basic::NOESY_ASSIGN_UPDATE_PEAK_VOL, basic::NOESY_ASSIGN_CALIBRATE,
  basic::NOESY_ASSIGN_ELIMINATE, basic::NOESY_ASSIGN_GEN_CST, basic::NOESY_ASSIGN_WRITE_CST, basic::NOESY_ASSIGN_MAP2CB,
  basic::NOESY_ASSIGN_CP_GEN_CST, basic::NOESY_ASSIGN_PA_GEN_CST, basic::NOESY_ASSIGN_NMR_STRING, basic::NOESY_ASSIGN_REQUIRES_CB_MAPPING,
  basic::NOESY_ASSIGN_MAP2CB_NEW, basic::NOESY_ASSIGN_WRITE_ASSIGNMENTS, basic::NOESY_ASSIGN_READ_INPUT, basic::NOESY_ASSIGN_DIST_INIT,
  basic::NOESY_ASSIGN_DIST_PREP_SCORE, basic::NOESY_ASSIGN_DIST_SET_COMPABILITY_SCORE, basic::NOESY_ASSIGN_DIST_APPLY, basic::NOESY_ASSIGN_DIST_MAKE_POSE,
  basic::NOESY_ASSIGN_DIST_CST_EVAL, basic::NOESY_ASSIGN_DIST_CST_CAST, basic::SILENT_FILL_POSE, basic::SILENT_SET_POSE_COORDS,
  basic::SILENT_FILL_STRUCT, basic::TOTAL, basic::n_prof_tags = TOTAL
}
 

Functions

void basic::prof_start_function_body (ProfTag const tag)
 
void basic::prof_stop_function_body (ProfTag const tag)
 
void basic::prof_reset ()
 
void basic::prof_show ()
 
void basic::show_time (basic::Tracer &tr, std::string const &msg)
 

Variables

double const basic::clock_factor
 
clock_t const basic::SHRINK_FACTOR
 
bool basic::show_time_on_cerr
 print "TIME_STAMP: Www Mmm dd hh:mm:ss yyyy msg" on tr.Error and on std::cerr (if boolean is true) More...
 

Detailed Description

Author

Macro Definition Documentation

#define PROF_START (   expr)    ( prof_start_function_body( expr) )

not intended for profiling inside tight loops the clock() routine currently being used has fairly crappy resolution and it will introduce some small overhead with the function calls and the if-check even if not using -profile on the command line

you can wrap it around large-ish chunks of code, like fullatom_energy or rotamer_trials...

A simple setup for timing code fragments. Probably not optimal timing functions – I'm open to suggestions.

looks like (see eg fullatom_energy or scorefxn)

PROF_START( prof::TAG );

<function call>="">

PROF_STOP( prof::TAG );

where TAG is in the enum "Prof_tag" below (feel free to add new ones) also add to tag2string if you want friendly output.

PROF_STOP checks the time and increments the total time assigned to TAG

  1. later on, in your simulation code you can do:

prof_reset();

– miscellaneous simulation –

prof_show();

The final call to prof::show() will display the time usage measured by all the PROF_* calls between reset() and show()

Referenced by basic::prof_reset(), basic::prof_show(), and basic::ProfileThis::ProfileThis().

#define PROF_STOP (   expr)    ( prof_stop_function_body( expr ) )