54 |
|
#include "math/Vector3.hpp" |
55 |
|
#include "primitives/Molecule.hpp" |
56 |
|
#include "primitives/StuntDouble.hpp" |
57 |
– |
#include "UseTheForce/DarkSide/neighborLists_interface.h" |
58 |
– |
#include "UseTheForce/doForces_interface.h" |
57 |
|
#include "utils/MemoryUtils.hpp" |
58 |
|
#include "utils/simError.h" |
59 |
|
#include "selection/SelectionManager.hpp" |
60 |
|
#include "io/ForceFieldOptions.hpp" |
61 |
|
#include "UseTheForce/ForceField.hpp" |
62 |
|
#include "nonbonded/SwitchingFunction.hpp" |
65 |
– |
|
66 |
– |
#ifdef IS_MPI |
67 |
– |
#include "UseTheForce/mpiComponentPlan.h" |
68 |
– |
#include "UseTheForce/DarkSide/simParallel_interface.h" |
69 |
– |
#endif |
63 |
|
|
64 |
|
using namespace std; |
65 |
|
namespace OpenMD { |
770 |
|
temp = usesElectrostatic; |
771 |
|
MPI_Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
772 |
|
#endif |
780 |
– |
fInfo_.SIM_uses_PBC = usesPeriodicBoundaries_; |
781 |
– |
fInfo_.SIM_uses_DirectionalAtoms = usesDirectionalAtoms_; |
782 |
– |
fInfo_.SIM_uses_MetallicAtoms = usesMetallicAtoms_; |
783 |
– |
fInfo_.SIM_requires_SkipCorrection = usesElectrostaticAtoms_; |
784 |
– |
fInfo_.SIM_requires_SelfCorrection = usesElectrostaticAtoms_; |
785 |
– |
fInfo_.SIM_uses_AtomicVirial = usesAtomicVirial_; |
773 |
|
} |
774 |
|
|
775 |
|
|
880 |
|
int* oneThreeList = oneThreeInteractions_.getPairList(); |
881 |
|
int* oneFourList = oneFourInteractions_.getPairList(); |
882 |
|
|
883 |
< |
setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray_[0], |
884 |
< |
&nExclude, excludeList, |
885 |
< |
&nOneTwo, oneTwoList, |
886 |
< |
&nOneThree, oneThreeList, |
887 |
< |
&nOneFour, oneFourList, |
888 |
< |
&molMembershipArray[0], &mfact[0], &nCutoffGroups_, |
889 |
< |
&fortranGlobalGroupMembership[0], &isError); |
903 |
< |
|
904 |
< |
if( isError ){ |
905 |
< |
|
906 |
< |
sprintf( painCave.errMsg, |
907 |
< |
"There was an error setting the simulation information in fortran.\n" ); |
908 |
< |
painCave.isFatal = 1; |
909 |
< |
painCave.severity = OPENMD_ERROR; |
910 |
< |
simError(); |
911 |
< |
} |
883 |
> |
//setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray_[0], |
884 |
> |
// &nExclude, excludeList, |
885 |
> |
// &nOneTwo, oneTwoList, |
886 |
> |
// &nOneThree, oneThreeList, |
887 |
> |
// &nOneFour, oneFourList, |
888 |
> |
// &molMembershipArray[0], &mfact[0], &nCutoffGroups_, |
889 |
> |
// &fortranGlobalGroupMembership[0], &isError); |
890 |
|
|
891 |
+ |
// if( isError ){ |
892 |
+ |
// |
893 |
+ |
// sprintf( painCave.errMsg, |
894 |
+ |
// "There was an error setting the simulation information in fortran.\n" ); |
895 |
+ |
// painCave.isFatal = 1; |
896 |
+ |
// painCave.severity = OPENMD_ERROR; |
897 |
+ |
// simError(); |
898 |
+ |
//} |
899 |
|
|
914 |
– |
sprintf( checkPointMsg, |
915 |
– |
"succesfully sent the simulation information to fortran.\n"); |
900 |
|
|
901 |
< |
errorCheckPoint(); |
901 |
> |
// sprintf( checkPointMsg, |
902 |
> |
// "succesfully sent the simulation information to fortran.\n"); |
903 |
|
|
904 |
+ |
// errorCheckPoint(); |
905 |
+ |
|
906 |
|
// Setup number of neighbors in neighbor list if present |
907 |
< |
if (simParams_->haveNeighborListNeighbors()) { |
908 |
< |
int nlistNeighbors = simParams_->getNeighborListNeighbors(); |
909 |
< |
setNeighbors(&nlistNeighbors); |
910 |
< |
} |
907 |
> |
//if (simParams_->haveNeighborListNeighbors()) { |
908 |
> |
// int nlistNeighbors = simParams_->getNeighborListNeighbors(); |
909 |
> |
// setNeighbors(&nlistNeighbors); |
910 |
> |
//} |
911 |
|
|
912 |
|
#ifdef IS_MPI |
913 |
< |
mpiSimData parallelData; |
913 |
> |
// mpiSimData parallelData; |
914 |
|
|
915 |
|
//fill up mpiSimData struct |
916 |
< |
parallelData.nMolGlobal = getNGlobalMolecules(); |
917 |
< |
parallelData.nMolLocal = getNMolecules(); |
918 |
< |
parallelData.nAtomsGlobal = getNGlobalAtoms(); |
919 |
< |
parallelData.nAtomsLocal = getNAtoms(); |
920 |
< |
parallelData.nGroupsGlobal = getNGlobalCutoffGroups(); |
921 |
< |
parallelData.nGroupsLocal = getNCutoffGroups(); |
922 |
< |
parallelData.myNode = worldRank; |
923 |
< |
MPI_Comm_size(MPI_COMM_WORLD, &(parallelData.nProcessors)); |
916 |
> |
// parallelData.nMolGlobal = getNGlobalMolecules(); |
917 |
> |
// parallelData.nMolLocal = getNMolecules(); |
918 |
> |
// parallelData.nAtomsGlobal = getNGlobalAtoms(); |
919 |
> |
// parallelData.nAtomsLocal = getNAtoms(); |
920 |
> |
// parallelData.nGroupsGlobal = getNGlobalCutoffGroups(); |
921 |
> |
// parallelData.nGroupsLocal = getNCutoffGroups(); |
922 |
> |
// parallelData.myNode = worldRank; |
923 |
> |
// MPI_Comm_size(MPI_COMM_WORLD, &(parallelData.nProcessors)); |
924 |
|
|
925 |
|
//pass mpiSimData struct and index arrays to fortran |
926 |
|
//setFsimParallel(¶llelData, &(parallelData.nAtomsLocal), |
927 |
|
// &localToGlobalAtomIndex[0], &(parallelData.nGroupsLocal), |
928 |
|
// &localToGlobalCutoffGroupIndex[0], &isError); |
929 |
|
|
930 |
< |
if (isError) { |
931 |
< |
sprintf(painCave.errMsg, |
932 |
< |
"mpiRefresh errror: fortran didn't like something we gave it.\n"); |
933 |
< |
painCave.isFatal = 1; |
934 |
< |
simError(); |
935 |
< |
} |
930 |
> |
// if (isError) { |
931 |
> |
// sprintf(painCave.errMsg, |
932 |
> |
// "mpiRefresh errror: fortran didn't like something we gave it.\n"); |
933 |
> |
// painCave.isFatal = 1; |
934 |
> |
// simError(); |
935 |
> |
// } |
936 |
|
|
937 |
< |
sprintf(checkPointMsg, " mpiRefresh successful.\n"); |
938 |
< |
errorCheckPoint(); |
937 |
> |
// sprintf(checkPointMsg, " mpiRefresh successful.\n"); |
938 |
> |
// errorCheckPoint(); |
939 |
|
#endif |
940 |
|
|
941 |
< |
initFortranFF(&isError); |
942 |
< |
if (isError) { |
943 |
< |
sprintf(painCave.errMsg, |
944 |
< |
"initFortranFF errror: fortran didn't like something we gave it.\n"); |
945 |
< |
painCave.isFatal = 1; |
946 |
< |
simError(); |
947 |
< |
} |
948 |
< |
fortranInitialized_ = true; |
941 |
> |
// initFortranFF(&isError); |
942 |
> |
// if (isError) { |
943 |
> |
// sprintf(painCave.errMsg, |
944 |
> |
// "initFortranFF errror: fortran didn't like something we gave it.\n"); |
945 |
> |
// painCave.isFatal = 1; |
946 |
> |
// simError(); |
947 |
> |
// } |
948 |
> |
// fortranInitialized_ = true; |
949 |
|
} |
950 |
|
|
951 |
|
void SimInfo::addProperty(GenericData* genData) { |