Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | 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 COLOUMB   332.0636
#define BOLTZMAN   0.001987191
#define TIMEFACTOR   48.88821
#define PRESSUREFACTOR   6.95E4
#define PDBVELFACTOR   20.45482706
#define PDBVELINVFACTOR   (1.0/PDBVELFACTOR)
#define PNPERKCALMOL   69.479
#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 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 BOLTZMAN   0.001987191
 

Definition at line 45 of file common.h.

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

#define COLOUMB   332.0636
 

Definition at line 44 of file common.h.

Referenced by ExclElem::computeForce(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeEwald::doWork(), scale_n_copy_coordinates(), and SELF().

#define CYCLE_BARRIER   0
 

Definition at line 126 of file common.h.

#define DPMTATAG   106
 

Definition at line 124 of file common.h.

#define FALSE   0
 

Definition at line 88 of file common.h.

#define FULLFORCETAG   105
 

Definition at line 123 of file common.h.

Referenced by ComputeFullDirect::doWork().

#define FULLTAG   104
 

Definition at line 122 of file common.h.

Referenced by ComputeFullDirect::doWork().

#define MAX_NEIGHBORS   27
 

Definition at line 101 of file common.h.

#define MOLECULETAG   102
 

Definition at line 121 of file common.h.

#define NAMD_ComputeNonbonded_SortAtoms   1
 

Definition at line 151 of file common.h.

Referenced by SELF().

#define NAMD_ComputeNonbonded_SortAtoms_LessBranches   1
 

Definition at line 152 of file common.h.

#define NAMD_SeparateWaters   0
 

Definition at line 138 of file common.h.

Referenced by Patch::Patch().

#define NO   0
 

Definition at line 93 of file common.h.

#define ONE   1.000000000000000
 

Definition at line 61 of file common.h.

#define PDBVELFACTOR   20.45482706
 

Definition at line 48 of file common.h.

Referenced by Sequencer::maximumMove().

#define PDBVELINVFACTOR   (1.0/PDBVELFACTOR)
 

Definition at line 49 of file common.h.

#define PI   3.141592653589793
 

Definition at line 53 of file common.h.

#define PME_BARRIER   0
 

Definition at line 127 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(), and SimParameters::scriptSet().

#define SIMPARAMSTAG   100
 

Definition at line 119 of file common.h.

#define SMALLRAD   0.0005
 

Definition at line 69 of file common.h.

#define SMALLRAD2   SMALLRAD*SMALLRAD
 

Definition at line 73 of file common.h.

#define STATICPARAMSTAG   101
 

Definition at line 120 of file common.h.

#define STEP_BARRIER   0
 

Definition at line 128 of file common.h.

#define STRINGNULL   '\0'
 

Definition at line 98 of file common.h.

#define TIMEFACTOR   48.88821
 

Definition at line 46 of file common.h.

#define TRUE   1
 

Definition at line 89 of file common.h.

Referenced by ParseOptions::ParseOptions().

#define TWOPI   2.0 * PI
 

Definition at line 57 of file common.h.

Referenced by ComputeEField::doForce().

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

Definition at line 130 of file common.h.

Referenced by ControllerBroadcasts::ControllerBroadcasts().

#define WAT_SWM4   2
 

Definition at line 157 of file common.h.

#define WAT_TIP3   0
 

Definition at line 155 of file common.h.

#define WAT_TIP4   1
 

Definition at line 156 of file common.h.

#define YES   1
 

Definition at line 94 of file common.h.

#define ZERO   0.000000000000000
 

Definition at line 65 of file common.h.


Typedef Documentation

typedef double BigReal
 

Definition at line 84 of file common.h.

Referenced by HomePatch::addForceToMomentum(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), HomePatch::addVelocityToPosition(), PatchMap::assignToPatch(), average(), Sequencer::berendsenPressure(), ComputeNonbondedCUDA::build_force_table(), calc_fulldirect(), Controller::compareChecksums(), ExclElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), CrosstermElem::computeForce(), BondElem::computeForce(), AngleElem::computeForce(), ComputeHomeTuples< ExclElem, Exclusion, int >::ComputeHomeTuples(), ComputeNonbondedPair::ComputeNonbondedPair(), ComputeNonbondedSelf::ComputeNonbondedSelf(), NamdState::configListInit(), Controller::Controller(), convert(), PDBAtom::coordinates(), Sequencer::correctMomentum(), Controller::correctMomentum(), Vector::cross(), Lattice::delta(), HomePatch::doAtomMigration(), ComputeStir::doForce(), ComputeSphericalBC::doForce(), ComputeRestraints::doForce(), ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), ComputeEField::doForce(), ComputeCylindricalBC::doForce(), ComputeConsTorque::doForce(), ComputeConsForce::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), Vector::dot(), OptPmeCompute::doWork(), ComputePme::doWork(), ComputeHomeTuples< ExclElem, Exclusion, int >::doWork(), ComputeFullDirect::doWork(), ComputeEwald::doWork(), GlobalMasterMisc::easy_calc(), fep_vdw_forceandenergies(), PDB::find_extremes(), ComputeGridForce::finishForce(), Random::gaussian(), PressureProfileReduction::getData(), ComputePmeMgr::gridCalc2(), Matrix4TMD::identity(), GridforceGrid::init1(), GridforceGrid::init4(), ComputePmeMgr::initialize(), OptPmeMgr::initialize_pencils(), ComputePmeMgr::initialize_pencils(), Sequencer::integrate(), RequireReduction::item(), SubmitReduction::item(), Sequencer::langevinPiston(), Controller::langevinPiston1(), Controller::langevinPiston2(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Vector::length(), Vector::length2(), 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(), Matrix4TMD::multmatrix(), Matrix4TMD::multpoint(), Lattice::nearest(), normalize3d(), ComputeNonbondedPair::noWork(), PDBAtom::occupancy(), Vector::operator/=(), Vector::operator[](), Controller::outputFepEnergy(), Controller::outputTiEnergy(), PatchMap::pack(), pairlist_from_pairlist(), WorkDistrib::patchMapInit(), PDB::PDB(), OptPmeXPencil::pme_kspace(), PmeXPencil::pme_kspace(), PressureProfileReduction::PressureProfileReduction(), Controller::printDynamicsEnergies(), Controller::printEnergies(), Controller::printFepMessage(), Controller::printMinimizeEnergies(), 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(), Sequencer::reassignVelocities(), Controller::reassignVelocities(), Parameters::receive_Parameters(), Controller::receivePressure(), ReductionSetData::ReductionSetData(), Sequencer::reinitVelocities(), ReductionMgr::remoteSubmit(), Sequencer::rescaleVelocities(), Controller::rescaleVelocities(), Vector::rlength(), scale_n_copy_coordinates(), ComputeNonbondedUtil::select(), SELF(), settle1(), settle1init(), settlev(), PatchMap::sizeGrid(), sortEntries_bubbleSort(), sortEntries_mergeSort_v1(), sortEntries_mergeSort_v2(), sortEntries_selectionSort(), ComputeNonbondedUtil::square(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), ComputeNonbondedUtil::submitPressureProfileData(), Sequencer::submitReductions(), Tcl_centerOfMass(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), Controller::tcoupleVelocities(), PDBAtom::temperaturefactor(), ti_vdw_force_energy_dUdl(), Matrix4TMD::transpose(), ComputePme::ungridForces(), 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 103 of file common.h.

Referenced by GridforceGrid::allocateGridRequestTables(), ParseOptions::check_consistancy(), GridforceGrid::consolidateGridRequests(), WorkDistrib::createAtomLists(), ParseOptions::defined(), ParseOptions::exists(), PDBData::field(), WorkDistrib::fillOnePatchAtoms(), ParseOptions::get(), getCrosstermData(), getDihedralData(), GridforceGrid::getGridIndices(), getImproperData(), GridforceGrid::init1(), GridforceGrid::init4(), WorkDistrib::initAndSendHomePatch(), 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(), GridforceGrid::isGridValAvail(), GridforceGrid::isGridValCached(), ConfigList::okay(), GridforceGrid::pack(), ComputeNonbondedUtil::select(), Vector::set(), ParseOptions::set(), ParseOptions::units(), and GridforceGrid::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 79 of file common.h.

Referenced by Molecule::atomcharge(), Molecule::atommass(), ImproperElem::computeForce(), DihedralElem::computeForce(), BondElem::computeForce(), ComputeRestraints::doForce(), ComputeNonbondedCUDA::doWork(), ComputeGridForce::finishForce(), Molecule::get_stir_startTheta(), Parameters::get_vdw_params(), getAngleData(), getAtomData(), getBondData(), GenericAtom::getCharge(), GenericAtom::getMass(), GromacsTopFile::getVDWParams(), Molecule::langevin_param(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), outputCompressedFile(), outputPsfFile(), PDB::PDB(), Molecule::print_atoms(), Molecule::print_bonds(), Parameters::read_ener_table(), Molecule::receive_Molecule(), Parameters::receive_Parameters(), Molecule::rigid_bond_length(), and Parameters::send_Parameters().


Function Documentation

int Fclose FILE *  fout  ) 
 

