Rosetta 3.3
Classes | Namespaces | Defines | Enumerations | Functions | Variables
src/basic/prof.hh File Reference
#include <utility/vector1.hh>
#include <string>
#include <platform/types.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 <algorithm>
#include <cassert>
#include <cstddef>
#include <vector>
#include <time.h>
#include <basic/options/option.hh>
#include <basic/options/keys/run.OptionKeys.gen.hh>

Classes

class  basic::ProfileThis

Namespaces

namespace  basic

Defines

#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::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::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::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 ()

Variables

double const basic::clock_factor
clock_t const basic::SHRINK_FACTOR

Detailed Description

Author:

Define 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

2. 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 ) )
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines