diff --git a/fftma_module/gen/lib_src/Py_kgeneration.c b/fftma_module/gen/lib_src/Py_kgeneration.c index 0e9dd72..d7c7b05 100644 --- a/fftma_module/gen/lib_src/Py_kgeneration.c +++ b/fftma_module/gen/lib_src/Py_kgeneration.c @@ -54,6 +54,14 @@ void Py_kgeneration(long seed, struct grid_mod grid, struct statistic_mod stat, t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + for (int i = 0; i < cores; i++) { + get_stats(&final[i], i - 1); + } + + for (int i = 0; i < cores; i++) { + log_info("CPU %d: %lf%%\n", i, calculate_load(&initial[i], &final[i])); + } + double* total_ram = malloc(sizeof(double)); getTotalVirtualMem(total_ram); @@ -63,13 +71,8 @@ void Py_kgeneration(long seed, struct grid_mod grid, struct statistic_mod stat, log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); - for (int i = 0; i < cores; i++) { - get_stats(&final[i], i - 1); - } - - for (int i = 0; i < cores; i++) { - log_info("CPU %d: %lf%%\n", i, calculate_load(&initial[i], &final[i])); - } + free(total_ram); + free(used_ram); log_info("RESULT = success, ELAPSED = %f seconds", time_taken); } diff --git a/fftma_module/gen/lib_src/axes.c b/fftma_module/gen/lib_src/axes.c index e0f8216..7284c68 100644 --- a/fftma_module/gen/lib_src/axes.c +++ b/fftma_module/gen/lib_src/axes.c @@ -34,5 +34,6 @@ void axes(double* ap, double* scf, int N) } } } + return; } diff --git a/fftma_module/gen/lib_src/build_real.c b/fftma_module/gen/lib_src/build_real.c index deeb21b..35c83df 100644 --- a/fftma_module/gen/lib_src/build_real.c +++ b/fftma_module/gen/lib_src/build_real.c @@ -47,5 +47,17 @@ void build_real(int n[3], int NTOT, double* covar, double* realization, double* t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, realization = %f, ireal = %f, ELAPSED = %f seconds", *realization, *ireal, time_taken); } diff --git a/fftma_module/gen/lib_src/cardsin.c b/fftma_module/gen/lib_src/cardsin.c index 537bdd7..60ec7f1 100644 --- a/fftma_module/gen/lib_src/cardsin.c +++ b/fftma_module/gen/lib_src/cardsin.c @@ -23,6 +23,18 @@ double cardsin(double h) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, z = %f, ELAPSED = %f seconds", z, time_taken); return z; diff --git a/fftma_module/gen/lib_src/cgrid.c b/fftma_module/gen/lib_src/cgrid.c index a424551..50ba621 100644 --- a/fftma_module/gen/lib_src/cgrid.c +++ b/fftma_module/gen/lib_src/cgrid.c @@ -47,5 +47,17 @@ void cgrid(struct vario_mod variogram, struct grid_mod grid, int n[3]) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, n[0] = %d, n[1] = %d, n[2] = %d, ELAPSED = %f seconds", n[0], n[1], n[2], time_taken); } diff --git a/fftma_module/gen/lib_src/clean_real.c b/fftma_module/gen/lib_src/clean_real.c index 3d34a74..3c3295d 100644 --- a/fftma_module/gen/lib_src/clean_real.c +++ b/fftma_module/gen/lib_src/clean_real.c @@ -45,5 +45,17 @@ void clean_real(struct realization_mod* realin, int n[3], struct grid_mod grid, t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, ELAPSED = %f seconds", time_taken); } diff --git a/fftma_module/gen/lib_src/cov_value.c b/fftma_module/gen/lib_src/cov_value.c index a846c7f..412c872 100644 --- a/fftma_module/gen/lib_src/cov_value.c +++ b/fftma_module/gen/lib_src/cov_value.c @@ -57,6 +57,18 @@ double cov_value(struct vario_mod variogram, double di, double dj, double dk) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, hx = %f, hy = %f, hz = %f, h = %f, cov = %f, ELAPSED = %f seconds", hx, hy, hz, h, cov, time_taken); return cov; diff --git a/fftma_module/gen/lib_src/covariance.c b/fftma_module/gen/lib_src/covariance.c index 47f56a4..5ec8ced 100644 --- a/fftma_module/gen/lib_src/covariance.c +++ b/fftma_module/gen/lib_src/covariance.c @@ -83,5 +83,17 @@ void covariance(double* covar, struct vario_mod variogram, struct grid_mod mesh, t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, di = %f, dj = %f, dk = %f, ELAPSED = %f seconds", di, dj, dk, time_taken); } diff --git a/fftma_module/gen/lib_src/cubic.c b/fftma_module/gen/lib_src/cubic.c index 75d2c30..38c7ed2 100644 --- a/fftma_module/gen/lib_src/cubic.c +++ b/fftma_module/gen/lib_src/cubic.c @@ -21,6 +21,18 @@ double cubic(double h) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, z = %f, ELAPSED = %f seconds", z, time_taken); return z; diff --git a/fftma_module/gen/lib_src/fftma2.c b/fftma_module/gen/lib_src/fftma2.c index eb6ab48..03b06d5 100644 --- a/fftma_module/gen/lib_src/fftma2.c +++ b/fftma_module/gen/lib_src/fftma2.c @@ -103,5 +103,17 @@ void FFTMA2(struct vario_mod variogram, struct grid_mod grid, int n[3], struct r t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, NTOT = %d, NMAX = %d, NDIM = %d, ntot = %d, nmax = %d, NXYZ = %d, nxyz = %d, ELAPSED = %f seconds", NTOT, NMAX, NDIM, ntot, nmax, NXYZ, nxyz, time_taken); } diff --git a/fftma_module/gen/lib_src/fourt.c b/fftma_module/gen/lib_src/fourt.c index 33c7a6e..f54d52a 100644 --- a/fftma_module/gen/lib_src/fourt.c +++ b/fftma_module/gen/lib_src/fourt.c @@ -589,6 +589,18 @@ void fourt(double* datar, double* datai, int nn[3], int ndim, int ifrwd, int icp L920: t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); log_info("RESULT = success, ELAPSED = %f", time_taken); return; diff --git a/fftma_module/gen/lib_src/gammf.c b/fftma_module/gen/lib_src/gammf.c index 89ebd2c..eb98587 100644 --- a/fftma_module/gen/lib_src/gammf.c +++ b/fftma_module/gen/lib_src/gammf.c @@ -19,6 +19,18 @@ double gammf(double h, double alpha) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, delta = %f, z = %f, ELAPSED = %f seconds", delta, z, time_taken); return z; } diff --git a/fftma_module/gen/lib_src/gasdev.c b/fftma_module/gen/lib_src/gasdev.c index fbd2ee1..2da6775 100644 --- a/fftma_module/gen/lib_src/gasdev.c +++ b/fftma_module/gen/lib_src/gasdev.c @@ -32,6 +32,18 @@ double gasdev(long* idum, long* idum2, long* iy, long iv[NTAB]) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, gset = %f, fac = %f, v1 = %f, ELAPSED = %f seconds", gset, fac, v1, time_taken); return (v2 * fac); } else { @@ -40,6 +52,18 @@ double gasdev(long* idum, long* idum2, long* iy, long iv[NTAB]) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, gset = %f, ELAPSED = %f seconds", gset, time_taken); return gset; } diff --git a/fftma_module/gen/lib_src/generate.c b/fftma_module/gen/lib_src/generate.c index 9e1ae09..f4a395f 100644 --- a/fftma_module/gen/lib_src/generate.c +++ b/fftma_module/gen/lib_src/generate.c @@ -51,6 +51,16 @@ void generate(long* seed, int n, struct realization_mod* realization, int cores) t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + for (int i = 0; i < cores; i++) { + get_stats(&final[i], i - 1); + } + + for (int i = 0; i < cores; i++) { + log_info("CPU %d: %lf%%\n", i, calculate_load(&initial[i], &final[i])); + } + + free(iv); + double* total_ram = malloc(sizeof(double)); getTotalVirtualMem(total_ram); @@ -60,17 +70,8 @@ void generate(long* seed, int n, struct realization_mod* realization, int cores) log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); - for (int i = 0; i < cores; i++) { - get_stats(&final[i], i - 1); - } - - for (int i = 0; i < cores; i++) { - log_info("CPU %d: %lf%%\n", i, calculate_load(&initial[i], &final[i])); - } - free(total_ram); free(used_ram); - free(iv); log_info("RESULT = success, ELAPSED = %f seconds", time_taken); } diff --git a/fftma_module/gen/lib_src/length.c b/fftma_module/gen/lib_src/length.c index 91bff7f..6c4a759 100644 --- a/fftma_module/gen/lib_src/length.c +++ b/fftma_module/gen/lib_src/length.c @@ -44,6 +44,18 @@ int length(int N, int i, double* scf, double* ap, double D, int Nvari) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, n = %d, ELAPSED = %f seconds", n, time_taken); return n; } diff --git a/fftma_module/gen/lib_src/maxfactor.c b/fftma_module/gen/lib_src/maxfactor.c index a225fac..cda2bfd 100644 --- a/fftma_module/gen/lib_src/maxfactor.c +++ b/fftma_module/gen/lib_src/maxfactor.c @@ -39,6 +39,18 @@ int maxfactor(int n) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, maxfac = %d, ELAPSED = %f seconds", maxfac, time_taken); return maxfac; } diff --git a/fftma_module/gen/lib_src/nor2log.c b/fftma_module/gen/lib_src/nor2log.c index 78719de..af17aa1 100644 --- a/fftma_module/gen/lib_src/nor2log.c +++ b/fftma_module/gen/lib_src/nor2log.c @@ -75,5 +75,17 @@ void nor2log(struct realization_mod* realin, int typelog, struct realization_mod t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, ELAPSED = %f seconds", time_taken); } diff --git a/fftma_module/gen/lib_src/prebuild_gwn.c b/fftma_module/gen/lib_src/prebuild_gwn.c index b6b092f..be1f3bb 100644 --- a/fftma_module/gen/lib_src/prebuild_gwn.c +++ b/fftma_module/gen/lib_src/prebuild_gwn.c @@ -54,5 +54,17 @@ void prebuild_gwn(struct grid_mod grid, int n[3], struct realization_mod* realin t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + log_info("RESULT = success, ELAPSED = %f seconds", time_taken); } diff --git a/fftma_module/gen/lib_src/ran2.c b/fftma_module/gen/lib_src/ran2.c index b54d06a..79a564e 100644 --- a/fftma_module/gen/lib_src/ran2.c +++ b/fftma_module/gen/lib_src/ran2.c @@ -60,6 +60,18 @@ double ran2(long* idum, long* idum2, long* iy, long iv[NTAB]) { t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time + double* total_ram = malloc(sizeof(double)); + getTotalVirtualMem(total_ram); + + double* used_ram = malloc(sizeof(double)); + getVirtualMemUsed(used_ram); + + log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", + *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); + + free(total_ram); + free(used_ram); + if ((temp = AM * (*iy)) > RNMX) { log_info("RESULT = success, ELAPSED = %f", time_taken); return (RNMX); diff --git a/fftma_module/gen/lib_src/spherical.c b/fftma_module/gen/lib_src/spherical.c index dee26b7..a63c3ac 100644 --- a/fftma_module/gen/lib_src/spherical.c +++ b/fftma_module/gen/lib_src/spherical.c @@ -13,6 +13,7 @@ double spherical(double h) { } else { z = 1. - 1.5 * (double)h + 0.5 * (double)(h * h * h); } + log_info("RESULT = success, z = %f", z); return z;