if an openmp code works on a single cpu with multi-threads, will it neccessarily work on a multi-processor machine?

if an openmp code works on a single cpu with multi-threads, will it neccessarily work on a multi-processor machine?

I am asking this question because I have had this strange problem for days. The code in question is parallelized using openmp directives, and runs well on my pc, a linux box that has only one cpu, but nevertheless I have set the enviroment variable OMP_NUM_THREADS to be 4 (or more). Now if I compile the same code on an SGI altix 3000, the results are drastically different and not correct. Both my pc and the SGI machine use ifort as compilor.

Should the fact that a code works on a single-CPU machine with multi-threads specified guarantee a correct behavior on a multi-processor machine? Or actually there is no relavance at all?

Any suggestion will be appreciated.

2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

If you can run your case with thread checker, you have a reasonable chance of catching multi-processing issues. Call it strange if you like, but this is a large part of the reason for thread checker.

Accedere per lasciare un commento.