#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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 132 of file common.h. Referenced by ComputeFullDirect::doWork(). |
|
|
Definition at line 131 of file common.h. Referenced by ComputeFullDirect::doWork(). |
|
|
Definition at line 134 of file common.h. Referenced by Node::reloadGridforceGrid(). |
|
|
|
|
|
|
|
|
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(). |
|
|
Definition at line 161 of file common.h. Referenced by SELF(). |
|
|
|
|
|
Definition at line 148 of file common.h. Referenced by Patch::Patch(). |
|
|
|
|
|
|
|
|
Definition at line 48 of file common.h. Referenced by ParallelIOMgr::bcastMolInfo(), and Sequencer::maximumMove(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 47 of file common.h. Referenced by PressureProfileReduction::getData(), Controller::printEnergies(), Controller::receivePressure(), Controller::rescaleaccelMD(), and SimParameters::scriptSet(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 46 of file common.h. Referenced by Sequencer::minimize(), and Sequencer::newMinimizeDirection(). |
|
|
Definition at line 98 of file common.h. Referenced by GridforceFullSubGrid::initialize(), and ParseOptions::ParseOptions(). |
|
|
Definition at line 66 of file common.h. Referenced by ComputeEField::doForce(). |
|
|
Definition at line 140 of file common.h. Referenced by ControllerBroadcasts::ControllerBroadcasts(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(). |
|
|
|
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() */
|
|
||||||||||||
|
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() */
|
|
||||||||||||
|
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 }
|
|
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
||||||||||||||||
|
|
1.3.9.1