Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

common.h File Reference

#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include "converse.h"

Go to the source code of this file.

Defines

#define COULOMB   332.0636
#define BOLTZMANN   0.001987191
#define TIMEFACTOR   48.88821
#define PRESSUREFACTOR   6.95E4
#define PDBVELFACTOR   20.45482706
#define PDBVELINVFACTOR   (1.0/PDBVELFACTOR)
#define PNPERKCALMOL   69.479
#define mynearbyint(x)   floor((x)+0.5)
#define PI   3.141592653589793
#define TWOPI   2.0 * PI
#define ONE   1.000000000000000
#define ZERO   0.000000000000000
#define SMALLRAD   0.0005
#define SMALLRAD2   SMALLRAD*SMALLRAD
#define FALSE   0
#define TRUE   1
#define NO   0
#define YES   1
#define STRINGNULL   '\0'
#define MAX_NEIGHBORS   27
#define SIMPARAMSTAG   100
#define STATICPARAMSTAG   101
#define MOLECULETAG   102
#define FULLTAG   104
#define FULLFORCETAG   105
#define DPMTATAG   106
#define GRIDFORCEGRIDTAG   107
#define CYCLE_BARRIER   0
#define PME_BARRIER   0
#define STEP_BARRIER   0
#define USE_BARRIER   (CYCLE_BARRIER || PME_BARRIER || STEP_BARRIER)
#define NAMD_SeparateWaters   0
#define NAMD_ComputeNonbonded_SortAtoms   1
#define NAMD_ComputeNonbonded_SortAtoms_LessBranches   1
#define WAT_TIP3   0
#define WAT_TIP4   1
#define WAT_SWM4   2

Typedefs

typedef long long int64
typedef float Real
typedef double BigReal
typedef int Bool

Functions

void NAMD_quit (const char *)
void NAMD_die (const char *)
void NAMD_err (const char *)
void NAMD_bug (const char *)
void NAMD_backup_file (const char *filename, const char *extension=0)
void NAMD_write (int fd, const void *buf, size_t count)
char * NAMD_stringdup (const char *)
FILE * Fopen (const char *filename, const char *mode)
int Fclose (FILE *fout)


Define Documentation

#define BOLTZMANN   0.001987191
 

Definition at line 45 of file common.h.