Definition at line 255 of file common.C.

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

00256 {
00257   int rc = -1;
00258 #if !defined(NOCOMPRESSED)
00259   rc = pclose(fout);
00260 #endif
00261   if (rc == -1) // stream not associated with a popen()
00262     {
00263     rc = fclose(fout);
00264     }
00265   return rc;
00266 } /* Fclose() */

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

Definition at line 170 of file common.C.

References iout.

Referenced by ConfigList::ConfigList(), parm::genopen(), GridforceGrid::init1(), PDB::PDB(), read_binary_file(), Parameters::read_parameter_file(), and Molecule::read_psf_file().

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

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

Definition at line 117 of file common.C.

References iERROR(), and iout.

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

00118 {
00119   struct stat sbuf;
00120   if (stat(filename, &sbuf) == 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     remove(backup);
00127 #endif
00128     if ( rename(filename,backup) )
00129     {
00130       char *sys_err_msg = strerror(errno);
00131       if ( ! sys_err_msg ) sys_err_msg = "(unknown error)";
00132       iout << iERROR << "Error on renaming file " << filename
00133         << " to " << backup << ": " << sys_err_msg << "\n" << endi;
00134       fflush(stdout);
00135       // char errmsg[256];
00136       // sprintf(errmsg, "Error on renaming file %s to %s",filename,backup);
00137       // NAMD_err(errmsg);
00138     }
00139     delete [] backup;
00140   }
00141 }

