Skip to content

Commit 8ae6d74

Browse files
Merge pull request #61 from Zhaoli2042/main
PR: small change of code and initial pybind mix
2 parents 2b9c6e9 + f8b22f7 commit 8ae6d74

15 files changed

+657
-113
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ A detailed installation note for gRASPA on CentOS/Ubuntu 24.04 is documented in
2828
* A40, A100, RTX 3080 Ti, RTX 3090, RTX 4090.
2929
* 🤯: RTX 3090/4090 is faster than A40/A100 for gRASPA
3030
* gRASPA has a SYCL version (experimental) that supports other devices, available in [Releases](https://github.com/snurr-group/gRASPA/releases)
31+
32+
### Pybind Extension (testing)
33+
* Pybind extension for gRASPA allows user to interact with the **internal variables** of gRASPA, break down **MC moves**, add their **modifications**
34+
* Access the pybind-gRASPA extension [here](https://github.com/Zhaoli2042/gRASPA_pybind), as a patch to the original code
35+
3136
## Quick Start
3237
* Go to [```Examples/```](Examples/) folder and read more!
3338

@@ -75,11 +80,11 @@ A detailed installation note for gRASPA on CentOS/Ubuntu 24.04 is documented in
7580
| Automatic Determination<br>of # unit cells | | | :heavy_check_mark: |
7681

7782
## Authors
78-
* Zhao Li (Northwestern University, currently at Purdue University)
79-
* Kaihang Shi (Northwestern University, currently at University at Buffalo)
80-
* David Dubbeldam (University of Amsterdam)
81-
* Mark Dewing (Argonne National Laboratory)
82-
* Christopher Knight (Argonne National Laboratory)
83-
* Alvaro Vazquez Mayagoitia (Argonne National Laboratory)
84-
* Randall Q. Snurr (Northwestern University)
83+
* Zhao Li (Northwestern University, currently at Purdue University/University of Notre Dame, [email protected])
84+
* Kaihang Shi (Northwestern University, currently at University at Buffalo, [email protected])
85+
* David Dubbeldam (University of Amsterdam, [email protected])
86+
* Mark Dewing (Argonne National Laboratory, [email protected])
87+
* Christopher Knight (Argonne National Laboratory, [email protected])
88+
* Alvaro Vazquez Mayagoitia (Argonne National Laboratory, [email protected])
89+
* Randall Q. Snurr (Northwestern University, [email protected])
8590

src_clean/DNN_HostGuest_Energy_Functions.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010
#include "read_data.h"
1111
//###PATCH_LCLIN_INCLUDE_HEADER###//
1212

13-
__global__ void Initialize_DNN_Positions(Atoms* d_a, Atoms New, Atoms Old, size_t Oldsize, size_t Newsize, size_t SelectedComponent, size_t Location, size_t chainsize, int MoveType, size_t CYCLE)
13+
__global__ void Initialize_DNN_Positions(Atoms* d_a, Atoms New, Atoms Old, double3* temp, size_t Oldsize, size_t Newsize, size_t SelectedComponent, size_t Location, size_t chainsize, int MoveType, size_t CYCLE)
1414
{
15+
size_t ij = blockIdx.x * blockDim.x + threadIdx.x;
16+
17+
if(ij < (Newsize + Oldsize))
18+
{
19+
Initialize_Copy_Positions_Together(d_a, New, Old, temp, Oldsize, Newsize, SelectedComponent, Location, chainsize, MoveType);
20+
}
21+
/*
1522
//Zhao's note: need to think about changing this boolean to switch//
1623
if(MoveType == TRANSLATION || MoveType == ROTATION || MoveType == SINGLE_INSERTION || MoveType == SINGLE_DELETION) // Translation/Rotation/single_insertion/single_deletion //
1724
{
@@ -53,6 +60,8 @@ __global__ void Initialize_DNN_Positions(Atoms* d_a, Atoms New, Atoms Old, size_
5360
Old.scaleCoul[i] = d_a[SelectedComponent].scaleCoul[Location + i];
5461
}
5562
}
63+
*/
64+
5665
/*
5766
if(CYCLE == 145)
5867
{
@@ -62,7 +71,7 @@ __global__ void Initialize_DNN_Positions(Atoms* d_a, Atoms New, Atoms Old, size_
6271
*/
6372
}
6473

65-
void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, Components& SystemComponents, size_t SelectedComponent, int MoveType, size_t Location)
74+
void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, double3* temp, Components& SystemComponents, size_t SelectedComponent, int MoveType, size_t Location)
6675
{
6776
size_t Oldsize = 0; size_t Newsize = 0; size_t chainsize = 0;
6877
switch(MoveType)
@@ -90,8 +99,11 @@ void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, Component
9099
}
91100
case REINSERTION: // Reinsertion //
92101
{
93-
throw std::runtime_error("Use the Special Function for Reinsertion");
94-
//break;
102+
Oldsize = SystemComponents.Moleculesize[SelectedComponent];
103+
Newsize = SystemComponents.Moleculesize[SelectedComponent];
104+
chainsize = SystemComponents.Moleculesize[SelectedComponent];
105+
//throw std::runtime_error("Use the Special Function for Reinsertion");
106+
break;
95107
}
96108
case IDENTITY_SWAP:
97109
{
@@ -120,7 +132,9 @@ void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, Component
120132
break;
121133
}
122134
}
123-
Initialize_DNN_Positions<<<1,1>>>(d_a, New, Old, Oldsize, Newsize, SelectedComponent, Location, chainsize, MoveType, SystemComponents.CURRENTCYCLE);
135+
//Initialize_DNN_Positions<<<1,1>>>(d_a, New, Old, Oldsize, Newsize, SelectedComponent, Location, chainsize, MoveType, SystemComponents.CURRENTCYCLE);
136+
size_t Nblock = 0; size_t Nthread = 0; Setup_threadblock(Oldsize + Newsize, Nblock, Nthread);
137+
Initialize_DNN_Positions<<<Nblock,Nthread>>>(d_a, New, Old, SystemComponents.tempMolStorage, Oldsize, Newsize, SelectedComponent, Location, chainsize, MoveType, SystemComponents.CURRENTCYCLE);
124138
}
125139

