NAMD
Classes | Macros | Typedefs | Functions | Variables
Controller.C File Reference
#include "InfoStream.h"
#include "converse.h"
#include "memusage.h"
#include "Node.h"
#include "Molecule.h"
#include "SimParameters.h"
#include "Controller.h"
#include "ReductionMgr.h"
#include "CollectionMaster.h"
#include "Output.h"
#include "strlib.h"
#include "BroadcastObject.h"
#include "NamdState.h"
#include "ScriptTcl.h"
#include "Broadcasts.h"
#include "LdbCoordinator.h"
#include "Thread.h"
#include <math.h>
#include <signal.h>
#include "NamdOneTools.h"
#include "PatchMap.h"
#include "PatchMap.inl"
#include "Random.h"
#include "imd.h"
#include "IMDOutput.h"
#include "BackEnd.h"
#include <fstream>
#include <iomanip>
#include <errno.h>
#include "qd.h"
#include "Debug.h"

Go to the source code of this file.

Classes

class  PressureProfileReduction
 
struct  Controller::CthThreadWrapper
 
struct  minpoint
 

Macros

#define MIN_DEBUG_LEVEL   3
 
#define XXXBIGREAL   1.0e32
 
#define AVGXY(T)
 
#define CALCULATE
 
#define MOVETO(X)
 
#define PRINT_BRACKET
 
#define LIMIT_SCALING(VAR, MIN, MAX, FLAG)
 
#define AVGXY(T)
 
#define CALLBACKDATA(LABEL, VALUE)   labels << (LABEL) << " "; values << (VALUE) << " ";
 
#define CALLBACKLIST(LABEL, VALUE)   labels << (LABEL) << " "; values << "{" << (VALUE) << "} ";
 

Typedefs

typedef void(* namd_sighandler_t) (int)
 

Functions

static double namdWallTimer ()
 
static char * FEPTITLE (int X)
 
static char * FEPTITLE_BACK (int X)
 
static char * FEPTITLE2 (int X)
 
static char * TITITLE (int X)
 
static void my_sigint_handler (int sig)
 
static char * FORMAT (BigReal X, int decimal=4)
 
static char * FORMAT (const char *X, int decimal=4)
 
static char * ETITLE (int X)
 

Variables

int eventEndOfTimeStep
 
static int gotsigint = 0
 

Macro Definition Documentation

◆ AVGXY [1/2]

#define AVGXY (   T)
Value:
T.xy = T.yx = 0; T.xx = T.yy = 0.5 * ( T.xx + T.yy );\
T.xz = T.zx = T.yz = T.zy = 0.5 * ( T.xz + T.yz );

Referenced by Controller::calcPressure(), and Controller::Controller().

◆ AVGXY [2/2]

#define AVGXY (   T)
Value:
T.xy = T.yx = 0; T.xx = T.yy = 0.5 * ( T.xx + T.yy );\
T.xz = T.zx = T.yz = T.zy = 0.5 * ( T.xz + T.yz );

◆ CALCULATE

#define CALCULATE
Value:
printMinimizeEnergies(step); \
outputExtendedSystem(step); \
rebalanceLoad(step); \
if ( step == numberOfSteps ) return; \
else ++step;

Definition at line 724 of file Controller.C.

Referenced by Controller::minimize().

◆ CALLBACKDATA

#define CALLBACKDATA (   LABEL,
  VALUE 
)    labels << (LABEL) << " "; values << (VALUE) << " ";

◆ CALLBACKLIST

#define CALLBACKLIST (   LABEL,
  VALUE 
)    labels << (LABEL) << " "; values << "{" << (VALUE) << "} ";

◆ LIMIT_SCALING

#define LIMIT_SCALING (   VAR,
  MIN,
  MAX,
  FLAG 
)
Value:
{\
if ( VAR < (MIN) ) { VAR = (MIN); FLAG = 1; } \
if ( VAR > (MAX) ) { VAR = (MAX); FLAG = 1; } }

Definition at line 1353 of file Controller.C.

Referenced by Controller::berendsenPressure().

◆ MIN_DEBUG_LEVEL

#define MIN_DEBUG_LEVEL   3

Definition at line 72 of file Controller.C.

◆ MOVETO

#define MOVETO (   X)
Value:
if ( step == numberOfSteps ) { \
if ( minVerbose ) { iout << "LINE MINIMIZER: RETURNING TO " << mid.x << " FROM " << last.x << "\n" << endi; } \
if ( newDir || (mid.x-last.x) ) { \
broadcast->minimizeCoefficient.publish(minSeq++,mid.x-last.x); \
} else { \
broadcast->minimizeCoefficient.publish(minSeq++,0.); \
broadcast->minimizeCoefficient.publish(minSeq++,0.); \
min_reduction->require(); \
broadcast->minimizeCoefficient.publish(minSeq++,0.); \
} \
enqueueCollections(step); \
CALCULATE \
} else if ( (X)-last.x ) { \
broadcast->minimizeCoefficient.publish(minSeq++,(X)-last.x); \
newDir = 0; \
last.x = (X); \
enqueueCollections(step); \
CALCULATE \
last.u = min_energy; \
last.dudx = -1. * min_f_dot_v; \
last.noGradient = min_huge_count; \
if ( minVerbose ) { \
iout << "LINE MINIMIZER: POSITION " << last.x << " ENERGY " << last.u << " GRADIENT " << last.dudx; \
if ( last.noGradient ) iout << " HUGECOUNT " << last.noGradient; \
iout << "\n" << endi; \
} \
}
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define X
Definition: msm_defn.h:29
#define iout
Definition: InfoStream.h:51

