• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revisionc6746334c11b5fa2de91edb5f843d41d45b4560d (tree)
Zeit2017-04-16 01:14:12
Autormitsuaki1987 <kawamitsuaki@gmai...>
Commitermitsuaki1987

Log Message

More tuning of OpenMP and appearance

Ändern Zusammenfassung

Diff

--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
11
22 CC = gcc
33
4-CFLAGS=-O3 -lglut -lGLU -lGL -lm -g -fopenmp
4+CFLAGS=-g -O0 -lglut -lGLU -lGL -lm -fopenmp -g
55 # for mac
66 #CFLAGS=-D MAC -O3 -framework OpenGL -framework GLUT -lm
77
--- a/src/basic_math.c
+++ b/src/basic_math.c
@@ -29,6 +29,10 @@ THE SOFTWARE.
2929 #include <GL/glut.h>
3030 #endif
3131
32+#if defined(_OPENMP)
33+#include <omp.h>
34+#endif
35+
3236 /**
3337 *Work as Modulo function of fortran
3438 */
@@ -122,3 +126,13 @@ void normal_vec(
122126 norm = sqrtf(out[0] * out[0] + out[1] * out[1] + out[2] * out[2]);
123127 for (i = 0; i<3; i++) out[i] = out[i] / norm;
124128 } /* normal_vec */
129+
130+int get_thread() {
131+ int ithread;
132+#if defined(_OPENMP)
133+ ithread = omp_get_thread_num();
134+#else
135+ ithread = 0;
136+#endif
137+ return ithread;
138+}
--- a/src/basic_math.h
+++ b/src/basic_math.h
@@ -41,4 +41,5 @@ void normal_vec(
4141 GLfloat in1[3] /**< [in] Corner 1*/,
4242 GLfloat in2[3] /**< [in] Corner 2*/,
4343 GLfloat in3[3] /**< [in] Corner 3*/,
44- GLfloat out[3] /**< [out] The normal vector*/);
\ No newline at end of file
44+ GLfloat out[3] /**< [out] The normal vector*/);
45+int get_thread();
--- a/src/bz_lines.c
+++ b/src/bz_lines.c
@@ -131,7 +131,7 @@ void bz_lines() {
131131 }
132132 /**/
133133 if (query == 1) {
134- printf("# of lines for BZ : %d \n", nbzl);
134+ printf(" # of lines for BZ : %d\n", nbzl);
135135 /**/
136136 bzl = (GLfloat***)malloc(nbzl * sizeof(GLfloat*));
137137 for (ibzl = 0; ibzl < nbzl; ++ibzl) {
--- a/src/calc_nodeline.c
+++ b/src/calc_nodeline.c
@@ -25,6 +25,7 @@ THE SOFTWARE.
2525 #include <stdio.h>
2626 #include <math.h>
2727 #include "variable.h"
28+#include "basic_math.h"
2829
2930 #if defined(MAC)
3031 #include <GLUT/glut.h>
@@ -32,10 +33,6 @@ THE SOFTWARE.
3233 #include <GL/glut.h>
3334 #endif
3435
35-#if defined(_OPENMP)
36-#include <omp.h>
37-#endif
38-
3936 /**
4037 * Node line
4138 */
@@ -49,11 +46,7 @@ void calc_nodeline() {
4946 shared(nb,nnl,matp,ntri,ntri_th) \
5047 private(ib,itri,mprod,nnl0,ithread)
5148 {
52-#if defined(_OPENMP)
53- ithread = omp_get_thread_num();
54-#else
55- ithread = 0;
56-#endif
49+ ithread = get_thread();
5750 for (ib = 0; ib < nb; ib++) {
5851 nnl0 = 0;
5952 #pragma omp for
@@ -99,11 +92,10 @@ void calc_nodeline() {
9992 }
10093 ntri_th[ib][0] = 0;
10194 }
102- printf("band # of nodeline \n");
95+ printf(" band # of nodeline\n");
10396 for (ib = 0; ib < nb; ib++) {
104- printf("%d %d \n", ib + 1, nnl[ib]);
97+ printf(" %d %d\n", ib + 1, nnl[ib]);
10598 }
106- printf("\n");
10799 /**
108100 * Allocation of nodeline
109101 */
@@ -126,11 +118,7 @@ void calc_nodeline() {
126118 shared(nb,nnl,matp,kvnl,kvp,ntri,ntri_th) \
127119 private(ib,itri,mprod,i,nnl0,ithread)
128120 {
129-#if defined(_OPENMP)
130- ithread = omp_get_thread_num();
131-#else
132- ithread = 0;
133-#endif
121+ ithread = get_thread();
134122 for (ib = 0; ib < nb; ib++) {
135123 nnl0 = ntri_th[ib][ithread];
136124 #pragma omp for
--- a/src/fermi_patch.c
+++ b/src/fermi_patch.c
@@ -33,10 +33,6 @@ THE SOFTWARE.
3333 #include <GL/glut.h>
3434 #endif
3535
36-#if defined(_OPENMP)
37-#include <omp.h>
38-#endif
39-
4036 /**
4137 * Store triangle patch
4238 */
@@ -216,9 +212,19 @@ void fermi_patch()
216212 GLfloat kvec1[8][3], eig1[8], mat1[8];
217213 /**/
218214 if (fbz == 1) {
215+ if (query == 1) {
216+ printf("\n");
217+ printf(" ## First Brillouin zone mode #######\n");
218+ printf("\n");
219+ }
219220 for (i0 = 0; i0 < 3; ++i0) start[i0] = - ng[i0];
220221 }
221222 else {
223+ if (query == 1) {
224+ printf("\n");
225+ printf(" ## Premitive Brillouin zone mode #######\n");
226+ printf("\n");
227+ }
222228 for (i0 = 0; i0 < 3; ++i0) start[i0] = 0;
223229 }
224230 /**/
@@ -226,11 +232,7 @@ void fermi_patch()
226232 shared(nb,ntri,ntri_th,start,ng,ng0,eig,EF,mat,shiftk,query) \
227233 private(ib,j0,j1,j2,i0,i1,i2,ii0,ii1,ii2,kvec1,eig1,mat1,i,j,ntri0,ithread)
228234 {
229-#if defined(_OPENMP)
230- ithread = omp_get_thread_num();
231-#else
232- ithread = 0;
233-#endif
235+ ithread = get_thread();
234236 for (ib = 0; ib < nb; ++ib) {
235237
236238 if(query == 1) ntri0 = 0;
@@ -329,9 +331,9 @@ void fermi_patch()
329331 ntri_th[ib][0] = 0;
330332 }
331333 /**/
332- printf("band # of patchs \n");
334+ printf(" band # of patchs\n");
333335 for (ib = 0; ib < nb; ib++) {
334- printf("%d %d \n", ib + 1, ntri[ib]);
336+ printf(" %d %d\n", ib + 1, ntri[ib]);
335337 }
336338 printf("\n");
337339 /**
--- a/src/fermisurfer.c
+++ b/src/fermisurfer.c
@@ -80,12 +80,16 @@ int main(
8080 char *argv[] /**< [in] */)
8181 {
8282 printf("\n");
83- printf(" Welocome to FermiSurfer ver. 1.8\n");
83+ printf("########################################\n");
84+ printf("## ##\n");
85+ printf("## Welocome to FermiSurfer ver. 1.8 ##\n");
86+ printf("## ##\n");
87+ printf("########################################\n");
8488 printf("\n");
8589 if (argc < 2) {
8690 printf("\n");
87- printf(" Input file is not specified !\n");
88- printf(" Press any key to exit.\n");
91+ printf(" Input file is not specified !\n");
92+ printf(" Press any key to exit.\n");
8993 getchar();
9094 exit(-1);
9195 }
@@ -97,9 +101,9 @@ int main(
97101 #else
98102 nthreads = 1;
99103 #endif
100- printf(" Number of threads : %d\n", nthreads);
104+ printf(" Number of threads : %d\n", nthreads);
101105 printf("\n");
102- printf(" Initialize variables ...\n");
106+ printf(" Initialize variables ...\n");
103107 printf("\n");
104108 initialize_val();
105109 /**/
@@ -114,23 +118,23 @@ int main(
114118 /**/
115119 max_and_min_bz();
116120 /**/
117- printf("\n##### First Brillouin zone mode ##### \n\n");
118121 query = 1;
119122 fermi_patch();
120123 query = 0;
121124 fermi_patch();
122125 calc_nodeline();
123126 /**/
124- printf("\n##### Full color scale ##### \n\n");
125127 max_and_min();
126128 /*
127129 Description
128130 */
129- printf("\n##### How to handle ##### \n\n");
130- printf(" mouse drag : Rotate objects \n");
131- printf(" mousewheel : Resize objects \n");
132- printf(" cursorkey : Move objects \n");
133- printf(" mouse right button : Menu \n");
131+ printf("\n");
132+ printf(" ## How to handle ###################\n");
133+ printf("\n");
134+ printf(" mouse drag : Rotate objects\n");
135+ printf(" mousewheel : Resize objects\n");
136+ printf(" cursorkey : Move objects\n");
137+ printf(" mouse right button : Menu\n");
134138 printf("\n");
135139 /**/
136140 glutInit(&argc, argv);
--- a/src/free_patch.c
+++ b/src/free_patch.c
@@ -26,6 +26,7 @@ THE SOFTWARE.
2626 #include <math.h>
2727 #include <stdio.h>
2828 #include "variable.h"
29+#include "basic_math.h"
2930
3031 /**
3132 * Free variables for patch
@@ -80,133 +81,177 @@ void free_patch() {
8081 * Max. & Min. of matrix elements.
8182 */
8283 void max_and_min() {
83- int ib, itri, i, j, ierr;
84- GLfloat matmax, matmin, mat2;
85- /**/
86- matmax = -100000000.0000;
87- matmin = 100000000.0000;
84+ int ib, itri, i, j, ierr, ithread;
85+ GLfloat matmax, matmin, mat2, *max_th, *min_th;
86+
87+ max_th = (GLfloat*)malloc(nthreads * sizeof(GLfloat));
88+ min_th = (GLfloat*)malloc(nthreads * sizeof(GLfloat));
89+
90+ printf("\n");
91+ if (fcscl == 1) printf(" ## Full color scale mode #############\n");
92+ else if (fcscl == 2) printf(" ## Manual color scale mode #############\n");
93+ else if (fcscl == 3) printf(" ## Uni-color mode #############\n");
94+ else printf(" ## Periodic color scale mode #############\n");
95+ printf("\n");
96+
97+#pragma omp parallel default(none) \
98+ shared(nb,ntri,matp,max_th,min_th) private(ib,itri,i,ithread)
99+ {
100+ ithread = get_thread();
101+ max_th[ithread] = -100000000.0000;
102+ min_th[ithread] = 100000000.0000;
103+
104+ for (ib = 0; ib < nb; ib++) {
105+#pragma omp for
106+ for (itri = 0; itri < ntri[ib]; ++itri) {
107+ for (i = 0; i < 3; ++i) {
108+ if (matp[ib][itri][i] > max_th[ithread]) max_th[ithread] = matp[ib][itri][i];
109+ if (matp[ib][itri][i] < min_th[ithread]) min_th[ithread] = matp[ib][itri][i];
110+ }
111+ }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
112+ }/*for (ib = 0; ib < nb; ib++)*/
113+ }/*End of parallel region*/
88114 /**/
89- for (ib = 0; ib < nb; ib++) {
90- for (itri = 0; itri < ntri[ib]; ++itri) {
91- for (i = 0; i < 3; ++i) {
92- if (matp[ib][itri][i] > matmax) matmax = matp[ib][itri][i];
93- if (matp[ib][itri][i] < matmin) matmin = matp[ib][itri][i];
94- }
95- }
115+ matmax = max_th[0];
116+ matmin = min_th[0];
117+ for (ithread = 1; ithread < nthreads; ithread++) {
118+ if (max_th[ithread] > matmax) matmax = max_th[ithread];
119+ if (min_th[ithread] > matmin) matmin = min_th[ithread];
96120 }
97- /**/
98- printf("Max. value : %f \n", matmax);
99- printf("Min. value : %f \n \n", matmin);
121+ printf(" Max. value : %f\n", matmax);
122+ printf(" Min. value : %f\n\n", matmin);
100123 /**/
101124 if (fcscl == 2) {
102- printf("Set min. value : ");
125+ printf(" Set min. value : ");
103126 ierr = scanf("%f", &matmin);
104127 if (ierr == 0) printf("error ! reading min");
105- printf("Set max. value : ");
128+ printf(" Set max. value : ");
106129 ierr = scanf("%f", &matmax);
107130 if (ierr == 0) printf("error ! reading max");
108131 }
109132 /**/
110133 if (fcscl == 1 || fcscl == 2) {
111- for (ib = 0; ib < nb; ib++) {
112- for (itri = 0; itri < ntri[ib]; ++itri) {
113- for (i = 0; i < 3; ++i) {
114- /**/
115- mat2 = (matp[ib][itri][i] - matmin) / (matmax - matmin);
116- mat2 = mat2 * 4.0;
117- /**/
118- if (mat2 <= 1.0) {
119- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + blue[j] * (1.0 - mat2);
120- }
121- else if (mat2 <= 2.0) {
122- mat2 = mat2 - 1.0;
123- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + cyan[j] * (1.0 - mat2);
124- }
125- else if (mat2 <= 3.0) {
126- mat2 = mat2 - 2.0;
127- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + green[j] * (1.0 - mat2);
128- }
129- else {
130- mat2 = mat2 - 3.0;
131- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + yellow[j] * (1.0 - mat2);
132- }
133- }
134- }
135- }
134+#pragma omp parallel default(none) \
135+shared(nb,ntri,matp,clr,cyan,blue,green,yellow,red,matmax,matmin) \
136+private(ib,itri,i,mat2,j)
137+ {
138+ for (ib = 0; ib < nb; ib++) {
139+#pragma omp for nowait
140+ for (itri = 0; itri < ntri[ib]; ++itri) {
141+ for (i = 0; i < 3; ++i) {
142+ /**/
143+ mat2 = (matp[ib][itri][i] - matmin) / (matmax - matmin);
144+ mat2 = mat2 * 4.0;
145+ /**/
146+ if (mat2 <= 1.0) {
147+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + blue[j] * (1.0 - mat2);
148+ }
149+ else if (mat2 <= 2.0) {
150+ mat2 = mat2 - 1.0;
151+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + cyan[j] * (1.0 - mat2);
152+ }
153+ else if (mat2 <= 3.0) {
154+ mat2 = mat2 - 2.0;
155+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + green[j] * (1.0 - mat2);
156+ }
157+ else {
158+ mat2 = mat2 - 3.0;
159+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + yellow[j] * (1.0 - mat2);
160+ }
161+ }/*for (i = 0; i < 3; ++i)*/
162+ }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
163+ }/*for (ib = 0; ib < nb; ib++)*/
164+ }/*End of parallel region*/
136165 }
137166 else if (fcscl == 4) {
138- for (ib = 0; ib < nb; ib++) {
139- for (itri = 0; itri < ntri[ib]; ++itri) {
140- for (i = 0; i < 3; ++i) {
141- /**/
142- mat2 = matp[ib][itri][i] / 6.283185307;
143- mat2 = mat2 - floorf(mat2);
144- mat2 = mat2 * 6.0;
145- /**/
146- if (mat2 <= 1.0) {
147- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + red[j] * (1.0 - mat2);
148- }
149- else if (mat2 <= 2.0) {
150- mat2 = mat2 - 1.0;
151- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + yellow[j] * (1.0 - mat2);
152- }
153- else if (mat2 <= 3.0) {
154- mat2 = mat2 - 2.0;
155- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + green[j] * (1.0 - mat2);
156- }
157- else if (mat2 <= 4.0) {
158- mat2 = mat2 - 3.0;
159- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = blue[j] * mat2 + cyan[j] * (1.0 - mat2);
160- }
161- else if (mat2 <= 5.0) {
162- mat2 = mat2 - 4.0;
163- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = magenta[j] * mat2 + blue[j] * (1.0 - mat2);
164- }
165- else {
166- mat2 = mat2 - 5.0;
167- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + magenta[j] * (1.0 - mat2);
168- }
169- }
170- }
171- }
172- }
173- else {
174- for (ib = 0; ib < nb; ib++) {
175- /**/
176- mat2 = 1.0 / (GLfloat)(nb - 1) * (GLfloat)ib;
177- mat2 = mat2 * 4.0;
178- /**/
179- if (mat2 <= 1.0) {
167+#pragma omp parallel default(none) \
168+shared(nb,ntri,matp,clr,cyan,blue,green,yellow,red,magenta) \
169+private(ib,itri,i,mat2,j)
170+ {
171+ for (ib = 0; ib < nb; ib++) {
180172 for (itri = 0; itri < ntri[ib]; ++itri) {
181173 for (i = 0; i < 3; ++i) {
182- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + blue[j] * (1.0 - mat2);
174+ /**/
175+ mat2 = matp[ib][itri][i] / 6.283185307;
176+ mat2 = mat2 - floorf(mat2);
177+ mat2 = mat2 * 6.0;
178+ /**/
179+ if (mat2 <= 1.0) {
180+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + red[j] * (1.0 - mat2);
181+ }
182+ else if (mat2 <= 2.0) {
183+ mat2 = mat2 - 1.0;
184+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + yellow[j] * (1.0 - mat2);
185+ }
186+ else if (mat2 <= 3.0) {
187+ mat2 = mat2 - 2.0;
188+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + green[j] * (1.0 - mat2);
189+ }
190+ else if (mat2 <= 4.0) {
191+ mat2 = mat2 - 3.0;
192+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = blue[j] * mat2 + cyan[j] * (1.0 - mat2);
193+ }
194+ else if (mat2 <= 5.0) {
195+ mat2 = mat2 - 4.0;
196+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = magenta[j] * mat2 + blue[j] * (1.0 - mat2);
197+ }
198+ else {
199+ mat2 = mat2 - 5.0;
200+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + magenta[j] * (1.0 - mat2);
201+ }
202+ }/*for (i = 0; i < 3; ++i)*/
203+ }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
204+ }/*for (ib = 0; ib < nb; ib++)*/
205+ }/*End of parallel region*/
206+ }
207+ else {
208+#pragma omp parallel default(none) \
209+shared(nb,ntri,matp,clr,cyan,blue,green,yellow,red) \
210+private(ib,itri,i,mat2,j)
211+ {
212+ for (ib = 0; ib < nb; ib++) {
213+ /**/
214+ mat2 = 1.0 / (GLfloat)(nb - 1) * (GLfloat)ib;
215+ mat2 = mat2 * 4.0;
216+ /**/
217+ if (mat2 <= 1.0) {
218+#pragma omp for nowait
219+ for (itri = 0; itri < ntri[ib]; ++itri) {
220+ for (i = 0; i < 3; ++i) {
221+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = cyan[j] * mat2 + blue[j] * (1.0 - mat2);
222+ }
183223 }
184224 }
185- }
186- else if (mat2 <= 2.0) {
187- mat2 = mat2 - 1.0;
188- for (itri = 0; itri < ntri[ib]; ++itri) {
189- for (i = 0; i < 3; ++i) {
190- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + cyan[j] * (1.0 - mat2);
225+ else if (mat2 <= 2.0) {
226+ mat2 = mat2 - 1.0;
227+#pragma omp for nowait
228+ for (itri = 0; itri < ntri[ib]; ++itri) {
229+ for (i = 0; i < 3; ++i) {
230+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = green[j] * mat2 + cyan[j] * (1.0 - mat2);
231+ }
191232 }
192233 }
193- }
194- else if (mat2 <= 3.0) {
195- mat2 = mat2 - 2.0;
196- for (itri = 0; itri < ntri[ib]; ++itri) {
197- for (i = 0; i < 3; ++i) {
198- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + green[j] * (1.0 - mat2);
234+ else if (mat2 <= 3.0) {
235+ mat2 = mat2 - 2.0;
236+#pragma omp for nowait
237+ for (itri = 0; itri < ntri[ib]; ++itri) {
238+ for (i = 0; i < 3; ++i) {
239+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = yellow[j] * mat2 + green[j] * (1.0 - mat2);
240+ }
199241 }
200242 }
201- }
202- else {
203- mat2 = mat2 - 3.0;
204- for (itri = 0; itri < ntri[ib]; ++itri) {
205- for (i = 0; i < 3; ++i) {
206- for (j = 0; j<4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + yellow[j] * (1.0 - mat2);
243+ else {
244+ mat2 = mat2 - 3.0;
245+#pragma omp for nowait
246+ for (itri = 0; itri < ntri[ib]; ++itri) {
247+ for (i = 0; i < 3; ++i) {
248+ for (j = 0; j < 4; ++j) clr[ib][itri][i][j] = red[j] * mat2 + yellow[j] * (1.0 - mat2);
249+ }
207250 }
208251 }
209252 }
210- }
253+ }/*End of parallel region*/
211254 }
255+ free(max_th);
256+ free(min_th);
212257 } /* max_and_min */
--- a/src/initialize.c
+++ b/src/initialize.c
@@ -220,8 +220,10 @@ void max_and_min_bz() {
220220 int ib, i0, i1, i2;
221221 GLfloat eigmin, eigmax, matmin, matmax;
222222 /**/
223- printf("\n##### Max. and Min. of each bands ##### \n\n");
224- printf("Band Eig_Min. Eig_Max Mat_Min Mat_Max \n");
223+ printf("\n");
224+ printf(" ## Max. and Min. of each bands #######################\n");
225+ printf("\n");
226+ printf(" Band Eig_Min. Eig_Max Mat_Min Mat_Max\n");
225227 for (ib = 0; ib < nb; ib++) {
226228 eigmax = -100000000.0000;
227229 eigmin = 100000000.0000;
@@ -237,7 +239,7 @@ void max_and_min_bz() {
237239 }
238240 }
239241 }
240- printf("%d %f %f %f %f \n", ib + 1, eigmin, eigmax, matmin, matmax);
242+ printf(" %d %f %f %f %f\n", ib + 1, eigmin, eigmax, matmin, matmax);
241243 }
242244 /**/
243245 }/* max_and_min_bz */
--- a/src/kumo.c
+++ b/src/kumo.c
@@ -84,12 +84,13 @@ void interpol_energy() {
8484 * 3rd order - three dimensional Kumo interpolation
8585 */
8686 #pragma omp parallel default(none) \
87- shared(ib,nb,ng0,ng,eig,eig0,mat,mat0,interpol) \
88- private (i0,i1,ii,i2,j0,j1,j2,coef,eig1,mat1,eig2,mat2,eig3,mat3)
87+ shared(nb,ng0,ng,eig,eig0,mat,mat0,interpol) \
88+ private (ib,i0,i1,ii,i2,j0,j1,j2,coef,eig1,mat1,eig2,mat2,eig3,mat3)
8989 {
9090 for (ib = 0; ib < nb; ib++) {
9191 # pragma omp for nowait
9292 for (i0 = 0; i0 < ng0[0]; i0++) {
93+ //if (ith == 1) continue;
9394 for (i1 = 0; i1 < ng0[1]; i1++) {
9495 for (i2 = 0; i2 < ng0[2]; i2++) {
9596 for (j0 = 0; j0 < 4; j0++) {
@@ -104,7 +105,6 @@ void interpol_energy() {
104105 }/*for (j2 = 0; j2 < 4; j2++)*/
105106 }/*for (j1 = 0; j1 < 4; j1++)*/
106107 }/*for (i2 = 0; i2 < ng0[2]; i2++)*/
107-
108108 for (j0 = 0; j0 < interpol; j0++) {
109109 kumo_coef(j0, &coef[0]);
110110 for (j1 = 0; j1 < 4; j1++) {
--- a/src/menu.c
+++ b/src/menu.c
@@ -97,9 +97,9 @@ void menu_shiftEF(int value /**< [in] Selected menu*/)
9797 }
9898 }
9999 }
100- printf("Min Max E_F \n");
101- printf("%f %f %f \n", emin, emax, EF);
102- printf("New Fermi energy : ");
100+ printf(" Min Max E_F \n");
101+ printf(" %f %f %f \n", emin, emax, EF);
102+ printf(" New Fermi energy : ");
103103 //
104104 ierr = scanf("%f", &EF);
105105 if (ierr != 1) printf("error ! reading ef");
@@ -125,8 +125,8 @@ void menu_interpol(int value /**< [in] Selected menu*/)
125125 GLfloat emin, emax;
126126
127127 if (value == 1) {
128- printf("Old interpolation ratio : %d\n", interpol);
129- printf("New interpolation ratio : ");
128+ printf(" Old interpolation ratio : %d\n", interpol);
129+ printf(" New interpolation ratio : ");
130130 //
131131 ierr = scanf("%d", &interpol);
132132 if (ierr != 1) printf("error ! reading interpol");
@@ -153,15 +153,15 @@ void menu_view(int value /**< [in] Selected menu*/)
153153
154154 if (value == 1) {
155155
156- printf(" Current Scale : %f\n", scl);
157- printf(" New Scale : ");
156+ printf(" Current Scale : %f\n", scl);
157+ printf(" New Scale : ");
158158 ierr = scanf("%f", &scl);
159159
160160 }
161161 else if (value == 2) {
162162
163- printf(" Current Position(x y) : %f %f\n", trans[0], trans[1]);
164- printf(" New Position(x y) : ");
163+ printf(" Current Position(x y) : %f %f\n", trans[0], trans[1]);
164+ printf(" New Position(x y) : ");
165165 ierr = scanf("%f %f", &trans[0], &trans[1]);
166166
167167 }
@@ -183,8 +183,8 @@ void menu_view(int value /**< [in] Selected menu*/)
183183 thetax = 180.0 / 3.14159265 * thetax;
184184 thetay = 180.0 / 3.14159265 * thetay;
185185 thetaz = 180.0 / 3.14159265 * thetaz;
186- printf(" Current Rotation (theta_x theta_y teta_z) in degree : %f %f %f\n", thetax, thetay, thetaz);
187- printf(" New Rotation (theta_x theta_y teta_z) in degree : ");
186+ printf(" Current Rotation (theta_x theta_y teta_z) in degree : %f %f %f\n", thetax, thetay, thetaz);
187+ printf(" New Rotation (theta_x theta_y teta_z) in degree : ");
188188 ierr = scanf("%f %f %f", &thetax, &thetay, &thetaz);
189189 thetax = 3.14159265 / 180.0 * thetax;
190190 thetay = 3.14159265 / 180.0 * thetay;
@@ -364,7 +364,7 @@ void menu_colorbar(int value /**<[in] Selected menu*/) {
364364 void menu_tetra(int value) /**<[in] Selected menu*/ {
365365 /**/
366366 if (value != itet) {
367- printf("Tetra patern %d \n", value + 1);
367+ printf(" Tetra patern %d \n", value + 1);
368368 itet = value;
369369 init_corner();
370370 free_patch();
--- a/src/read_file.c
+++ b/src/read_file.c
@@ -43,13 +43,15 @@ void read_file(char *fname/**<[in] fname Input file name*/)
4343 getchar();
4444 exit(EXIT_FAILURE);
4545 }
46- printf("\n##### Brillouin zone informations ##### \n\n");
46+ printf("\n");
47+ printf(" ## Brillouin zone informations ###########\n");
48+ printf("\n");
4749 /*
4850 k-point grid
4951 */
5052 ierr = fscanf(fp, "%d%d%d", &ng0[0], &ng0[1], &ng0[2]);
5153 if (ierr == 0) printf("error ! reading ng");
52- printf("k point grid : %d %d %d \n", ng0[0], ng0[1], ng0[2]);
54+ printf(" k point grid : %d %d %d \n", ng0[0], ng0[1], ng0[2]);
5355 for (i = 0; i < 3; i++) ng[i] = ng0[i];
5456 /*
5557 Shift of k-point grid
@@ -58,15 +60,15 @@ void read_file(char *fname/**<[in] fname Input file name*/)
5860 if (ierr == 0) printf("error ! reading lshift");
5961
6062 if (lshift == 0) {
61- printf("k point grid is the Monkhorst-Pack grid. \n");
63+ printf(" k point grid is the Monkhorst-Pack grid. \n");
6264 for (i = 0; i < 3; i++) shiftk[i] = (ng0[i] + 1) % 2;
6365 }
6466 else if (lshift == 1) {
65- printf("k point grid starts from Gamma. \n");
67+ printf(" k point grid starts from Gamma. \n");
6668 for (i = 0; i < 3; i++) shiftk[i] = 0;
6769 }
6870 else if (lshift == 2) {
69- printf("k point grid starts from Gamma + a half grid. \n");
71+ printf(" k point grid starts from Gamma + a half grid. \n");
7072 for (i = 0; i < 3; i++) shiftk[i] = 1;
7173 }
7274 else {
@@ -77,7 +79,7 @@ void read_file(char *fname/**<[in] fname Input file name*/)
7779 */
7880 ierr = fscanf(fp, "%d", &nb);
7981 if (ierr == 0) printf("error ! reading nb");
80- printf("# of bands : %d \n", nb);
82+ printf(" # of bands : %d\n", nb);
8183 ntri = (int*)malloc(nb * sizeof(int));
8284 ntri_th = (int**)malloc(nb * sizeof(int*));
8385 for (ib = 0; ib < nb; ib++) ntri_th[ib] = (int*)malloc(nthreads * sizeof(int));
@@ -90,7 +92,7 @@ void read_file(char *fname/**<[in] fname Input file name*/)
9092 for (i = 0; i < 3; ++i) {
9193 ierr = fscanf(fp, "%e%e%e", &bvec[i][0], &bvec[i][1], &bvec[i][2]);
9294 if (ierr == 0) printf("error ! reading bvec");
93- printf("bvec %d : %f %f %f \n", i + 1, bvec[i][0], bvec[i][1], bvec[i][2]);
95+ printf(" bvec %d : %f %f %f \n", i + 1, bvec[i][0], bvec[i][1], bvec[i][2]);
9496 }
9597 /*
9698 Allocation of Kohn-Sham energies $ matrix elements
Show on old repository browser