OpenMP and MPI hybrid thread numbers


 
Thread Tools Search this Thread
Top Forums Programming OpenMP and MPI hybrid thread numbers
# 1  
Old 08-31-2015
OpenMP and MPI hybrid thread numbers

hi,

I have two basic questions, I will be really grateful if I receive any
comment from you,

I have an MPI code where I am trying to implement OpenMP directives.
The machine where I run the code has 16 cores. I run the code with

Code:
export OMP_NUM_THREADS=2
mpirun -np 4  ./exec

If I used mpi alone, I understand that the program "exec" would run on
4 cores. But what does the program do when I use MPI combined with
OpenMP, does it mean that I will be using 8 cores (4 MPI processes x
2 threads) for the entire work? Or that I will use only 4 cores and
each core will be doubly occupied?

The second thing is related to the use of OpenMP directives inside subroutines.
If I have the following code:

Code:
program main 
....
!$omp parallel 
!$omp sections 
!$omp section
    print*, "hello"
!$omp section 
    call func()
!$omp end sections 
!$omp end parallel

end program

subroutine func()
...
!$omp parallel do
do i=1,100
   ...
enddo
!$omp end parallel do 
end subroutine

how many threads would there be in the parallel section of func() if
I set export OMP_NUM_THREADS=2? According to my code there
will be 1 thread available for func() because it is inside a "section"
but I don't know how the threads work when the function is nested
as in this case,

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Undefined reference to omp_get_thread_num using OpenMP?

I am using a large code-base that compiled successfully before using make with a makefile and cmake. However, now that I'm trying to use openmp with it, I'm now getting the errors undefined reference to `omp_get_thread_num' undefined reference to `omp_get_num_threads'I don't think this... (0 Replies)
Discussion started by: larry burns
0 Replies

2. Programming

Need help with counting within parallelized block - OpenMP/C-Programming

Hello together, I have a question for you. Since a few weeks I am trying to programm a small bruteforce application in C on Ubuntu 14.04.1 using Code::Blocks with gcc-4.8.2. My programm is nothing special. It's just for practise, Without hashing or something like that. For me the focus is on... (11 Replies)
Discussion started by: DaveX
11 Replies

3. Programming

Gcc openmp programming problem

Dear Linux users, I'm a noob at openmp, gcc and c programming. I can run my own openmp code in terminal with no problem, eg. gcc -fopenmp program.c -o program. But now I'm trying to compile and run another person's code, it contains a makefile and multiple .c and .h files. I don't know how to... (2 Replies)
Discussion started by: pigeon151
2 Replies

4. Shell Programming and Scripting

Grep username and get all the lines with thread numbers

I need help to extract the file. If I am entering the user name like abcd@xyz.com, search the username and get the tread number. Once will get thread number all the line having same threadnumber wanted to keep in seperate file. It can be more than thread number for single username. For... (3 Replies)
Discussion started by: nes
3 Replies

5. HP-UX

Spawn more than 8 threads OpenMP & HPUX

Hi folks, I am trying to run more than 8 threads in OpenMP team on my HP-UX 11i v3 system (without root access), but NO success. Compiler: aCC A.06.26 I tried to setup: OMP_NUM_THREADS, omp_set_num_threads(), max_thread_proc=1000, nkthread=8416, set_dynamic=0 Machine has 2 processors... (1 Reply)
Discussion started by: ATveretinov
1 Replies

6. Virtualization and Cloud Computing

Private, Public and Hybrid Clouds

Hi all, Private, Public and Hybrid Clouds I'm now testing OpenStack; Home OpenStack Open Source Cloud Computing Software -Infrastructure as a Service (IaaS) -Platform as a Service (PaaS) -Software as a Service (SaaS) It is an Open Source software. I'm interested to know whether... (0 Replies)
Discussion started by: satimis
0 Replies

7. What is on Your Mind?

Has anyone in this forum tried a hybrid HDD, is it worth?

I'm looking for a new internal hard drive for my desktop PC. Having a look at some 'techie' sites I ran along some reviews of hybrid drives which supposedly combine the high capacity storage of magnetic drives with the fast performance of SSDs. For example this 500 GB Seagate has 4 GB NAND... (4 Replies)
Discussion started by: verdepollo
4 Replies

8. UNIX for Dummies Questions & Answers

Hybrid CD-ROMs

Hello, Is there any way to create a hybrid CD-ROM on either a Windows or Solaris server to be able to mastered with a Windows mastering software like Roxio. Thanks, Mike (1 Reply)
Discussion started by: bubba112557
1 Replies
Login or Register to Ask a Question