Up: Porting PVM to
Previous: Porting PVM to
PVM is supported on most Unix platforms. If an architecture
is not listed in the file $PVM_ROOT/docs/arches, the following
description should help you to create a new PVM port.
Anything from a small amount of tweaking to major surgery may
depending on how accomodating your version of Unix is.
The PVM source directories are organized in the following manner:
Files in src form the core for PVM (pvmd and libpvm);
files in console are for
the PVM console, which is just a special task; source for
the FORTRAN interface and group functions are in the libfpvm
and pvmgs directories, respectively.
In each of the source directories,
the file Makefile.aimk is the generic makefile for all
System-specific definitions are kept in the conf directory under
The script lib/aimk, invoked by the top-level makefile,
determines the value of PVM_ARCH,
then chooses the appropriate makefile for a particular architecture.
It first looks in the PVM_ARCH
subdirectory for a makefile; if none is found, the generic one is used.
The custom information stored in the conf directory is
prepended to the head of the chosen makefile, and the build begins.
The generic makefiles for MPP and shared-memory systems are
Makefile.mimd and Makefile.shmem, respectively. System-specific rules
are kept in the makefile under the PVM_ARCH subdirectory.
The steps to create a new architecture (for example ARCH) are:
- Add a rule to the script lib/pvmgetarch so it returns ARCH.
PVM uses this program to determine machine architecture at run time.
pvmgetarch tries to use the uname or arch command
(supplied by many vendors).
If there is no such command,
we check for the existence of a file or device unique to a machine - try
to find one that doesn't depend on configuration options.
Don't break the existing architectures when adding a new one,
unless you won't be sharing the code or just want to hack it together.
you can override pvmgetarch by setting
PVM_ARCH in your .cshrc file.
- Create files ARCH.def and ARCH.m4
As a first try,
copy them from another architecture similar to yours (you'll have to
figure that out).
ARCH.def is a machine-dependent header used with the generic
makefiles (for example see the file src/Makefile.aimk).
It defines the following variables (and possibly others):
- PVM_ARCH -
This is set to the architecture name, ARCH.
- ARCHCFLAGS -
This lists any special C compiler flags needed,
for example, optimizer limits or floating-point switches
(Not, for example, -O).
It also defines macros needed to switch in optional PVM source code,
for example, -DSYSVSIGNAL.
Common compiler macros are explained below.
- ARCHDLIB -
This lists any special libraries needed to link with the pvmd,
for example -lsocket.
You'll need to set this if there are symbols undefined while linking
You can use nm and grep to find the missing functions
They may occur in multiple libraries,
but are probably defined in only one.
- ARCHLIB -
This lists any special libraries needed to link with tasks
(anything linked with libpvm).
It is probably a supeset of ARCHDLIB,
because libpvm uses mostly the same functions as the pvmd,
and also uses XDR.
- HASRANLIB -
This should be set to t if your machine has the ranlib
and f otherwise.
Compiler macros imported from conf/ARCH.def
are listed at the top of the file named src/Makefile.aimk.
They enable options that are common to several machines
and so generally useful.
New ones are added occasionally.
The macro IMA_ARCH can be used to enable code that only
applies to a single architecture.
The ones most commonly used are:
- FDSETPATCH -
If fd_set definitions are missing from the system (rare these days).
- HASSTDLIB -
If system has <stdlib.h>.
- NOGETDTBLSIZ -
If system doesn't have getdtablesize()
(uses sysconf(_SC_OPEN_MAX) instead).
- NOREXEC -
If system doesn't have rexec() function.
- NOSOCKOPT -
If system doesn't have setsockopt() function,
or it doesn't work.
- NOSTRCASE -
If system doesn't have strcasecmp() or strncasecmp()
- NOTMPNAM -
If system doesn't have tmpnam() function, or it's broken.
- NOUNIXDOM -
To disable use of Unix-domain sockets for local communication.
- NOWAIT3 -
If system doesn't have wait3() function
- NOWAITPID -
If system doesn't have waitpid() function either
- RSHCOMMAND -
If rsh command isn't named "/usr/ucb/rsh".
- SHAREDTMP -
If /tmp directory is shared between machines in a cluster.
- SOCKADHASLEN -
If struct sockaddr has an sa_len field.
- SYSVBFUNC -
If system doesn't have bcopy() but does have
- SYSVSIGNAL -
If system has System-5 signal handling (signal handlers are
uninstalled after each signal).
- SYSVSTR -
If system doesn't have index() but does have strchr().
- UDPMAXLEN -
To set a different maximum UDP packet length (the default is 4096).
ARCH.m4 is a file of commands for the m4 macro
edits the libfpvm C source code to conform to FORTRAN
which vary from machine to machine.
The two main things you must determine about your FORTRAN are:
How FORTRAN subroutine names are converted to linker symbols.
Some systems append an underscore to the name;
others convert to all capital letters.
How strings are passed in FORTRAN -
One common method is to pass the address in a char*,
and pass corresponding lengths after all remaining parameters.
The easiest way to discover the correct choices
may be to try every common case (approximately three) for each.
get the function names right,
then make sure you can pass string data to FORTRAN tasks.
- Add ARCH to the arches array in src/pvmarchc.c.
You must determine the data format of your machine to know which
class to assign it to.
Machines with the same arches[i].archnum
have the same binary representations
for integers and floating point numbers.
At worst, put the new machine in a class by itself.
- Modify the source if it still doesn't work.
Use cpp symbol IMA_ARCH to include modifications
that only apply to ARCH, so they don't affect other ports.
Up: Porting PVM to
Previous: Porting PVM to