--- trunk/mdtools/md_code/Thermo.cpp 2003/01/28 22:16:55 252 +++ trunk/mdtools/md_code/Thermo.cpp 2003/01/30 20:03:37 254 @@ -1,8 +1,9 @@ #include #include +using namespace std; - #ifdef IS_MPI +#include #include #endif //is_mpi @@ -16,7 +17,10 @@ Thermo::Thermo( SimInfo* the_entry_plug ) { Thermo::Thermo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; int baseSeed = BASE_SEED; + + cerr << "creating thermo stream\n"; gaussStream = new gaussianSPRNG( baseSeed ); + cerr << "created thermo stream\n"; } Thermo::~Thermo(){ @@ -65,7 +69,7 @@ double Thermo::getKinetic(){ } } #ifdef IS_MPI - MPI_COMM_WORLD.Allreduce(&kinetic,&kinetic_global,1,MPI_DOUBLE,MPI_SUM); + MPI::COMM_WORLD.Allreduce(&kinetic,&kinetic_global,1,MPI_DOUBLE,MPI_SUM); kinetic = kinetic_global; #endif //is_mpi @@ -96,7 +100,7 @@ double Thermo::getPotential(){ // Get total potential for entire system from MPI. #ifdef IS_MPI - MPI_COMM_WORLD.Allreduce(&potential,&potential_global,1,MPI_DOUBLE,MPI_SUM); + MPI::COMM_WORLD.Allreduce(&potential,&potential_global,1,MPI_DOUBLE,MPI_SUM); potential = potential_global; #endif // is_mpi @@ -164,7 +168,6 @@ void Thermo::velocitize() { ndf = ndfRaw - n_constraints - 3; kebar = kb * temperature * (double)ndf / ( 2.0 * (double)ndfRaw ); - printf("Entered Velocitize\n"); for(vr = 0; vr < n_atoms; vr++){ // uses equipartition theory to solve for vbar in angstrom/fs @@ -188,7 +191,7 @@ void Thermo::velocitize() { #ifdef IS_MPI #error "SPRNG random number generator must be used for MPI" #else -#warning "Using drand48 for random number generation" + // warning "Using drand48 for random number generation" #endif // is_mpi x = drand48(); @@ -202,7 +205,7 @@ void Thermo::velocitize() { x = drand48(); y = drand48(); vz = vbar * sqrt( -2.0 * log(x)) * cos(2 * M_PI * y); - printf("Setting new velocities vx: %f\n",vx); + #endif // use_spring #ifdef USE_SPRNG @@ -264,7 +267,7 @@ void Thermo::velocitize() { #ifdef IS_MPI #error "SPRNG random number generator must be used for MPI" #else // is_mpi -#warning "Using drand48 for random number generation" + //warning "Using drand48 for random number generation" #endif // is_MPI vbar = sqrt( 2.0 * kebar * dAtom->getIxx() );