Referenced by Controller::adaptTempUpdate(), HomePatch::hardWallDrude(), Controller::langevinPiston1(), Controller::langevinPiston2(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK2(), Controller::outputFepEnergy(), Sequencer::reassignVelocities(), Sequencer::reinitVelocities(), and Controller::writeFepEnergyData().

#define COULOMB   332.0636
 

Definition at line 44 of file common.h.

Referenced by ComputeNonbondedUtil::calcGBIS(), ExclElem::computeForce(), ComputeMsm::ComputeMsm(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeEwald::doWork(), HomePatch::gbisComputeAfterP2(), HomePatch::positionsReady(), ComputeMsmSerialMgr::recvCoord(), ComputeFmmSerialMgr::recvCoord(), and scale_n_copy_coordinates().

#define CYCLE_BARRIER   0
 

Definition at line 136 of file common.h.

#define DPMTATAG   106
 

Definition at line 133 of file common.h.

#define FALSE   0
 

Definition at line 97 of file common.h.

#define FULLFORCETAG   105
 

Definition at line 132 of file common.h.

Referenced by ComputeFullDirect::doWork().

#define FULLTAG   104
 

Definition at line 131 of file common.h.

Referenced by ComputeFullDirect::doWork().

#define GRIDFORCEGRIDTAG   107
 

Definition at line 134 of file common.h.

Referenced by Node::reloadGridforceGrid().

#define MAX_NEIGHBORS   27
 

Definition at line 110 of file common.h.

#define MOLECULETAG   102
 

Definition at line 130 of file common.h.

#define mynearbyint  )     floor((x)+0.5)
 

Definition at line 58 of file common.h.

Referenced by ALCHPAIR(), Parameters::read_ener_table(), Parameters::read_energy_type(), Parameters::read_energy_type_bothcubspline(), and Parameters::read_energy_type_cubspline().

#define NAMD_ComputeNonbonded_SortAtoms   1
 

Definition at line 161 of file common.h.

Referenced by SELF().

#define NAMD_ComputeNonbonded_SortAtoms_LessBranches   1
 

Definition at line 162 of file common.h.

#define NAMD_SeparateWaters   0
 

Definition at line 148 of file common.h.

Referenced by Patch::Patch().

#define NO   0
 

Definition at line 102 of file common.h.

#define ONE   1.000000000000000
 

Definition at line 70 of file common.h.

#define PDBVELFACTOR   20.45482706
 

Definition at line 48 of file common.h.

Referenced by ParallelIOMgr::bcastMolInfo(), and Sequencer::maximumMove().

#define PDBVELINVFACTOR   (1.0/PDBVELFACTOR)
 

Definition at line 49 of file common.h.

#define PI   3.141592653589793
 

Definition at line 62 of file common.h.

#define PME_BARRIER   0
 

Definition at line 137 of file common.h.

#define PNPERKCALMOL   69.479
 

Definition at line 50 of file common.h.

#define PRESSUREFACTOR   6.95E4
 

Definition at line 47 of file common.h.

Referenced by PressureProfileReduction::getData(), Controller::printEnergies(), Controller::receivePressure(), Controller::rescaleaccelMD(), and SimParameters::scriptSet().

#define SIMPARAMSTAG   100
 

Definition at line 128 of file common.h.

#define SMALLRAD   0.0005
 

Definition at line 78 of file common.h.

#define SMALLRAD2   SMALLRAD*SMALLRAD
 

Definition at line 82 of file common.h.

#define STATICPARAMSTAG   101
 

Definition at line 129 of file common.h.

#define STEP_BARRIER   0
 

Definition at line 138 of file common.h.

#define STRINGNULL   '\0'
 

Definition at line 107 of file common.h.

#define TIMEFACTOR   48.88821
 

Definition at line 46 of file common.h.

Referenced by Sequencer::minimize(), and Sequencer::newMinimizeDirection().

#define TRUE   1
 

Definition at line 98 of file common.h.

Referenced by GridforceFullSubGrid::initialize(), and ParseOptions::ParseOptions().

#define TWOPI   2.0 * PI
 

Definition at line 66 of file common.h.

Referenced by ComputeEField::doForce().

#define USE_BARRIER   (CYCLE_BARRIER || PME_BARRIER || STEP_BARRIER)
 

Definition at line 140 of file common.h.

Referenced by ControllerBroadcasts::ControllerBroadcasts().

#define WAT_SWM4   2
 

Definition at line 167 of file common.h.

#define WAT_TIP3   0
 

Definition at line 165 of file common.h.

#define WAT_TIP4   1
 

Definition at line 166 of file common.h.

#define YES   1
 

Definition at line 103 of file common.h.

#define ZERO   0.000000000000000
 

Definition at line 74 of file common.h.


Typedef Documentation

typedef double BigReal
 

Definition at line 93 of file common.h.

Referenced by Controller::adaptTempInit(), Controller::adaptTempUpdate(), HomePatch::addForceToMomentum(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), HomePatch::addVelocityToPosition(), ALCHPAIR(), msm::PatchData::anterpolation(), msm::PatchData::anterpolationC1Hermite(), PatchMap::assignToPatch(), average(), ParallelIOMgr::bcastHydroBasedCounter(), Sequencer::berendsenPressure(), ComputeNonbondedCUDA::build_force_table(), Molecule::build_go_arrays(), Molecule::build_go_sigmas(), Calc_dEda_PairSer(), Calc_dEdr_PairSer(), calc_fulldirect(), ComputeNonbondedUtil::calcGBIS(), calcOverlap(), CalcScaleSer(), Controller::compareChecksums(), TholeElem::computeForce(), ExclElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), CrosstermElem::computeForce(), BondElem::computeForce(), AnisoElem::computeForce(), AngleElem::computeForce(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), ComputeNonbondedPair::ComputeNonbondedPair(), ComputeNonbondedSelf::ComputeNonbondedSelf(), NamdState::configListInit(), Controller::Controller(), convert(), PDBAtom::coordinates(), Sequencer::correctMomentum(), Controller::correctMomentum(), Vector::cross(), Lattice::delta(), dh1Ser(), dh2Ser(), dh3Ser(), dh4Ser(), dh5Ser(), HomePatch::doAtomMigration(), ComputeStir::doForce(), ComputeSphericalBC::doForce(), ComputeRestraints::doForce(), ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), ComputeLCPO::doForce(), ComputeGridForce::doForce(), ComputeEField::doForce(), ComputeCylindricalBC::doForce(), ComputeConsTorque::doForce(), ComputeConsForce::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), Vector::dot(), OptPmeCompute::doWork(), ComputePme::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), ComputeFullDirect::doWork(), ComputeEwald::doWork(), GlobalMasterMisc::easy_calc(), fep_vdw_forceandenergies(), PDB::find_extremes(), ComputeNonbondedCUDA::finishWork(), Random::gaussian(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), ComputeMsmMgr::gc_c1hermite_elem_accum(), Molecule::get_go_force(), Molecule::get_go_force2(), Molecule::get_go_force_new(), Molecule::get_gro_force2(), Molecule::GetAtomAlpha(), PressureProfileReduction::getData(), ComputePmeMgr::gridCalc2R(), h1Ser(), h2Ser(), h3Ser(), h4Ser(), h5Ser(), HomePatch::hardWallDrude(), Matrix4Symmetry::identity(), Matrix4TMD::identity(), GridforceFullMainGrid::initialize(), ComputePmeMgr::initialize(), ComputeMsmMgr::initialize(), OptPmeMgr::initialize_pencils(), ComputePmeMgr::initialize_pencils(), Sequencer::integrate(), msm::PatchData::interpolation(), msm::PatchData::interpolationC1Hermite(), RequireReduction::item(), SubmitReduction::item(), Sequencer::langevinPiston(), Controller::langevinPiston1(), Controller::langevinPiston2(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Vector::length(), Vector::length2(), PatchMap::makePatches(), Matrix4Symmetry::Matrix4Symmetry(), Matrix4TMD::Matrix4TMD(), MatrixFitRMS(), PatchMap::max_a(), PatchMap::max_b(), PatchMap::max_c(), Sequencer::maximumMove(), PatchMap::min_a(), PatchMap::min_b(), PatchMap::min_c(), Sequencer::minimize(), Controller::minimize(), mollify(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Matrix4Symmetry::multmatrix(), Matrix4TMD::multmatrix(), Matrix4Symmetry::multpoint(), Matrix4TMD::multpoint(), ComputeMsmMgr::ndsplitting(), Lattice::nearest(), Sequencer::newMinimizeDirection(), normalize3d(), PDBAtom::occupancy(), cr_sortop::operator()(), Vector::operator/=(), Vector::operator[](), Controller::outputFepEnergy(), Controller::outputTiEnergy(), PatchMap::pack(), pairlist_from_pairlist(), pairlistFromAll(), partition(), WorkDistrib::patchMapInit(), PDB::PDB(), Phase2_PairSer(), OptPmeXPencil::pme_kspace(), PmeXPencil::pme_kspace(), HomePatch::positionsReady(), PressureProfileReduction::PressureProfileReduction(), Controller::printEnergies(), Controller::printFepMessage(), Controller::printTiMessage(), proc_anglegrad(), proc_dihedralgrad(), proc_getdihedral(), GlobalMaster::processData(), HomePatch::rattle1(), HomePatch::rattle2(), Parameters::read_ener_table(), Parameters::read_energy_type(), Parameters::read_energy_type_bothcubspline(), Parameters::read_energy_type_cubspline(), GridforceFullBaseGrid::readHeader(), Sequencer::reassignVelocities(), Controller::reassignVelocities(), Parameters::receive_Parameters(), Controller::receivePressure(), ReductionSetData::ReductionSetData(), Sequencer::reinitVelocities(), ReductionMgr::remoteSubmit(), Sequencer::rescaleaccelMD(), Controller::rescaleaccelMD(), Sequencer::rescaleVelocities(), Controller::rescaleVelocities(), Vector::rlength(), scale_n_copy_coordinates(), ComputeNonbondedUtil::select(), SELF(), settle1(), settle1init(), settlev(), ComputeMsmMgr::setup_hgrid_1d(), PatchMap::sizeGrid(), sortEntries_bubbleSort(), sortEntries_mergeSort_v1(), sortEntries_mergeSort_v2(), sortEntries_selectionSort(), ComputeMsmMgr::splitting(), ComputeNonbondedUtil::square(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), ComputeNonbondedUtil::submitPressureProfileData(), Sequencer::submitReductions(), ComputePmeMgr::submitReductions(), Tcl_centerOfMass(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), Controller::tcoupleVelocities(), PDBAtom::temperaturefactor(), ti_vdw_force_energy_dUdl(), Matrix4Symmetry::transpose(), Matrix4TMD::transpose(), Random::uniform(), PatchMap::unpack(), vec_rotation_matrix(), Lattice::volume(), Lattice::wrap_nearest_delta(), Controller::writeFepEnergyData(), PDBAtom::xcoor(), PDBAtom::ycoor(), and PDBAtom::zcoor().

typedef int Bool
 

Definition at line 112 of file common.h.

Referenced by Molecule::atoms_1to4(), ParseOptions::check_consistency(), WorkDistrib::createAtomLists(), ParseOptions::defined(), ParseOptions::exists(), PDBData::field(), ParseOptions::get(), Molecule::go_restricted(), GridforceFullMainGrid::initialize(), Sequencer::integrate(), Molecule::is_atom_constorqued(), Molecule::is_atom_constrained(), Molecule::is_atom_exPressure(), Molecule::is_atom_fixed(), Molecule::is_atom_gridforced(), Molecule::is_atom_movdragged(), Molecule::is_atom_rotdragged(), Molecule::is_atom_stirred(), Molecule::is_group_fixed(), ConfigList::okay(), GridforceFullBaseGrid::pack(), Molecule::read_go_file(), ComputeNonbondedUtil::select(), SELF(), PmeZPencil::send_all_ungrid(), PmeYPencil::send_trans(), PmeZPencil::send_trans(), PmeYPencil::send_untrans(), PmeXPencil::send_untrans(), Vector::set(), ParseOptions::set(), ParseOptions::units(), and GridforceFullBaseGrid::unpack().

typedef long long int64
 

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

Definition at line 34 of file common.h.

Referenced by ExclElem::computeForce(), and Random::split().

typedef float Real
 

Definition at line 88 of file common.h.

Referenced by Molecule::atomcharge(), Molecule::atommass(), Molecule::build_go_arrays(), Molecule::build_go_sigmas(), Molecule::build_go_sigmas2(), Molecule::build_gridforce_params(), ImproperElem::computeForce(), DihedralElem::computeForce(), BondElem::computeForce(), ComputeGridForce::do_calc(), ComputeRestraints::doForce(), ComputeLCPO::doForce(), Molecule::get_go_cutoff(), Molecule::get_go_epsilon(), Molecule::get_go_epsilonRep(), Molecule::get_go_force(), Molecule::get_go_force2(), Molecule::get_go_force_new(), Molecule::get_go_sigmaRep(), Molecule::get_stir_startTheta(), Parameters::get_vdw_params(), GenericAtom::getCharge(), GenericAtom::getMass(), GromacsTopFile::getVDWParams(), GromacsTopFile::GromacsTopFile(), Molecule::langevin_param(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), outputCompressedFile(), PDB::PDB(), Molecule::print_atoms(), Molecule::print_bonds(), Molecule::print_go_sigmas(), Parameters::read_ener_table(), Molecule::read_go_file(), Molecule::receive_GoMolecule(), Molecule::receive_Molecule(), Parameters::receive_Parameters(), Molecule::rigid_bond_length(), Molecule::send_GoMolecule(), Parameters::send_Parameters(), and HomePatch::setGBISIntrinsicRadii().


Function Documentation

int Fclose FILE *  fout  ) 
 

Definition at line 271 of file common.C.

Referenced by ConfigList::ConfigList(), parm::genclose(), PDB::PDB(), read_binary_file(), and Parameters::read_parameter_file().

00272 {
00273   int rc = -1;
00274 #if !defined(NOCOMPRESSED)
00275   rc = pclose(fout);
00276 #endif
00277   if (rc == -1) // stream not associated with a popen()
00278     {
00279     rc = fclose(fout);
00280     }
00281   return rc;
00282 } /* Fclose() */

FILE* Fopen const char *  filename,
const char *  mode
 

Definition at line 177 of file common.C.

References iout.

Referenced by ConfigList::ConfigList(), parm::genopen(), GridforceFullMainGrid::initialize(), PDB::PDB(), read_binary_file(), and Parameters::read_parameter_file().

00178 {
00179   struct stat buf;
00180   // check if basic filename exists (and not a directory)
00181 
00182 #if defined(NOCOMPRESSED)
00183   if (!stat(filename,&buf))
00184     {
00185       FILE *rval;
00186       while ( ! (rval = fopen(filename,mode)) ) {
00187         if ( errno != EINTR ) break;
00188       }
00189       return(rval);
00190     }
00191 #else
00192   if (!stat(filename,&buf))
00193     {
00194       if (!S_ISDIR(buf.st_mode)) {
00195         FILE *rval;
00196         while ( ! (rval = fopen(filename,mode)) ) {
00197           if ( errno != EINTR ) break;
00198         }
00199         return(rval);
00200       }
00201     }
00202   // check for a compressed file
00203   char *realfilename;
00204   char *command;
00205   FILE *fout;
00206   command = (char *)malloc(strlen(filename)+25);
00207   // check for .Z (unix compress)
00208   sprintf(command,"zcat %s.Z",filename);
00209   realfilename = command+5;
00210   iout << "Command = " << command << "\n" << endi;
00211   iout << "Filename.Z = " << realfilename << "\n" << endi;
00212   if (!stat(realfilename,&buf))
00213         {
00214         if (!S_ISDIR(buf.st_mode))
00215                 {
00216                 fout = popen(command,mode);
00217                 // on HP-UX, the first character(s) out of pipe may be
00218                 // garbage!  (Argh!)
00219                 int C;
00220                 do
00221                   {
00222                   C = fgetc(fout);
00223                   // iout << "C is " << C << "\n" << endi;
00224                   if (isalnum(C) || isspace(C))
00225                         {
00226                         ungetc(C,fout);
00227                         C = -1; // outta loop
00228                         }
00229                   } while(C != -1);
00230                 free(command);
00231                 return(fout);
00232                 }
00233         }
00234   // check for .gz (gzip)
00235   sprintf(command,"gzip -d -c %s.gz",filename);
00236   realfilename = command+11;
00237   iout << "Command = " << command << "\n" << endi;
00238   iout << "Filename.gz = " << realfilename << "\n" << endi;
00239   if (!stat(realfilename,&buf))
00240         {
00241         if (!S_ISDIR(buf.st_mode))
00242                 {
00243                 fout = popen(command,mode);
00244                 // on HP-UX, the first character(s) out of pipe may be
00245                 // garbage!  (Argh!)
00246                 int C;
00247                 do
00248                   {
00249                   C = fgetc(fout);
00250                   // iout << "C is " << C << "\n" << endi;
00251                   if (isalnum(C) || isspace(C))
00252                         {
00253                         ungetc(C,fout);
00254                         C = -1; // outta loop
00255                         }
00256                   } while(C != -1);
00257                 free(command);
00258                 return(fout);
00259                 }
00260         }
00261   free(command);
00262 #endif /* !defined(NOCOMPRESSED) */
00263 
00264   return(NULL);
00265 } /* Fopen() */

void NAMD_backup_file const char *  filename,
const char *  extension = 0
 

Definition at line 118 of file common.C.

References iERROR(), and iout.

Referenced by Controller::adaptTempInit(), colvarproxy_namd::backup_file(), Controller::outputExtendedSystem(), Controller::outputFepEnergy(), Controller::outputTiEnergy(), and CollectionMaster::receiveDataStream().

00119 {
00120   if (access(filename, F_OK) == 0) {
00121     if ( ! extension ) extension = ".BAK";
00122     char *backup = new char[strlen(filename)+strlen(extension)+1];
00123     strcpy(backup, filename);
00124     strcat(backup, extension);
00125 #if defined(WIN32) && !defined(__CYGWIN__)
00126     if ( remove(backup) ) if ( errno != ENOENT ) {
00127       char *sys_err_msg = strerror(errno);
00128       if ( ! sys_err_msg ) sys_err_msg = "(unknown error)";
00129       iout << iERROR << "Error on removing file "
00130         << backup << ": " << sys_err_msg << "\n" << endi;
00131       fflush(stdout);
00132     }
00133 #endif
00134     if ( rename(filename,backup) )
00135     {
00136       char *sys_err_msg = strerror(errno);
00137       if ( ! sys_err_msg ) sys_err_msg = "(unknown error)";
00138       iout << iERROR << "Error on renaming file " << filename
00139         << " to " << backup << ": " << sys_err_msg << "\n" << endi;
00140       fflush(stdout);
00141       // char errmsg[256];
00142       // sprintf(errmsg, "Error on renaming file %s to %s",filename,backup);
00143       // NAMD_err(errmsg);
00144     }
00145     delete [] backup;
00146   }
00147 }

void NAMD_bug const char *   ) 
 

