Newsgroups: comp.parallel.pvm
From: papadopo@cs.utk.edu (Philip Papadopoulos)
Subject: Re: (no subject)
Organization: CS Department, University of Tennessee, Knoxville
Date: 7 Jul 1995 08:57:06 -0400
Message-ID: <3tjav2INNi6m@duncan.cs.utk.edu>

In article <3tj49k$1c5m@msunews.cl.msu.edu> "Paul A. Gray" <pgray@mth.msu.edu> writes:
>Greetings all.
>
>I would appreciate any advice on the following dilemma...
>
>I am having problems spawning FORTRAN processes on a Linux machine.  For
>instance, the example programs master1.f and slave1.f (when compiled via 
>"aimk fmaster fslave") make fine.  However, upon running the master program, I am
>able to enter the number of processes, nproc, but then I encounter the error: 
>
>[tid000something] pvm_spawn: Bad argument
>Segmentation fault
>
The problem is with the LINUX.m4 file in the pvm3/conf directory. f2c passes
string arguments just like the SUN4 compiler -- i.e., it passes the string
length at the end of the parameter list.  If you copy the SUN4.m4 file
to LINUX.m4 and then recompile the fortran libraries with
              % cd $PVM_ROOT
              % make f

And then recompile the test programs, you should be OK. There is one other
thing. (You probably have come up against the following since you
got the original fortran files compiled) 
The fortran files will have trouble finding the includes. The 
aimk utility does a chdir to the $PVM_ARCH directory (eg. pvm3/examples/LINUX).
f2c then writes out a C program in the $PVM_ARCH directory and uses gcc to 
compile.  If, in your fortran file you have the include

       include '../include/fpvm3.h'

(as is done in the example programs), then the C version of the fortran
file (got that? :-)) will have the following source line

#include "../include/fpvm3.h" 

The problem is that the C file resides in the pvm3/examples/LINUX directory
and not in the pvm3/examples directory (as it would if the compiler
was native fortran. There is no pvm3/examples/include directory and
the compiler then complains. The simple fix is to make a soft link

        % cd pvm3/examples
        % ln -s ../include include

Hope this helps you,
Philip Papadopoulos 

