Skip to content

Commit

Permalink
Revert "Merge branch 'MPIPT_w_NVT' into MPIPT"
Browse files Browse the repository at this point in the history
This reverts commit 4fdda0f, reversing
changes made to 7d29f6e.
  • Loading branch information
Greg Schwing committed Nov 26, 2019
1 parent 4fdda0f commit c2803ce
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 1,217 deletions.
3 changes: 0 additions & 3 deletions CMake/FileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ set(sources
src/NoEwald.cpp
src/OutConst.cpp
src/OutputVars.cpp
src/ParallelTemperingMPIMethods.cpp
src/ParallelTemperingPreprocessor.cpp
src/PDBSetup.cpp
src/PDBOutput.cpp
Expand Down Expand Up @@ -113,7 +112,6 @@ set(headers
src/OutConst.h
src/OutputAbstracts.h
src/OutputVars.h
src/ParallelTemperingMPIMethods.h
src/ParallelTemperingPreprocessor.h
src/PDBConst.h
src/PDBOutput.h
Expand Down Expand Up @@ -164,7 +162,6 @@ set(headers
src/moves/MoleculeTransfer.h
src/moves/MoveBase.h
src/moves/MultiParticle.h
src/moves/ParallelTempering.h
src/moves/Regrowth.h
src/moves/Rotation.h
src/moves/Translate.h
Expand Down
59 changes: 0 additions & 59 deletions metamakeMPIDebug.sh

This file was deleted.

20 changes: 1 addition & 19 deletions src/ConfigSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,25 +1743,7 @@ void ConfigSetup::Init(const char *fileName, MultiSim *& multisim)
out.restart.settings.frequency);
} else
printf("%-40s %-s \n", "Info: Printing restart coordinate", "Inactive");
} else if (CheckString(line[0], "ParallelTemperingFreq")) {
out.parallelTempering.enable = checkBool(line[1]);
if(line.size() == 3){
out.parallelTempering.frequency = stringtoi(line[2]);
multisim->nst = out.parallelTempering.frequency;
}
if(out.parallelTempering.enable && (line.size() == 2)) {
if(sys.step.total > 1000) {
out.parallelTempering.frequency = (ulong)sys.step.total / 1000;
} else {
out.parallelTempering.frequency = (ulong)sys.step.total / 100;
}
}
if(out.parallelTempering.enable) {
printf("%-40s %-lu \n", "Info: Parallel Tempering frequency",
out.parallelTempering.frequency);
} else
printf("%-40s %-s \n", "Info: Parallel Tempering", "Inactive");
} else if(CheckString(line[0], "ConsoleFreq")) {
} else if(CheckString(line[0], "ConsoleFreq")) {
out.console.enable = checkBool(line[1]);
if(line.size() == 3)
out.console.frequency = stringtoi(line[2]);
Expand Down
6 changes: 1 addition & 5 deletions src/ConfigSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct Step {
//Holds the percentage of each kind of move for this ensemble.
struct MovePercents {
double displace, rotate, intraSwap, intraMemc, regrowth, crankShaft,
multiParticle;
multiParticle;
bool multiParticleEnabled;
#ifdef VARIABLE_VOLUME
double volume;
Expand Down Expand Up @@ -377,11 +377,7 @@ struct Statistics {
struct Output {
SysState state, restart;
Statistics statistics;
#if GOMC_LIB_MPI
EventSettings console, checkpoint, parallelTempering;
#else
EventSettings console, checkpoint;
#endif
};

}
Expand Down
26 changes: 1 addition & 25 deletions src/MoveConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ along with this program, also can be found at <http://www.gnu.org/licenses/>.

#include <vector>
#include <string>
#include "GOMC_Config.h"


namespace mv
{
Expand All @@ -34,13 +34,7 @@ const uint INTRA_SWAP = 3;
const uint REGROWTH = 4;
const uint INTRA_MEMC = 5;
const uint CRANKSHAFT = 6;
#if GOMC_LIB_MPI
const uint PARALLEL_TEMPERING = 7;
const uint MOVE_KINDS_TOTAL = 8;
const uint MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING = 7;
#else
const uint MOVE_KINDS_TOTAL = 7;
#endif
#elif ENSEMBLE == GCMC
const uint INTRA_SWAP = 3;
const uint REGROWTH = 4;
Expand All @@ -49,13 +43,7 @@ const uint CRANKSHAFT = 6;
const uint MEMC = 7;
const uint MOL_TRANSFER = 8;
const uint CFCMC = 9;
#if GOMC_LIB_MPI
const uint PARALLEL_TEMPERING = 10;
const uint MOVE_KINDS_TOTAL = 11;
const uint MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING = 10;
#else
const uint MOVE_KINDS_TOTAL = 10;
#endif
#elif ENSEMBLE == GEMC
const uint VOL_TRANSFER = 3;
const uint INTRA_SWAP = 4;
Expand All @@ -65,27 +53,15 @@ const uint CRANKSHAFT = 7;
const uint MEMC = 8;
const uint MOL_TRANSFER = 9;
const uint CFCMC = 10;
#if GOMC_LIB_MPI
const uint PARALLEL_TEMPERING = 11;
const uint MOVE_KINDS_TOTAL = 12;
const uint MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING = 11;
#else
const uint MOVE_KINDS_TOTAL = 11;
#endif
#elif ENSEMBLE == NPT
const uint VOL_TRANSFER = 3;
const uint INTRA_SWAP = 4;
const uint REGROWTH = 5;
const uint INTRA_MEMC = 6;
const uint CRANKSHAFT = 7;
#if GOMC_LIB_MPI
const uint PARALLEL_TEMPERING = 8;
const uint MOVE_KINDS_TOTAL = 9;
const uint MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING = 8;
#else
const uint MOVE_KINDS_TOTAL = 8;
#endif
#endif

const uint BOX0 = 0;
const uint BOX1 = 1;
Expand Down
4 changes: 0 additions & 4 deletions src/MoveSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ void MoveSettings::AdjustMoves(const uint step)
//Check whether we need to adjust this move's scaling.
if ((step + 1) % perAdjust == 0) {
for(uint b = 0; b < BOX_TOTAL; b++) {
#if GOMC_LIB_MPI
for (uint m = 0; m < mv::MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING; ++m) {
#else
for (uint m = 0; m < mv::MOVE_KINDS_TOTAL; ++m) {
#endif
for(uint k = 0; k < totKind; k++) {
Adjust(b, m, k);
}
Expand Down
3 changes: 1 addition & 2 deletions src/MoveSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ along with this program, also can be found at <http://www.gnu.org/licenses/>.
#include "PDBSetup.h" //Primary source of volume.
#include "MoveConst.h" //For sizes of arrays.
#include <vector>
#include "GOMC_Config.h"

namespace mp {
const int MPDISPLACE = 0;
Expand Down Expand Up @@ -79,7 +78,7 @@ class MoveSettings

void AdjustMultiParticle(const uint box, const uint typePick);

void UpdateMoveSettingMultiParticle(uint box, bool isAccept, uint typePick);
void UpdateMoveSettingMultiParticle(uint box, bool isAccept, uint typePick);

double Scale(const uint box, const uint move, const uint kind = 0) const
{
Expand Down
33 changes: 0 additions & 33 deletions src/ParallelTemperingMPIMethods.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions src/ParallelTemperingMPIMethods.h

This file was deleted.

3 changes: 3 additions & 0 deletions src/ParallelTemperingPreprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ std::string ParallelTemperingPreprocessor::mkdirWrapper(std::string multisimDire
std::string pathToReplicaDirectory = replicaStream.str();
replicaStream << "ConsoleOut.dat";
std::string pathToReplicaLogFile = replicaStream.str();
//std::ofstream out(pathToReplicaLogFile);
//std::streambuf * coutbuf;
//auto coutbuf = std::cout.rdbuf(out.rdbuf()); //save and redirect
freopen(pathToReplicaLogFile.c_str(),"w",stdout);
return pathToReplicaDirectory;

Expand Down
2 changes: 1 addition & 1 deletion src/ParallelTemperingPreprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class MultiSim {
public:
explicit MultiSim(int worldSize, int worldRank, std::string pathToReplicaDirectory);
int worldSize, worldRank;
ulong nst;
std::string pathToReplicaDirectory;


private:
};
#endif /*ParallelTemperingPreprocessor_H*/
4 changes: 2 additions & 2 deletions src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Simulation::Simulation(char const*const configFileName, MultiSim *& multisim)
staticValues = new StaticVals(set);
system = new System(*staticValues);
staticValues->Init(set, *system);
system->Init(set, startStep, multisim, step);
system->Init(set, startStep);
//recal Init for static value for initializing ewald since ewald is
//initialized in system
staticValues->InitOver(set, *system);
Expand Down Expand Up @@ -96,7 +96,7 @@ void Simulation::RunSimulation(void)
cpu->Output(frameSteps[i] - 1);
}
}
for (step = startStep; step < totalSteps; step++) {
for (ulong step = startStep; step < totalSteps; step++) {
system->moveSettings.AdjustMoves(step);
system->ChooseAndRunMove(step);
cpu->Output(step);
Expand Down
1 change: 0 additions & 1 deletion src/Simulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Simulation
std::vector<ulong> frameSteps;
uint remarksCount;
ulong startStep;
ulong step;
};

#endif /*SIMULATION_H*/
17 changes: 0 additions & 17 deletions src/StaticVals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,14 @@ void StaticVals::InitMovePercents(config_setup::MovePercents const& perc)
movePerc[m] = perc.cfcmc;
break;
#endif
#endif
#if GOMC_LIB_MPI
case mv::PARALLEL_TEMPERING :
// Double check this isn't an off by 1 error. Simple test, check value when sPPT == 1; should
// be 100%
movePerc[m] = (double)(((totalSteps - equilSteps) / stepsPerParallelTempering) / (totalSteps - equilSteps));
continue;
#endif
default:
movePerc[m] = 0.0;
break;
}
totalPerc += movePerc[m];
}
#if GOMC_MPI_LIB
for (uint m = 0; m < mv::MOVE_KINDS_TOTAL_EXCLUDING_PARALLEL_TEMPERING; m++)
#else
for (uint m = 0; m < mv::MOVE_KINDS_TOTAL; m++)
#endif
movePerc[m] /= totalPerc;
totalPerc = 1.0;
}
Expand Down Expand Up @@ -143,12 +132,6 @@ StaticVals::StaticVals(Setup & set) : memcVal(set.config.sys.memcVal),
intraMemcVal(set.config.sys.intraMemcVal),
cfcmcVal(set.config.sys.cfcmcVal),
freeEnVal(set.config.sys.freeEn)
#if GOMC_LIB_MPI
, stepsPerParallelTempering(set.config.out.parallelTempering.frequency),
enableParallelTempering(set.config.out.parallelTempering.enable),
equilSteps(set.config.sys.step.equil),
totalSteps(set.config.sys.step.total)
#endif
{
multiParticleEnabled = set.config.sys.moves.multiParticleEnabled;
isOrthogonal = true;
Expand Down
8 changes: 0 additions & 8 deletions src/StaticVals.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ along with this program, also can be found at <http://www.gnu.org/licenses/>.
#include "BoxDimensionsNonOrth.h"
#include "MoleculeLookup.h"
#include "Molecules.h"
#include "GOMC_Config.h"

class Setup;
class System;
Expand Down Expand Up @@ -59,13 +58,6 @@ class StaticVals
double totalPerc;
config_setup::MEMCVal intraMemcVal;
config_setup::FreeEnergy freeEnVal;
// This is assigned a value from set, and then used to assign value to system's copy of stepsPerParallelTempering
#if GOMC_LIB_MPI
ulong & stepsPerParallelTempering;
bool & enableParallelTempering;
ulong & equilSteps;
ulong & totalSteps;
#endif

//Only include these variables if they're static for this ensemble...
#ifndef VARIABLE_VOLUME
Expand Down
Loading

0 comments on commit c2803ce

Please sign in to comment.