126140
__global__ void Initialize_DNN_Positions_Reinsertion(double3* temp, Atoms* d_a, Atoms Old, size_t Oldsize, size_t Newsize, size_t realpos, size_t SelectedComponent)

src_clean/Ewald_Energy_Functions.h

Lines changed: 61 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -102,46 +102,71 @@ __device__ void Initialize_Vectors_thread(Complex* eik, size_t numberOfAtoms, in
102102
eik[i + k * numberOfAtoms] = multiply(eik[i + (k - 1) * numberOfAtoms], eik[i + 1 * numberOfAtoms]);
103103
}
104104
}
105-
106-
__global__ void Initialize_WaveVector_General(Boxsize Box, int3 kmax, Atoms* d_a, Atoms New, Atoms Old, size_t Oldsize, size_t Newsize, size_t SelectedComponent, size_t Location, size_t chainsize, size_t numberOfAtoms, int MoveType)
105+
//Copy Old positions and new positions together into Old//
106+
//including double3* temp, for reinsertion//
107+
__device__ void Initialize_Copy_Positions_Together(Atoms*& d_a, Atoms& New, Atoms& Old, double3* temp, size_t Oldsize, size_t Newsize, size_t SelectedComponent, size_t Location, size_t chainsize, int MoveType)
107108
{
108-
//Zhao's note: need to think about changing this boolean to switch//
109109
size_t ij = blockIdx.x * blockDim.x + threadIdx.x;
110-
if(ij < (Newsize + Oldsize))
110+
if(MoveType == TRANSLATION || MoveType == ROTATION || MoveType == SPECIAL_ROTATION || MoveType == SINGLE_INSERTION || MoveType == SINGLE_DELETION) // Translation/Rotation/single_insertion/single_deletion //
111111
{
112-
if(MoveType == TRANSLATION || MoveType == ROTATION || MoveType == SPECIAL_ROTATION || MoveType == SINGLE_INSERTION || MoveType == SINGLE_DELETION) // Translation/Rotation/single_insertion/single_deletion //
112+
//For Translation/Rotation, the Old positions are already in the Old struct, just need to put the New positions into Old, after the Old positions//
113+
if(ij >= Oldsize)
113114
{
114-
//For Translation/Rotation, the Old positions are already in the Old struct, just need to put the New positions into Old, after the Old positions//
115-
if(ij >= Oldsize)
116-
{
117-
Old.pos[ij] = New.pos[ij - Oldsize];
118-
Old.scale[ij] = New.scale[ij - Oldsize];
119-
Old.charge[ij] = New.charge[ij - Oldsize];
120-
Old.scaleCoul[ij] = New.scaleCoul[ij - Oldsize];
121-
}
115+
Old.pos[ij] = New.pos[ij - Oldsize];
116+
Old.scale[ij] = New.scale[ij - Oldsize];
117+
Old.charge[ij] = New.charge[ij - Oldsize];
118+
Old.scaleCoul[ij] = New.scaleCoul[ij - Oldsize];
122119
}
123-
else if(MoveType == INSERTION || MoveType == CBCF_INSERTION) // Insertion & Fractional Insertion //
120+
}
121+
else if(MoveType == INSERTION || MoveType == CBCF_INSERTION) // Insertion & Fractional Insertion //
122+
{
123+
//Put the trial orientations in New to Old, right after the first bead position//
124+
if(ij < chainsize)
124125
{
125-
//Put the trial orientations in New to Old, right after the first bead position//
126-
if(ij < chainsize)
127-
{
128-
Old.pos[ij + 1] = New.pos[Location * chainsize + ij];
129-
Old.scale[ij + 1] = New.scale[Location * chainsize + ij];
130-
Old.charge[ij + 1] = New.charge[Location * chainsize + ij];
131-
Old.scaleCoul[ij + 1] = New.scaleCoul[Location * chainsize + ij];
132-
}
126+
Old.pos[ij + 1] = New.pos[Location * chainsize + ij];
127+
Old.scale[ij + 1] = New.scale[Location * chainsize + ij];
128+
Old.charge[ij + 1] = New.charge[Location * chainsize + ij];
129+
Old.scaleCoul[ij + 1] = New.scaleCoul[Location * chainsize + ij];
133130
}
134-
else if(MoveType == DELETION || MoveType == CBCF_DELETION) // Deletion //
131+
}
132+
else if(MoveType == DELETION || MoveType == CBCF_DELETION) // Deletion //
133+
{
134+
if(ij < Oldsize)
135135
{
136-
if(ij < Oldsize)
137-
{
138-
// For deletion, Location = UpdateLocation, see Deletion Move //
139-
Old.pos[ij] = d_a[SelectedComponent].pos[Location + ij];
140-
Old.scale[ij] = d_a[SelectedComponent].scale[Location + ij];
141-
Old.charge[ij] = d_a[SelectedComponent].charge[Location + ij];
142-
Old.scaleCoul[ij] = d_a[SelectedComponent].scaleCoul[Location + ij];
143-
}
136+
// For deletion, Location = UpdateLocation, see Deletion Move //
137+
Old.pos[ij] = d_a[SelectedComponent].pos[Location + ij];
138+
Old.scale[ij] = d_a[SelectedComponent].scale[Location + ij];
139+
Old.charge[ij] = d_a[SelectedComponent].charge[Location + ij];
140+
Old.scaleCoul[ij] = d_a[SelectedComponent].scaleCoul[Location + ij];
144141
}
142+
}
143+
else if(MoveType == REINSERTION)
144+
{
145+
if(ij < Oldsize)
146+
{
147+
Old.pos[ij] = d_a[SelectedComponent].pos[Location + ij];
148+
Old.scale[ij] = d_a[SelectedComponent].scale[Location + ij];
149+
Old.charge[ij] = d_a[SelectedComponent].charge[Location + ij];
150+
Old.scaleCoul[ij] = d_a[SelectedComponent].scaleCoul[Location + ij];
151+
}
152+
else
153+
{
154+
Old.pos[ij] = temp[ij - Oldsize];
155+
Old.scale[ij] = d_a[SelectedComponent].scale[Location + ij - Oldsize];
156+
Old.charge[ij] = d_a[SelectedComponent].charge[Location + ij - Oldsize];
157+
Old.scaleCoul[ij] = d_a[SelectedComponent].scaleCoul[Location + ij - Oldsize];
158+
}
159+
}
160+
}
161+
162+
__global__ void Initialize_WaveVector_General(Boxsize Box, int3 kmax, Atoms* d_a, Atoms New, Atoms Old, double3* temp, size_t Oldsize, size_t Newsize, size_t SelectedComponent, size_t Location, size_t chainsize, size_t numberOfAtoms, int MoveType)
163+
{
164+
//Zhao's note: need to think about changing this boolean to switch//
165+
size_t ij = blockIdx.x * blockDim.x + threadIdx.x;
166+
167+
if(ij < (Newsize + Oldsize))
168+
{
169+
Initialize_Copy_Positions_Together(d_a, New, Old, temp, Oldsize, Newsize, SelectedComponent, Location, chainsize, MoveType);
145170
//Old+New//
146171
Complex tempcomplex; tempcomplex.real = 1.0; tempcomplex.imag = 0.0;
147172
tempcomplex.real = 1.0; tempcomplex.imag = 0.0;
@@ -224,8 +249,6 @@ __global__ void Initialize_WaveVector_IdentitySwap(Boxsize Box, int3 kmax, doubl
224249
Old.charge[ij] = d_a[NEWComponent].charge[ij - Oldsize];
225250
Old.scaleCoul[ij] = 1.0;
226251
}
227-
228-
229252
//Old+New//
230253
Complex tempcomplex; tempcomplex.real = 1.0; tempcomplex.imag = 0.0;
231254
tempcomplex.real = 1.0; tempcomplex.imag = 0.0;
@@ -467,8 +490,10 @@ double2 GPU_EwaldDifference_General(Simulations& Sim, ForceField& FF, Components
467490
}
468491
case REINSERTION: // Reinsertion //
469492
{
470-
throw std::runtime_error("EWALD: Use the Special Function for Reinsertion");
471-
//break;
493+
Newsize = SystemComponents.Moleculesize[SelectedComponent];
494+
Oldsize = SystemComponents.Moleculesize[SelectedComponent];
495+
chainsize = SystemComponents.Moleculesize[SelectedComponent] - 1;
496+
break;
472497
}
473498
case IDENTITY_SWAP:
474499
{
@@ -501,7 +526,7 @@ double2 GPU_EwaldDifference_General(Simulations& Sim, ForceField& FF, Components
501526
size_t numberOfAtoms = Oldsize + Newsize;
502527

503528
size_t Nblock = 0; size_t Nthread = 0; Setup_threadblock(Oldsize + Newsize, Nblock, Nthread);
504-
Initialize_WaveVector_General<<<Nblock,Nthread>>>(Box, Box.kmax, d_a, New, Old, Oldsize, Newsize, SelectedComponent, Location, chainsize, numberOfAtoms, MoveType); checkCUDAErrorEwald("error Initializing Ewald Vectors");
529+
Initialize_WaveVector_General<<<Nblock,Nthread>>>(Box, Box.kmax, d_a, New, Old, SystemComponents.tempMolStorage, Oldsize, Newsize, SelectedComponent, Location, chainsize, numberOfAtoms, MoveType); checkCUDAErrorEwald("error Initializing Ewald Vectors");
505530

506531
//Fourier Loop//
507532
size_t numberOfStructureFactors = (Box.kmax.x + 1) * (2 * Box.kmax.y + 1) * (2 * Box.kmax.z + 1);
@@ -552,39 +577,6 @@ double2 GPU_EwaldDifference_General(Simulations& Sim, ForceField& FF, Components
552577
return {SameSum, 2.0 * CrossSum};
553578
}
554579

555-
//Zhao's note: THIS IS A SPECIAL FUNCTION JUST FOR REINSERTION//
556-
double2 GPU_EwaldDifference_Reinsertion(Boxsize& Box, Atoms*& d_a, Atoms& Old, double3* temp, ForceField& FF, double* Blocksum, Components& SystemComponents, size_t SelectedComponent, size_t UpdateLocation)
557-
{
558-
if(FF.noCharges && !SystemComponents.hasPartialCharge[SelectedComponent]) return {0.0, 0.0};
559-
double alpha = Box.Alpha; double alpha_squared = alpha * alpha;
560-
double prefactor = Box.Prefactor * (2.0 * M_PI / Box.Volume);
561-
562-
size_t numberOfAtoms = SystemComponents.Moleculesize[SelectedComponent];
563-
size_t Oldsize = 0; size_t Newsize = numberOfAtoms;
564-
//Zhao's note: translation/rotation/reinsertion involves new + old states. Insertion/Deletion only has the new state.
565-
Oldsize = SystemComponents.Moleculesize[SelectedComponent];
566-
numberOfAtoms += Oldsize;
567-
568-
Complex* SameType = Box.AdsorbateEik; Complex* CrossType = Box.FrameworkEik;
569-
570-
// Construct exp(ik.r) for atoms and k-vectors kx, ky, kz = 0, 1 explicitly
571-
size_t Nblock = 0; size_t Nthread = 0; Setup_threadblock(Oldsize + Newsize, Nblock, Nthread);
572-
Initialize_WaveVector_Reinsertion<<<Nblock,Nthread>>>(Box, Box.kmax, temp, d_a, Old, Oldsize, Newsize, UpdateLocation, numberOfAtoms, SelectedComponent);
573-
574-
//Fourier Loop//
575-
size_t numberOfStructureFactors = (Box.kmax.x + 1) * (2 * Box.kmax.y + 1) * (2 * Box.kmax.z + 1);
576-
Nblock = 0; Nthread = 0; Setup_threadblock(numberOfStructureFactors, Nblock, Nthread);
577-
Fourier_Ewald_Diff<<<Nblock * 2, Nthread, Nthread * sizeof(double)>>>(Box, SameType, CrossType, Old, alpha_squared, prefactor, Box.kmax, Oldsize, Newsize, Blocksum, false, Nblock);
578-
//double sum[Nblock * 2];
579-
double SameSum = 0.0; double CrossSum = 0.0;
580-
cudaMemcpy(SystemComponents.host_array, Blocksum, 2 * Nblock * sizeof(double), cudaMemcpyDeviceToHost);
581-
582-
for(size_t i = 0; i < Nblock; i++){SameSum += SystemComponents.host_array[i];}
583-
for(size_t i = Nblock; i < 2 * Nblock; i++){CrossSum += SystemComponents.host_array[i];}
584-
585-
return {SameSum, 2.0 * CrossSum};
586-
}
587-
588580
double2 GPU_EwaldDifference_IdentitySwap(Boxsize& Box, Atoms*& d_a, Atoms& Old, double3* temp, ForceField& FF, double* Blocksum, Components& SystemComponents, size_t OLDComponent, size_t NEWComponent, size_t UpdateLocation)
589581
{
590582
if(FF.noCharges && !SystemComponents.hasPartialCharge[NEWComponent] && !SystemComponents.hasPartialCharge[OLDComponent]) return {0.0, 0.0};

src_clean/VDW_Coulomb.cuh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ __global__ void Energy_difference_LambdaChange(Boxsize Box, Atoms* System, Atoms
9898
//////////////////////
9999
double CPU_EwaldDifference(Boxsize& Box, Atoms& New, Atoms& Old, ForceField& FF, Components& SystemComponents, size_t SelectedComponent, bool Swap, size_t SelectedTrial);
100100

101-
double2 GPU_EwaldDifference_Reinsertion(Boxsize& Box, Atoms*& d_a, Atoms& Old, double3* temp, ForceField& FF, double* Blocksum, Components& SystemComponents, size_t SelectedComponent, size_t UpdateLocation);
102-
103101
double2 GPU_EwaldDifference_IdentitySwap(Boxsize& Box, Atoms*& d_a, Atoms& Old, double3* temp, ForceField& FF, double* Blocksum, Components& SystemComponents, size_t OLDComponent, size_t NEWComponent, size_t UpdateLocation);
104102

105103
void Copy_Ewald_Vector(Simulations& Sim);
@@ -149,7 +147,7 @@ double TailCorrectionIdentitySwap(Components& SystemComponents, size_t NEWCompon
149147
// Deep Potential For Host-Guest //
150148
// General Functions //
151149
///////////////////////////////////
152-
void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, Components& SystemComponents, size_t SelectedComponent, int MoveType, size_t Location);
150+
void Prepare_DNN_InitialPositions(Atoms*& d_a, Atoms& New, Atoms& Old, double3* temp, Components& SystemComponents, size_t SelectedComponent, int MoveType, size_t Location);
153151

154152
void Prepare_DNN_InitialPositions_Reinsertion(Atoms*& d_a, Atoms& Old, double3* temp, Components& SystemComponents, size_t SelectedComponent, size_t Location);
155153

src_clean/axpy.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void Select_Box_Component_Molecule(Variables& Vars, size_t box_index)
9999

100100
Vars.RandomNumber = Get_Uniform_Random();
101101
}
102-
inline void RunMoves(Variables& Vars, size_t box_index, int Cycle)
102+
void RunMoves(Variables& Vars, size_t box_index, int Cycle)
103103
{
104104
MC_MOVES MOVES;
105105

src_clean/axpy.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ void Calculate_Exclusion_Energy_Rigid(Boxsize& Box, Atoms* System, ForceField FF
1616
void Check_WaveVector_CPUGPU(Boxsize& Box, Components& SystemComponents);
1717
*/
1818

19+
void RunMoves(Variables& Vars, size_t box_index, int Cycle);
20+
1921
double CreateMolecule_InOneBox(Variables& Vars, size_t systemId, bool AlreadyHasFractionalMolecule);
2022

2123
void Run_Simulation_MultipleBoxes(Variables& Vars);
@@ -49,7 +51,10 @@ __global__ void StoreNewLocation_Reinsertion(Atoms Mol, Atoms NewMol, double3* t
4951
__global__ void Update_Reinsertion_data(Atoms* d_a, double3* temp, size_t SelectedComponent, size_t UpdateLocation);
5052

5153
double GetPrefactor(Components& SystemComponents, Simulations& Sims, size_t SelectedComponent, int MoveType);
52-
void AcceptInsertion(Variables& Vars, size_t systemId, int MoveType, CBMC_Variables& InsertionVariables);
54+
55+
//void AcceptInsertion(Variables& Vars, size_t systemId, int MoveType, CBMC_Variables& InsertionVariables);
56+
void AcceptInsertion(Variables& Vars, CBMC_Variables& InsertionVariables, size_t systemId, int MoveType);
57+
5358
void AcceptDeletion(Variables& Vars, size_t systemId, int MoveType);
5459
MoveEnergy Insertion_Body(Variables& Vars, size_t systemId, CBMC_Variables& CBMC);
5560
MoveEnergy Deletion_Body(Variables& Vars, size_t systemId, CBMC_Variables& CBMC);
@@ -72,14 +77,4 @@ struct SingleMove
7277
}
7378
};
7479

75-
//struct InsertionMove;
76-
//struct InsertionMove {};
77-
//struct MC_MOVES {};
78-
/*
79-
struct MC_MOVES
80-
{
81-
InsertionMove INSERTION;
82-
};
83-
*/
84-
8580
#include "move_struct.h"

src_clean/data_struct.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ struct Simulations //For multiple simulations//
12291229
Atoms* d_a; // Pointer For Atom Data in the Simulation Box //
12301230
Atoms Old; // Temporary data storage for Old Configuration //
12311231
Atoms New; // Temporary data storage for New Configuration //
1232+
Atoms Temp; // Temporary storage (for xfering data and accepting move) //
12321233
int2* ExcludeList; // Atoms to exclude during energy calculations: x: component, y: molecule-ID (may need to add z and make it int3, z: atom-ID)
12331234
double* Blocksum; // Block sums for partial reduction //
12341235
bool* device_flag; // flags for overlaps on the device //

src_clean/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@ Variables Initialize(void) //for pybind
272272
Prepare_TempSystem_On_Host(Vars.SystemComponents[a].TempSystem);
273273
cudaMemcpy(Vars.Sims[a].d_a, device_System, sizeof(Atoms)*NComponents.x, cudaMemcpyHostToDevice);
274274
// SET UP TEMPORARY ARRAYS //
275-
Setup_Temporary_Atoms_Structure(Vars.Sims[a].Old, Vars.SystemComponents[a].HostSystem);
276-
Setup_Temporary_Atoms_Structure(Vars.Sims[a].New, Vars.SystemComponents[a].HostSystem);
275+
Setup_Temporary_Atoms_Structure(Vars.Sims[a].Old, Vars.SystemComponents[a].HostSystem);
276+
Setup_Temporary_Atoms_Structure(Vars.Sims[a].New, Vars.SystemComponents[a].HostSystem);
277+
Setup_Temporary_Atoms_Structure(Vars.Sims[a].Temp, Vars.SystemComponents[a].HostSystem);
277278

278279
if(Vars.SystemComponents[a].UseDNNforHostGuest)
279280
{

src_clean/main.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Variables Initialize(void);
2+
void RunSimulation(Variables& Vars);
3+
void EndOfSimulationWrapUp(Variables& Vars);
4+
5+
MoveEnergy check_energy_wrapper(Variables& Var, size_t i);
6+
void ENERGY_SUMMARY(Variables& Vars);

0 commit comments

Comments
 (0)