Sharing Memory Between Multiple Instances of Same Program

General OpenMP discussion

Sharing Memory Between Multiple Instances of Same Program

Postby mcwest » Fri Mar 09, 2012 4:59 pm

I'm new to OpenMP and I want to introduce OpenMP commands into existing video motion estimation code. What I want to achieve is to run the encoding software on two nearly identical video files sequentially until the two processes reach the motion estimation step. Then I would like them to operate collectively with each process looking outside of its particular video to the other for possible matches to be used for motion estimation. Any advice would be much appreciated.

Let me digress. What I want is for two instances of the same program to share data at one specific step in their algorithm. I know that having more than one master thread is an oxymoron, but is it possible to trick OpenMP to do what I want. For instance, could I write a program in C++ that creates the two processes and have OpenMP treat the processes like threads?
mcwest
 
Posts: 1
Joined: Fri Mar 09, 2012 3:57 pm

Re: Sharing Memory Between Multiple Instances of Same Progra

Postby ftinetti » Tue Mar 13, 2012 3:10 am

What I want to achieve is to run the encoding software on two nearly identical video files sequentially until the two processes reach the motion estimation step. Then I would like them to operate collectively with each process looking outside of its particular video to the other for possible matches to be used for motion estimation. Any advice would be much appreciated.

Hard to say with this general description. And remember that with OpenMP you handle multiple threads in a process, not multiple processes.

Let me digress. What I want is for two instances of the same program to share data at one specific step in their algorithm. I know that having more than one master thread is an oxymoron, but is it possible to trick OpenMP to do what I want. For instance, could I write a program in C++ that creates the two processes and have OpenMP treat the processes like threads?

I think there is no OS support for this... or not in the well known OSs.

HTH.
ftinetti
 
Posts: 558
Joined: Wed Feb 10, 2010 2:44 pm

Re: Sharing Memory Between Multiple Instances of Same Progra

Postby MarkB » Tue Mar 13, 2012 10:35 am

I think it is unlikely you can readily achieve what you want to do in OpenMP. You may want to look into using shared memory segments (i.e. shmget(), shmctl() and shmat() functions in C). The Boost Interprocess library provides a convenient interface if you are in C++: http://www.boost.org/doc/libs/1_35_0/do ... ocess.html
MarkB
 
Posts: 408
Joined: Thu Jan 08, 2009 10:12 am


Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 3 guests