EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Problem with subArray - unnecessary memory allocation
From: Noboru Yamamoto <[email protected]>
To: Thomas Birke <[email protected]>
Cc: [email protected]
Date: Wed, 04 Feb 2009 21:35:57 +0900
Hi,

We encountered same problem when we building KEKB control system.
Our solution is to modify EPICS base and provide API to access a part of
source waveform. And also we created a record named CompactSubArrayRecord, which uses API above and copy data just it needs.

Unfortunately this mechanism works only for DB-link but not for CA-link.
(We will need to extend CA protocol to access a part of waveform data,say channel name like "myWaveFormRecord[10:20]")

And also you need to change source code of base.
We have been using this version of modified base in KEKB and J-PARC and
encounters no problem caused by this change.

Noboru Yamamoto
J-PARC control group/J-PARC center(KEK & JAEA)
EPICS group/KEK
JAPAN

Thomas Birke wrote:
Thomas Birke wrote:

Since the INDX actually has nothing to do with the subArray-record itself, but is just an index into the referenced waveform (of unknown size), to me it makes no sense at all to limit INDX to MALM-1.

For me the only solution is to set MALM of my subArray to INDX+NELM which leads to hundreds of oversized and allocated arrays in my subArray-records. E.g. to slice out the last element of a waveform, I have to (statically!) allocate space for the whole source-waveform and then copy exactly one element.

I simply ask to drop these 4 lines of code from subArrayRecord.c - it shouldn't even break existing installations, and for my case I could reduce memory-consumption a lot.
Ooops - I just found, that this has been discussed before (back in 2005, see http://www.aps.anl.gov/epics/tech-talk/2005/msg00924.php).
I should have looked at the tech-talk archives before, sorry...

The problem is, that you actually can't index into the source-waveform. Values retrieved always range from index 0 to <n>.

Maybe we should at least point out this behaviour in the Record Reference Manual. It's not only NELM that must not be greater that MALM, but also INDX+NELM always must be less or equal MALM, otherwise NORD will be less then NELM.

Regards,
Thomas



Replies:
Re: Problem with subArray - unnecessary memory allocation Thomas Birke
References:
Problem with subArray - unnecessary memory allocation Thomas Birke
Re: Problem with subArray - unnecessary memory allocation Thomas Birke

Navigate by Date:
Prev: Re: Problem with subArray - unnecessary memory allocation Thomas Birke
Next: Re: Problem with subArray - unnecessary memory allocation Thomas Birke
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Problem with subArray - unnecessary memory allocation Thomas Birke
Next: Re: Problem with subArray - unnecessary memory allocation Thomas Birke
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·