Skip to content
Snippets Groups Projects
Commit fbe7d378 authored by Armin Damon Riess's avatar Armin Damon Riess
Browse files

sligthly improved efficiency (~2.5 sec)

parent 30115a72
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -68,7 +68,7 @@ void nBodySim::calculateForces() {
forces_[i] = 0.0;
}
// loop over each pair of particles and calculate the force between them
#pragma omp parallel for schedule(guided)
#pragma omp parallel for // schedule(guided)
for (unsigned i = 0; i < nParticles_; i++) {
double mi = masses_[i];
double s = softening_[i];
......
......@@ -36,7 +36,8 @@ int main(int argc, char** argv) {
try {
auto start = std::chrono::high_resolution_clock::now();
sim.calculateForces();
// for (unsigned i=0; i<100; ++i)
sim.calculateForces();
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(stop - start);
......
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