Fabian Bull | 2 Jan 18:35 2010

Having trouble with sbcl networking.

hi everybody.

First of all: I am relatively new to Lisp, so  please be nice to me :D.

I am tinkering with the sbcl networking abilities but I just can't get a stream to work.
I tried to exchange messages between 2 concurrent slime processes.
That's what I tried:

Client:   (defparameter *client* (make-instance 'inet-socket
                                                                   :type :stream
                                                                   :protocol :tcp))
Server:   (defparameter *server* (make-instance 'inet-socket
                                                                   :type :stream
                                                                   :protocol :tcp))
Client:(socket-bind *client* #(192 168 1 42) 33333)
Server:(socket-bind *server* #(192 168 1 42) 44444)
Server:(socket-listen *server* 100)
Client:(socket-connect *client* #(192 168 1 42) 44444)

At this stage I can send data with socket-send and socket-receive. But If I try something like:

Client:(defparameter *stream1 (socket-make-stream *client* :input t :output t))
Server:(defparameter *stream1 (socket-make-stream *server* :input t :output t))

I can't wright something like:
Client:(format *stream*1 "hello, server")
Server:(read *stream2*)  -> "hello, server"

I don't get any error if I try this commands but I don't get a message too.
Can anybody help me in working with streams?

thanks in advance.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Leslie P. Polzer | 4 Jan 17:27 2010
Picon

[Fwd: Re: Failed contribs: asdf-install, sb-posix]


Haven't been able to test this as I don't have an x64 system
at hand. Perhaps someone else can verify this.

----------------------------------- Original Message -----------------------------------
Subject: Re: [Sbcl-help] Failed contribs: asdf-install, sb-posix
From:    "Michael Bykov" <m.bykov <at> gmail.com>
Date:    Sat, January 2, 2010 8:05 pm
To:      leslie.polzer <at> gmx.net
----------------------------------------------------------------------------------------

2009/12/5 Leslie P. Polzer <sky <at> viridian-project.de>:
>
> Nikodemus Siivola wrote:
>> 2009/10/5 Michael Bykov <m.bykov <at> gmail.com>:
>>
>>> debugger invoked on a UNDEFINED-ALIEN-ERROR in thread #<THREAD
>>> "initial thread" RUNNING {A8C4049}>:
>>>  Undefined alien: "waitpid"
>>>
>>> Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
>>>
>>> restarts (invokable by number or by possibly-abbreviated name):
>>>  0: [ABORT] Exit debugger, returning to top level.
>>>
>>> (FOREIGN-SYMBOL-ADDRESS "waitpid" #<unused argument>)
>>> 0]
>>
>> That's strange.
>>
>> Can you try adding "waitpid" to tools-for-build/ldso-stubs.lisp (eg.
>> between "wait3" and "write"), and rebuilding. (Run clean.sh before
>> rebuilding.)
>
> Someone has posted an analysis of this here:
>
>  http://bbs.archlinux.org/viewtopic.php?pid=667471#p667471
>
> I don't know why it only fails on x86_64, but it's worrying that
> the original error gets obscured, leading to the slightly unrelated
> error about a missing waitpid().
>
> The bottom line is that a "-Wl,--as-needed" in LDFLAGS causes
> the compilation of tools-for-build/os-provides-dlopen-test.c
> to fail.
>
> Filed as #492783: https://bugs.launchpad.net/sbcl/+bug/492783
>
>  Leslie
>

Yes, thank you. Now with 1.0.34 it simply works. Obviously, this bug was fixed.

M.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Tamas K Papp | 8 Jan 16:54 2010
Picon

coercing numerical simple-vector to another type, fast

I have a simple array of a numerical type (float or integer), and I
need to convert it to another type (eg with coerce).

What's the fastest way to do this in SBCL?  I tried

(map '(simple-array double-float (*))
     (lambda (x)
       (declare (type single-float x))
       (coerce x 'double-float))
     (the (simple-array single-float (*)) elements))))

but get various warnings with (declare (optimize speed)).  For the
above:

; note: doing float to pointer coercion (cost 13) to "<return value>"

in the (lambda ...).  For coercion to complex numbers, I get

; note: unable to
;   optimize
; because:
;   open coding coercion to (COMPLEX SINGLE-FLOAT) not implemented.

I need the following conversions (in (source target) pairs):

 (single-float double-float)
 (single-float (complex single-float))
 (single-float (complex double-float))

 (double-float single-float)
 (double-float (complex single-float))
 (double-float (complex double-float))

 ((complex single-float) (complex double-float))

 ((complex double-float) (complex single-float))

 ((signed-byte 32) single-float)
 ((signed-byte 32) double-float)
 ((signed-byte 32) (complex single-float))
 ((signed-byte 32) (complex double-float))

I am happy to do convoluted things, the code is macro-generated.  Just
don't know where to start.

Thanks,

Tamas

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Alistair Gee | 9 Jan 00:24 2010
Picon

How to set dynamic-space-start and dynamic-space-end (and other parameters in parms.lisp) to allow use of more than 8GB RAM on x86-64?

I am using sbcl 1.0.29 for data analysis on ubuntu 9.10 Linux x86-64
with 96GB RAM.

sbcl dies at about 8GB of heap usage, regardless of the what I specify
for --dynamic-space-size on the command line.

I notice that 8GB is the same number as determined by
dynamic-space-start and dynamic-space-end in
src/compiler/x86-64/parms.lisp:

(progn
  (def!constant read-only-space-start     #x20000000)
  (def!constant read-only-space-end       #x200ff000)

  (def!constant static-space-start        #x20100000)
  (def!constant static-space-end          #x201ff000)

  (def!constant dynamic-space-start   #x1000000000)
  #!-openbsd
  (def!constant dynamic-space-end     #x11ffff0000)
  #!+openbsd
  ;; This is lower on OpenBSD to allow SBCL to run under the default
  ;; 512M data size limit.
  (def!constant dynamic-space-end     #x101bcf0000)

  (def!constant linkage-table-space-start #x20200000)
  (def!constant linkage-table-space-end   #x202ff000)

  (def!constant linkage-table-entry-size 16))

Therefore, I would like to rebuild sbcl after modifying the settings
in parms.lisp to allow the full use of my 96GB RAM. What exactly
should I change?

I suspect that I can just lower dynamic-space-start, but how low can I
set it to? Do I need to change anything else?

--

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Didier Verna | 11 Jan 16:12 2010
X-Face
Face
Picon
Picon
Picon
Picon

Handling of bogus slot allocation


       Hello,

I discovered (by accident) that SBCL lets you do something like this:

(defclass foo () ((slot :accessor foo-slot :allocation :nonsense)))
(make-instance 'foo)

without any warning or error. It will only barf when actually trying to
access the slot. Allegro, on the other hand, barfs on the call to
make-instance (no big deal; I understand this is somewhat uncharted
territory, and SBCL's behavior seems more compliant to the AMOP).

What bothers me a little is the way the standard defines defclass: it
says that :allocation should be either :instance or :class. On the other
hand, it doesn't explicitely say that an error should be triggered
otherwise...

So, is the current behavior both standard-compliant and AMOP-compliant ?

Thanks.

--

-- 
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Adam Majewski | 14 Jan 17:33 2010
Picon

Re: How to set dynamic-space-start and dynamic-space-end (and other parameters in parms.lisp) to allow use of more than 8GB RAM on x86-64?

It's very intresting question ( how to work with big memory).
Unfortunatelly I do not know the answer 
Please give here an answer if you will find it. 

Adam

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Juho Snellman | 14 Jan 19:28 2010
Picon
Picon

Re: How to set dynamic-space-start and dynamic-space-end (and other parameters in parms.lisp) to allow use of more than 8GB RAM on x86-64?

On Sat, Jan 9, 2010 at 12:24 AM, Alistair Gee <alistair.gee <at> gmail.com> wrote:

I am using sbcl 1.0.29 for data analysis on ubuntu 9.10 Linux x86-64
with 96GB RAM.

sbcl dies at about 8GB of heap usage, regardless of the what I specify
for --dynamic-space-size on the command line.

How does it die?

--
Juho Snellman
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Alistair Gee | 14 Jan 19:42 2010
Picon

Re: How to set dynamic-space-start and dynamic-space-end (and other parameters in parms.lisp) to allow use of more than 8GB RAM on x86-64?

On Thu, Jan 14, 2010 at 10:28 AM, Juho Snellman <jsnell <at> iki.fi> wrote:
> On Sat, Jan 9, 2010 at 12:24 AM, Alistair Gee <alistair.gee <at> gmail.com>
> wrote:
>>
>> I am using sbcl 1.0.29 for data analysis on ubuntu 9.10 Linux x86-64
>> with 96GB RAM.
>>
>> sbcl dies at about 8GB of heap usage, regardless of the what I specify
>> for --dynamic-space-size on the command line.
>
> How does it die?
> --
> Juho Snellman
>

I don't remember the message, but it said something like "game over"
or "out of heap space" and drops into ldb.

I have since rebuilt sbcl (from CVS) with dynamic-space-end (in
parms.lisp) increased to #x31ffff0000, and it seems to be OK.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Yue Li | 15 Jan 03:17 2010
Picon

SBCL threads only occupy one of the cores

Hi,

I'm new to Lisp programming and SBCL, and I'm currently facing some
problems on using sbcl threads library.

I'm running some simple computation, such as computing the sum of a
list of one million integers in a reduction fashion.  I would like to
parallelize the sum by using threads.  Therefore, I usually create
about 2-4 threads, each computes a portion of the sum. The results are
always correct, however, I found the performance is always as fast as
my sequential version. Then I looked at the CPU monitor, and it shows
that when doing computation using threads, all the threads only occupy
the first core, and very seldomly occupy the second core. I read the
SBCL manual, and googled on websites but seems I could not find the
answer.

My machine is a Dual-core x86-64-fedora12 box, with 4gb memory. Later,
I thought it maybe due to the gc. Therefore I used the command:

(sb-ext:bytes-consed-between-gcs)

And found that the default value is 12582912, I tried to make it
larger to 512mb (also tried other values) by using

(setf (sb-ext:bytes-consed-between-gcs) (- (expt 2 29) 10)))

Then run my multithreading program again, and still, all the threads
occupy one of the two cores when running, and the speed up is very
trivial.

Here did I miss something on configuring the GC? or I am totally out
of the correct direction?

Thanks for your help,

Cheers,

Yue

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Daniel Herring | 15 Jan 08:23 2010

Re: SBCL threads only occupy one of the cores

On Thu, 14 Jan 2010, Yue Li wrote:
> Then run my multithreading program again, and still, all the threads
> occupy one of the two cores when running, and the speed up is very
> trivial.
>
> Here did I miss something on configuring the GC? or I am totally out
> of the correct direction?

I think you hit a common problem.  The official SBCL binaries are built 
single-threaded.  To get a multithreaded build, you must build it 
yourself.

This isn't very hard.  Download and extract the SBCL sources somewhere. 
The INSTALL file tells you what to do and how to enable threads (see 
sections 2.1 and 2.2).

I don't think this is a GC issue.

Later,
Daniel

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

Gmane