Eli Billauer | 4 Feb 15:27
Picon

Cat on (RAM) steroids

Hi all,

I need a simple command-line program, which works as a plain FIFO stream 
buffer with a huge RAM. Something I can do:

$ fatcat -b 256M /dev/datasource | ./my_shaky_data_sink

The idea is that "fatcat" reads data whenever available and stores it to 
non-swappable RAM. It then pushes the data to stdout. So it's just like 
good old "cat", only with a potentially large tummy.

Rationale: The (kernel) device /dev/datasource has limited RAM it can 
allocate in kernel space. If data arrives at a high constant rate (say, 
100 MB/sec), the kernel buffers (4 MB total?) overflow rather quickly if 
not constantly drained. A real-life data sink may write the data to a 
disk with sufficient *average* rate, but with breaks every now and then 
to mind its own business.

So if data is loaded into a huge RAM array (what is 256 MB these days?) 
by a high-priority thread (dare I say "real-time"?), there's a good 
chance the kernel buffers are emptied quick enough.

It's rather straightforward to write a program doing this with POSIX 
threads, but why bother if it's already available? After all, I can't be 
the first one in the world with this need.

My own search lead me at best to cstream, which doesn't look like it's 
tailored for solving realtime issues.

Ideas, anyone?
(Continue reading)

Baruch Even | 4 Feb 15:40

Re: Cat on (RAM) steroids

On Sat, Feb 4, 2012 at 4:27 PM, Eli Billauer <eli-GsdA+T+tvpNS1MOuV/RT9w@public.gmane.org> wrote:
Hi all,


I need a simple command-line program, which works as a plain FIFO stream buffer with a huge RAM. Something I can do:


$ fatcat -b 256M /dev/datasource | ./my_shaky_data_sink


The idea is that "fatcat" reads data whenever available and stores it to non-swappable RAM. It then pushes the data to stdout. So it's just like good old "cat", only with a potentially large tummy.

I've used pv or buffer for such purposes.

Baruch
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Eli Billauer | 4 Feb 16:15
Picon

Re: Cat on (RAM) steroids

Thanks for that one. "yum install buffer". How simple.


So I tried it out:


$ dd if=/dev/zero bs=1M count=256  > /dev/null
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 0.0258608 s, 10.4 GB/s


Original throughput is 10.4 GB/sec. Looks not so bad.


$ dd if=/dev/zero bs=1M count=256  | cat > /dev/null

256+0 records in
256+0 records out

268435456 bytes (268 MB) copied, 0.199799 s, 1.3 GB/s


The regular cat is somewhat slower, then.


Now let's try buffer:


$ dd if=/dev/zero bs=1M count=256 | buffer -m 256m > /dev/null
Cannot handle that many blocks, aborting!


Hmmm... The default buffer size is too small, so asking for 256MB didn't work well. Let's ask for 128kByte buffers:


$ dd if=/dev/zero bs=1M count=256 | buffer -s 128k -m 256m > /dev/null

256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 0.379354 s, 708 MB/s

On one hand, it's not all that impressive that the rate went down. But it's still way above the 100 MB/sec needed. On the other hand, going


$ dd if=/dev/zero bs=1M count=256 | buffer -s 128k -m 256m | hexdump -C > /dev/null


gives exactly the same result, except that command prompt returns after a second or so, which is the time it took for hexdump to consume the data.


So I suppose we have a winner. Thanks again.


   Eli



Baruch Even wrote:

On Sat, Feb 4, 2012 at 4:27 PM, Eli Billauer <eli-GsdA+T+tvpNS1MOuV/RT9w@public.gmane.org> wrote:
Hi all,


I need a simple command-line program, which works as a plain FIFO stream buffer with a huge RAM. Something I can do:


$ fatcat -b 256M /dev/datasource | ./my_shaky_data_sink


The idea is that "fatcat" reads data whenever available and stores it to non-swappable RAM. It then pushes the data to stdout. So it's just like good old "cat", only with a potentially large tummy.

I've used pv or buffer for such purposes.

Baruch


-- Web: http://www.billauer.co.il
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Eli Billauer | 4 Feb 20:32
Picon

[HAIFUX LECTURE] C++ AMP: Microsoft approach for Heterogeneous Computing by Avi Mendelson

On Monday, February 6th at 18:30, Haifux will gather to hear a talk by Avi Mendelson:

   C++ AMP: Microsoft approach for Heterogeneous Computing

Abstract

C++ AMP (Accelerated Massive Parallelism) is a native programming model that contains elements that span the C++ programming language and its runtime library. The syntactic changes introduced by AMP are minimal, but additional restrictions are enforced to reflect the limitations of data parallel hardware. Data parallel algorithms are supported by the introduction of multi-dimensional array types, array operations on those types, indexing, asynchronous memory transfer, shared memory, synchronization and tiling/partitioning techniques.

=================================================================

We meet in Taub building, room 6. For instructions see:
http://www.haifux.org/where.html

Attendance is free, and you are all invited!

==================================================================
Future lectures:

20/02/2012  Making Hebrew slides with LaTeX and Beamer by Gai Shaked

==================================================================

We are always interested in hearing your talks and ideas. If you wish to give a talk, hold a discussion, or just plan some event haifux might be interested in, please contact us at webmaster-E9S1XMMTbEgdnm+yROfE0A@public.gmane.org

--
Web: http://www.billauer.co.il
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Oron Peled | 5 Feb 01:26
X-Face
Picon
Picon

Re: Cat on (RAM) steroids

On Saturday, 4 בFebruary 2012 16:27:27 Eli Billauer wrote:
> ...
> Rationale: The (kernel) device /dev/datasource has limited RAM it can 
> allocate in kernel space.
> ...
> So if data is loaded into a huge RAM array (what is 256 MB these days?) 

I fail to see why the kernel driver would be more limited in RAM
allocation than the utility you want?

After all, RAM is RAM if you have enough for the application to
use (you asked for non-pageable memory), than why can't the
kernel driver allocate it just the same and be done with it?

Bye,

--

-- 
Oron Peled                                 Voice: +972-4-8228492
oron <at> actcom.co.il                  http://users.actcom.co.il/~oron
Linux: Because a PC is a terrible thing to waste.

_______________________________________________
Linux-il mailing list
Linux-il <at> cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Boaz Rymland | 5 Feb 06:20
Picon

Preparing to convince to shift to non-propriety documents formats

Hi all,

I'm about to meet my daughter's school principal on the subject of the formats of documents the school spreads around routinely, like the weekly schedule. In short - they are using .DOC MS Word format and I don't like it as I cannot cleanly open those documents on my computer (which runs Ubuntu).

Although I'm quite old in the Linux world and probably heard over the years most of them - still I prefer having a refreshment of all the arguments in favor of moving to more open or at least affordable (e.g. PDF) document formats.

Any pointers/text will be appreciated.

Thanks,
Boaz.
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Ori Idan | 5 Feb 07:17
Picon
Gravatar

Re: Preparing to convince to shift to non-propriety documents formats

Another point to notice is that there is no such format as MS word format. Each version has a different format and sometimes one can not open the documents that was sent to him in this format.
I have seen many cases where OpenOffice opened files that people who had a version of MS-word could not open.

--
Ori Idan


2012/2/5 Boaz Rymland <boaz.rymland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Hi all,

I'm about to meet my daughter's school principal on the subject of the formats of documents the school spreads around routinely, like the weekly schedule. In short - they are using .DOC MS Word format and I don't like it as I cannot cleanly open those documents on my computer (which runs Ubuntu).

Although I'm quite old in the Linux world and probably heard over the years most of them - still I prefer having a refreshment of all the arguments in favor of moving to more open or at least affordable (e.g. PDF) document formats.

Any pointers/text will be appreciated.

Thanks,
Boaz.

_______________________________________________
Linux-il mailing list
Linux-il-NSemkxREmS1YZAO8hgG6+w@public.gmane.org
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Picon

Re: Preparing to convince to shift to non-propriety documents formats

