For Programmers: Free Programming Magazines  


Home > Archive > Prolog > April 2004 > Parallel prolog









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Parallel prolog
Laurence Darby

2004-03-27, 12:11 am

Hello,

My final year project is to distribute a prolog program across a
cluster of 7 dual cpu P4 machines. The original proposal was to split
the program up into different sized chunks, and use openmosix (cluster
load balancer) to distribute these chunks.

This allows distribution of arbitrary loads, making the cluster
usefull for other projects. However, the efficiency is terrible for
this particular workload (lots of redundancy, large data sets copied
to each instance of prolog). I've been looking at parallel prolog
implementations such as Aurora and Muse, for Sicstus prolog, however
these are only for shared memory SMP machines.

Is there a standard, classical way to distribute prolog across a
cluster?

Thank you,
Laurence
Cameron Hughes

2004-03-27, 12:11 am

Laurence Darby wrote:
>
> Hello,
>
> My final year project is to distribute a prolog program across a
> cluster of 7 dual cpu P4 machines. The original proposal was to split
> the program up into different sized chunks, and use openmosix (cluster
> load balancer) to distribute these chunks.
>
> This allows distribution of arbitrary loads, making the cluster
> usefull for other projects. However, the efficiency is terrible for
> this particular workload (lots of redundancy, large data sets copied
> to each instance of prolog). I've been looking at parallel prolog
> implementations such as Aurora and Muse, for Sicstus prolog, however
> these are only for shared memory SMP machines.
>
> Is there a standard, classical way to distribute prolog across a
> cluster?
>
> Thank you,
> Laurence


I use a method that is practical to me. Others may see it differently!
I use SWI-Prolog and their FLI (foreign language interface) and PVM or
MPI for
the distributed processes.

First I write/test my prolog stuff and pure prolog

Then I write C++ interfaces for the prolog stuff using SWI's FLI. The
C++ code simply becomes
a wrapper for my prolog code. After this interface is done I use either
PVM or MPI to distribute
the C++ code (which is really just an interface to prolog code). PVM
and MPI are pretty standard
software libraries/protocols to distribute code in a cluster I use the
message passing in PVM/MPI
to pass data between the prolog modules. If large amounts of data need
to be transmitted realtime
between the prolog modules I use either NFS mounts, or dynamic scripted
ftp transfers between nodes.
Everything involved is standard based: Standard Prolog, Standard C++,
Standard MPI/PVM Standard
(Ftp) when absolutely necessary.


This works for me. Of course it requires C++/C programming as well but
as far as I'm concerned
its very effective for my stuff. Considering my applications are
interactive, the performance is satisfactory!
However, I'm always looking to improve the architecture.


Cameron Hughes
Programmer/Analyst
Youngstown State University
------------ And now a word from our sponsor ------------------
Want to have instant messaging, and chat rooms, and discussion
groups for your local users or business, you need dbabble!
-- See http://netwinsite.com/sponsor/sponsor_dbabble.htm ----
Alexei A. Morozov

2004-03-27, 12:11 am

Hi,

Please visit Actor Prolog homepage http://www.cplire.ru/Lab144 . One
can get some English papers on the topic and free beta version of the
language.

Best regards,

Alexei A. Morozov

http://www.cplire.ru/Lab144
Institute of Radio Engineering and Electronics RAS
Laurence Darby

2004-03-30, 2:38 pm

On Wed, 24 Mar 2004 12:19:38 -0500, Cameron Hughes <cahughes@cc.ysu.edu>
wrote:

> I use a method that is practical to me. Others may see it differently!
> I use SWI-Prolog and their FLI (foreign language interface) and PVM or
> MPI for
> the distributed processes.
>
> First I write/test my prolog stuff and pure prolog
>
> Then I write C++ interfaces for the prolog stuff using SWI's FLI. The
> C++ code simply becomes
> a wrapper for my prolog code. After this interface is done I use either
> PVM or MPI to distribute
> the C++ code (which is really just an interface to prolog code). PVM
> and MPI are pretty standard
> software libraries/protocols to distribute code in a cluster I use the
> message passing in PVM/MPI
> to pass data between the prolog modules. If large amounts of data need
> to be transmitted realtime
> between the prolog modules I use either NFS mounts, or dynamic scripted
> ftp transfers between nodes.
> Everything involved is standard based: Standard Prolog, Standard C++,
> Standard MPI/PVM Standard
> (Ftp) when absolutely necessary.
>
>
> This works for me. Of course it requires C++/C programming as well but
> as far as I'm concerned
> its very effective for my stuff. Considering my applications are
> interactive, the performance is satisfactory!
> However, I'm always looking to improve the architecture.
>


Thank you very much for your reply.
That sounds interesting, and got me thinking.

I've got a complicated architecture - the front end (java servlets and
JSP forms for input) is hosted on one machine, and all the heavy
searching is to be done on the cluster, (so the front end is portable
to a general web server). Also, I've found that to instantiate
sicstus, with the data, is fastest by doing it once, and saving the
environment to a bash script file, with save_program(env), then
executing the env.sav file.

So my plan is for now, to set up the env twice on each machine (dual
cpu) and have a main loop that sends a goal to all the env.savs, and
keep track of what's free/busy. I think I'll use prologBeans for
the communication.

It's probably more difficult than using MPI, (but then I would have to
learn that as well) although I guess it would be about as efficient.

Cheers,
Laurence
Cameron Hughes

2004-04-15, 9:43 am

Laurence Darby wrote:
>
> On Wed, 24 Mar 2004 12:19:38 -0500, Cameron Hughes <cahughes@cc.ysu.edu>
> wrote:
>
>
> Thank you very much for your reply.
> That sounds interesting, and got me thinking.
>
> I've got a complicated architecture - the front end (java servlets and
> JSP forms for input) is hosted on one machine, and all the heavy
> searching is to be done on the cluster, (so the front end is portable
> to a general web server). Also, I've found that to instantiate
> sicstus, with the data, is fastest by doing it once, and saving the
> environment to a bash script file, with save_program(env), then
> executing the env.sav file.
>
> So my plan is for now, to set up the env twice on each machine (dual
> cpu) and have a main loop that sends a goal to all the env.savs, and
> keep track of what's free/busy. I think I'll use prologBeans for
> the communication.
>
> It's probably more difficult than using MPI, (but then I would have to
> learn that as well) although I guess it would be about as efficient.
>
> Cheers,
> Laurence


prologBeans?


are the components executing in parallel tightly coupled with respect
to communication?

does prologBeans provide synchronization capabilities?

sounds interesting...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com