User forums > General (but related to Code::Blocks)

TDM-GCC 4.2.3 for MinGW

<< < (3/4) > >>

asdz:

--- Quote from: Biplab on March 20, 2008, 12:05:05 pm ---
Did you try specifying the number of threads before running your app?? On Windows, export the following environment variable as-

--- Code: ---set OMP_NUM_THREADS=2
--- End code ---
or in Linux,

--- Code: ---export OMP_NUM_THREADS=2
--- End code ---

You can also add the following code at the top of your main() function in your code to set the number of threads.

--- Code: ---omp_set_num_threads(2);
--- End code ---

Please note that the above code has higher precedence than the environment variables.

--- End quote ---

When using set omp_num_threads=2... the program works PERFECT on both cores parallel....
But when using omp_get_num_procs() (this is the fuction that returns the physical number of cores) returns the number of threads i had set before... but on Visual Studio compiler this doesnt happen.

Let's say we have:

--- Code: ---#include <omp.h>
#include <stdio.h>


int main () {
  int id;
  omp_set_num_threads(3);
#pragma omp parallel private(id)
  {
    id = omp_get_thread_num();
    printf("Threads i have set: %d\n", id );
    #pragma omp barrier
  }
  printf("Real cores %d\n", omp_get_num_procs());
  getchar();
  return 0;
}

--- End code ---
On Visual Studio i have
Thread i have set: 0
Thread i have set: 1
Thread i have set: 2
Real cores 2 (thats correct i have an core 2 duo proc.)

On GCC:
Thread i have set: 0
Thread i have set: 1
Thread i have set: 2
Real cores 3

it seems that can't recognize at once the number of cores... even using omp_get_num_threads() returns 1 if i don't have set earlier the number of threads... but if i set the numbers of thread = 2, because i have a Core 2 duo system and works perfectly....
anything on that?

patlecat:

--- Quote from: TDragon on March 20, 2008, 04:30:20 am ---
A parting shot:
You may have noticed that I haven't posted my typical announcement here concerning the TDM 4.3.0 release. This is because 4.3.0 currently does not successfully build Code::Blocks. I have not yet looked into the source of the problem.

--- End quote ---
Okay but why you still have it classified as Recommended Download when in fact it is not usable at the moment? I'm, really thankful for your work in general but this upset me, because i spent a lot of time installing this new release and trying fruitlessly to get Qt 4.4 to build. :?

Question: Has anyone had experience with the new official mingw gcc4.3?

joubertdj:

--- Quote from: patlecat on May 19, 2008, 10:10:16 am ---
--- Quote from: TDragon on March 20, 2008, 04:30:20 am ---
A parting shot:
You may have noticed that I haven't posted my typical announcement here concerning the TDM 4.3.0 release. This is because 4.3.0 currently does not successfully build Code::Blocks. I have not yet looked into the source of the problem.

--- End quote ---
Okay but why you still have it classified as Recommended Download when in fact it is not usable at the moment? I'm, really thankful for your work in general but this upset me, because i spent a lot of time installing this new release and trying fruitlessly to get Qt 4.4 to build. :?

Question: Has anyone had experience with the new official mingw gcc4.3?

--- End quote ---

Mmmmhhh ... die MinGW 4.3 is not "official" ... it is "alpha" ... hence ... unstable ... only for "tinkering" / "bug finding" issues ...

patlecat:
I know that it's alpha, but what else can you say about it? Have u actually used it?

thomas:

--- Quote from: patlecat on May 19, 2008, 10:10:16 am ---Okay but why you still have it classified as Recommended Download when in fact it is not usable at the moment? I'm, really thankful for your work in general but this upset me, because i spent a lot of time installing this new release and trying fruitlessly to get Qt 4.4 to build. :?
Question: Has anyone had experience with the new official mingw gcc4.3?

--- End quote ---
Well, maybe it's called "recommended" because TDragon offers like 200 different releases, and this one is the most recent one with the most bugfixes? Besides, why is it automatically "useless" only because it doesn't build Code::Blocks?
The same goes for QT - you're being fruitless building a huge beast like QT using a custom-built compiler from an experimental development branch with a couple of patches applied, so... uh... err... what am I missing there?  8)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version