#include <omp.h>
#include "numlist.h"
+#ifndef min
+ #define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
+#endif
+#ifndef max
+ #define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
+#endif
+
typedef int numtype;
void printlist(char * message, numtype * ptr, int len);
int main ( int argc, char ** argv) {
int n = LISTSIZE, m = LISTSIZE;
- int p = 1;
+ int p = min(omp_get_num_procs(), n);
int opt, i;
int a_len, b_len, b_len_end, b_len_begin;
numtype * c;
}
}
- //printf ("Maximal number of threads: %i\n", omp_get_max_threads());
+ printf ("Number of processes that will be started: %i\n", p);
//printf ("----------------------------------\n");
c = (numtype *) malloc((LISTSIZE * 2 + 1) * (sizeof (numtype)));