Definition at line 104 of file common.C.

Referenced by LdbCoordinator::barrier(), ComputeNonbondedCUDA::build_exclusions(), ComputeNonbondedCUDA::build_lj_table(), HomePatch::buildSpanningTree(), ReductionMgr::buildSpanTree(), ComputeNonbondedUtil::calc_error(), checkSum(), Box< Patch, CompAtom >::close(), Controller::compareChecksums(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeTclBC::ComputeTclBC(), NamdState::configListInit(), WorkDistrib::createAtomLists(), CsmAckHandler(), CsmHandler(), cuda_check_local_progress(), cuda_check_remote_progress(), cuda_initialize(), MigrateAtomsCombinedMsg::distribute(), ComputePme::doWork(), WorkDistrib::enqueueAngles(), WorkDistrib::enqueueAniso(), WorkDistrib::enqueueBonds(), WorkDistrib::enqueueCrossterms(), WorkDistrib::enqueueDihedrals(), WorkDistrib::enqueueExcls(), WorkDistrib::enqueueImpropers(), WorkDistrib::enqueueLCPO(), WorkDistrib::enqueuePme(), WorkDistrib::enqueueSelfA1(), WorkDistrib::enqueueSelfA2(), WorkDistrib::enqueueSelfA3(), WorkDistrib::enqueueSelfB1(), WorkDistrib::enqueueSelfB2(), WorkDistrib::enqueueSelfB3(), WorkDistrib::enqueueThole(), WorkDistrib::enqueueWork(), WorkDistrib::enqueueWorkA1(), WorkDistrib::enqueueWorkA2(), WorkDistrib::enqueueWorkA3(), WorkDistrib::enqueueWorkB1(), WorkDistrib::enqueueWorkB2(), WorkDistrib::enqueueWorkB3(), WorkDistrib::enqueueWorkC(), ScriptTcl::eval(), ComputeMap::extendPtrs(), Communicate::getMessage(), GridforceFullBaseGrid::grid_index(), ParallelIOMgr::initialize(), LdbCoordinator::initialize(), ComputePme::initialize(), ComputePmeMgr::initialize(), ComputePatch::initialize(), ComputeHomePatch::initialize(), IRSet::insert(), ScriptTcl::load(), WorkDistrib::messageEnqueueWork(), NAMD_write(), Node::Node(), Box< Patch, CompAtom >::open(), PatchMap::pack(), PmePencilMap::populateInitial(), ProxyMgr::ProxyMgr(), HomePatch::rattle1(), HomePatch::rattle2(), Sequencer::reassignVelocities(), recursive_bisect_with_curve(), BroadcastMgr::recvBroadcast(), WorkDistrib::recvComputeMapChanges(), ComputePmeMgr::recvGrid(), ProxyMgr::recvResults(), OptPmeMgr::recvUngrid(), ComputePmeMgr::recvUngrid(), ReductionSet::ReductionSet(), register_cuda_compute_pair(), register_cuda_compute_self(), AtomMapper::registerIDsCompAtomExt(), AtomMapper::registerIDsFullAtom(), registerUserEventsForAllComputeObjs(), Node::reloadGridforceGrid(), ReductionMgr::remoteSubmit(), IRSet::remove(), CollectionMgr::CollectVectorInstance::reset(), CollectionMaster::CollectVectorInstance::reset(), WorkDistrib::saveComputeMap(), ComputeNonbondedUtil::select(), SELF(), PatchMgr::sendAtoms(), Communicate::sendMessage(), PatchMgr::sendMovePatches(), PatchMgr::sendOneHomePatch(), ComputePmeMgr::sendPencils(), SimpleBroadcastObject< Tensor >::SimpleBroadcastObject(), Box< Patch, CompAtom >::skip(), Node::startup(), ComputeMap::storeCompute(), IRSet::unchecked_insert(), ComputePme::ungridForces(), ComputeMap::unpack(), GridforceGrid::unpack_grid(), unregister_cuda_compute(), AtomMapper::unregisterIDsCompAtomExt(), AtomMapper::unregisterIDsFullAtom(), and AtomMapper::~AtomMapper().

00106 {
00107    const char *bug_msg = 
00108      "FATAL ERROR: See http://www.ks.uiuc.edu/Research/namd/bugreport.html";
00109    char *new_err_msg = new char[strlen(err_msg) + 20 + strlen(bug_msg)];
00110    sprintf(new_err_msg,"FATAL ERROR: %s\n%s\n",err_msg,bug_msg);
00111    CkPrintf(new_err_msg);
00112    fflush(stdout);
00113    CmiAbort(new_err_msg);
00114    delete [] new_err_msg;
00115 }

void NAMD_die const char *   ) 
 

