100 likes | 281 Views
Porting CCTK to NT at the Cornell Velocity NT Cluster. Werner Benger Max-PIanck-Institut für Gravitationsphysik (Albert-Einstein-Institute at Golm/Potsdam – AEI) and Konrad-Zuse-Center for Information Technology Berlin (ZIB) Werner.Benger@aei-potsdam.mpg.de.
E N D
Porting CCTK to NTat the Cornell Velocity NT Cluster Werner Benger Max-PIanck-Institut für Gravitationsphysik (Albert-Einstein-Institute at Golm/Potsdam – AEI) and Konrad-Zuse-Center for Information Technology Berlin (ZIB) Werner.Benger@aei-potsdam.mpg.de
Porting Cactus to NT – Requirements • CYGWIN – Unix GNU Make • CCTK makefiles using lots of gmake special functions • Bash • more powerfull than command.com • Required for `autoconf' configure script • Some shell-commands used in makefiles • Sed • Command line argument conversions when gmake functionality or shell commands are not sufficient • Perl • CCTK Flesh-Thorn interfaces consists of code generated by perl scripts from description files in `Cactus Configuration Language' - .ccl files • Preprocessing of F77,F90,C,C++ • Compilers: C, (C++,) [F77, F90]
Early Difficulties • PERL! • Required at the very earliest step, directly invoked from makefile • ActiveState Perl is installed on the NT Cluster • Incompatible to cygwin perl • Cygwin uses unix-like path names: • /cygdrive/c/temp/Werner/Cactus • //c/temp/Werner/Cactus • ActiveState Perl uses DOS/Windows like path names: • c:\temp\Werner\Cactus • Cygwin perl needed to be installed on local workstation, no installation on NT Cluster • Compilation only possible locally • Installation of cygwin perl on NT cluster in local homedir works, but need to specify perl include path on each invokation... • Compilation on NT Cluster very slow anyway...
Cygwin • Cygwin 5.0 installed • Not yet supported by CCTK • Introduces the /cygdrive/ prefix • /cygdrive/c/ for //c in earlier version or c:\ in DOS/Windows • Had to adjust makefile includes in a couple of places • $(subst /cygdrive/,//, <expr>) backward compatibility to cygwin 4.0 • external/IEEEIO library explicitely looking for CYGWIN_NT-4.0 • Added support for CYGWIN_NT-5.0 • Environment now set up for use of gcc cygwin compiler – but we want Visual C++!
Cygwin and MS Visual C++ • Unix compiler vs. MS compiler • Path names: c:\temp\Werner\Cactus vs. //c/temp/Werner/Cactus • Command line switches: /Ic:\library\include -I/include • Extensions: • Object files: .o vs. .obj • works, as MSC treats unkown extensions as object files • Libraries: lib<xxx>.a vs. xxx.lib • lib/make/make.thornlib to be modified to transform unix libname into MSC libname • Executable: .exe • Ok, already handled • Still want to use cygwin gcc to create dependency information for makefiles • In some parts cygwin pathnames and parameters • Other parts MSC pathnames and parameters • Pathname conversion routines required • #define's and #include paths from MSC need to be set for gcc, too!
Pathname Conversion • Task: Convert /cygdrive/c/temp/Werner/ to c:\temp\Werner • Using sed is powerful, but requires external tool and is slow • GNU make functions are fast, but limited • Well, can still be done: LETTERS= a b c d e f g h i j k l m n o p q r s t u v w x y z \ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z INCLUDE_PARAMETERS=$(subst -I,/I,$(subst /,\\, $(foreach DRIVE, $(LETTERS), $(filter -I$(DRIVE):%,$(subst //$(DRIVE),$(DRIVE):,$(subst /cygdrive/,//,$(INC_DIRS:%=-I%))))))) INC_DIRS=/cygdrive/h/PROGRA~1/MPIPRO //c/PROGRA~1/MICROS~2/VC98/INCLUDE show: @echo INC_DIRS=$(INC_DIRS) @echo INCLUDE_PARAMETERS=$(INCLUDE_PARAMETERS) WEYL://c/temp/werner $ make show INC_DIRS=/cygdrive/h/PROGRA~1/MPIPRO //c/PROGRA~1/MICROS~2/VC98/INCLUDE INCLUDE_PARAMETERS= /Ic:\PROGRA~1\MICROS~2\VC98\INCLUDE /Ih:\PROGRA~1\MPIPRO WEYL://c/temp/werner $
Properties of Pathname conversion • - Pathnames must not contain spaces • Uses windows shortcut names instead of long names • //c/PROGRA~1/MICROS~2/VC98/INCLUDE • //c/Program Files/Microsoft Visual Studio/VC98/INCLUDE • Find out by starting `command.com' from bash • + Late evalutation in make • May define make expression first • May set of variable to expanded later • Make function is evaluated not before it is actually used • + Much faster than calling sed scripts • + Doesn't require external tool (directly portable) • - Need to copy the expression for each make variable to be used • - Hardly readable... so better don't touch and avoid using too often
Minor changes • Support for MPIPro • Added shell script: lib/make/extras/MPI/MPIPro • Some fixes in the lib/make/know-architectures/cygwin default variables • CC=cl • CXX="$CC /TP" • AR=lib • Etc. • Editing Thornlist: • `preferred editor' is `notepad' under Windows • Changed lib/make/make.configuration • But this might be a matter of taste, other people might still prefer `vi'... • Can't run notepad from telnet session...
Networking • TCP calls (mostly already done for SC99 NCSA NT Cluster) • Similar, but still minor differences between Unix and Windows • read(),write() vs. recv(), send() • close() vs. Closesocket() • etc. • Conversion of socket descriptor to file descriptor not possible (?) • Cannot use C++ Standard Stream library for sockets!? • No ofstream(int fd) constructor... • Had to provide a `stream emulator class' under windows • TCP Initialization • Windows Socket Layer must be initialized before any TCP networking works!! • WSAStartup() • C++ Constructor Call or CCTK Startup Routine • HTTP Support for MSIE • Requires explicit HTTP header where netscape doesn't • `Movie Thorn': multipart encoding of streamed jpeg images works with Netscape, but not yet with MSIE... (?)