00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include <stdlib.h>
00035 #include <stdio.h>
00036 #include <string.h>
00037 #include <sys/resource.h>
00038 #include <ctype.h>
00039 #include <unistd.h>
00040 #include "omp_util.h"
00041
00042 void
00043 Not_Valid (char *error_message)
00044 {
00045 fprintf(stderr, error_message);
00046 fprintf(stderr, "\n");
00047 fflush(stderr);
00048 abort();
00049 }
00050
00051 void
00052 Warning (char *warning_message)
00053 {
00054 fprintf(stderr, "Warning: %s\n", warning_message);
00055 fflush(stderr);
00056 }
00057
00058 char *
00059 Trim_Leading_Spaces (char *input)
00060 {
00061 char *output = input;
00062 DevWarning( output != NULL, ("input string is NULL!"));
00063
00064 while ((*output != '\0') && isspace((int)(*output))) {
00065 output++;
00066 }
00067
00068 return output;
00069 }
00070
00071 unsigned long int
00072 Get_System_Stack_Limit (void)
00073 {
00074 struct rlimit cur_rlimit;
00075 int return_value;
00076 return_value = getrlimit(RLIMIT_STACK, &cur_rlimit);
00077 Is_True(return_value == 0, ("user stack limit setting wrong"));
00078 return cur_rlimit.rlim_cur;
00079 }
00080
00081 int
00082 Get_SMP_CPU_num (void)
00083 {
00084
00085 return (int) sysconf(_SC_NPROCESSORS_ONLN);
00086 }
00087
00088 void
00089 __ompc_do_nothing (void)
00090 {
00091 }
00092