Orocos-Toolchian on Xenomai with multiple cores

Hi all, I am working with Orocos-Toolchain to design a open (software) architecture of a robot that we have in our lab, and the computer we are using is a new one with multiple cores.

I have developed and tested multiple tasks with orocos-toolchain 2.1 on Gnulinux and they work perfectly; however, as I need hard real time for controlling the robot, I recompiled the components also with Orocos-Toolchian on Xenomai. They also worked.

The question is that, when I run the application with all components, then the computer gets blocked. I think it is because all the tasks are executing in only one CPU. I have checked with Gnulinux and the tasks execute in multiple cores.

Is this because I can not use multiple cores in real time with Orocos-Toolchain on Xenomai?.

Thanks in advance for you help and regards

Alejandro

Orocos-Toolchian on Xenomai with multiple cores

On Wed, Jun 22, 2011 at 1:52 PM, <asgarcia [..] ...> wrote:
> Hi all,
> I am working with Orocos-Toolchain to design a open (software) architecture of a robot that we have in our lab, and the computer we are using is a new one with multiple cores.
>
> I have developed and tested multiple tasks with orocos-toolchain 2.1 on Gnulinux and they work perfectly; however, as I need hard real time for controlling the robot, I recompiled the components also with Orocos-Toolchian on Xenomai. They also worked.
>
> The question is that, when  I run the application with all components, then the computer gets blocked.  I think it is because all the tasks are executing in only one CPU. I have checked with  Gnulinux and the tasks execute in multiple cores.
>
> Is this because I can not use multiple cores in real time with Orocos-Toolchain on Xenomai?.

You can check on which core your process is run by doing: cat
/proc/xenomai/sched (look for the CPU field)

You need to set the affinity to let a thread run on another core than
CPU 0. We recently added this API to 2.4.0, but the
os/xenomai/fosi_internal.cpp of Xenomai does not use it yet. It's
trivial though. All functions are there, you only need to fill them
in.

Normally, you should have built your Xenomai Linux kernel with SMP
support, so Xenomai can use these extra cores too.

Another thing you can do is to set all priorities to zero such that
your threads don't run in the primary domain, and see if:it still
crashes your computer and which cpu usage your threads take

Peter
--
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Orocos-Toolchian on Xenomai with multiple cores

>You can check on which core your process is run by doing: cat >/proc/xenomai/sched (look for the CPU field)

We have already done it and all the threads are running in CPU(0).

>You need to set the affinity to let a thread run on another core than >CPU 0. We recently added this API to 2.4.0, but the >os/xenomai/fosi_internal.cpp of Xenomai does not use it yet. It's >trivial though. All functions are there, you only need to fill them >in.

In the current version you are implementing, do you manage this affinity automatically? or, however, all the tasks are executed in CPU (0)

>Normally, you should have built your Xenomai Linux kernel with SMP >support, so Xenomai can use these extra cores too.

We are using this functionality.

>Another thing you can do is to set all priorities to zero such that >your threads don't run in the primary domain, and see if:it still >crashes your computer and which cpu usage your threads take

Ok, I will try it!.

Thanks!!

Orocos-Toolchian on Xenomai with multiple cores

On Wed, 22 Jun 2011, asgarcia [..] ... wrote:

> Hi all,
> I am working with Orocos-Toolchain to design a open (software) architecture of a robot that we have in our lab, and the computer we are using is a new one with multiple cores.
>
> I have developed and tested multiple tasks with orocos-toolchain 2.1 on Gnulinux and they work perfectly; however, as I need hard real time for controlling the robot, I recompiled the components also with Orocos-Toolchian on Xenomai. They also worked.
>
> The question is that, when I run the application with all components, then the computer gets blocked. I think it is because all the tasks are executing in only one CPU. I have checked with Gnulinux and the tasks execute in multiple cores.
>
> Is this because I can not use multiple cores in real time with Orocos-Toolchain on Xenomai?.
>
The most probably cause is that your code is not thread safe and has race
conditions. The different scheduling behaviours in the different OS
versions can make them appear on one but not on the other.

> Thanks in advance for you help and regards
>
> Alejandro

Herman

Orocos-Toolchian on Xenomai with multiple cores

Thanks Herman, our problem, I think, is due to other questions. I have seen Peter's response and he is telling me to try a set of steps. I will do it.

Orocos-Toolchian on

On Thu, 23 Jun 2011, asgarcia [..] ... wrote:

> Thanks Herman, our problem, I think, is due to other questions. I have seen Peter's response and he is telling me to try a set of steps. I will do it.

If those steps solve your problem, you _do_ have a real problem...:
fiddling with priorities and CPU affinities can _never_ solve halting
problems robustly. Never.

Herman

Orocos-Toolchian on

El 23/06/11 15:12, Herman Bruyninckx escribió:
> On Thu, 23 Jun 2011, asgarcia [..] ... wrote:
>
>> Thanks Herman, our problem, I think, is due to other questions. I
>> have seen Peter's response and he is telling me to try a set of
>> steps. I will do it.
>
> If those steps solve your problem, you _do_ have a real problem...:
> fiddling with priorities and CPU affinities can _never_ solve halting
> problems robustly. Never.

You were also right. We just discovered problems with the calculation of
the Jacobian and it was consuming to much resources.

Thanks and regards.
>
> Herman