Skip to content
Snippets Groups Projects
Commit 05ba8652 authored by cmaffeo2's avatar cmaffeo2
Browse files

Fix crashes caused by unneccesary updateParticleList call prior to RB attached...

Fix crashes caused by unneccesary updateParticleList call prior to RB attached particle update and improper initialization of atomic indicies for RB attached particles
parent 9b793d12
No related branches found
No related tags found
No related merge requests found
...@@ -566,19 +566,20 @@ void GrandBrownTown::run() ...@@ -566,19 +566,20 @@ void GrandBrownTown::run()
wkf_timer_start(timer0); wkf_timer_start(timer0);
wkf_timer_start(timerS); wkf_timer_start(timerS);
if (fullLongRange == 0) //// Happens at step 1 later anyway!
{ // if (fullLongRange == 0)
// cudaSetDevice(0); // {
internal->decompose(); // // cudaSetDevice(0);
gpuErrchk(cudaDeviceSynchronize()); // internal->decompose();
#ifdef _OPENMP // gpuErrchk(cudaDeviceSynchronize());
omp_set_num_threads(4); // #ifdef _OPENMP
#endif // omp_set_num_threads(4);
#pragma omp parallel for // #endif
for(int i = 0; i < numReplicas; ++i) // #pragma omp parallel for
RBC[i]->updateParticleLists( (internal->getPos_d()[0])+i*(num+conf.num_rb_attached_particles), sys_d); // for(int i = 0; i < numReplicas; ++i)
gpuErrchk(cudaDeviceSynchronize()); // RBC[i]->updateParticleLists( (internal->getPos_d()[0])+i*(num+conf.num_rb_attached_particles), sys_d);
} // gpuErrchk(cudaDeviceSynchronize());
// }
float t; // simulation time float t; // simulation time
...@@ -643,7 +644,6 @@ void GrandBrownTown::run() ...@@ -643,7 +644,6 @@ void GrandBrownTown::run()
switch (fullLongRange) switch (fullLongRange)
{ {
case 0: // [ N*log(N) ] interactions, + cutoff | decomposition case 0: // [ N*log(N) ] interactions, + cutoff | decomposition
if (s % decompPeriod == 0)
{ {
// cudaSetDevice(0); // cudaSetDevice(0);
internal -> decompose(); internal -> decompose();
......
...@@ -217,7 +217,7 @@ void RigidBodyType::initializeParticleLists() { ...@@ -217,7 +217,7 @@ void RigidBodyType::initializeParticleLists() {
// Build temporary id array of type j particles // Build temporary id array of type j particles
int tmp[conf->numPartsOfType[j]]; int tmp[conf->numPartsOfType[j]];
int currId = 0; int currId = 0;
for (int aid = 0; aid < conf->num; ++aid) { for (int aid = 0; aid < conf->num + conf->num_rb_attached_particles ; ++aid) {
if (conf->type[aid] == j) if (conf->type[aid] == j)
tmp[currId++] = aid; tmp[currId++] = aid;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment