Permalink
Browse files

added openmp calculation

  • Loading branch information...
1 parent 1dda5e4 commit fcfa2c5c1f42b8120a0b1a13598235a32283bb5c Dmitry Cherkassov committed May 24, 2012
Showing with 10 additions and 6 deletions.
  1. +5 −2 Makefile
  2. +5 −4 particles.cpp
View
@@ -1,5 +1,8 @@
-particles: particles.cpp
- g++ -o particles particles.cpp -lglut -lGL -lGLU
+particles: particles.cpp
+# g++ -O2 -o particles particles.cpp -lglut -lGL -lGLU
+ g++ -O2 -o particles particles.cpp -lglut -lGL -lGLU -fopenmp
+#g++ -o particles -pg particles.cpp -lglut -lGL -lGLU
+
clean:
rm particles *.o
View
@@ -21,7 +21,7 @@ using namespace std;
float rtri; // Angle For The Triangle
float rquad; // Angle For The Quad
-const int Nvr = 30;
+const int Nvr = 35;
const int ws = 1.0; //wire step
@@ -91,6 +91,7 @@ vector<GLdouble> GetOGLPos(int x, int y)
void calcParticles()
{
+#pragma omp parallel for
for (int i = 0; i < pVecSz; i++)
{
// printf("winx = %f\t",winx);
@@ -344,9 +345,9 @@ void motion(int x,int y)
Y = pos[1] * 300;
Z = 0;
- printf("X = %f\t",(float)X);
- printf("Y = %f\t",(float)Y);
- printf("Z = %f\n",(float)Z);
+ // printf("X = %f\t",(float)X);
+ // printf("Y = %f\t",(float)Y);
+ // printf("Z = %f\n",(float)Z);
}
void mouse(int button, int state, int x, int y)

0 comments on commit fcfa2c5

Please sign in to comment.