#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 | USE_BARRIER (CYCLE_BARRIER || PME_BARRIER) |
| #define | NAMD_SeparateWaters 0 |
| #define | NAMD_ComputeNonbonded_SortAtoms 0 |
| #define | NAMD_ComputeNonbonded_SortAtoms_LessBranches 1 |
| #define | WAT_TIP3 0 |
| #define | WAT_TIP4 1 |
| #define | CmiMemcpy(D, S, N) memcpy(D,S,N) |
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 44 of file common.h. Referenced by ComputePme::doWork(), ComputeEwald::doWork(), and SELF(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 123 of file common.h. Referenced by ComputeFullDirect::doWork(). |
|
|
Definition at line 122 of file common.h. Referenced by ComputeFullDirect::doWork(). |
|
|
|
|
|
Definition at line 121 of file common.h. Referenced by Molecule::send_Molecule(). |
|
|
|
|
|
|
|
|
Definition at line 137 of file common.h. Referenced by Patch::Patch(). |
|
|
|
|
|
|
|
|
Definition at line 48 of file common.h. Referenced by Sequencer::maximumMove(). |
|
|
|
|
|
Definition at line 53 of file common.h. Referenced by CrosstermElem::computeForce(), crossterm_setup(), ComputeEField::doForce(), GromacsTopFile::GromacsTopFile(), and vec_rotation_matrix(). |
|
|
|
|
|
|
|
|
Definition at line 47 of file common.h. Referenced by PressureProfileReduction::getData(), and Controller::printEnergies(). |
|
|
Definition at line 119 of file common.h. Referenced by SimParameters::send_SimParameters(). |
|
|
|
|
|
|
|
|
Definition at line 120 of file common.h. Referenced by Parameters::send_Parameters(). |
|
|
|
|
|
Definition at line 46 of file common.h. Referenced by Sequencer::submitMinimizeReductions(). |
|
|
Definition at line 89 of file common.h. Referenced by ParseOptions::ParseOptions(). |
|
|
Definition at line 57 of file common.h. Referenced by ComputeEField::doForce(). |
|
|
Definition at line 129 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 Random::split(). |
|
|
|
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() */
|
|
||||||||||||
|
Definition at line 170 of file common.C. References iout. Referenced by ConfigList::ConfigList(), parm::genopen(), GridforceGrid::initialize(), 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() */
|
|
||||||||||||
|
Definition at line 117 of file common.C. References iERROR(), and iout. Referenced by 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 }
|
|
|
|
|
Definition at line 88 of file common.C. Referenced by Molecule::build_extra_bonds(), 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 }
|
|
|
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 }
|
|
|
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 }
|
|
||||||||||||||||
|
|
1.3.9.1