Hi Avinash,
at first glance I am baffled as to why the code runs differently with
X10_NTHREADS>1. One interesting point that may help you track it down
is that if you remove either of the 'asyncs' from the last loop in
SmartCamera.work (for either the convolve or comparator) it works fine
with any number of threads, and any number of places. So there is some
interaction between the different comparators or convolution kernels,
even though they should be independent.
Regarding multi-place parallelism, the way the code is structured at the
moment, all the work will be done at Place(0) regardless of the number
of places. This is because the work is done at the home place of the
input stream for each kernel, and all streams are created at Place(0).
You might consider restructuring so that each output stream is located
at the same place as its generating kernel, with a DistArray for each
kernel type (readImage, convolution etc.). In this case a GlobalRef is
only required for the input streams. This would simplify the code and
reduce the amount of unnecessary copying in 'at' statements; and the
DistArray for the kernels would actually distribute the work across places.
Some minor asides:
- a lot of values have explicit types. Generally this should be
avoided. (see http://x10-lang.org/documentation/performance-tuning.html )
- the code in convolutionKernels doesn't look like a real convolution -
I assume this is a work in progress?
Sorry I couldn't help with the threading bug - perhaps others will have
better luck!
Cheers,
Josh
On 22/10/11 00:09, Avinash Malik wrote:
Hello,
I am attching the source code for the application. One needs to
have the global matrix library installed for the code to
work. The description of the code is in a README file. The main
file is called SmartCamera.x10.
The x10c++ compiler is unable to compile the code atleast for
me, because of symbol errors, so I use the java backend.
"Josh" == Josh Milthorpe<josh.miltho...@anu.edu.au> writes:
Josh> Hi Avinash, are you able to post a full code example that
Josh> exhibit the deadlock and the problem with X10_NTHREADS=2?
Josh> The problem with X10_NTHREADS=2 sounds like a race condition,
Josh> but this may be impossible to diagnose without the code.
Josh> Can you compile the same code with x10c++ to see if it also
Josh> crashes with no output under X10_NPLACES=2 ?
Josh> Cheers
Josh> Josh
Josh> On 20/10/11 05:53, Avinash Malik wrote:
>> Hello,
>>
>> I am using X10 compiler svn revision r23082, which fixes the
>> async at and at async problems. I still cannot get the async
>> at(p){} code to work. It deadlocks. at(p) async{} works
>> fine. Also, using a val before the async at(p){} works fine (the
>> work around that Olivier) described before.
>>
>> Another point. When I set X10_NTHREADS to 2, which is the number
>> of cores I got on my machine. The application somehow seems to
>> loose data. For example, I have a facial recognition system with
>> 12 images. When I have X10_NTHREADS=1, then all 12 images are
>> recognised. But, when X10_THREADS=2, sometimes the system only
>> processes 4 images, discarding the other 8, sometimes it
>> processes only 6 images, etc.
>>
>> Finally, I have only a single place Place(0). But, I purposely
>> set X10_NPLACES=2, just to see what happens. In this case the
>> program crashes without giving out any output.
>>
>> I have compiled the X10 compiler without optimizations, I use the
>> GML (global matrix library) compiled with optimization turned off
>> and my own application (and streaming library that I have built
>> using X10) itself is compiled without optimizations turned on.
>>
>> Help is appreciated.
>>
Josh>
------------------------------------------------------------------------------
Josh> The demand for IT networking professionals continues to grow,
Josh> and the demand for specialized networking skills is growing
Josh> even more rapidly. Take a complimentary Learning@Ciosco
Josh> Self-Assessment and learn about Cisco certifications,
Josh> training, and career opportunities.
Josh> http://p.sf.net/sfu/cisco-dev2dev
Josh> _______________________________________________ X10-users
Josh> mailing list X10-users@lists.sourceforge.net
Josh> https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users