- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to run my code on 2 CPUs (multithreads) on Linux using intel compiler ver. 9.
In my makefile,
>>FFLAGS = -O3 -openmp -threads -parallel
>>INCLUDES = -I/opt/intel/mkl/9.1/include
>>LIBS = -L/opt/intel/mkl/9.1/lib/em64t -lmkl_solver -lmkl_lapack -lmkl_em64t -lguide -lpthread
once I compile, I did
%export OMP_NUM_THREADS=2
before I submit the job.
Then I see one CPU is running in its full capacity while the other is doing nothing.
Well. Clearly I am a beignner in this area and I just follow the manual as you can see.
Any help or guide will be greatly appreciated well in advance.
Thanks A Lot.
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe the 9.1 compiler still had the screen echo on by default, which would tell you about any loops successfully parallelized by OpenMP or auto-parallel. If your MKL calls occur inside a parallel region in your source code, MKL should not start additional threads unless you set OMP_NESTED and possibly adjust NUM_THREADS. MKL would not do so anyway unless the problem size is sufficiently large.
Running against the openmp-profile library, which you could accomplish by setting it in LD_PRELOAD, if you have linked the usual .so, should give you useful statistics in the guide.gvs file.
Running against the openmp-profile library, which you could accomplish by setting it in LD_PRELOAD, if you have linked the usual .so, should give you useful statistics in the guide.gvs file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One other thing to check is your shell. "%" as a prompt has me wondering if you are using csh or tcsh as your shell (in which case the export statement is wrong).
echo $0
should give one or two things:
echo $0
-bash
(in which case your export is fine)
or
echo $0
csh
in which case you need:
spdr65 forums/70342> setenv OMP_NUM_THREADS 2
spdr65 forums/70342> echo $OMP_NUM_THREADS
2
echo $0
should give one or two things:
echo $0
-bash
(in which case your export is fine)
or
echo $0
csh
in which case you need:
spdr65 forums/70342> setenv OMP_NUM_THREADS 2
spdr65 forums/70342> echo $OMP_NUM_THREADS
2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your replay.
In my case, it was the first case.
Since you are the expert in this group, let me bother you a few more times.
do you see any errors in my makefile?
is this auto-parallelization working only for intel CPU, not AMD cpu?
(linux system i am using has 1 master (intel) + 6 compute nodes (4 intel and 2 AND))
Again, thanks in well advance.
Quoting - Ronald W. Green (Intel)
One other thing to check is your shell. "%" as a prompt has me wondering if you are using csh or tcsh as your shell (in which case the export statement is wrong).
echo $0
should give one or two things:
echo $0
-bash
(in which case your export is fine)
or
echo $0
csh
in which case you need:
spdr65 forums/70342> setenv OMP_NUM_THREADS 2
spdr65 forums/70342> echo $OMP_NUM_THREADS
2
echo $0
should give one or two things:
echo $0
-bash
(in which case your export is fine)
or
echo $0
csh
in which case you need:
spdr65 forums/70342> setenv OMP_NUM_THREADS 2
spdr65 forums/70342> echo $OMP_NUM_THREADS
2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Auto-parallelization doesn't care who made your CPU.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Auto-parallelization doesn't care who made your CPU.
But Auto-parallelization and OpenMP only works on 1 node - it does not parallelize for clusters. If you need to use more than 1 node you will need to parallelize your program with MPI or something like Cluster OpenMP (http://whatif.intel.com), and that is outside of the scope of this forum.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as one method to test my way of compiling, i'd like to run my code in serial condition. to do that, what options should i get rid of from my makefile?
>>FFLAGS = -O3 -openmp -threads -parallel
>>INCLUDES = -I/opt/intel/mkl/9.1/include
>>LIBS = -L/opt/intel/mkl/9.1/lib/em64t -lmkl_solver -lmkl_lapack -lmkl_em64t -lguide -lpthread
should be modified to
>>FFLAGS = -O3
>>INCLUDES = -I/opt/intel/mkl/9.1/include
>>LIBS = -L/opt/intel/mkl/9.1/lib/em64t -lmkl_solver -lmkl_lapack -lmkl_em64t -lguide
is this right way to make my code in serial? I'd like to make sure.....
always, thanks in advance.
Quoting - kidariyoon
I am trying to run my code on 2 CPUs (multithreads) on Linux using intel compiler ver. 9.
In my makefile,
>>FFLAGS = -O3 -openmp -threads -parallel
>>INCLUDES = -I/opt/intel/mkl/9.1/include
>>LIBS = -L/opt/intel/mkl/9.1/lib/em64t -lmkl_solver -lmkl_lapack -lmkl_em64t -lguide -lpthread
once I compile, I did
%export OMP_NUM_THREADS=2
before I submit the job.
Then I see one CPU is running in its full capacity while the other is doing nothing.
Well. Clearly I am a beignner in this area and I just follow the manual as you can see.
Any help or guide will be greatly appreciated well in advance.
Thanks A Lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you don't have any OpenMP function calls, it may be enough simply to omit the -openmp and -parallel options, as you said. If you do have those, you must enclose the OpenMP specific stuff by #ifdef, and invoke pre-processing:
#ifdef _OPENMP
USE OMP
#endif
....
#ifdef _OPENMP
your omp_ function calls
#endif
This facility works the same for all OpenMP, not only Intel, so the explanation in your reference is applicable.
The way you have linked, you will have automatic threading in MKL. If you wish to avoid that, you may be able to
set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
#ifdef _OPENMP
USE OMP
#endif
....
#ifdef _OPENMP
your omp_ function calls
#endif
This facility works the same for all OpenMP, not only Intel, so the explanation in your reference is applicable.
The way you have linked, you will have automatic threading in MKL. If you wish to avoid that, you may be able to
set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>If you wish to avoid that, you may be able to
>set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
>set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
You mention thatto avoid automatic threadening, I need to compile itwith serial libraries....
I am a little confused here. On linux machine, I thought there are no serial (sequencial) libraries.
Its all controlled by link options.
Do those serial libraries have different names ?
In that case, what should my LIBS line look like?
FFLAGS = -O3
LIBS = -L/opt/intel/mkl/9.1/lib/32 -lmkl_solver -lmkl_lapack -lmkl_ia32 << is this correct?
(i thought 32, 64 and em64t are nothing related to serial or parallel. hmmmmm)
always thanks in advance.
Quoting - tim18
If you don't have any OpenMP function calls, it may be enough simply to omit the -openmp and -parallel options, as you said. If you do have those, you must enclose the OpenMP specific stuff by #ifdef, and invoke pre-processing:
#ifdef _OPENMP
USE OMP
#endif
....
#ifdef _OPENMP
your omp_ function calls
#endif
This facility works the same for all OpenMP, not only Intel, so the explanation in your reference is applicable.
The way you have linked, you will have automatic threading in MKL. If you wish to avoid that, you may be able to
set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
#ifdef _OPENMP
USE OMP
#endif
....
#ifdef _OPENMP
your omp_ function calls
#endif
This facility works the same for all OpenMP, not only Intel, so the explanation in your reference is applicable.
The way you have linked, you will have automatic threading in MKL. If you wish to avoid that, you may be able to
set MKL_SERIAL environment variable, or link from the corresponding mkl serial library.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose, for your version of MKL, the sequential component would have been a separate tar file, which you may not have installed.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page