|
|
@ -32,6 +32,18 @@ double gasdev(long* idum, long* idum2, long* iy, long iv[NTAB]) {
|
|
|
|
t = clock() - t;
|
|
|
|
t = clock() - t;
|
|
|
|
double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time
|
|
|
|
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);
|
|
|
|
log_info("RESULT = success, gset = %f, fac = %f, v1 = %f, ELAPSED = %f seconds", gset, fac, v1, time_taken);
|
|
|
|
return (v2 * fac);
|
|
|
|
return (v2 * fac);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -40,6 +52,18 @@ double gasdev(long* idum, long* idum2, long* iy, long iv[NTAB]) {
|
|
|
|
t = clock() - t;
|
|
|
|
t = clock() - t;
|
|
|
|
double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time
|
|
|
|
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);
|
|
|
|
log_info("RESULT = success, gset = %f, ELAPSED = %f seconds", gset, time_taken);
|
|
|
|
return gset;
|
|
|
|
return gset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|