void NAMD_bug const char *   ) 
 

Definition at line 103 of file common.C.

Referenced by LdbCoordinator::barrier(), ComputeNonbondedCUDA::build_exclusions(), HomePatch::buildSpanningTree(), ComputeNonbondedUtil::calc_error(), checkSum(), Controller::compareChecksums(), ComputeTclBC::ComputeTclBC(), NamdState::configListInit(), WorkDistrib::createAtomLists(), ComputePme::doWork(), WorkDistrib::enqueueAngles(), WorkDistrib::enqueueBonds(), WorkDistrib::enqueueCrossterms(), WorkDistrib::enqueueCUDA(), WorkDistrib::enqueueDihedrals(), WorkDistrib::enqueueExcls(), WorkDistrib::enqueueImpropers(), WorkDistrib::enqueuePme(), WorkDistrib::enqueueSelfA(), WorkDistrib::enqueueSelfB(), WorkDistrib::enqueueWork(), WorkDistrib::enqueueWorkA(), WorkDistrib::enqueueWorkB(), WorkDistrib::enqueueWorkC(), WorkDistrib::fillOnePatchAtoms(), Communicate::getMessage(), ComputePmeMgr::initialize(), ComputePatch::initialize(), ComputeHomePatch::initialize(), ScriptTcl::load(), WorkDistrib::messageEnqueueWork(), NAMD_write(), Node::Node(), Controller::printDynamicsEnergies(), ProxyMgr::ProxyMgr(), HomePatch::rattle1(), HomePatch::rattle2(), Sequencer::reassignVelocities(), BroadcastMgr::recvBroadcast(), ComputePmeMgr::recvGrid(), ProxyMgr::recvResults(), OptPmeMgr::recvUngrid(), ComputePmeMgr::recvUngrid(), ReductionSet::ReductionSet(), registerUserEventsForAllComputeObjs(), ReductionMgr::remoteSubmit(), CollectionMgr::CollectVectorInstance::reset(), CollectionMaster::CollectVectorInstance::reset(), ComputeNonbondedUtil::select(), SELF(), Communicate::sendMessage(), SimpleBroadcastObject< Tensor >::SimpleBroadcastObject(), Node::startup(), and wrap_coor_int().

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

