PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

MM5 performance on AMD64 Opteron
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Thu Nov 18, 2004 11:47 am    Post subject: Reply with quote

Hi Jesse,

I was able to work on the NCAR Graphic library and was able to get the test case to work in 32-bits (on a P4 and AMD64). I did have to make some modifications to the configuration, but not much. To get it to work in 64-bits will require some porting which I have not done. I may have the time later but for now the 32-bit version should work fine. I'll try and fit in TERRAIN today or tommorrow.

In both cases I used pgf90 and pgcc release 5.2-4 and ncag release 4.3.1. Disclamier: I've only done a minimal amount of testing. The accompanying test case worked but I have not tested beyond that. Also, I have not tried increasing the optimization.

Notes on building and installing NCAR can be found at http://ngwww.ucar.edu/ng/installsrc/html.

Steps on a P4:

1) Download and untar the package
2) set NCARG to the "nacag-4.3.1" directory.
3) Modify the file config/LINUX.pgi
- Add "-lpgf90 -lpgf90_rpm1 -lpgf902" to the "CtoFLibraries"
4) copy config/LINUX to config/LINUX.org
5) copy config/LINUX.pgi to config/LINUX
6) Edit config/Template by either removing or commenting out
lines 833 and 835. Change line 834 from ".f" to ".F".
The resulting preprocesser ".f" files and not formatted properly, so I
removed the preprocessing since pgf90 can handle ".F" files directly.
7) Run "./Configure -v" and follow the steps. Be sure to build the
F90 libraries and set the f90 compiler to 'pgf90'. I did not use
the HDF libraries.
8) Run "make Everything >& make.log". Inspect the log for errors.
9) set your PATH to the location you installed the ncar executables.
Also set NCARG_ROOT.
10) Test the configuration by running
% ncargex cpex08
% ctrans -d X11 cpex08.ncgm

32-bits on AMD64

1) Download and untar the package
2) set NCARG to the "nacag-4.3.1" directory.
3) Set your compiler path to the 32-bit compilers. These
are located in "$PGI/linux86/5.2/bin". The 64-bit compilers
are located in "$PGI/linux86-64/5.2/bin".
4) Modify the file config/LINUX.pgi
- Add "-lpgf90 -lpgf90_rpm1 -lpgf902" to the "CtoFLibraries"
- Add the line "#define LdCommand ld -m elf_i386"
5) copy config/LINUX to config/LINUX.org
6) copy config/LINUX.pgi to config/LINUX
7) Add "x86_64:" to line 357 of config/ymake. This will allow the
configure script to recognize the system.
8) Edit config/Template by either removing or commenting out
lines 833 and 835. Change line 834 from ".f" to ".F".
The resulting preprocesser ".f" files and not formatted properly, so I
removed the preprocessing since pgf90 can handle ".F" files directly.
9) Run "./Configure -v" and follow the steps. Be sure to build the
F90 libraries and set the f90 compiler to 'pgf90'. I did not use
the HDF libraries.
10) Run "make Everything >& make.log". Instpect the log errors.
11) set your PATH to the location you installed the ncar executables.
Also set NCARG_ROOT
12) Test the configuration by running
% ncargex cpex08
% ctrans -d X11 cpex08.ncgm


Let me know if you have problems or if something is unclear.
- Mat
Back to top
View user's profile
Jesse



Joined: 27 Jul 2004
Posts: 4

PostPosted: Thu Nov 18, 2004 3:49 pm    Post subject: Reply with quote

I have successfully compiled TERRAIN in 32bit on AMD64. As said, modified the PGI path pointing to 32bit pgi version. Then, edit TERRAIN/Makefile. Add "-L/usr/X11R6/lib" to LOCAL_LIBRARIES; else, the linker cannot find libX11.

May you kindly take a loot at REGRID/pregrid... As before I used 32bit pgi fortran to compile the codes. What happens is that a c program: uti/cio.c is compiled by gnu c which produces 64bit output. What should I do to get around this problem? Thanks!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Thu Nov 18, 2004 5:38 pm    Post subject: Reply with quote

Hi Jesse,


Either add "-m32" to the CCFLAGS or add a line that sets CC to pgcc. "-m32" is gcc's flag to tell the compiler to create a 32-bit object.

FYI, I've been able to compile the 32-bit TERRAIN with the NCAR Libraries and in 64-bits without the libraries. To compile in 64-bits change the "LOCAL_LIBRARIES" to "-L/usr/X11R6/lib64 -lX11 -L/usr/lib64 -g77libs" and set "NCARGRAPHICS" to "NONCARG". On 64-bit systems 32-bit libraries are still in "lib" while 64-bit libraries are in "lib64". However, I'm not sure if it's really worth it to compile this 64-bits. But that's one of the great thing about AMD64, if can't or don't want to port your app to 64-bits, you don't have to!

I'm still downloading data so I haven't tested it yet. I'll update you if I see the seg fault you reported.

- Mat
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Fri Nov 19, 2004 12:30 pm    Post subject: Reply with quote

Hi Jesse,


The seg fault your seeing with the 64-bit terrain.exe is caused by a subtle coding error in the file src/terdrv.F. The subroutine TERDRV calls WATERCHECK using 10 actual arguments while the WATERCHECK subroutine is expecting 11. Adding a 11th argument "0" at line 477 and 481 fixes the problem.

Change:
Code:
       CALL WATERCHECK(IX,JX,NVC,FORCETER,VEGEC,LVEGE,IWATER,
    -                  49.0,RAD,DIS(N))

to

Code:
       CALL WATERCHECK(IX,JX,NVC,FORCETER,VEGEC,LVEGE,IWATER,
    -                  49.0,RAD,DIS(N),0)


Why does this code ever work? Because the program gets lucky when the stack happens to contain a valid value.

- Mat
Back to top
View user's profile
julieh



Joined: 02 Feb 2006
Posts: 3

PostPosted: Thu Feb 02, 2006 4:05 am    Post subject: MM5 performance on AMD64 Opteron Reply with quote

Hi,

can anyone post a list of Makefile options that work on amd opteron using pgf90 (suse 9.1 if relevant).

I have TERRAIN working and INTERPRF - but am stuggling with REGRID - the error I get when I run the Makefile is

/usr/bin/cpp -I. -C -P -traditional gribcode.F > gribcode.f
pgf90 -c -Mfreeform -byteswapio -I../util gribcode.f
PGF90-S-0038-Symbol, mwsize, has not been explicitly declared (gribcode.f)
0 inform, 0 warnings, 1 severes, 0 fatal for findgrib
PGF90-S-0038-Symbol, mwsize, has not been explicitly declared (gribcode.f)
0 inform, 0 warnings, 1 severes, 0 fatal for gribget
PGF90-S-0038-Symbol, mwsize, has not been explicitly declared (gribcode.f)
0 inform, 0 warnings, 1 severes, 0 fatal for gribheader
make[2]: [gribcode.o] Error 2 (ignored)

thanks,

julie
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group