Skip to main content

Sponsors

Software

Posted in

I'm starting to release my programs under GPL. This book page consolidates all the software I release.

Latest software:
Linux Utility v0.1
Reversi in C++ v0.1
Reversi in Java v0.7a
Parallel Reversi in Java v0.8b
Reversi in C++ Benchmark v0.1
OpenMP Parallel Reversi in C++ Benchmark v0.2
Parallel Reversi in Java Benchmark v0.1

Check out my git repository for these software.

Parallel Programming with SpeedGo Computing

Parallel programming is a new popular curriculum for graduate schools. As processors as in CPU, GPU, etc. are hitting their clock speed limit, higher core count is expected in modern processors instead of higher clock as before. There is no reason why one should hesitate to take up parallel programming course and workshop.

While you may think that there are no obvious applications that require the multiple cores settings, why should I bother? However, reality is cruel. Those standing still simply get obsolete. It's up to you to innovate! Innovating is the key to success.

Check out SpeedGo Computing blog and their website for more information about parallel programming.

Trial: jsMath

Posted in

\(x^2 + y^2 + 1\)
[math]\root 3\of {1-\pi x^2}[/math]

Compiling Ruby 1.9.1-p376 on Fedora 12

Posted in

Get the following errors while compiling Ruby 1.9.1-p376?

ossl_ssl.c: In function ‘ossl_sslctx_get_ciphers’:
ossl_ssl.c:626: error: ‘STACK’ undeclared (first use in this function)
ossl_ssl.c:626: error: (Each undeclared identifier is reported only once
ossl_ssl.c:626: error: for each function it appears in.)
ossl_ssl.c:626: error: expected expression before ‘)’ token
ossl_ssl.c:629: error: expected expression before ‘)’ token
ossl_ssl.c:629: error: too few arguments to function ‘sk_value’
ossl_ssl.c: In function ‘ossl_ssl_get_peer_cert_chain’:
ossl_ssl.c:1198: warning: passing argument 1 of ‘sk_num’ from incompatible pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’
ossl_ssl.c:1201: warning: passing argument 1 of ‘sk_value’ from incompatible pointer type
/usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’
ossl_ssl.c: In function ‘ossl_ssl_get_cipher’:
ossl_ssl.c:1223: warning: assignment discards qualifiers from pointer target type
make[1]: *** [ossl_ssl.o] Error 1

Try the patch in this post.

ruby-1.9.1-p376 $ tar zxf fix_stack_not_found.tgz
ruby-1.9.1-p376 $ cat fix_stack_not_found.patch | patch -p1
patching file ext/openssl/ossl.c
patching file ext/openssl/ossl_pkcs7.c
patching file ext/openssl/ossl_ssl.c

ruby-1.9.1-p376 $ make
...

The compilation is now able to complete. However, I didn't verify whether the SSL is working properly.

Trial: Mimetex with mathfilter

Posted in

ax^2 + bx + c = 0

x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}

Parallel QuickSort with OpenMP and Cilk++

The introduction of omp task in OpenMP 3.0 allows easy parallelization of the famous quick sort algorithm. As OpenMP 3.0 support in GCC is relatively new, I like to compare its performance particularly the omp task with a commercial compiler Cilk++ which is designed to efficiently support spawn/sync mechanism. Conceptually, the omp task and the Cilk++ spawn/sync are very similar.

Quick sort chooses a pivot, partitions elements into [< pivot] & [>= pivot], and sorts the two partitions recursively. The implementation in my experiment performs partitioning sequentially, and sorts the two resulting partitions in parallel.

Experiment setup:

  • AMD64 Phenom X4 9950 (2.6GHz)
  • Fedora 10 x86_64
  • GCC 4.4 svn revision 144773
  • Cilk++ 1.0.2

Parallelizing Recursive Fibonacci using OpenMP and Cilk++

OpenMP 3.0 has added an interesting construct called omp task, while Cilk++ is a compiler developed by Cilk Arts to easily parallelize a C/C++ program. It is interesting to see how we can parallelize the following simple fibonacci program.

Serial:

long fib_serial(long n)
{
    if (n < 2) return n;
    return fib_serial(n-1) + fib_serial(n-2);
}

Fedora 10 Problem: Cannot find CTL module "transform_RRT"

Posted in

On Fedora 64bit, exrdisplay is not able to display an .exr image.

$ exrdisplay lighting.exr 
Warning: Environment variable CTL_DISPLAY_TRANSFORM is not set; using default value ("transform_display_video").
Warning: Environment variable CTL_DISPLAY_CHROMATICITIES is not set; using default value (chromaticities according to Rec. ITU-R BT.709).
Warning: Environment variable CTL_DISPLAY_WHITE_LUMINANCE  is is not set; using default value (120 candelas per square meter).
Warning: Environment variable CTL_DISPLAY_SURROUND_LUMINANCE  is is not set; using default value (12 candelas per square meter).
Cannot find CTL module "transform_RRT".

Solution I: Set the CTL module path manually.

user$ CTL_MODULE_PATH=/usr/lib64/CTL exrdisplay lighting.exr

or

Solution II: Install the 32bit CTL library (OpenEXR_CTL-libs.i386)

root% yum install OpenEXR_CTL-libs.i386
user$ exrdisplay lighting.exr

or

Solution III: Link the expected CTL module path.

# This assumes the 32bit CTL library (OpenEXR_CTL-libs.i386) is not installed.
root% cd /usr/lib
root% ln -s ../lib64/CTL
user$ exrdisplay lighting.exr

Fedora 10 Problem: Broken XFCE Windows Manager

Posted in

After installing Fedora 10 with XFCE, when you try to customize your windows interface, you'll get the following:

"These settings cannot work with your current window manager (imsetting-xim)"

According to Fedora Project website, a bug in GTK2 is to blame. But we can't just wait for the bug to be fixed.

I simply use KDE display manager by setting /etc/sysconfig/desktop.

% cat /etc/sysconfig/desktop
DISPLAYMANAGER="KDE"

and restart your X windows (ctrl-alt-backspace) or restart your system.

Fedora 10 Problem: Cannot Type in Textbox in Java Applet

Posted in

Whether it is Sun Java plugin, IceTea plugin, I simply cannot type in a textbox of a Java applet. After much hacking, I found that scim-bridge is the one causing the problem. Killing off all the im-*, gconf-im-*, imsettings-xim, and scim-* processes immediately solves the problem.

I use scim-bridge because it can work with GTK or QT windows. Now looked like I can just use scim with GTK only.

Syndicate content