• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C++ making algotirhm thread

Carlis

Senior member
Hi.
I have developed a program that minimizes the free energy in GL models. I am not going to describe my algorithm in any depth, but basically, I store values of certain functions in multi - arrays and then minimize a functional by varying function values in a single point at a time.

Right now, I am doing this on a desktop computer, but I could probably use a cluster for this purpose, and therefore I need do modify my program. I am a physics student and not a programmer and so I don't know a great deal of c++ / multi core programing.

The algorithm I use is certainly threadable. I would do something like varying the value of many points at the same time. If the points are suitably chosen (sufficiently separated), then these processes are completely independent.

Some questions come in to my mind though.

Do I have to tell the compiler in some manner that I want to thread my application?

Since we are talking about a cluster, I assume there is some latency when data travel between machines? Then I assume one has to write some sort of routine that shuffles data between the machines at certain steps during the iteration?

Finally, is this dependent on operative system? I am developing this on a mac, but will probably run it on a linux cluster...
 
I know with pthread in *nix, you have to compile with -lpthread (and naturally use the pthread library).

No clue about clustering though.
 
This might be something to run on a graphics card instead, Google CUDA and OpenCL.

An nVidia GTX 260 card for under $200 has 216 "stream processors" for massively parallel data processing.

Also Google "c++ parallel programming" for information on the different libraries that are available for CPU-based programming.
 
The usual system for high-performance computing is MPI. It's OS and hardware-independent, so you should have no problem there. You can download MPICH for free and see what you can do with it. Though personally I found its hardware-independence made it clunky.
 
Back
Top