NAMD
Classes | Macros | Typedefs | Functions | Variables
Controller.C File Reference
#include "InfoStream.h"
#include "common.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 "PatchData.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 739 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 1366 of file Controller.C.

Referenced by Controller::berendsenPressure().

◆ MIN_DEBUG_LEVEL

#define MIN_DEBUG_LEVEL   3

Definition at line 69 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 746 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 73 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 528 of file Controller.C.

Function Documentation

◆ ETITLE()

static char* ETITLE ( int  X)
static

Definition at line 1833 of file Controller.C.

References X.

Referenced by Controller::printEnergies().

1834 {
1835  static char tmp_string[21];
1836  sprintf(tmp_string,"ENERGY: %7d",X);
1837  return tmp_string;
1838 }
#define X
Definition: msm_defn.h:29

◆ FEPTITLE()

static char* FEPTITLE ( int  X)
static

Definition at line 76 of file Controller.C.

References X.

Referenced by Controller::writeFepEnergyData().

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

◆ FEPTITLE2()

static char* FEPTITLE2 ( int  X)
static

Definition at line 90 of file Controller.C.

References X.

Referenced by Controller::printEnergies().

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

◆ FEPTITLE_BACK()

static char* FEPTITLE_BACK ( int  X)
static

Definition at line 83 of file Controller.C.

References X.

Referenced by Controller::writeFepEnergyData().

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

◆ FORMAT() [1/2]

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

Definition at line 1808 of file Controller.C.

References X.

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

1809 {
1810  static char tmp_string[50];
1811  static char format_string[50];
1812  const double maxnum = 99999999999.9999;
1813  if ( X > maxnum ) X = maxnum;
1814  if ( X < -maxnum ) X = -maxnum;
1815 
1816  int whole = (decimal <= 4 ? 14 : 10 + decimal);
1817  sprintf(format_string, " %%%d.%df", whole, decimal);
1818  sprintf(tmp_string, format_string, X);
1819  return tmp_string;
1820 }
#define X
Definition: msm_defn.h:29

◆ FORMAT() [2/2]

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

Definition at line 1822 of file Controller.C.

References X.

1823 {
1824  static char tmp_string[50];
1825  static char format_string[50];
1826 
1827  int width = (decimal <= 4 ? 14 : 10 + decimal);
1828  sprintf(format_string, " %%%ds", width);
1829  sprintf(tmp_string, format_string, X);
1830  return tmp_string;
1831 }
#define X
Definition: msm_defn.h:29

◆ my_sigint_handler()

static void my_sigint_handler ( int  sig)
static

Definition at line 524 of file Controller.C.

References gotsigint.

524  {
525  if (sig == SIGINT) gotsigint = 1;
526 }
static int gotsigint
Definition: Controller.C:523

◆ 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 59 of file Controller.C.

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

59  {
60  return CmiWallTimer();
61 }

◆ TITITLE()

static char* TITITLE ( int  X)
static

Definition at line 97 of file Controller.C.

References X.

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

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

Variable Documentation

◆ eventEndOfTimeStep

int eventEndOfTimeStep

Definition at line 296 of file Node.C.

Referenced by Controller::integrate().

◆ gotsigint

int gotsigint = 0
static

Definition at line 523 of file Controller.C.

Referenced by my_sigint_handler().