Re: [Chicken-users] Anyone up for porting Termite to Chicken?

2008-05-21 Thread Ivan Raikov

  It appears that I was wrong about not being able to start MPI
processes dynamically. The MPI-2 standard does include a procedure
MPI_Comm_spawn which can be used to create MPI processes from a master
process. In fact, one of the main motivations for MPI-2 was to break
free from the static process model. I have added a binding for
MPI_Comm_spawn to the mpi egg, and it appears to work as advertised
with Open MPI under Linux.

  My impression of the Erlang process model is also based on the
documentation. Both systems seem to follow a very similar approach in
that the processes are completely isolated from one another, and there
is a system-wide barrier synchronization facility. This is what makes
implementing concurrent systems in Erlang and MPI so easy. The real
trouble with concurrent systems starts when you share memory and both
Erlang and MPI avoid this zealously. But I will be interested to hear
about other aspects of Erlang and Termite that are lacking in Chicken
MPI.

   -Ivan


Mark Fredrickson <[EMAIL PROTECTED]> writes:

> An Erlang "process" is really a green thread, not dissimilar to
> Chicken's continuation based threads. Erlang processes run inside of a
> virtual machine, which is the equivalent of the Chicken run-time. At
> least on paper (which is as far as my knowledge extends) the Erlang
> and Scheme + MPI models are fairly similar.
>
> I do believe that one can start a new Erlang VM and add it to the
> cloud at any time, but I get the impression this is actually rare.
> With n cores, why not just start a VM on each core to begin with? The
> Erlang designers are extremely paranoid about the VM's stability (e.g.
> I understand a large portion of IO is done over pipes so that if the
> IO process crashes, the VM is safe), so restarts of VMs tend to be
> few. This is probably one area that Chicken would not fair as well. In
> Erlang, if one "process" (thread really) has a problem it crashes (by
> design) and everyone else is fine. A Chickeny Termite would probably
> need to expend some effort to match this. Though I think it certainly
> could be done.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Anyone up for porting Termite to Chicken?

2008-05-21 Thread Graham Fawcett
On Wed, May 21, 2008 at 9:39 AM, Mark Fredrickson
<[EMAIL PROTECTED]> wrote:

> I do believe that one can start a new Erlang VM and add it to the cloud at
> any time, but I get the impression this is actually rare. With n cores, why
> not just start a VM on each core to begin with?

A year or two ago, the Erlang VM gained SMP support, so while it runs
green threads, they can be executed in parallel. I believe this is
called M:N threading (running M green threads on N native ones). Prior
to this, I suspect one-vm-per-core was an Erlang idiom.

Graham


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Anyone up for porting Termite to Chicken?

2008-05-21 Thread Mark Fredrickson


On May 20, 2008, at 8:04 PM, Ivan Raikov wrote:



Answers embedded below:


Alaric Snell-Pym <[EMAIL PROTECTED]> writes:


Well, as far as I can tell, MPI seems to have a fairly static view of
the world as having a fixed number of processes in it upon startup,
so the following (in Erlang) comes to mind:

http://www.erlang.org/doc/reference_manual/processes.html#10.2

Which, basically, creates a new process and returns its PID, which is
then usable as the destination for a message send.


 Ok, you cannot do this with MPI as far as I know.


An Erlang "process" is really a green thread, not dissimilar to  
Chicken's continuation based threads. Erlang processes run inside of a  
virtual machine, which is the equivalent of the Chicken run-time. At  
least on paper (which is as far as my knowledge extends) the Erlang  
and Scheme + MPI models are fairly similar.


I do believe that one can start a new Erlang VM and add it to the  
cloud at any time, but I get the impression this is actually rare.  
With n cores, why not just start a VM on each core to begin with? The  
Erlang designers are extremely paranoid about the VM's stability (e.g.  
I understand a large portion of IO is done over pipes so that if the  
IO process crashes, the VM is safe), so restarts of VMs tend to be  
few. This is probably one area that Chicken would not fair as well. In  
Erlang, if one "process" (thread really) has a problem it crashes (by  
design) and everyone else is fine. A Chickeny Termite would probably  
need to expend some effort to match this. Though I think it certainly  
could be done.


Cheers,
-Mark



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users