Hi Boaz,
The time is not ripe. Don't waste your energy. Your school principal will 
not know what you are talking about and will dismiss you as a hopeless 
geek.

A slightly more productive line might be to claim that you are no longer 
using desktop computers - only mobile devices, and for these you need 
either PDF or Google docs.

I found that this approach, mobile devices, works. For example, at the 
American School in Even Yehuda it helped convince teachers to accept and 
give assignments in PDF or via Google docs. The techers made this head 
switch about three years ago when the younger students who were 
the early technology adopters demanded it. It didn't come from the 
principal, and not from the parents either, both groups being generally 
clueless.

  - yba

On Sun, 5 Feb 2012, Boaz Rymland wrote:

> Date: Sun, 5 Feb 2012 07:20:39 +0200
> From: Boaz Rymland <boaz.rymland@...>
> To: linux-il <linux-il@...>
> Subject: Preparing to convince to shift to non-propriety documents formats
> 
> Hi all,
> I'm about to meet my daughter's school principal on the subject of the formats of documents the school
spreads around
> routinely, like the weekly schedule. In short - they are using .DOC MS Word format and I don't like it as I cannot
> cleanly open those documents on my computer (which runs Ubuntu).
> 
> Although I'm quite old in the Linux world and probably heard over the years most of them - still I prefer
having a
> refreshment of all the arguments in favor of moving to more open or at least affordable (e.g. PDF) document formats.
> 
> Any pointers/text will be appreciated.
> 
> Thanks,
> Boaz.
> 
>

--

-- 
  EE 77 7F 30 4A 64 2E C5  83 5F E7 49 A6 82 29 BA    ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
      - yba@... - tel: +972.2.679.5364, http://www.tkos.co.il -
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Yedidyah Bar-David | 5 Feb 07:43

Re: Preparing to convince to shift to non-propriety documents formats

On Sun, Feb 05, 2012 at 07:20:39AM +0200, Boaz Rymland wrote:
> Hi all,
> 
> I'm about to meet my daughter's school principal on the subject of the
> formats of documents the school spreads around routinely, like the weekly
> schedule. In short - they are using .DOC MS Word format and I don't like it
> as I cannot cleanly open those documents on my computer (which runs Ubuntu).
> 
> Although I'm quite old in the Linux world and probably heard over the years
> most of them - still I prefer having a refreshment of all the arguments in
> favor of moving to more open or at least affordable (e.g. PDF) document
> formats.
> 
> Any pointers/text will be appreciated.

Searching for stuff like 'do not email me doc files' will find you plenty
of such lists.

In addition to "classic" points you can find, you might suggest that in
this age of always-online connectivity, it's probably better to publish
stuff on the net and not send files. Potential examples: some Wiki (e.g.
wikia.com, there are others), google docs and its competitors, etc.
--

-- 
Didi

_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Nadav Har'El | 5 Feb 07:52
Picon
Favicon

Re: Preparing to convince to shift to non-propriety documents formats

On Sun, Feb 05, 2012, Ori Idan wrote about "Re: Preparing to convince to shift to non-propriety documents formats":
> Another point to notice is that there is no such format as MS word format.
> Each version has a different format and sometimes one can not open the
> documents that was sent to him in this format.
> I have seen many cases where OpenOffice opened files that people who had a
> version of MS-word could not open.

Be careful not to rely on arguments that can easily be refuted...

I saw someone with an old version of MS-Word receive a newer ("docx")
document. His Word popped up a message saying something like "This document
comes from a newer version of Word, you need to download a converter for
this format". He clicked "OK", and in a couple of minutes he was able to
read this document, and see it just like Microsoft intended.

I tried to read the same document on my OpenOffice, and it was kind of
visible, I guess, but it was quite far from what the document was
intended to look like :(

--

-- 
Nadav Har'El                        |                     Sunday, Feb 5 2012, 
nyh@...             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Politics, n: from Greek, "poly"=many,
http://nadav.harel.org.il           |"ticks"=blood sucking parasites.

_______________________________________________
Linux-il mailing list
Linux-il@...
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Gmane