Definition at line 731 of file Controller.C.

Referenced by Controller::minimize().

◆ PRINT_BRACKET

#define PRINT_BRACKET
Value:
iout << "LINE MINIMIZER BRACKET: DX " \
<< (mid.x-lo.x) << " " << (hi.x-mid.x) << \
" DU " << (mid.u-lo.u) << " " << (hi.u-mid.u) << " DUDX " << \
lo.dudx << " " << mid.dudx << " " << hi.dudx << " \n" << endi;
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define iout
Definition: InfoStream.h:51

Referenced by Controller::minimize().

◆ XXXBIGREAL

#define XXXBIGREAL   1.0e32

Definition at line 76 of file Controller.C.

Referenced by Controller::Controller(), and Controller::printEnergies().

Typedef Documentation

◆ namd_sighandler_t

typedef void(* namd_sighandler_t) (int)

Definition at line 511 of file Controller.C.

Function Documentation

◆ ETITLE()

static char* ETITLE ( int  X)
static

Definition at line 1855 of file Controller.C.

References X.

Referenced by Controller::printEnergies().

1856 {
1857  static char tmp_string[21];
1858  sprintf(tmp_string,"ENERGY: %7d",X);
1859  return tmp_string;
1860 }
#define X
Definition: msm_defn.h:29

◆ FEPTITLE()

static char* FEPTITLE ( int  X)
static

Definition at line 79 of file Controller.C.

References X.

Referenced by Controller::writeFepEnergyData().

80 {
81  static char tmp_string[21];
82  sprintf(tmp_string, "FepEnergy: %6d ",X);
83  return tmp_string;
84 }
#define X
Definition: msm_defn.h:29

◆ FEPTITLE2()

static char* FEPTITLE2 ( int  X)
static

Definition at line 93 of file Controller.C.

References X.

Referenced by Controller::printEnergies().

94 {
95  static char tmp_string[21];
96  sprintf(tmp_string, "FEP: %7d",X);
97  return tmp_string;
98 }
#define X
Definition: msm_defn.h:29

◆ FEPTITLE_BACK()

static char* FEPTITLE_BACK ( int  X)
static

Definition at line 86 of file Controller.C.

References X.

Referenced by Controller::writeFepEnergyData().

87 {
88  static char tmp_string[21];
89  sprintf(tmp_string, "FepE_back: %6d ",X);
90  return tmp_string;
91 }
#define X
Definition: msm_defn.h:29

◆ FORMAT() [1/2]

static char* FORMAT ( BigReal  X,
int  decimal = 4 
)
static

Definition at line 1830 of file Controller.C.

References X.

Referenced by Controller::outputTiEnergy(), Controller::printEnergies(), Controller::writeFepEnergyData(), and Controller::writeTiEnergyData().

1831 {
1832  static char tmp_string[50];
1833  static char format_string[50];
1834  const double maxnum = 99999999999.9999;
1835  if ( X > maxnum ) X = maxnum;
1836  if ( X < -maxnum ) X = -maxnum;
1837 
1838  int whole = (decimal <= 4 ? 14 : 10 + decimal);
1839  sprintf(format_string, " %%%d.%df", whole, decimal);
1840  sprintf(tmp_string, format_string, X);
1841  return tmp_string;
1842 }
#define X
Definition: msm_defn.h:29

◆ FORMAT() [2/2]

static char* FORMAT ( const char *  X,
int  decimal = 4 
)
static

Definition at line 1844 of file Controller.C.

References X.

1845 {
1846  static char tmp_string[50];
1847  static char format_string[50];
1848 
1849  int width = (decimal <= 4 ? 14 : 10 + decimal);
1850  sprintf(format_string, " %%%ds", width);
1851  sprintf(tmp_string, format_string, X);
1852  return tmp_string;
1853 }
#define X
Definition: msm_defn.h:29

◆ my_sigint_handler()

static void my_sigint_handler ( int  sig)
static

Definition at line 507 of file Controller.C.

References gotsigint.

507  {
508  if (sig == SIGINT) gotsigint = 1;
509 }
static int gotsigint
Definition: Controller.C:506

◆ namdWallTimer()

static double namdWallTimer ( )
static

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 57 of file Controller.C.

Referenced by Controller::cycleBarrier(), Controller::printEnergies(), Controller::printTiming(), Controller::rebalanceLoad(), Controller::resumeAfterTraceBarrier(), and Controller::traceBarrier().

57  {
58  return CmiWallTimer();
59 }

◆ TITITLE()

static char* TITITLE ( int  X)
static

Definition at line 100 of file Controller.C.

References X.

Referenced by Controller::printEnergies(), and Controller::writeTiEnergyData().

101 {
102  static char tmp_string[21];
103  sprintf(tmp_string, "TI: %7d",X);
104  return tmp_string;
105 }
#define X
Definition: msm_defn.h:29

Variable Documentation

◆ eventEndOfTimeStep

int eventEndOfTimeStep

Definition at line 293 of file Node.C.

Referenced by Controller::integrate().

◆ gotsigint

int gotsigint = 0
static

Definition at line 506 of file Controller.C.

Referenced by my_sigint_handler().