MM5 on dual-processed linux boxes


(Please note that Todd has also provided a pre-compiled version of libpthread.a that you may download from this link. )

From: "Hutchinson, Todd A." 
To: "'Zamora, Robert'" ,
    "'John G. Michalakes'"
     ,
    "'mesouser@mmm.mmm.ucar.edu'"
     
Cc: "'mm5-users@UCAR.EDU'" ,
    "'Dave Borer'"
     
Subject: MM5 on dual-processed linux boxes
Date: Tue, 28 Sep 1999 16:40:43 -0400

I had a few requests for instructions on how to run the MM5 on
multi-processed linux boxes under RedHat 6.0 with the Portland Group
Compiler (version 3.0-4).

Here goes:

Install the Portland Group Fortran Compiler (http://www.pgroup.com) and the
redhat 6.0 patches(ftp://ftp.pgroup.com/x86/linux86-patches/rh6).  This will
work fine if you are using a single-processor machine.  

Unfortunately, symmetric multiprocessing with the Portland Group Compiler
does not work cleanly with the MM5 under redhat 6.0.  If you've experienced
unexplained core dumps while running the MM5 in SMP mode, you may be
exceeding the default stack size in the pthread library.  

If you want to do symmetric multiprocessing (not MPI), you will need to
increase the default stack size and recompile the libpthread.a library (this
is part of the gnu C library).  Here are the instructions:

I can send the libpthread.a library that I've compiled to user's that are
interested (just ask), but here are the instructions for compiling the
library:


1) Download the following files:

ftp://prep.ai.mit.edu/pub/gnu/glibc/glibc-2.1.2.tar.gz
ftp://prep.ai.mit.edu/pub/gnu/glibc/glibc-linuxthreads-2.1.1.tar.gz
ftp://prep.ai.mit.edu/pub/gnu/glibc/glibc-crypt-2.0.6.tar.gz

2) Untar the files:
        tar xzf glibc-2.1.2.tar.gz
        cd glibc-2.1.2
        tar xzf ../glibc-linuxthreads-2.1.1.tar.gz
        tar xzf ../glibc-crypt-2.0.6.tar.gz

3) Edit the default stack size in the pthread library:
        edit the file linuxthreads/internals.h
        change line 233 from
                #define STACK_SIZE(2*1024*1024)
        to 
                #define STACK_SIZE(2*1024*1024*4) 
                         (This was large enough for my MM5 runs, but 
                          you may need to make it larger.)

4) Edit a source code file to eliminate a coding problem 
        edit crypt/sysdeps/unix/crypt_util.c
        change line 268 from 
                #include 
        to
                #include 

5) Build the libraries
        make                    (This takes about and hour or two.)

6) Copy the newly created library into the Portland Group directory
        mv $PGI/linux86/lib/libpthread.a $PGI/linux86/lib/libpthread.a-old
        cp linuxthreads/libpthread.a $PGI/linux86/lib

It should work from here.



Todd




