Newsgroups: comp.parallel.pvm
From: adilger@enel.ucalgary.ca (Andreas Dilger)
Subject: Re: How to change the priority on slaves?
Organization: ECE Department, U. of Calgary, Calgary, Alberta, Canada
Date: 3 Aug 1995 16:18:25 GMT
Message-ID: <3vqssh$iv0@ds2.acs.ucalgary.ca>

In article <CMOORE.95Aug2133508@boadicea.mit.edu>,
Christopher B. Moore <cmoore@boadicea.mit.edu> wrote:
>hsong@lal.cs.utah.edu (Hwal Song) writes:
>
>>  Setpriority does not seem to work.

For pvmpov, my version of parallel POV-Ray, I have used a small bit of code
for each of my slaves to optionally lower their priority.  Note that this
has to be in the code of the slaves, not the master to change the slave
priority.  Note you have to add a -D$(PVMARCH) for the compilation of the
slave program to have SUN4SOL2 or whatever defined.

#include <sys/time.h>
#include <sys/resource.h>

#if defined(SUN4SOL2)

extern int nice(int priority);

nice(10);

#else

extern int setpriority (int which, int who, int prio);
extern int getpriority (int which, int who);

setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+10);

#endif
-- 
Andreas Dilger    University of Calgary   \ "If a man ate a pound of pasta and
(403) 220-8792    Micronet Research Group  \  a pound of antipasto, would they
Dept of Electrical & Computer Engineering   \    cancel out, leaving him still
http://www-mddsp.enel.ucalgary.ca/People/adilger/          hungry?" -- Dogbert
-- 
Andreas Dilger    University of Calgary   \ "If a man ate a pound of pasta and
(403) 220-8792    Micronet Research Group  \  a pound of antipasto, would they
Dept of Electrical & Computer Engineering   \    cancel out, leaving him still
http://www-mddsp.enel.ucalgary.ca/People/adilger/          hungry?" -- Dogbert

