Posted to tcl by patthoyts at Fri Mar 16 13:55:19 GMT 2007view pretty

#define _CRT_SECURE_NO_DEPRECATE

#include <omp.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *const argv[])
{
    if (argc > 1) {
        long nThreads = strtol(argv[1], NULL, 0);
        omp_set_num_threads(nThreads);
    }

#pragma omp parallel
    {
        printf("thread id %d\n", omp_get_thread_num());
    }
    return 0;
}