SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is a multiprocessor box with Slackware 11.0 running with 2.6.17.13- smp kernel. Kernel sees all the processors and uses them all distributing processes among them.
The problem is that a mathematical model has to be run on it. In the source there are loops which should be split on several processors. Practically it has to run one process simultaneously on more then 1 processor. But it is not happening.
If you use Fedora the process split. I know there is quite a difference between Fedora and Slack so I don't compare them.
My Question is : How can I make the model run on Slackware the same way as it does on Fedora? I really don't want to give up on Slack because of this. Can anyone help?
So....wait... the source is written with SMP threading built into it? That should simply work in Slack.
The differences between FC and Slack are not all that wide as you may think. It is still linux, and the kernel source is still the same. Software that you have compiled on either box should just simply work, unless something else is going on that you are not aware of.
That's right. It "should" be ok but it is not. When the model is running the "top" shows one of the processors busy 100% and the others almost sleep and in the list below there is only one process (model) running. In Fedora there are 2 processors running at 100% and two processes running the model. there is an obvious difference in speed as well.
May be there is another difference between Slack and Fedora. Kernel source is the same but the precompiled kernels for both distributions are quite different. The way kernels "work" with the other software is different.
My question is about Slackware - I want to work on a Slack box.
How to make it split the process?
Was this a precompiled kernel, or did you configure and compile it yourself? The first thing I would try is building a new kernel from the latest source. If you get the same results, start looking at the binary. Is there an option to run it with a number of threads?
Also, under the kernel configuration there is an option for 'max number of processors' if you enable SMP. Set that to 2 or greater.
May be there is another difference between Slack and Fedora. Kernel source is the same but the precompiled kernels for both distributions are quite different. The way kernels "work" with the other software is different.
Hopefully the difference is Fedora loads a module [not hardwired] that Slack is not loading. Try lsmod on each system to see what Slack might not be loading. Harder approach is to diff the .config files used by the smp kernels of each distro. I am assuming you are dual booting the same computer as I have no idea what differences in actual cpus used may throw into the mix.
Having just done a bunch of SMP kernel compiling both 2.4 and 2.6 I noticed that
2.6 has tweeks for PREEMPT and IO Schedulers, which could be the source of what
you are seeing.
Having just done a bunch of SMP kernel compiling both 2.4 and 2.6 I noticed that
2.6 has tweeks for PREEMPT and IO Schedulers, which could be the source of what
you are seeing.
The .config could give you the clue you need.
Good luck
Even if your kernel is tweaked for a certain type of scheduling, you can tweak a running kernel using the cpusets functionality that was introduced to linux in 2.6.9.
I have made consulting with colleagues and now I am refining the question:
--I mean mathematical model MM5 which runs 95% in user mode;
--OpenMP parallelization;
-- SMP kernel (self compiled | precompiled);
--Dual processor (dual core) Xeon 5140 box.
The doubts are, the matter of fact is pthread library in FC vs tls/pthread in Slack. The last one do not support (still???) user mode. Is that correct?
Is it possible that it is the problem?
Aha! OpenMP parallelization is the key here. It sounds like the Slackware box doesn't have the OpenMPI drivers installed, which do come with Redhat straight out of the box.
You have a choice of using OpenMPI or perhaps mvapich to solve this problem you are having.
Is this OpenMP? or OpenMPI? both are different things. OpenMP was specifically thought for making Multi-Processor enabled processes without too much low-level thinkering. OpenMPI was made as a Message Passing Interface (i.e., how dbus should've been done, even if MPI comes from ages before dbus), and is mostly used as a paralell or distributed computing librarly (but it can do more than that).
OpenMP needs support at the compiler side (either ICC or GCC-4.2-cvs are OpenMP-enabled). It's possible that RedHat have included an OpenMP-patched GCC distribution (specially if you consider that they are the main sponsors of GCC), but it isn't supported in any of the official releases of GCC (yet).
OpenMPI, instead can be installed as a separate program, and I presume (I haven't tried) that it will work OK on Slack.
One is not a susbtitute for the other, they work in completely different ways. If you need OpenMP support, the easiest path, IMHO, is to get the Intel Compiler for linux (http://www.intel.com/cd/software/pro...eng/219771.htm).
EDIT:
Another solution to have OpenMP support under GCC is the Omni OpenMP project which is suppoused to translate OpenMP C/C++ into plain C/C++, you may want to take a look at it: http://phase.hpcc.jp/Omni/
--the model MM5 is a mixed FORTRAN/C project and requires Intel or Portland compiler;
--it compiles successfully with both and gives no compile errors (on Slack and Fedora/Redhat ;
--on Slack it gives runtime errors (segmentation fault) , on Fedora/Redhad it runs fine.
In the previous message I mentioned pthread and tls/pthread for a reason. If that is the core of the problem where should I look for an answer?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.