g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: Re: Utilities for EPICS on Multi-Core Linux
From: "Shen, Guobao" <shengb@bnl.gov>
To: Till Straumann <strauman@slac.stanford.edu>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 12 Dec 2012 11:56:42 -0500
Yes, I did.

Guobao


On 12/12/12 11:37 AM, Till Straumann wrote:
Have you built EPICS base with

USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES

?

- Till

On 12/12/2012 10:17 AM, Shen, Guobao wrote:
Hi Ralph,

On 12/11/12 5:27 PM, Ralph Lange wrote:
Hi Guobao,

As the subject, the mail body, and the documentation say: This is
for *LINUX*.
It is my fault. I pretend to treat mac as a linux machine, but it really is not. :)
For the time being, the module only uses Posix calls, and might be
working on other Posix compliant platforms. This is not by specification
but by chance, though, and there are no plans to support anything other
than Linux. Thus the Makefile only creates the Library for Linux platforms.
OK, now I tried it on my desktop, which is a debian linux (wheezy).
Here is the compiling error:

/usr/bin/gcc  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -O3 -g   -Wall    -D_GNU_SOURCE -DVERSION=\"1.1.1\"
-mtune=generic     -m32 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../include/compiler/gcc -I../../include/os/Linux -I../../include -I/home/user/epics/base-3.15.0.1/include/compiler/gcc
-I/home/user/epics/base-3.15.0.1/include/os/Linux -I/home/user/epics/base-3.15.0.1/include       -c ../threadRules.c
../threadRules.c: In function 'modifyRTProperties':
../threadRules.c:217:60: error: 'struct epicsThreadOSD' has no member named 'schedPolicy'
../threadRules.c:222:15: error: 'struct epicsThreadOSD' has no member named 'schedPolicy'
../threadRules.c:223:63: error: 'struct epicsThreadOSD' has no member named 'schedPolicy'
../threadRules.c:227:19: error: 'struct epicsThreadOSD' has no member named 'isRealTimeScheduled'
../threadRules.c:229:19: error: 'struct epicsThreadOSD' has no member named 'isRealTimeScheduled'
../threadRules.c:248:51: error: 'struct epicsThreadOSD' has no member named 'schedPolicy'
make[2]: *** [threadRules.o] Error 1
make[2]: Leaving directory `/home/user/epics/mcoreutils/MCoreUtilsApp/O.linux-x86'
make[1]: *** [install.linux-x86] Error 2
make[1]: Leaving directory `/home/user/epics/mcoreutils/MCoreUtilsApp'
make: *** [MCoreUtilsApp.install] Error 2

$ gcc --version
gcc (Debian 4.7.2-4) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Guobao
Or do you refer to running Linux on Apple hardware?!

Cheers,
~Ralph


On 11.12.2012 20:21, Shen, Guobao wrote:
Hi Ralph,
After a short try, there are 2 compile problems on my Mac.
1. the Mac version of cp command does not support "-T" flag. Either I
have to change it to use GNU cp, or remove T.
2. It compiles and install documentation only. No library is produced
by default.

Guobao


On 12/10/12 4:21 AM, Ralph Lange wrote:
Hi Jack,

On 09.12.2012 15:59, Jack Smith wrote:
On Fri, Nov 23, 2012 at 2:48 PM, Ralph Lange <Ralph.Lange@gmx.de>
wrote:
MCoreUtils - Utilities for EPICS on Multi-Core Linux

I recently started working on a collection of useful stuff for
running IOCs
on multi-core (RT or not) Linux architectures. (*)

The first two modules are now available on SourceForge [1]:

Real-time threadShow routines
Enhanced threadShow functions that print LWP ID, scheduling policy,
and CPU
affinity.

Rule-based setting of real-time properties
Pattern matching engine that allows to set real-time properties of
EPICS
threads (scheduling policy, priority, and CPU affinity) by regular
expression matching on thread names. Rules can be set in a config
file or
from the iocShell, and will be applied to any thread started
through the
libCom/OSI API of EPICS Base. This allows to restrict the complete
IOC onto
a subset of CPUs, dedicate CPUs to specific (driver) threads,
fine-tune
policies and priorities, etc.

MCoreUtils need EPICS Base 3.15.0.1 or later, on a Linux platform.

This project is in an early stage.
I know that more and more EPICS sites are using this family of
platforms and
have to cope with similar things, so I would like to invite
everybody to
step forward with ideas and suggestions (and code!). I hope we can
manage to
minimize parallel developments, and combine efforts for a better
real-time
behaviour and performance of EPICS.

Cheers,
~Ralph

I guess the purpose of MCoreUtils is to make Linux system (RT or not)
more deterministic. Right?
Correct.
ITER's fast controllers run a RT-Linux (RHEL-based MRG-R), but the
general direction is a) to get more over-all deterministic behavior, and
b) to allow to run specific RT applications on dedicated cores, i.e.
restrict the IOC to a subset of the available cores.

For EPICS base 3.14.x, how do the IOCs' threads use the CPU resources
on a multi-core Linux system? Do the threads just randomly pick up any
available CPU resource?
Basically, yes.
The default for EPICS Base is to not use Posix real-time scheduling, so
all EPICS IOC threads are using the Linux default scheduler, which will
distribute them onto available CPU resources according to its
implemented strategy. Which of course - strictly speaking - is not
randomly, but looks a lot like it... ;-)

There's a good page on the EPICS Wiki by Till Straumann [1], describing
how to switch an IOC to use Posix real-time scheduling under Linux.

Cheers,
~Ralph

[1]
https://wiki-ext.aps.anl.gov/epics/index.php/How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux



.


.



Replies:
Re: Utilities for EPICS on Multi-Core Linux Till Straumann
References:
Utilities for EPICS on Multi-Core Linux Ralph Lange
Re: Utilities for EPICS on Multi-Core Linux Jack Smith
Re: Utilities for EPICS on Multi-Core Linux Ralph Lange
Re: Utilities for EPICS on Multi-Core Linux Shen, Guobao
Re: Utilities for EPICS on Multi-Core Linux Ralph Lange
Re: Utilities for EPICS on Multi-Core Linux Shen, Guobao
Re: Utilities for EPICS on Multi-Core Linux Till Straumann

Navigate by Date:
Prev: Re: .PACT .TIME Till Straumann
Next: Re: Utilities for EPICS on Multi-Core Linux Till Straumann
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Re: Utilities for EPICS on Multi-Core Linux Till Straumann
Next: Re: Utilities for EPICS on Multi-Core Linux Till Straumann
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·