Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

Optimizations and output routine fails with tbb

Last post 10-18-2007, 7:39 AM by ClayB. 2 replies.
Sort Posts: Previous Next
 10-18-2007, 5:45 AM 30242246  

Optimizations and output routine fails with tbb

I use tbb with:
   Microsoft Development environment 2003 version 7.1.3088
   Intel c++ compiler 9.0 (W_CC_C_9.0.030)
   OS: windows 2000 5.00.2195, Service pack 4

first remark: I will not have fscanf_s (and the other security improved (sic!)  functions). Never mind!

Second and more important: if I use the code added below (your code with a tbb function call, but the problem will come out with other functions), it compiles, it works inside the visual studio debugger, but it does not work if I call it from a console (in both the debug and release compilation). It only work if I do not add the tbb functions.
Is this a windows 2000 problem or a compiler problem?

As you can see, this is a big problem if somebody want to use intel compiler with tbb!

Any suggestion?


Gaetano

// Quicksort.cpp : Traditional version of Quicksort algorithm. 
//
//
#include <windows.h>
#include <stdio.h>
#include <task_scheduler_init.h>
#include <parallel_sort.h>

int *A, N;

int Partition (int p, int r)
{
    int x = A[p];
    int k = p;
    int l = r+1;
    int t;
    while (1)
    {
        do
          k++;
        while ((A[k] <= x) && (k < r));
        do
          l--;
        while (A[l] > x);

        while (k < l) {
            t = A[k];  A[k] = A[l];  A[l] = t;
            do k++; while (A[k] <= x);
            do l--; while (A[l] > x);
        }
        t = A[p];  A[p] = A[l];  A[l] = t;
        return l;
    }
}

void QuickSort(int p, int r)
{
    if (p < r)
    {int q = Partition(p, r);
        QuickSort (p, q-1);
        QuickSort (q+1, r);
    }
}


void init_data()
{
   FILE *fd;
   int i;

   fd=fopen("InputData.in", "r");
   fscanf(fd, "%d", &N);
   A = (int*) malloc(N * sizeof(int));
   for (i = 0; i < N; i++)
      fscanf(fd, "%d", &A[i]);
   fclose(fd);
}

void out_data()
{
   FILE *fd;
   int i;

   fd=fopen("Sorted.out", "w");
   for (i = 0; i < N; i++)
      fprintf(fd, "%d\n", A[i]);
   fclose(fd);
}

int main(int argc, char* argv[])
{
   init_data();
   tbb::task_scheduler_init init;
   tbb::parallel_sort(A,A+N);
//   QuickSort(0, N-1);
   out_data();
   printf("Done");
   return 0;
}
 
 10-18-2007, 6:37 AM 30242249 in reply to 30242246  

Re: Optimizations and output routine fails with tbb

I actually found that the program that does not work on windows 2000 works on windows XP!

I just found out that Intel TBB does not work with windowx 2000!

It is true!

Gaetano

 
 10-18-2007, 7:39 AM 30242261 in reply to 30242249  

Re: Optimizations and output routine fails with tbb

Was this non-support for Windows 2000 part of the TBB documentation (release notes or installation guide)?  If not, I think you need to post this information to the Threading Building Blocks forums at http://threadingbuildingblocks.org.  Find out what the TBB team has to say about such support.

--clay


"It's all very complicated and would take a scientist to explain it." -- MST3K
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...