void NAMD_die const char *   ) 
 

Definition at line 75 of file common.C.

Referenced by ConfigList::add_element(), after_backend_init(), Controller::algorithm(), 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(), buildBondData(), ReductionMgr::buildSpanTree(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMaster::calculate(), GlobalMaster::check(), colvarproxy_namd::colvarproxy_namd(), AngleElem::computeForce(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeTclBC::ComputeTclBC(), ConfigList::ConfigList(), NamdState::configListInit(), ConfigList::ConfigListNode::ConfigListNode(), Sequencer::correctMomentum(), Controller::correctMomentum(), cuda_errcheck(), cuda_initialize(), ComputeNonbondedSelf::doForce(), ComputeGridForce::doForce(), HomePatch::doMarginCheck(), Parameters::done_reading_files(), ComputeTclBC::doWork(), ComputeNonbondedCUDA::doWork(), ARestraint::EarlyExit(), GlobalMasterMisc::easy_calc(), CollectionMasterHandler::enqueuePositions(), CollectionMasterHandler::enqueueVelocities(), colvarproxy_namd::fatal_error(), OptPmeXPencil::fft_init(), OptPmeYPencil::fft_init(), OptPmeZPencil::fft_init(), PmeXPencil::fft_init(), PmeYPencil::fft_init(), PmeZPencil::fft_init(), 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(), getAcceptorData(), getAngleData(), getAtomData(), getBondData(), getCrosstermData(), getDihedralData(), getDonorData(), getExclusionData(), getExtraBonds(), getImproperData(), ExclElem::getMoleculePointers(), ImproperElem::getMoleculePointers(), DihedralElem::getMoleculePointers(), CrosstermElem::getMoleculePointers(), BondElem::getMoleculePointers(), AngleElem::getMoleculePointers(), GlobalMasterIMD::GlobalMasterIMD(), GromacsTopFile::GromacsTopFile(), BackEnd::init(), GridforceGrid::init1(), GridforceGrid::init3(), OptPmeMgr::initialize(), LdbCoordinator::initialize(), ComputePmeMgr::initialize(), SimParameters::initialize_config_data(), ScriptTcl::load(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), ludcmp(), WorkDistrib::mapComputes(), Molecule::Molecule(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), NAMD_new_handler(), NAMD_read_int(), NAMD_read_line(), NAMD_write(), Vector::operator[](), MGridforceParamsList::pack_data(), WorkDistrib::patchMapInit(), PDB::PDB(), PDBUnknown::PDBUnknown(), parm::preadln(), ProblemParsing(), GlobalMaster::processData(), 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(), Parameters::read_parameter_file(), Parameters::read_parm(), Molecule::read_psf_file(), readPsfFile(), RecBisection::RecBisection(), Parameters::receive_Parameters(), CollectionMaster::receiveDataStream(), ComputeMgr::recvComputeDPMEData(), ComputeMgr::recvComputeDPMEResults(), ComputeMgr::recvComputeEwaldData(), ComputeMgr::recvComputeEwaldResults(), ComputeMgr::recvComputeGlobalConfig(), ComputeMgr::recvComputeGlobalData(), ComputeMgr::recvComputeGlobalResults(), ComputeExtMgr::recvCoord(), GlobalMasterServer::recvData(), register_cuda_compute_pair(), register_cuda_compute_self(), Node::reloadCharges(), ReductionMgr::remoteRegister(), ReductionMgr::remoteUnregister(), ReductionSet::removeData(), ScriptTcl::run(), SimParameters::scriptSet(), ComputeNonbondedUtil::select(), SELF(), Parameters::send_Parameters(), Node::sendCharmArrProxies(), ComputeMgr::sendComputeDPMEData(), ComputeMgr::sendComputeEwaldData(), PatchMap::sizeGrid(), StringList::StringList(), ComputeMap::unpack(), unregister_cuda_compute(), ReductionMgr::willRequire(), and ReductionMgr::willSubmit().

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

void NAMD_err const char *   ) 
 

Definition at line 88 of file common.C.

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

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

void NAMD_quit const char *   ) 
 

Definition at line 62 of file common.C.

Referenced by GlobalMasterIMD::get_vmd_forces().

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

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 48 of file common.C.

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

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


Generated on Sat Nov 7 04:07:50 2009 for NAMD by  doxygen 1.3.9.1