octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patching octave-parallel so it allows more than one master* on a compute


From: Oz Nahum Tiram
Subject: Patching octave-parallel so it allows more than one master* on a computer
Date: Thu, 10 Mar 2011 16:00:09 +0100

Hi Everyone,

I am not at all a C++ dev, so this is a call for help regarding GNU
Octave: In octave forge there are a few packages for parallel
processing:

http://octave.sourceforge.net/multicore/index.html
http://octave.sourceforge.net/parallel/index.html
http://octave.sourceforge.net/general/function/parcellfun.html
http://octave.sourceforge.net/general/function/pararrayfun.html
http://octave.sourceforge.net/openmpi_ext/index.html

The first package allows processing on multicores, which is great if
you have expansive machine with more than 2 cores ... The second one
allows you to use octave on many cores with bewolf cluster, but allows
the usage of one process per node. I.E if you cluster compute nodes
have more than one CPU, you can't use them - UNLESS, you write code
using functions from 1, 2 or 3. The last solution is totally not user
friendly, and I can't use it.

The problem with writing code that uses 1,2 or 3 is that you have to
invent wrapper functions that will be able to run on unknown number of
CPU and compute nodes if you want your code to be portable ...

What I would like to to do, is to enable more than one compute server
on each node. I.E, one than more octave process on each node using
octave parallel. At the moment this is not possible because when the
function server.m starts it looks for a pid lock file. Commands are
sent to slave machines over TCP connections to port 12502, data is
sent between machines over TCP connections to port 12501.

The following lines in the file pserver.cc in the octave-parallel are
responsible for the lock:

 DEFUN_DLD (pserver,,,
 "pserver\n\
 \`enter code here`n\
  Connect hosts and return sockets.")
 {
 FILE *pidfile=0;
 int ppid,len=118;
 char hostname[120],pidname[128],errname[128],bakname[128];
 struct stat fstat;

 gethostname(hostname,len);
 sprintf(pidname,"/tmp/.octave-%s.pid",hostname);
 if(stat(pidname,&fstat)==0){
std::cerr << "octave : "<<hostname<<": server already running"<<std::endl;
clean_up_and_exit (1);
 }

So, after the long introduction, comes my question: 1. Is possible to
remove this lock check ? 2. Will it be possible to make the master
communicate with more than one slave on each host ? 3. And finally, is
there someone willing to help me implement it (I will help in testing
and documenting ... unfortunately, I can hardly write c++)?

I am not subscribed to octave maintainers ... so please include my
private email if you decide to answer me.

many thanks,
Oz Nahum

*In subject of mail by master  I mean of course a compute slave
instance (called by master.m which is highly confusing)...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]