|
@@ -185,37 +185,38 @@ int main(int argc, char *argv[]) {
|
|
long cpptime_sec, ctime_sec;
|
|
long cpptime_sec, ctime_sec;
|
|
long repeats = 150;
|
|
long repeats = 150;
|
|
//HeapProfilerStart("heapprof");
|
|
//HeapProfilerStart("heapprof");
|
|
|
|
+ printf("Start\n");
|
|
do {
|
|
do {
|
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
|
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
|
|
for (int i = 0; i<repeats; ++i) {
|
|
for (int i = 0; i<repeats; ++i) {
|
|
nmie::nMie(L, x, m, nt, Theta, &Qextw, &Qscaw,
|
|
nmie::nMie(L, x, m, nt, Theta, &Qextw, &Qscaw,
|
|
&Qabsw, &Qbkw, &Qprw, &gw, &Albedow, S1w, S2w);
|
|
&Qabsw, &Qbkw, &Qprw, &gw, &Albedow, S1w, S2w);
|
|
- break;
|
|
|
|
|
|
+ // break;
|
|
}
|
|
}
|
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
|
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
|
|
cpptime_nsec = diff(time1,time2).tv_nsec;
|
|
cpptime_nsec = diff(time1,time2).tv_nsec;
|
|
cpptime_sec = diff(time1,time2).tv_sec;
|
|
cpptime_sec = diff(time1,time2).tv_sec;
|
|
|
|
|
|
- printf("-- C++ time consumed %lg sec\n", (cpptime_nsec/1e9));
|
|
|
|
|
|
+ printf("-- C++ time consumed %lg sec\n", cpptime_sec+(cpptime_nsec/1e9));
|
|
repeats *= 10;
|
|
repeats *= 10;
|
|
- break;
|
|
|
|
- } while (cpptime_nsec < 1e8 && ctime_nsec < 1e8);
|
|
|
|
|
|
+ // break;
|
|
|
|
+ } while (cpptime_sec < 3 && ctime_sec < 3);
|
|
|
|
|
|
- printf("\n");
|
|
|
|
|
|
+ printf("Finish\n");
|
|
|
|
|
|
- if (has_comment) {
|
|
|
|
- printf("%6s, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e \n", comment.c_str(), Qextw, Qscaw, Qabsw, Qbkw, Qprw, gw, Albedow);
|
|
|
|
- } else {
|
|
|
|
- printf("%+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e \n", Qextw, Qscaw, Qabsw, Qbkw, Qprw, gw, Albedow);
|
|
|
|
- }
|
|
|
|
|
|
+ // if (has_comment) {
|
|
|
|
+ // printf("%6s, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e \n", comment.c_str(), Qextw, Qscaw, Qabsw, Qbkw, Qprw, gw, Albedow);
|
|
|
|
+ // } else {
|
|
|
|
+ // printf("%+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e, %+.5e \n", Qextw, Qscaw, Qabsw, Qbkw, Qprw, gw, Albedow);
|
|
|
|
+ // }
|
|
|
|
|
|
- if (nt > 0) {
|
|
|
|
- printf(" Theta, S1.r, S1.i, S2.r, S2.i\n");
|
|
|
|
|
|
+ // if (nt > 0) {
|
|
|
|
+ // printf(" Theta, S1.r, S1.i, S2.r, S2.i\n");
|
|
|
|
|
|
- for (i = 0; i < nt; i++) {
|
|
|
|
- printf("%6.2f, %+.5e, %+.5e, %+.5e, %+.5e \n", Theta[i]*180.0/PI, S1w[i].real(), S1w[i].imag(), S2w[i].real(), S2w[i].imag());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // for (i = 0; i < nt; i++) {
|
|
|
|
+ // printf("%6.2f, %+.5e, %+.5e, %+.5e, %+.5e \n", Theta[i]*180.0/PI, S1w[i].real(), S1w[i].imag(), S2w[i].real(), S2w[i].imag());
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
|
|
} catch( const std::invalid_argument& ia ) {
|
|
} catch( const std::invalid_argument& ia ) {
|
|
// Will catch if multi_layer_mie fails or other errors.
|
|
// Will catch if multi_layer_mie fails or other errors.
|