PUMA
219
Portable University Model of the Atmosphere
|
00001 #include <sys/resource.h> 00002 00003 void pumax_dummy(void) {} 00004 00005 int nresources_(double *ut, double *st, long *mem, long *par, long *paf, 00006 long *swa, long *dr, long *dw) 00007 { 00008 struct rusage ru; 00009 getrusage(RUSAGE_SELF,&ru); 00010 *ut = ru.ru_utime.tv_sec + 0.000001 * ru.ru_utime.tv_usec; 00011 *st = ru.ru_stime.tv_sec + 0.000001 * ru.ru_stime.tv_usec; 00012 *mem = ru.ru_maxrss; 00013 *par = ru.ru_minflt; 00014 *paf = ru.ru_majflt; 00015 *swa = ru.ru_nswap; 00016 *dr = ru.ru_inblock; 00017 *dw = ru.ru_oublock; 00018 return 1; 00019 } 00020 00021 /* ------------------------------------------------ */ 00022 /* Stub routines for Absoft Compiler and others, */ 00023 /* which require, that FORTRAN callable C-functions */ 00024 /* are written in uppercase letters only */ 00025 /* ------------------------------------------------ */ 00026 00027 00028 int NRESOURCES(double *ut, double *st, long *mem, long *par, long *paf, 00029 long *swa, long *dr, long *dw) 00030 { 00031 return nresources_(ut,st,mem,par,paf,swa,dr,dw); 00032 } 00033 00034 /* ------------------------------------------------ */ 00035 /* Stub routines for IBM Compiler and others, */ 00036 /* which require, that FORTRAN callable C-functions */ 00037 /* are written in lowercase without underscore */ 00038 /* ------------------------------------------------ */ 00039 00040 00041 int nresources(double *ut, double *st, long *mem, long *par, long *paf, 00042 long *swa, long *dr, long *dw) 00043 { 00044 return nresources_(ut,st,mem,par,paf,swa,dr,dw); 00045 }