> -----Original Message-----
> From: Zamora, Robert [SMTP:rzamora@etl.noaa.gov]
> Sent: Thursday, September 23, 1999 6:38 PM
> To:   'Hutchinson, Todd A.'
> Subject:      RE: mm5 under Redhat 6.0
> 
> Todd,
> 
> I seem to be having similar problems in that I'm getting Segmentation
> Faults
> in all my compiles under pgf77 on a dual processor Pentium.  Could you
> write
> up the details of getting the source code and recompiling the libpthread.a
> library?
> 
> Thanks,
> 
> Bob Zamora
> NOAA Environmental Technology Laboratory
> Boulder, CO 80303
> 303-497-6526
> 
> > ----------
> > From:       Hutchinson, Todd A.[SMTP:tahutchinson@tasc.com]
> > Sent:       Thursday, September 23, 1999 6:51 AM
> > To:         'michalak@ucar.edu'; 'Mariusz Pagowski';
> 'mm5-users@ucar.edu'
> > Subject:    RE: mm5 under Redhat 6.0
> > 
> > I have also been running mm5 (v2-12) under redhat 6.0 with pgf77 v3.0.
> I
> > installed all the patches that the Portland Group supplied on their
> > website
> > and still had problems when using more than one processor.  
> > 
> > The Portland Group states 
> > "As a workaround, we suggest renaming $PGI/linux86/lib/libpthread.a
> > to something like $PGI/linux86/lib/libpthread.a-old.
> > This should work by now linking in the standard RH 6 version,
> > except in cases where the stack size needed is larger than
> > the RH 6 version provides." 
> > 
> > in their readme file.
> > 
> > Well, it turned out that the stack size needed (for the particular mm5
> > configuration that I was running) was larger than what was provided in
> the
> > standard libpthread.a library.  It took me quite a while to figure out
> > that
> > this was the problem, but the symptom was random MM5 crashes (sorry to
> be
> > so
> > vague).  Anyway, after talking with the Portland Group about the
> problem,
> > I
> > decided to try and recompile the libpthread.a library.  I was successful
> > and
> > now, everything is working fine on my dual-processed pentium.
> > 
> > If there are folks out there interested in how to recompile the
> libpthread
> > library with a larger stacksize, I can write up some instructions--just
> > ask.
> > 
> > Todd
> > 
> > > -----Original Message-----
> > > From: John G. Michalakes [mailto:michalak@UCAR.EDU]
> > > Sent: Wednesday, September 22, 1999 2:11 PM
> > > To: 'Mariusz Pagowski'; 'mm5-users@ucar.edu'
> > > Subject: RE: mm5 under Redhat 6.0
> > > 
> > > 
> > > My information is second hand, but there appear to be some 
> > > problems with pgf77 
> > > under RH 6.  Several users I know of have reported this and 
> > > according to those 
> > > who have contacted Portland Group (http://www.pgroup.com), 
> > > the problem is known 
> > > and they are working on it.
> > > 
> > > John
> > > 
> > > On Wednesday, September 22, 1999 11:21 AM, Mariusz Pagowski 
> > > [SMTP:mariusz@atmosp.physics.utoronto.ca] wrote:
> > > > Hello Users,
> > > >
> > > > I am trying to compile mm5 under the latest Redhat
> > > >
> > > > (Red Hat Linux release 6.0 Publisher's Edition (Hedwig)
> > > > Kernel 2.2.5-15smp on an i686)
> > > >
> > > > with pgf77.
> > > >
> > > > Apparently some C files are missing/got replaced  in my 
> > > distibution (see
> > > > below).
> > > > Anybody has a quick fix?
> > > >
> > > > Thanks,
> > > >
> > > > Mariusz Pagowski
> > > >
> > > > _________________________________________________________________
> > > > pgf77 -o mm5.exe mm5.o -O2 -Mcray=pointer -tp p6 -pc 32 -Mnoframe
> > > > -byteswapio  ../libutil.a
> > > > Linking:
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `__stat':
> > > > pgstdinit.o(.text+0x2c): undefined reference to `_xstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In 
> > > function `stat':
> > > > pgstdinit.o(.text+0x5c): undefined reference to `_xstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `__lstat':
> > > > pgstdinit.o(.text+0x8c): undefined reference to `_lxstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `lstat':
> > > > pgstdinit.o(.text+0xbc): undefined reference to `_lxstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `__fstat':
> > > > pgstdinit.o(.text+0xec): undefined reference to `_fxstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `fstat':
> > > > pgstdinit.o(.text+0x11c): undefined reference to `_fxstat'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `__mknod':
> > > > pgstdinit.o(.text+0x156): undefined reference to `_xmknod'
> > > > /n/slate/enviro/pgi/linux86/lib/libpgc.a(pgstdinit.o): In function
> > > > `mknod':
> > > > pgstdinit.o(.text+0x196): undefined reference to `_xmknod'
> > > > make: *** [mm5.exe] Error 1
> > > 
> >