Definition at line 76 of file common.C.

Referenced by Controller::adaptTempInit(), ConfigList::add_element(), ComputeMsmMgr::addPotential(), after_backend_init(), Controller::algorithm(), AnisoElem::AnisoElem(), msm::PatchData::anterpolation(), msm::PatchData::anterpolationC1Hermite(), Parameters::assign_angle_index(), Parameters::assign_bond_index(), Parameters::assign_crossterm_index(), Parameters::assign_dihedral_index(), Parameters::assign_improper_index(), Parameters::assign_vdw_index(), WorkDistrib::assignNodeToPatch(), ComputeNonbondedCUDA::build_exclusions(), Molecule::build_go_arrays(), Molecule::build_go_params(), Molecule::build_go_sigmas(), Molecule::build_go_sigmas2(), Molecule::build_gridforce_params(), buildBondData(), ReductionMgr::buildSpanTree(), ParallelIOMgr::calcAtomsInEachPatch(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMaster::calculate(), GlobalMaster::check(), colvarproxy_namd::colvarproxy_namd(), ComputeMsmMgr::compute(), PmeRealSpace::compute_forces(), AngleElem::computeForce(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeTclBC::ComputeTclBC(), ConfigList::ConfigList(), NamdState::configListInit(), ConfigList::ConfigListNode::ConfigListNode(), Sequencer::correctMomentum(), Controller::correctMomentum(), cuda_check_local_progress(), cuda_check_remote_progress(), cuda_die(), cuda_errcheck(), cuda_initialize(), ComputeMsmMgr::d_stencil_1d(), ComputeNonbondedSelf::doForce(), ComputeGridForce::doForce(), HomePatch::doMarginCheck(), Parameters::done_reading_files(), ComputeTclBC::doWork(), ARestraint::EarlyExit(), GlobalMasterMisc::easy_calc(), msm::Grid< BlockDiagram >::elem(), msm::GridFixed< T, N >::elem(), msm::Array< BlockDiagram >::elem(), ScriptTcl::eval(), colvarproxy_namd::fatal_error(), OptPmeXPencil::fft_init(), OptPmeYPencil::fft_init(), OptPmeZPencil::fft_init(), PmeXPencil::fft_init(), PmeYPencil::fft_init(), PmeZPencil::fft_init(), PmeRealSpace::fill_charges(), parm::get(), Molecule::get_atom_from_index_in_residue(), Molecule::get_atom_from_name(), Molecule::get_atomtype(), Parameters::get_dihedral_params(), Parameters::get_improper_params(), Molecule::get_residue_size(), Parameters::get_vdw_params(), TholeElem::getMoleculePointers(), ExclElem::getMoleculePointers(), ImproperElem::getMoleculePointers(), DihedralElem::getMoleculePointers(), CrosstermElem::getMoleculePointers(), BondElem::getMoleculePointers(), AnisoElem::getMoleculePointers(), AngleElem::getMoleculePointers(), TholeElem::getTupleInfo(), AnisoElem::getTupleInfo(), GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterSymmetry::GlobalMasterSymmetry(), GromacsTopFile::GromacsTopFile(), BackEnd::init(), OptPmeMgr::initialize(), LdbCoordinator::initialize(), GridforceLiteGrid::initialize(), GridforceFullSubGrid::initialize(), GridforceFullMainGrid::initialize(), ComputePmeMgr::initialize(), ComputeMsmMgr::initialize(), SimParameters::initialize_config_data(), msm::PatchData::interpolation(), msm::PatchData::interpolationC1Hermite(), ScriptTcl::load(), ludcmp(), Node::mallocTest(), WorkDistrib::mapComputes(), Molecule::Molecule(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), NAMD_new_handler(), NAMD_read_int(), NAMD_read_line(), NAMD_write(), ComputeMsmMgr::ndsplitting(), Vector::operator[](), Node::outputPatchComputeMaps(), MGridforceParamsList::pack_data(), WorkDistrib::patchMapInit(), PDB::PDB(), PDBUnknown::PDBUnknown(), parm::preadln(), ProblemParsing(), GlobalMaster::processData(), MsmC1HermiteBlockProxyMsg::put(), MsmBlockProxyMsg::put(), HomePatch::rattle2(), read_binary_file(), Parameters::read_charmm_parameter_file(), Parameters::read_ener_table(), Parameters::read_energy_type(), Parameters::read_energy_type_bothcubspline(), Parameters::read_energy_type_cubspline(), Molecule::read_go_file(), Parameters::read_parameter_file(), Parameters::read_parm(), GridforceFullBaseGrid::readSubgridHierarchy(), RecBisection::RecBisection(), Molecule::receive_GoMolecule(), Parameters::receive_Parameters(), CollectionMaster::receiveDataStream(), ParallelIOMgr::recvAtomsCntPerPatch(), ComputeMgr::recvComputeDPMEData(), ComputeMgr::recvComputeDPMEResults(), ComputeMgr::recvComputeEwaldData(), ComputeMgr::recvComputeEwaldResults(), ComputeMgr::recvComputeGlobalData(), ComputeMgr::recvComputeGlobalResults(), ComputeMsmSerialMgr::recvCoord(), ComputeFmmSerialMgr::recvCoord(), ComputeExtMgr::recvCoord(), GlobalMasterServer::recvData(), Node::reloadCharges(), Node::reloadGridforceGrid(), ReductionMgr::remoteRegister(), ReductionMgr::remoteUnregister(), ReductionSet::removeData(), Sequencer::rescaleaccelMD(), ScriptTcl::run(), ComputeMsm::saveResults(), SimParameters::scriptSet(), ComputeNonbondedUtil::select(), Molecule::send_GoMolecule(), Parameters::send_Parameters(), ComputeMgr::sendComputeDPMEData(), ComputeMgr::sendComputeEwaldData(), msm::Array< T >::setmax(), ComputeMsmMgr::setup_hgrid_1d(), ComputeMsmMgr::setup_periodic_blocksize(), PatchMap::sizeGrid(), ComputeMsmMgr::splitting(), ComputeMsmMgr::stencil_1d(), NamdCentLB::Strategy(), StringList::StringList(), TholeElem::TholeElem(), ReductionMgr::willRequire(), and ReductionMgr::willSubmit().

00078 {
00079    char *new_err_msg = new char[strlen(err_msg) + 20];
00080    sprintf(new_err_msg,"FATAL ERROR: %s\n",err_msg);
00081    CkPrintf(new_err_msg);
00082    fflush(stdout);
00083    CmiAbort(new_err_msg);
00084    delete [] new_err_msg;
00085 }

void NAMD_err const char *   ) 
 

Definition at line 89 of file common.C.

Referenced by after_backend_init(), NAMD_write(), Controller::outputExtendedSystem(), PDB::PDB(), and PDB::write().

00091 {
00092    char *sys_err_msg = strerror(errno);
00093    if ( ! sys_err_msg ) sys_err_msg = "(unknown error)";
00094    char *new_err_msg = new char[strlen(err_msg) + 20 + strlen(sys_err_msg)];
00095    sprintf(new_err_msg,"FATAL ERROR: %s: %s\n",err_msg, sys_err_msg);
00096    CkPrintf(new_err_msg);
00097    fflush(stdout);
00098    CmiAbort(new_err_msg);
00099    delete [] new_err_msg;
00100 }

void NAMD_quit const char *   ) 
 

Definition at line 63 of file common.C.

Referenced by GlobalMasterIMD::get_vmd_forces().

00065 {
00066    char *new_err_msg = new char[strlen(err_msg) + 20];
00067    sprintf(new_err_msg,"EXITING: %s\n",err_msg);
00068    CkPrintf(new_err_msg);
00069    fflush(stdout);
00070    CmiAbort(new_err_msg);
00071    delete [] new_err_msg;
00072 }

char* NAMD_stringdup const char *  s  ) 
 

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

Definition at line 49 of file common.C.

00049                                     {
00050   char *rs;
00051 
00052   if(!s)
00053     return NULL;
00054 
00055   rs = new char[strlen(s) + 1];
00056   strcpy(rs,s);
00057 
00058   return rs;
00059 }

void NAMD_write int  fd,
const void *  buf,
size_t  count
 


Generated on Tue Jun 18 04:07:50 2013 for NAMD by  doxygen 1.3.9.1