Home
Users` Guide to NetSolve V2.0 - Innovative Computing Laboratory
Contents
1. PLATFOR mips sgi irix6 5 ETSOLVE VERSION 2 0 EXEC PREFIX S NETSOLVE ROOT S NETSOLVE ARCH BINDIR S NETSOLVE ROOT bin NETSOLVE ARCH LIBDIR S NETSOLVE ROOT lib NETSOLVE ARCH OBJDIR S NETSOLVE ROOT obj NETSOLVE ARCH MATLABOBJDIR S OBJDIR MATLAB PDFGUICLASSDIR S BINDIR PDFGUICLASSDIR RH EE FE FE AE FE EH HEE HE EE EH HE HHH COMPILERS AND OPTIONS RHE aH FE AE FE EH HE FE FE AE EH EE EH EE HEE HHH ce usr bin cc C_OPT_FLAGS 03 C_NOOPT_FLAGS n32 mips4 r12000 common CFLAGS C OPT FLAGS C NOOPT FLAGS S C OPT FLAGS S C OPT FLAGS S HBMFLAG S F2CFLAG S OUTPUT LEVEL ARCHCFLAGS S INCDIR PROXY S CPU STAT IBPFLAG S AUTHENTICATION DSIFLAGS S C NOOPT FLAGS HBMFLAG F2CFLAG OUTPUT LEVEL S ARCHCFLAGS S INCDIR PROXY S CPU STAT IBPFLAG S AUTHENTICATION DSIFLAGS S CFLAGS CFLAGS HBMFLAG F2CFLAG OUTPUT LEVEL ARCHCFLAGS S INCDIR PROXY S CPU STAT IBPFLAG S AUTHENTICATION DSIFLAGS S C NOOPT FLAGS FC usr bin f77 F OPT FLAGS 03 F_NOOPT_FLAGS n32 mips4 r12000 FFLAGS F_OPT_FLAGS F NOOPT FLAGS NS FFLAGS S FFLAGS S INCDIR S ARCHCFLAGS NS_F_OPT_FLAGS F OPT FLAGS INCDIR S ARCHCFLAGS 53 Chapter 12
2. 123 24 Matlab Reference Manual ee cette teneret tertie tre rte Debet need 124 25 C Reference Manu l pee geo et ee doe eed pete RO ee 126 26 Fortran Reference Manual ec eee etc eene ree aba toe tine coire pene 127 27 Error Handling 1n NetSolve eti ee ed eerte ec eet er SEHE pe 128 V Appendices 130 A NetSolve Tutorials 3 2 2 ce Gee t prre ede echte tee dett 131 Tutorial for basic data types int double char sere 131 Tutorial for Handling Files ete metere Regent riit 133 Tutorial for Matrix and Vector Operations esses eene 135 Tutorial for Sparse Matrices trennen nennen enr enren nennen nennen nene 137 Bi GE Example usd ipe iti eit eite pe eiie a cte nee eee 140 Overview of C Examples 0 0 a e e E e REE E E E AE 140 Step T Installation of NetSolve s oir reiten AARE eerte es 140 Step 2 Installation of Server service ener nennen 141 Step 3 Installation of Client Software sessssesseeeeeeeeee nennen ene enne 142 Step 4 Starting the NetSolve Agent Server sese ene 142 Start Optimization cete RR EE EA RE NUR eet eA ee tend 143 vii CComplete C Example enemies aO RE Ra IRE 145 D Complete Fortran77 Example conri 150 igicur M 154 viii List of Tables 17 Available d ta types eei tpe bodie et ep Hcet ned rer 8
3. SF2CNAMES options F2CADD F77 netsl gt C netsl_ default F2CADD__ F77 netsl gt C netsl__ F2CNOCHANGE F77 netsl gt C netsl F2CUPCASE F77 netsl gt C NETSL F2CNAMES F2CADD SF2CSTR options F2CSTRSUNSTYLE Sun style of passing strings from f2c F2CSTRCRAYSTYLE Cray style of passing strings from f2c 54 Chapter 12 roubteshooting F2CSTRSTRUCTPTR Struct style of passing strings from f2c F2CSTRSTRUCTVAL Struct style of passing strings from f2c F2CSTR F2CSTRSUNSTYLE PETE AE FE AE AE FE HEE EH EE RHEE H AUXILIARY PROGRAMS FE AEE TE AE FE AE HEE HEE EH EE RHEE H FLEX usr bin flex BISON usr bin bison AR usr bin ar ARFLAGS Cr RANLIB RES RUSAGE HAVERUSAGE dd NETSOLVE SPECIFIC OPTIONS dd F2C F2CFLAG DNOCHANG LH Program Output DEBUG For really verbose debugging information VIEW For smooth information during the execution NO OUTPUT no output OUTPUT LEVEL DVIEW Client Proxy LE Proxies are currently mutually exclusive LE GLOBUS PROXY build and enable globus proxy HHH NETSOLVE PROXY build and enable netsolve proxy PROXY DNETSOLVE PROXY Information Serv
4. EXTERNAL FNETSL FNETSLNB FNETSLPB FNETSLWT INTRINSIC DBLE MOD Enter the size of your matrix M IF M GT MAX THEN WRITE Too big 1 150 Appendix D Complete rortran Example STOP ENDIF C C Generating the matrices C WRITE Generating the problem INIT 1325 DO 10 I 1 M DO 11 J 1 M INIT MOD 2315 INIT 65536 A1 J 1 DBLE INIT 32768 D0 16384 D0 A2 J I Al J 1 A3 J I Al J 1 A4 J I Al J 1 11 CONTINUE 10 CONTINUE E Generating the right hand sides C DO 12 I 1 M INIT MOD 2315 INIT 65536 B1 1 DBLE INIT 32768 D0 16384 D0 B2 I B1 I B3 I B1 I BA I B1 I 12 CONTINUE C Calling Netsolve for dgesv in a blocking fashion C For dgesv the right hand side is overwritten C with the solution WRITE Calling NetSolve for dgesv blocking CALL FNETSL dgesv INFO M 1 A1 MAX PIVOT B1 MAX IERR IF INFO LT 0 THEN CALL FNETSLERR INFO STOP END IF IF IERR NE O THEN WRITE Cannot solve for this Matrix and right hand side ELSE WRI EQ JOokckckckckck kc ck kk kk WRITE oe Success FA WRI E TOokckckckckck kc ck kk kk WRITE Result DO 13 I 1 M WRITE Bl I 13 CONTINUE END IF C Calling Netsolve for dgesv in a non
5. The end of the first line shows the current trust parameters pub 2048R AABD3F7C created 2003 07 12 expires never trust f f this says how much you trust this key means never set means don t know means do NOT trust means trust marginally mh 85 9 means trust fully 77 Chapter 12 Kunning the Netdolve Server u means ultimate trust i e this is you gpg goes on to print the following menu Please decide how far you trust this user to correctly verify other users keys by looking at passports checking fingerprints from different sources Don t know I do NOT trust I trust marginally I trust fully I trust ultimately Ho vas GOR ES l back to the main menu Select 2 if you do not wish to trust the netsolve master key to sign other keys Select 4 if you wish to trust problems that have been signed by people whose keys are signed by netsolve master i e people that the netsolve developers trust Note Note that if you wish to trust code that is signed directly by netsolve master but NOT trust code that is signed by keys that were signed by netsolve master you should sign netsolve master s key but NOT trust netsolve master as an introducer How to list keys To list the keys that the NetSolve server knows about do UNIX gt gpg list keys This will return a list of keys along with their key ids You can list both keys and signatures by doing UNIX gt
6. GridRPC API Matlab interface 1 Standard Client Server Agent Testers Tools 2 Client 3 Server 4 Agent 5 Tools 6 Testers 7 8 9 Octave interface Enter 1 for the most common set of components 59 Chapter 13 Downloading Installing and lesting the Agent and Server 3 If your selection above included the Server component you will be asked whether you want to enable GPG for signing software when using the Hardware Software server feature It is recommended that you enter y here if you wish to use the Hardware Software server 4 GPG options If you selected to use GPG then you will be prompted to use version 1 2 3 If this version is present in your PATH you can choose to use it Otherwise you may select to download GPG yourself see http www gnupg org or let the script handle this download for you or use a tarball already present You may also skip GPG at this time 5 Finally you will be prompted for any additional arguements to be passed to configure Options are listed below under 2 1 Command line arguements For example if you wanted to limit the number of ports used by NetSolve to 9001 thru 9204 simply enter nable port restriction 6 The script will now configure and build the components selected If successful you should see NetSolve installation complete 7 Starting the Agent bin S NETSOLVE ARCH NS agent 8 Starting the Server You should check the
7. netsolve NetSolve List of available problems BLAS wrappers Level3 dmatmul BLAS wrappers Level3 zmatmul BLAS Levell daxpy BLAS Levell ddot BLAS Levell zaxpy BLAS Level2 dgemv BLAS Level3 dgemm BLAS Level3 zgemm LAPACK wrapper Simple Eig and Singular eig LAPACK wrapper Simple Linear Equations linsol 24 Chapter 6 Matlab Interjace LAPACK Simple Linear Equations dgesv LAPACK Auxiliary dlacpy Mandelbrot mandelbrot QuickSort DoublePrecision dqsort QuickSort Integer iqsort SCALAPACK LinearSystem pdgesv SCALAPACK LinearSystem pdposv SCALAPACK LinearSystem plinsol SuperLU MA28 sparse direct solve output args netsolve problem name input args Information on a specific problem netsolve problem name Information on the servers netsolve DX where each line contains a full problem name If the user would like more detailed information on a specific problem e g eig he can type gt gt netsolve eig ig Wrapper around the LAPACK routine DGEEV Simplified version of DGEEV Computes th igenvalues of a double precision real matrix A Returns two double precision real vectors containing respectively the real parts and the imaginary parts of the eigenvalues MATLAB Example r i netsolve eig a objects in INPUT input 0 Matrix Double Precision Real Matrix A 2 objects i
8. 7 3 Downloading Installing and Testing the Client esses 8 Installation on Unix Systems using ns_install o oooconncninincninnnononononcnannannononnnono co nono non crnncnncononos 8 Installation on Unix Systems using ns install eese 8 Installation on Unix SysteMS oooconococnnoconnnonnnoncnnconocnnonncononnnonnonn nono non eene nro non retenta 9 Testing the Unix anstallation otia ote aer etie e ae EORR 12 Installation on Windows systems eeceeeecesseencecereesecnseceececseeeseceacecenecseeesaeceaeeeeesaeseneeeeers 12 Testing the Windows installation enne teret nennen 13 Using NetSolve from Windows Matlab esee 14 Using the NetSolve Management Tools in Windows see 14 4 Introduction to the NetSolve Client 00 0 ce ceeecsseseceececeeececeececeeecaeeenecesecaeecaeeeeaeeeeeceeeeeaeeeeeenee 16 NetSolve Problem Specification teet dette tenes 16 Available Chent Interfaces menorca eee eee eie ne Hine ERR en 16 Problems that can be solved with NetSolve essen nente nene 16 Naming Scheme for a NetSolve problem seen enne 17 5 C and Fortran77 Interfaces ec tome tete RUE POP EIER I De ira PIER S 18 Inttod ctiOn iunc ae race ee tei Red cis toes ute Exe e RES cH te EXE de kt ee bee ee 18 Whatis the Calling S quence ovocitos 18 Blocking Calli dee PU ER E HU od a ee aad he HR nieces 20
9. Probes for a request completion The right hand side contains the keyword probe and the request handler The left hand side contains the output arguments These arguments are listed according to the problem description The right hand side contains the keyword probe and the request handler Upon completion of this call the output arguments contain the result of the computation netsolve_nb status Prints out the list of all the pending requests This list contains estimated time of completion the computational servers handling the requests and the current status The status can be COMPLETED or RUNNING 124 Chapter 24 Matlab nejerence Manual netsolve err Returns the error code of the most recently called NetSolve function gt gt netsolve_errmsg e Returns a string containing the error message that corresponds to the error code passed as the argument 125 Chapter 25 C Reference Manual status status status status We describe here all of the possible calls to NetSolve from C All of these calls return a NetSolve code status The list of the possible code status is given in Chapter 27 netsl problem name gt Sends a blocking request to NetSolve nets1 takes as argument the name of the problem and the list of arguments in the calling sequence See the Section called What is the Calling Sequence in Chapter 5 for a discussion about this calling sequence It returns the NetSolve sta
10. if info NetSolveOK info netslwt request if info lt 0 netslerr info else fprintf stderr Wok Kk ke kk ke e xN nU A fprintf stderr Success n fprintf stderr occ Ag fprintf stderr Solution n for i 0 i lt m 1 fprintf stderr At gt f n b4 i return 1 148 Appendix C Complete C Example 149 Appendix D Complete Fortran77 Example Example of the FORTRAN call to NetSolve This program sends One blocking request for the problem dgesv One non blocking request for the problem dgesv and One blocking request for the problem linsol One non blocking request for the problem linsol The problem linsol is a simplified version of dgesv WARNING The matrix may be singular in which case NetSolve will print an error message Ql OY OOOO QO Q ACA MOM Oni Q XO PROGRAM EXAMPLE INCLUDE include fnetsolve h INTEGER MAX PARAMETER MAX 500 INTEGER DOUBLE PRECISION Al MAX MAX DOUBLE PRECISION A2 MAX MAX DOUBLE PRECISION A3 MAX MAX DOUBLE PRECISION A4 MAX MAX DOUBLE PRECISION B1 MAX DOUBLE PRECISION B2 MAX DOUBLE PRECISION B3 MAX DOUBLE PRECISION B4 MAX INTEGER PIVOT MAX INTEGER IERR INTEGER I J II III INTEGER INIT INTEGER INFO REQUEST
11. where LAPACK LIB denotes the name of the LAPACK library and BLAS LIB denotes the name s of the BLAS library If these libraries are not already available on the user s machine he can download LAPACK from the LAPACK web page http www netlib org lapack lapack tgz If an optimized BLAS library is not available on the user s machine he can view the BLAS FAQ http www netlib org blas faq html 1 6 for details of availability otherwise he can download ATLAS from the ATLAS webpage http www netlib org atlas and it will automatically generate an optimized BLAS library for the installation architecture 64 Chapter 13 Downloading Installing and lesting the Agent and Server The user must then uncomment the respective line problems lapack in the PROBLEMS section of the SNETSOLVE_ROOT server_config file by removing the from the beginning of the line e And lastly the user must recompile the server by typing make server in the SNETSOLVE_ROOT directory Or use the dynamic server feature described in the Section called Dynamic Servers in Chapter 15 by sending kill USRI to the highest server PID Enabling the ScaLAPACK library To enable ScaLAPACK within NetSolve one must perform the following steps During the configure phase of the NetSolve installation type UNIX configure with scalapacklib SCALAPACK LIB with blacslib BLACS LIB with blaslib BLAS LIB with mpidir MPI D
12. where NETSOLVE ROOT is the full path name to the NetSolve directory and NETSOLVE ARCH is the architecture name generated by configure Before linking to one of these libraries the user must include the appropriate header file in his program SNETSOLVE ROOT include netsolve hin C SNETSOLVE ROOT include fnetsolve hin Fortran77 The Fortran77 include file is not mandatory but increases the source program readability by allowing calling subroutines to manipulate the NetSolve error codes by variable name rather than by integer value The Fortran77 interface is built on top of the C interface since all of the networking underneath NetSolve is written in C However we chose to write the Fortran77 interface with subroutines instead of functions for reasons of compiler compatibilities The C functions all return a NetSolve error code equal to O if the call was successful or to a negative value in case of error Chapter 27 contains the list of all possible error codes The Fortran77 subroutines take an extra output integer argument passed by reference at the beginning of the calling sequence that contains the error code after completion of the call The reference manuals for C and Fortran77 are in Chapter 25 and Chapter 26 The basic concepts here are the same as the ones discussed in Chapter 6 for the Matlab interface especially the ability to call NetSolve in a blocking or nonblocking fashion We describe the C
13. 23 NS Cannot contact agent NS operation timed out NS Authentication to server failed NS DSI file not found NS error in IBP_Allocate NS error in IBP_Manage NS error in IBP_Load NS error in IBP Store NS permission denied to DSI file NetSolveDsiDisabled NS NetSolve not configured with DSI 129 VI Appendices Appendix A NetSolve Tutorials The NETSOLVE ROOT Tutorial directory contains several tutorials which should demonstrate the use of NetSolve It should be a starting point for new users to write their own programs and also shows how to enhance the capabilities of NetSolve by adding new functions to the repository The tutorials do not depend on each other and can be performed in any order However if you are completly new to NetSolve it is recommended to perform the tutorials in the order described below since some explanations are given in more detail in the first sections The first three examples include code sections for blocking and non blocking calls as well as the task farming feature The last example sparse demonstrates how to include an existing application into NetSolve and uses only blocking codes although it should be easy with the information from the previous tutorials to build non blocking and farming calls too If some additional software is required to build the example a link to the sources is provided The examples are designed that they can be performed in userspace this includ
14. In order for a problem to be solved i e a function or library routine to be invoked using NetSolve there must exist a problem description file PDF corresponding to the problem routine A variety of PDFs are included with the NetSolve distribution A user can also write his own PDF for his function as described in Chapter 17 16 Chapter 4 introduction to the Netdolve Client The default NetSolve distribution only provides a subset of enabled software to test the various client interfaces Interfaces have been written for a variety of software libraries refer to SNETSOLVE_ROOT problems but as the libraries themselves are not included in the NetSolve distribution the library interfaces are not enabled Therefore the user can customize his installation to include these existing interfaces and or new interfaces Refer to the Section called Installation on Unix Systems using ns install in Chapter 13 for further details It is possible to query a NetSolve agent to obtain a list and descriptions of the problems that can be solved by its respective servers There are several ways of sending such queries 1 From the NetSolve homepage it is possible to specify an agent name and run CGI scripts to obtain detailed information about NetSolve problems including C and Fortran calling sequence specifications 2 Problem lists and descriptions are also directly available from the Matlab interface the Mathematica interface and the
15. PDE Generator eoo eme eO RERO eae neta 92 PDEWiZAId iets eae n edm eub eben eM 93 NetSolve IDL Simplified PDE eter epreime eee 93 1idltopd Utilidad 95 18 Security in NetSolve iiieecteonte pego pid pereo died ied pt E 97 Introduction ie deen bo Te e RO E RD Rim A ette 97 Compiling a Kerberized Server suere eterne terere eee rento 97 Installing a Kerberized Server sse ener nennen nennen ens 97 Running a Kerberized Server oie aee ee ciencia eh rre 98 TV Miscellaneous Features sssssssessssesssessessrsesesessessssesssersessssesssesseseesesssessesessesssseseseesesessesesesserees 100 19 Using Condor G with NetSolve oo ccc esses enne nete canon crac nennen enne 101 incest N 101 To Use Condor G with NetSolve sees nennen nennen ene 101 Howt WOFKS ierunt iS 101 20 Distributed Storage Infrastructure DSI in NetSolve essere 103 DSL Introduction erred ertet ea tien 103 vi Using DSL UAR CORRER RN SRI NRI 103 DOS VU M 103 DSI Example ere Sie Sot ade ode Su ee tees eee Aad ee 106 ZV GTO due 109 Introduction s Mielke r I OHNE RURSUS 109 Compilation nstructlOns sex css ee inpet i eit pte tereti dpt ee i eg e en eiit 109 Testing Siete res ete E ie ead baute eod 109 Additional Notes on Writing and Compiling GridRPC Programs esee 109 Fu
16. All of the client agent and server software is bundled into one tar gzipped file No root superuser Administrator privileges are needed to install or use any component of the NetSolve system NetSolve 2 0 s configuration and installation environment has changed from previous versions prior to 1 4 1 Previously a custom set of make include files were used to achieve easy installation NetSolve 2 0 now uses autoconf to create an environment that looks like many other Open Source projects There is also a new script ns install to help make the installation even easier It is recommended that you use this script to assist with the configuration and install of NetSolve It will step you through the configuration prompting for the necessary information to complete the install and then run configure You can bypass this script and run configure yourself if you are comfortable doing so Installation on Unix Systems using ns install The NetSolve distribution tar file is available from the NetSolve web site Attp icl cs utk edu netsolve downloads Once the file NetSolve 2 0 tgz has been downloaded the following UNIX commands will create the Net Solve 2 0 directory gunzip c NetSolve 2 0 tgz tar xvf Installation on Unix Systems using ns install 1 Run ns_install from the new NetSolve 2 0 directory where the NetSolve package was uncompressed UNIX gt ns_install 2 The script will first prompt for the components to be installed
17. BNF of the NetSolve IDL lt PROBLEMSTART gt PROBLEMDESC FUNCTION lt PROBLEMDESC gt PROBLEM lt PROBLEMNAME gt FUNCTION LANGUAGE FUNCTION FUNCDEFN lt FUNCDESC gt lt FUNCLIB gt lt FUNCMOVEABLE gt lt LANGUAGE gt C FORTRA lt FUNCDEFN gt lt FUNCNAME gt lt ARGLIST gt lt FUNCDESC gt STRING lt FUNCLIB gt LIBS STRING lt FUNCMOVEABLE gt empty MOVEABLE NONMOVEABLE lt ARGLIST gt gt lt ARGUMENT gt lt ARGLIST gt lt ARGUMENT gt lt ARGUMENT gt gt lt INOUTSTRING gt lt DATATYPE gt lt VARNAME gt lt INOUTSTRING gt lt DATATYPE gt lt VARNAME gt lt VACTORATTR gt lt INOUTSTRING gt lt DATATYPE gt lt VARNAME gt lt MATRIXATTR gt lt INOUTSTRING gt lt DATATYPE gt lt VARNAME gt lt SPARSEMATRIXATTR gt lt VECTORATTR gt gt lt DIMENSIONEXPR gt lt MATRIXATTR gt gt lt DIMENSIONEXPR gt lt DIMENSIONEXPR gt lt SPARSEMATRIXATTR gt MATRIXATTR lt OPENANGLE gt lt NNZVAR gt lt INDEXVAR gt lt POINTERVAR gt lt CLOSEANGLE gt lt DIMENSIONEXP
18. Downloading installing and testing the Client From this point forward we assume that the UNIX SHELL is from the csh family The installation of NetSolve is configured for a given architecture using the GNU tool configure UNIX gt cd NetSolve UNIX gt configure For a list of all options that can be specified to configure type UNIX configure help Optional Features disable FEATURE enable FEATURE ARG disable debug coptflags are used nable port restriction do not include FEATURE same as nable FEATURE no include FEATURE ARG yes exclude debugging info when compiling no effect when with cnoptflags and with Server uses only ports 9001 thru 9204 nable infoserver alon NetSolve Compile Options with cc with cnooptflags with coptflags with fc with fnooptflags with foptflags with ldflags NetSolve Run Time Options with nws NWSDIR with ibp IBPDIR with kerberos KRBDIR with proxy with outputlevel NetSolve Service Options with petsc PETSCDIR with petsclibdir PETSC LIB DIR use InfoServer alon determine which C compiler to use set compiler flags that don t deal with optimization ONLY USE IN COMBINATION WITH with cc CFLAGS will be set to C OPT FLAGS C NOOPT FLAGS set compiler optimization flags ONLY USE IN COMBINATION WITH with cc CFLAGS wil
19. Fortran ROUTINE dgesv IN int N IN int NRHS INOUT double A LDA N IN int LDA OUT int IPIV N INOUT double B LDB NRHS IN int LDB OUT int INFO From LAPACK Compute the solution to a real system of linear equations A X pb where A is an N by B matrix and X and B are N by NRHS matrices LIBS usr local lib liblapack a usr local lib libf77blas a 93 Chapter 1 he Problem Description rile usr local lib libatlas a The above IDL describes a routine called dgesv written in Fortran The routine accepts 8 parameters Parameters 1 2 4 and 7 are input parameters of type integer Parameter 8 is an output parameter of type integer The fifth parameter IPIV is an integer vector of N elements and is an output parameter Parameters 3 and 6 are matrices of double precision numbers and act as both input and output parameters The variables in the square brackets represent the rows and columns of the matrices respectively For example LDA represents the number of rows and N represents the number of columns of the matrix A The description of the function interface can be followed by comments about the problem in quotes This is followed by a listing of the libraries needed for linking with the function For example in the above example liblapack a libf77blas a and libatlas a are needed to link with the Fortran function dgesv The default type of the function is assumed to be sequential Following is the Backus Normal Form
20. Nornblocking Call 5 2 5 0 nieeceoteon ie peto Ut desicion 21 Catching Errors ico ace aeter encender ee Jae p e te e cet oe eben 22 Row or column maJOr aereo e ae tie lE ee e EE ETE oe T PER eR 23 Limitations of the Fortran77 interfaCe oooncnnoccnnonononoonncnnnconaconnnnnncnnnc eene nennen nen nnne nennen nnne 23 Built in examples etie erem eon eme RD DUI PEE HRS 23 6 Matlab Interface ee t ter p RI Pec UR deck E E Pes eee evi Pete xe 24 Inttod CtiOn udo P rtt rH EVE PEE PEERS Nee Er RE EAR a 24 What to Do Fitst 4 oae eot era cae 24 Calling net solve to perform computation sese 26 Calling NEES olye ni Y cs eue tette a uper tret tee E adn id 27 What Can Go Wrong aite it ede ee e e Pe e ER i EE E 29 Catching NetSoly amp erfors inerte quete rette pite tee eget ie iR eee 30 Optional Testing the NetSolve BLAS interfaces nene 31 Optional Testing the NetSolve LAPACK interfaces eee essere 31 Optional Testing the NetSolve ScaLAPACK interfaces 31 Optional Testing the NetSolve sparse iterative solve interface 32 Optional Testing the NetSolve sparse direct solve interface sss 33 7 Mathematica Interface eei eemper retten iee perte e eie eee pee etre nene 34 nre iii 34 What to do first ioo REOR e eR ene dad esaet 34 Blocking call to NetSolve 4 5 eie tei e tee tet e e e etes 37 Nonblocking Call to NetSolve sees eee eee enne ne
21. the user should first check the agent and server log files NETSOLVE ROOT nsagent log or NETSOLVE ROOT nsserver log respectively These files may contain more information to clarify the reason for the error message For diagnostic help in explaining the reasons for specific NetSolve run time error messages you can also refer to the NetSolve Errata File http Aicl cs utk edu netsolve errata html Details of the Makefile NETSOLVE ARCH inc File Although suitable default options are provided for the compilation of the software one may look in the NetSolve conf directory to edit the Make ile NETSOLVE ARCH inc file This file contains parameters to customize the compilation process Note All of the parameters in this include file can and should be modified using command line arguments to confi gure Most of the contents of this file are straightforward including definitions for compilers linkers etc and will not be explained here There are however a few entries that may need explanation NETSOLVE SPECIFIC OPTIONS The ovuTPUT LEVEL macro defines the amount of debug output to print during installation PROXY specifies which client proxy to use CPU STAT defines which method to use to monitor server processes in terms of workload etc and what method to use to assign tasks to servers The AUTH LIBS and AUTHENTICATION macros define the authentication to use if any in the system Currently
22. with arpacklib ARPACK LIB Arpack link line with mpi MPI DIR location of MPI Root Directory with lapacklib LAPACK LIB LAPACK link line with scalapacklib SCALAPACK LIB SCALAPACK link line with blaslib BLAS LIB BLAS link line with blacslib BLACS LIB BLACS link line with mldk MLDK PATH Path to MathLink Development Kit with rpclib RPC LIB Full path of RPC library with octave include OCTAVE INC DIR location of Octave include directory with rpcinc RPC INC Directory containing RPC header files with gpg GPGPATH Full path of gpg binary with buildgpg BUILDGPG Location of gpg tar gz file Note It is recommended that you set the environment variables NETSOLVE ROOT and NETSOLVE ARCH prior to running configure If you wish to compile the Matlab interface to NetSolve you must select a compiler flag setting for NetSolve that matches that used by Matlab If you have the IRIX64 version of Matlab you will need to overwrite NetSolve s flags to select the 64 during the configure step The configure script creates two main files conf Makefile NETSOLVE_ARCH inc and conf Makefile inc These files are created from the templates conf Makefile generic arch and Jconf Makefile inc in respectively SNETSOLVE ARCH is the string printed by the command Jconf config guess with all and characters converted to characters The variable NETSOLVE ROOT is the complete path name to the installed NetSolve directory and defin
23. A pointer to output object 0 LU pointer to output object 0 LU Argument 43 leading dimension of input object 40 A Argument 4 pointer to output object 1 PIVOT Argument 45 pointer to input object 1 RHS pointer to output object 1 PIVOT pointer to output object 2 SOLUTION Argument 46 leading dimension of input object 1 RHS Argument 7 pointer to output object 3 INFO This output can appear rather cryptic at first Let us work through it step by step First the number of arguments in the calling sequence is 8 This means that the call from C will look like status netsl dgesv X0 X1 X2 X3 X4 X5 X6 X7 And from Fortran77 the call to NetSolve would be CALL FNETSL dgesv STATUS X0 X1 X2 X3 X4 X5 X6 X7 Now each argument is described in the information returned by NS_probdesc and this description can be translated into meaningful variable names in the user source code For instance x2 should be a pointer to the matrix of the linear system and x3 should be an integer that is the leading dimension of the matrix We can now move on to the descriptions of the different ways of calling NetSolve from C or Fortran77 20 Chapter gt C and rortran Interfaces Blocking Call The blocking call to NetSolve from C or Fortran77 is the easiest to implement Specifically if the main program is in C one calls the function net s1 and if the main program i
24. Infrastructure DSL in Netsolve host name Name of the host where the IBP server resides flag This flag has the same meaning as the flag in open calls in C Specifically O_CREAT is used for creating a dsi file and so on permissions While creating the file with O_CREAT flag the user can specify the permissions for himself and others The permissions are similar to the ones used in UNIX Hence if the user wants to set read write execute permissions for himself and read and write permissions for others he would call ns dsi open With 76 as the value for the permissions size Represents the maximum length of the DSI file Write or read operations over this size limit will return an error storage system At present IBP ns dsi open is used for allocating a chunk of storage in the IBP storage On success ns dsi open returns a pointer to the DSI file On failure returns NULL Following are the various error values set in case of failure NetSolveUnknownDsiFile If the file does not exist and if the file is opened without O CREAT NetSolveIBPAllocateError Error while allocating IBP storage NetSolveDsiDisabled If DSI is not enabled in the NetSolve configuration int ns dsi close DSI FILE dsi file dsi file Pointer to the DSI file ns dsi close is used for closing a DSI file On success returns 1 On failure returns 1 Following are the various error values set in case of failure NetSolveIB
25. Matlab libraries with make matlab MATLAB gt gt addpath path to S NETSOLVE ROOT bin NETSOLVE ARCH e g home user NetSolve bin 1686 pc linux gnu MATLAB gt gt x netsolve pebbles A b x EPS PCG 1e 6 SOLVE 1 ELEMENT PRECOND 0 with A a positive definite sparse matrix b the right hand side vector and x the solution vector 139 Appendix B C Examples Overview of C Examples The C examples make use of NetSolve Farming In these examples the optimum points of the test functions are derived by GA Genetic Algorithm Genetic Algorithm GA is the optimization algorithm that imitates the evolution of living creatures In nature inadaptable creatures to an environment meet extinction and only adapted creatures can survive and reproduce A repetition of this natural selection spreads the superior genes to conspecifics and then the species prospers GA models this process of nature on computers GA can be applied to several types of optimization problems by encoding design variables of individuals Searching for the solution proceeds by performing the three genetic operations on the individuals selection crossover and mutation which play an important role in GA Selection is an operation that imitates the survival of the fittest in nature The individuals are selected for the next generation according to their fitness Crossover is an operation that imitates the repro
26. NETSOLVE ROOT Details of this interface can be found in ns mathematica and quick instructions requirements for building it are in the file SNETSOLVE ROOT src Mathematica INSTALL What to do first Once the interface is successfully installed the first thing to do is to start a Mathematica client by typing NetSolve which prints information on how to use the interface In 1 NetSolve usage etSolve FuncName argl blocking problem call etSolveNB FuncName argl nonblocking problem call tSolveProbe request checks if a request has been completed tSolveWait request waits for a request to complete etSolveGetAgent returns the current agent nam tSolveSetAgent AgentName changes the agent we are working with etSolveError returns the result code of the last xecuted NetSolve function etSolveErrorMsg rc returns a string describing the result code passed etSolve problems shows a list of available problems tSolve servers shows a list of available servers etSolve FuncName shows a problem description Let us review the possibilities Information functions NetSolve problems NetSolve servers and NetSolve FuncName This set of functions provides information about a specific problem s calling sequence and which problems and servers are available through the user s agent 34 Chapter Mathematica Interface Bl
27. TKKKKKKKKKKKKKT WRIIE j Success WRI E TKKKKKKKKKKKKKT WETITE f Result DO 17 I 1 M WRITE B3 I T CONTINUE END IF C Calling Net solve for linsol in a non blocking fashion 152 Appendix D Complete rortran Example E For linsol the right hand side is overwritten C with the solution WRITE Calling NetSolve for linsol non blocking CALL FNETSLNB linsol REQUEST M 1 A4 MAX B4 MAX IF REQUEST LT 0 THEN CALL FNETSLERR INFO STOP END IF WRITE Request REQUEST being processed WRITE Probing f 18 CONTINUE CALL FNETSLPR REQUEST INFO IF INFO EQ NetSolveNotReady THEN DO 22 II 1 50 III II 3 II 22 CONTINUE GO TO 18 END IF IF INFO EQ NetSolveOK CALL FNETSLWT REQUEST INFO IF INFO LT O THE CALL FNETSLERR INFO ELSE WRITE RRR KKK RK RAS WRITE Success WRITE RRR KKK RK RK WRITE Result DO 20 I 1 M WRITE 7 gt B4 1 20 CONTINUE END IF STOP END 153 Bibliography matlab 1992 The MathWorks Inc MATLAB Reference Guide mathematica 1996 Wolfram Median Inc and Cambridge University Press The Mathematica Book Third Edition netsolve 1997 The Interna
28. What Can Go Wrong During a computation two classes of error can occur NetSolve failures and user mistakes Let us demonstrate a few examples gt gt netsolve NS netsolveproxybasics c 225 connection refused Cannot contact agent gt gt x netsolve foo a unknown problem gt gt x y netsolve eig a a eig requires 1 objects in input 2 provided bad problem input output gt gt In case of error the different NetSolve functions print appropriate error messages However when the user writes Matlab scripts that call NetSolve he she needs ways to catch the errors while the script is running Hence the functions described in the next section Catching NetSolve errors There are two NetSolve functions that can be called from Matlab to catch errors The first function netsolve err takes no arguments and returns an integer that is the NetSolve error code returned by the last call to a NetSolve function see Chapter 27 for a list of the possible error codes Here is a call gt gt netsolve_err e 11 The other function net solve_errmsg takes an error code as an argument and returns a string that contains the corresponding error message A typical call to netsolve_errmsg is as follows gt gt msg netsolve errmsg netsolve err 30 Chapter 6 Matlab Interjace msg bad problem input output With these two functions it is possible to write Matlab scripts that call NetSolve and han
29. action wait Itis of course possible to call netsolve nb with the action wait before making any call with the action probe One last action can be passed to net solve_nb as shown here gt gt netsolve_nb status This command will return a description of all of the pending requests Let us see how it works on this last complete example gt gt a rand 100 b rand 150 gt gt rl netsolve nb send eig a Sending Input to Server zoot cs utk edu rd request id 0 rl gt gt r2 netsolve nb send eig b Sending Input to Server zoot cs utk edu rd request id 1 r2 Now let us see what status does gt gt netsolve nb status NetSolve pending requests Requests 40 eig submitted to zoot cs utk edu 160 36 58 152 was started 24 seconds ago netsolveProbeRequest returned 1 ns errno 0 Completed Requests 1 eig submitted to zoot cs utk edu 160 36 58 152 was started 7 seconds ago netsolveProbeRequest returned 1 ns errno 0 Completed The user can check what requests he has sent so far and obtain an estimation of the completion times By using the status action the user can also determine whether a request is still running or has been completed By sending multiple non blocking requests to NetSolve and relying on the agent for load balancing the user can achieve parallelism 29 Chapter 6 Matlab Interjace
30. an array of integers and tell nets1_farm which element of this array is to be used for which iteration This information is encapsulated in an iferator and we provide three functions to generate iterators ns int ns int array ns ptr array Let us review these functions one by one This function takes only one argument a character string that contains an expression that is evaluated to an integer at each iteration The format of that string is based on a Shell syntax i represents the current iteration index and classic arithmetic operators are allowed For instance ns int i c1 returns an iterator that generates an integer equal to one plus the current iteration index at each iteration ns int array This function takes two arguments 1 a pointer to an integer array int ii a character string that contains an expression For instance ns int array ptr i returns an iterator that generates at each iteration an integer equal to the i th element of the array ptr where i is the current iteration index 41 Chapter Netdolve Request Farming ns_ptr_array This function takes two arguments 1 a pointer to an array of pointers void 11 a character string that contains an expression For instance ns_ptr_array ptr i returns an iterator that generates at each iteration a pointer which is the i th element of the array ptr where i is the current iteration index An example Let us assume
31. and Fortran77 interfaces by the means of an example In the following section we start developing the example by demonstrating how a user can obtain information about the calling sequence to a given problem What is the Calling Sequence The C and Fortran77 interfaces as they are not object capable need to use specific calling sequences that are more involved than the ones used from Matlab or Mathematica In the Section called NetSolve Problem Specification in Chapter 4 we described the input and output arguments of a NetSolve problem as lists of objects The Matlab and Mathematica interfaces to NetSolve can manipulate objects directly 18 Chapter gt C and rortran Interfaces and it is therefore very easy to call NetSolve from their interfaces once problem descriptions are known From interfaces that are not object oriented C and Fortran it is necessary to use a calling sequence that describes the objects features individually For complete details the user should refer to Chapter 5 and the Section called Sparse Matrix Representation in NetSolve in Chapter 17 Let us take a very simple example the user wants to perform a dense linear system solve The first thing to know as stated in earlier chapters is the name or IP address of a host running a NetSolve agent The default NetSolve agent running at the University of Tennessee is aware of many servers that can perform the computation In fact a dense linear system solve is provide
32. client test pebbles c the client program which allows performing a simple test Instructions 1 Building the Library First install and compile Pebbles as described in the documentation Then copy the file outback cc to your pebbles libsrc prepro directory Next replace the file pebbles pebbles extern hh with the version of extern hh provided here In the following it is assumed that Pebbles is installed in pebbles i e the statically linked libraries after compiling Pebbles should be in pebbles lib MACHINE Build libpebbles a within the Pebbles source tree UNIX cp interface cc pebbles pebbles cd pebbles pebbles UNIX c c fpic o interface o ISHOME pebbles libsrc DFORTRANDOUBLEUNDERSCORE w interface cc UNIX mkdir pebbles libpebbles UNIX cp pebbles libsrc o pebbles libpebbles UNIX cp pebbles pebbles interface o pebbles libpebbles UNIX cd pebbles libpebbles ar rc libpebbles a o You should now have a file pebbles libpebbles libpebbles a NOTES Since Pebbles is written in C and NetSolve in C we have to provide the line extern C void pebbles at the beginning of interface cc to make sure that the internal nameing convention for the linker are fullfilled NetSolve and Pebbles use the same storage convention for sparse matrices called the compressed sparse row format CSR which uses the 3 vectors double A th
33. dependencies wait for at least one problem to finish update dependencies 47 Chapter 10 Asynchronous Request Handling There are a number of useful functions available to handle asynchronous requests netslpr netslwt netslkill netsl assignment A review of the above functions follow netslpr Checking for completion To check whether a previously submitted asynchronous request has completed you should use the netslpr call It does not block but returns a value signifying whether the call has completed or not Below is a short code example Submit the asynchronous request status netslnb inttest amp i Probe to determine if the request has completed status netslpr request Upon return status is either NetSolveNotReady the request has not completed NetSolveOK the request has completed Even after netslpr returns NetSolveOK to signify that the request has completed the user must call netslwt to get the results netslwt Waiting for completion To wait for a previously submitted asynchronous request to complete you should use the netslwt call It blocks until the request has completed Below is a short code example Submit the asynchronous request status netslnb inttest amp i Block until the request has completed status netslwt request 48 Chapter 10 Asynchronous Kequest Handling Upon return status is NetSolveOK the request has completed succes
34. edu killed killed NS killall This Shell script takes one argument on its command line the name of a host running a NetSolve agent After a basic user authentication the executable kills the agent along with all other NetSolve processes agents and servers known to that agent UNIX NS killall netsolve cs utk edu Server on cupid cs utk edu killed Server on maruti cs berkeley edu killed Agent on netsolve cs utk edu killed 82 Chapter 17 The Problem Description File The problem description file PDF is the mechanism through which NetSolve enables services for the user The NetSolve distribution contains the source code for MA28 ITPACK qsort and a subset of BLAS and LAPACK routines This software is contained in the NETSOLVE ROOT src SampleNumericalSoftware directory Therefore the default NetSolve enablement contained in SNETSOLVE_ROOT server_config only accesses the PDFs related to the included software packages The user should refer to the Section called Expanding the Server Capabilities in Chapter 13 for details on expanding the capabilities of a server and refer to the Section called Contents of a Problem Description File for details on the structure of a problem description file Contents of a Problem Description File In what follows we describe the contents of a problem description file PDF We offer all of the details because it may be necessary or desirable to be aware of them b
35. errors since it is a daemon with no controlling terminal and therefore has no way to do this otherwise If the 1 option is not specified the default log file is NETSOLVE ROOT nsserver log Successive runs of the server with no specification of a log file will overwrite the original log file so if the information is needed it must be copied to another file The k starts the server in Kerberized mode UNIX NS server k The s options marks a server as softwareserver i e the server acts as a repository for problems but does not execute any problems UNIX NS server s Note Also set the environment variables NETSOLVE KEYTAB pointing to the keytab and NETSOLVE USERS pointing to the list of authorized users The k option is only useful when installed with KERBEROS libraries 69 Chapter 12 Kunning the Netdolve Server The a options assigns a specific IP address to the server This allows the selection of which IP to use on servers with multiple network cards UNIX NS server a ip address Note Multiple NetSolve servers can be running on a given machine if and only if they have a different NetSolve agent When running multiple servers within the same directory tree if a unique log file isn t specified then the most recently started server will take over the log file Log messages from other servers will be lost Use the parameter to specify a unique log for each server to avoid this When the
36. file SNETSOLVE ROOT server config to be sure the AGENT parameter is set for the Agent that you intend to use then run bin SNETSOLVE ARCH NS server 9 To test your installation you can run bin SNETSOLVE_ARCH Test Installation on Unix Systems using configure From this point forward we assume that the UNIX SHELL is from the csh family The installation of NetSolve is configured for a given architecture using the GNU tool configure 60 Chapter 13 Downloading Installing and lesting the Agent and Server UNIX gt cd NetSolve UNIX gt configure For a list of all options that can be specified to configure type UNIX configure help A summary of NetSolve specific parameters are below Optional Features disable FEATURE do not include FEATURE same as nable FEATURE no enable FEATURE ARG include FEATURE ARG yes disable debug exclude debugging info when compiling no effect when with cnoptflags and with coptflags are used nable port restriction Server uses only ports 9001 thru 9204 nable infoserver alon use InfoServer alon NetSolve Compile Options with cc determine which C compiler to use with cnooptflags set compiler flags that don t deal with optimization ONLY USE IN COMBINATION WITH with cc CFLAGS will be set to C OPT FLAGS C NOOPT FLAGS with coptflags set compiler optimization flags ONL
37. into its agent to help its efforts of determining which computational servers would yield results to the client most efficiently Il The User s Manual The user has two choices when installing NetSolve He can install only the client software and use existing pools of resources agent s and server s or he can install his own stand alone NetSolve system client agent s and server s If the user wishes to only install the client interface s he should follow instructions in Part II The User s Manual However if the users wishes to install client agent s and server s he should follow the instructions in Part III The Administrator s Manual Chapter 3 Downloading Installing and Testing the Client The NetSolve client software is available for UNIX and UNIX like operating systems and Windows environments All of the client agent and server software is bundled into one tar gzipped file for UNIX like operating systems There is a separate distribution file for the Windows client No root superuser privileges are needed to install or use any component of the NetSolve system NetSolve 2 0 s configuration and installation environment has changed from previous versions prior to 1 4 1 Previously a custom set of make include files were used to achieve easy installation NetSolve 2 0 now uses autoconf to create an environment that looks like many other Open Source projects There is also a new script ns install to help make the installati
38. ll BO OF oroo OOo 0 UU o0 tn 64 Chapter 1 he Problem Description rile then val 131526184 col ind 02 3230130 row ptr 035 8 9 Thus if a problem in NetSolve has the following specifications sm prob object in INPUT input 0 Sparse Matrix Double Precision Real the sparse matrix Calling sequence from C or Fortran 11 arguments Argument 0 number of rows of input object 0 sm number of columns of input object 0 sm Argument 1 number of non zero values of input object 0 sm Argument 2 pointer to input object 0 sm Argument 3 column indices of non zeros of input object 0 sm Argument 4 row pointers of the sparse matrix 40 sm a Matlab user would call this program as gt gt netsolve sm prob SM where SM is a Matlab constructed sparse matrix object and a C user would invoke this problem as double val int col index int row ptr int rows num nzeros initialize the arrays and variables status netsl sm prob rows num nzeros val col index row ptr 85 Chapter 1 he Problem Description rile Mnemonics As described in the Section called NetSolve Objects the NetSolve system defines data structures that we call NetSolve objects These are high level objects that are comprised of integers and arrays of characters and floats To be able to relate high level and low level descriptions of the input and output obje
39. nameserver and a memory are started In fact the memory is started for the sake of simplicity Indeed the agent is known by the whole system It enables each sensor to register and easily store its measurements Furthermore this scheme avoids unnecessary communication costs A forecaster process is then started by the agent It generates information as soon as needed by the agent 115 Chapter zz Using the Network Weather Service Thus the agent possesses its own forecaster and can deal with client requests We shall now examine what happens on computational resources NetSolve server and the NWS sensor As soon as a NetSolve server computational resource is added to the NetSolve system it is necessary to start an NWS sensor This sensor is started on the server after its registration with the agent to avoid any incoherency with the NetSolve system The NWS sensor is totally independent from the NetSolve processes running on the server At present the NWS sensor is only detecting the CPU speed of the computational resource Future implementations will expand this functionality to include monitoring for the amount of physical memory available per computational resource as well as the latency bandwidth of the communication between each server and the client These improvements will require an additional sensor to be started on the client 116 Chapter 23 Using Octave with NetSolve Building the Octave Interface First obtain and buil
40. netsolve cs utk edu 128 169 93 161 SERVER maruti cs berkeley edu 128 32 36 83 SERVER cupid cs utk edu 128 169 94 221 SERVER fsmat htu tuwien ac at 128 131 95 99 0 failures softwareserver The list shows beside the name and the IP address how many failures occured to successfully finish a problem since the server was started and if the server acts as a software server NS problems This executable takes the name of a host running an agent as single argument on its command line It prints the list of problems that can be solved by contacting that agent IX NS problems netsolve cs utk edu BLAS Matrices matmul ItPack jsi LAPACK Matrices EigenValues eig LAPACK Matrices SingularValues svd SoM SR Cd 80 Chapter 16 Netsolve Management tools jor Administrators NS_probdesc This executable takes two arguments on its command line the name of a host running a NetSolve agent and the nickname of a NetSolve problem It prints the description of the problem UNIX gt NS_probdesc netsolve cs utk edu linsol linsol From LAPACK Compute the solution to a real system of linear equations A X pb where A is an N by B matrix and X and B are N by NRHS matrices Matlab Example x netsolve dgesv a b http www netlib org lapack index html 2 objects in INPUT input 0 Matrix Double Precision Real Matrix A input 1 Matrix Double Precision Real Right hand side
41. of a server configuration file The lines starting with a are considered comments Keywords are prefixed by a and mark the beginning of sub sections In what follows we describe each section separately as well as each keyword and sub sections within each section You may want to look at one existing problem description file as a template when reading this section Problem ID and General Information The following keywords are required and must occur in the order in which they are presented QPROBLEM lt nickname gt specifies the name of a problem as it will be visible to the NetSolve users clients QINCLUDE name specifies a C header file to include See the example in the Section called A Simple Example There can be several such lines as a problem can call several functions 86 Chapter 1 Lhe Problem Description rile QDASHI lt path gt specifies a default directory in which header files are to be looked for in a similar way as the I option of most C compilers There can be several such lines as a problem can call several functions QLIB lt name gt specifies a library or an object file to link to or a L option for the linker See the example in the Section called A Simple Example If multiple libraries are required a separate LIB line must be specified for each library and the libraries will be linked in the order in which they are specified The L1B line s can contain vari
42. of resources agent s and server s The second type of NetSolve user installs and administrates his own NetSolve system client agent s server s and potentially enables his software to be used by NetSolve This Users Guide addresses the needs of both types of users If the user wishes to only install the client interface s he should follow instructions in Part II The User s Manual However if the users wishes to install client agent s and server s he should follow the instructions in Part III The Administrator s Manual Note that the term administrates or administrator here simply refers to the person setting up and maintaining the NetSolve agent and server components NO ROOT PRIVILEGES ARE NEEDED TO INSTALL OR USE ANY COMPONENT OF THE NetSolve SYSTEM The Status of NetSolve The official release of NetSolve 2 0 is July 2003 New features implemented in this release include Hardware Software server this new feature allows for the transparent movement of problems to take advantage of available hardware software resources improving load balancing over your NetSolve system Dynamic server this feature improves the procedure required to add new problems to a NetSolve server by providing a mechanism to add new problems to a server without having to stop the server and recompile again as was required previously Octave support Octave is now supported providing an open source interface for numerical computations c
43. perform make wrappers first followed by make server NetSolve s distributed memory services e g ScaLAPACK PETSc are spawned using MPI mpirun machinefile MPImachines and thus require an MPI machine file describing the parallel machine on which to run The name of the file containing this list of homogeneous machines is called SNETSOLVE ROOT MPImachines and is referenced in the file SNETSOLVE ROOT server config for configuring the server Therefore if you are enabling parallel services within a server the user MUST edit this SNETSOLVE_ROOT MP Imachines file to list the specific machines to be used The current implementation of NetSolve allows only one MPImachines file per server This spawning file is tied to the server and not to a specific service enabled Therefore if you wish to enable parallel services on different clusters then you must enable the software on different servers i e maintain a separate NetSolve source code tree for each server enablement so that each parallel service can have its own MPImachines file from which to spawn A future release of NetSolve should identify a separate MPImachines file with each parallel service that can be enabled Enabling the LAPACK library To enable LAPACK within NetSolve one must perform the following steps During the configure phase of the NetSolve installation type UNIX configure with lapacklib LAPACK LIB with blaslib BLAS LIB
44. server has been compiled with the Kerberos libraries the administrator has the option of having the server require clients to authenticate before rendering services To mandate this authentication the k option must be used otherwise no authentication will be asked for and the server will be available to service requests to ANY client asking for services To terminate an existing server or query an existing NetSolve system the user should refer to the NetSolve management tools as outlined in Chapter 16 The Server Configuration File The server configuration file is used to customize the server The default configuration file in NETSOLVE ROOT server config should be used as a template to create new configuration files This configuration file is organized as follows A line can start with a in which case the line is ignored and can be used for comments A line can also start with a keyword that is prefixed by a Q typically followed by a single value or parameter Let us review all of the possible keywords and how they can be used to precisely define a NetSolve server as it is done in the default configuration file QAGENT hostname specifies the agent that the NetSolve server must contact to register into a NetSolve system The agent is identified by the name of the host on which it is running and there can be only one such line in the configuration file QPROC number specifies the number of
45. that the user wants to sort an array of integers with NetSolve using the C interface The default NetSolve server comes with a default problem called iqsort that does a quicksort on an integer vector The call looks like status netsl iqsort size ptr sorted where size is the size of the array to be sorted ptr is a pointer to the first element of the array and sorted is a pointer to the memory space that will hold the sorted array on return What if the user wants to sort 200 arrays One way is to write 200 calls as the one above Not only would it be tedious but also inefficient as the sorts would be done successively with no parallelism In order to obtain parallelism one must call nets1nb and make the corresponding calls to net slpr and netslwt as explained in Chapter 5 or use nets1_farm Before calling nets1_farm the user needs to construct arrays of pointers and integers that contain the arguments of each of the NetSolve calls This is straightforward where the user would have called NetSolve as requestsl netslnb iqgsort sizel ptrl sortedl1 requests2 netsinb igsort size2 ptr2 sorted2 requests200 netslnb igsort size200 array200 sorted200 and then to have calls to net slpr and net slwt for each request With farming one only needs to construct three arrays as int size_array 200 void ptr_array 200 void sorted_array 200 size array 0 sizel ptr array 0 ptrl
46. the only options are KERBEROS5 or NO AUTH no authentication for the AUTHENTICATION macro If authentication is set to KERBEROSS then AUTH_LIBS must be set to the location of the appropriate libraries needed to use the kerberos application programming interface AUXILIARY PACKAGES If NWS is enabled i e CPU STAT NWS the variable NWSDIR provides the path to the NWS distribution See Chapter 22 for further details In the case of a parallel server it is necessary to set the MPI DIR MPI INCLUDE DIR and MPI INCDIR variables to the proper paths If IBP is enabled then IBPDIR provides the path to the IBP distribution See Chapter 20 for further details 52 Chapter 12 Lroubleshooting Auxiliary Libs This section contains variables for setting path names and to optional software packages such as PETSc Aztec ITPACK SuperLU LAPACK ScaLAPACK MPIBLACS and BLAS An example Makefile NETSOLVE_ARCH inc for IRIX is listed below Generated automatically from Makefile generic arch in by configure Never include this file directly Always include Makefile inc and make sure it is appropriately set to include the proper platform specific file CUSTOMIZING CONFIGURATION SHELL bin sh a aE HHH HH HE EE EE EE HE EE EE HE aE EE EE INSTALL DIRECTORIES HH EH HH HH HEH HH EE HH EE HE 3r
47. 2 0 29 PETSC ARCH linux BOPT 0 PETSC LIB DIR S PETSC_DIR 1lib 1ibS BOPT S PETSC_ARCH HAVE aztec 0 AZTEC DIR src icl2 Aztec AZTEC LIB DIR src icl2 Aztec lib libg linux HAVE superlu 0 SUPERLU_DIR src icl2 SuperLU SUPERLU LIB DIR src icl2 SuperLU lib sequential linux USE SUPERLU SERIAL DUSE SERIAL USE SUPERLU DIST LAPACK LIB LINK usr local lib liblapack n32 a SCALAPACK LIB LINK usr local lib libscalapack a BLAS LIB LINK usr 1ib32 mips4 libblas a BLACS LIB LINK usr local lib libmpiblacsCinit p4 a usr local lib libmpiblacs p4 a usr local lib libmpiblacsCinit p4 a 57 Ill The Administrator s Manual The user has two choices when installing NetSolve He can install only the client software and use existing pools of resources agent s and server s or he can install his own stand alone NetSolve system client agent s and server s If the user wishes to only install the client interface s he should follow instructions in Part II The User s Manual However if the users wishes to install client agent s and server s he should follow the instructions in Part III The Administrator s Manual Chapter 13 Downloading Installing and Testing the Agent and Server The NetSolve agent and server software is currently available for UNIX and UNIX like operating systems as well as Cygwin running on Windows and Mac OSX
48. 3 17 2 Available object types iere rete ede esa Pipe eee acte R 84 27 3 BError COS ii REUS A s 128 List of Figures 1 1 The NetSolve sti OT eed ertet pe ie E rer a peine 1 9 1 Sample C Code Using Request Sequencing Constructs eere 47 20 1 Example 1 without using DSD oooocnnccnociocccccoonnononnnonocnnonnconononon non rennen nennen en nennen enr enne 106 20 2 Example 2 using DS ie edite met peii meet he eite ed e e Pei eene 107 Preface Who Should Read This Document This Document is intended to provide the reader with a discussion of how to use the different components of the NetSolve System and to serve as a reference manual for the commands and functions made available by NetSolve Although we offer a brief discussion of the NetSolve System this document is not necessarily intended to provide details about the NetSolve components The reader should refer to the NetSolve documents in the reference list and refer to the Documentation section of the NetSolve homepage http icl cs utk edu netsolve for more appropriate discussion of the NetSolve system The reader is expected to have some level of familiarity with programming and at least one programming languages preferably the C language Rudimentary knowledge of the UNIX operating system environment and the make utility will prove handy if installing and configuring NetSolve for the UNIX environment Organization of This Document This users guid
49. 4 Vectors of characters are passed as strings 5 Matrices of characters are passed as vectors of strings Blocking call to NetSolve In the previous section we explained how the user can obtain information about a problem and its calling sequence For the call itself the function Net Solve is invoked with the problem name and its arguments For example In 6 NetSolve iqsort 7 2 3 5 1 contacting server merlin comlab Out lel LL 2 3 Die T As stated earlier the user can pass not only numerical values but also symbols that contain data of proper type or functions that return a result of this type Indeed Mathematica calculates these expressions and passes the arguments by value For example In 7 v Range 5 Out 7 1 2 3 4 5 In 8 NetSolve iqsort v contacting server merlin comlab Out 8 les 4 3 7 2 1 or to sort a random vector of size 7 37 Chapter Mathematica Interface In 9 NetSolve iqsort Table Ceiling 10 Random 7 contacting server merlin comlab Que ls tly 2 25 2y 4 67 Tj Since NetSolve is a function defined in Mathematica it can be used in expressions like In 9 NetSolve iqsort Table Ceiling 10 Random 7 contacting server merlin comlab Out 9 f11 2 25 2 4 6 T In 10 Print The minimal element of v is NetSolve iqsort v 1 contacting server merlin comlab The minimal element of v is 5 Let us consider a more com
50. 600 rw The owner should not be root 98 Chapter 16 Security in Netdolve Running a Kerberized Server 1 You must have a NetSolve agent running somewhere first 2 You must be logged into UNIX as the owner of the etc netsolve keytab file since the server needs to be able to read this file 3 Set up the environment variables UNIX setenv NETSOLVE AGENT netsolve agent host UNIX setenv NETSOLVE KEYTAB etc netsolve keytab UNIX setenv NETSOLVE USERS etc netsolve users T The NETSOLVE USERS file is a text file that contains a list of Kerberos principal names one per line who are authorized to use the server It is reopened each time a user tries to authenticate to the server so you can add users while the server is running 4 Start the server UNIX path to netsolve NS server k amp If you do not use the k flag the server will not require authentication 99 IV Miscellaneous Features Chapter 19 Using Condor G with NetSolve Introduction NetSolve has provided an interface to the Condor system Condor developed at the University of Wisconsin Madison is a high throughput computing environment that can manage very large collections of distributed workstations Condor G is the job management part of Condor It allows users to submit jobs into a queue have a log detailing the life cycle of your jobs manage input and output files along with everyth
51. A Netsolve Lutorials UNIX nspovray licl pov Oicl png H400 W500 II non blocking calls uses non blocking calls and is invoked with the option nonblocking additionally you can specify with the n option how many instances parallel NetSolve calls you want to start e g UNIX nspovray licl1l pov Oicll png H400 W500 n2 nonblocking III task farming again as above but use with the option farming to produce an animation use for example UNIX nspovray icl animation ini oanimation mpg n2 farming Note Be sure to have an agent and at least one instance of the new server running Also check that the NETSOLVE AGENT environment variable is set on the client it should be the same value as the AGENT line in server config in the NETSOLVE ROOT directory Tutorial for Matrix and Vector Operations This tutorial shows how to use matrices and vectors within NetSolve by developing a little program which either invokes a custom function to perform the multiplication or uses the BLAS routine dgemm This includes the following steps I Building the library II Installing the problem and adding BLAS to the NetSolve repository III Invoking the function via NetSolve Requirements the following files are needed they should be in the current directory libmatmul c Contains the function which should perform the calculation matmul idl A file which describes how the problem should be included into the NetSolve repo
52. C and Octave Prejace Part V Reference These sections provide reference manuals for the client interfaces as well as a listing of error handling messages within the NetSolve system Part VI Appendices These appendices provides tutorials on using NetSolve and example programs calling the Fortran77 and C NetSolve interfaces Document Conventions Program Output Text that is output from a program UNIX gt The UNIX prompt at which commands can be entered User Input Data to be entered by the user Replaceable Content that may or must be replaced by the user Action A response to a user event Constant A program or system constant Function The name of a function or subroutine Parameter A value or symbolic reference to a value Type The classification of a value Variable The name of a variable Application The name of a software program Prejace Command The name of an executable program or other software command ENVAR A software environment variable Filename The name of a file Request for Comments Please help us improve future editions of this document by reporting any errors inaccuracies bugs misleading or confusing statements and typographical errors that you find Email your bug reports and comments to us at netsolve Ocs utk edu mailto netsolve cs utk edu Your help is greatly appreciated iii I Introduction Chapter 1 A NetSolve Overview An Introduction to Dis
53. Currently there is no mechanism to allow the client to insist on authentication of the server a Kerberized client will happily talk with either Kerberized or non Kerberized servers The server implements access control via a simple list of Kerberos principal names This list is kept in a text file which is consulted by the server A request to a NetSolve server must be made on behalf of one of those principal names If the principal name associated with the Kerberos credentials in the request appears in the list and the credentials are otherwise valid the request will be honored Otherwise the request will be denied Since the NetSolve server was not designed to run as a set uid program it is not currently feasible to have the NetSolve server run processes using the user id of the particular UNIX user who submitted the request NetSolve thus uses its own service principal name of netsolve rather than using the host principal What this means among other things is that you need to generate service principals and keytabs for each of your NetSolve servers even if you already have host principals in place The NetSolve server by default runs in non Kerberized mode To start up the server in Kerberized mode you need to add the k option to the command line and also set environment variables NETSOLVE KEYTAB pointing to the keytab and NETSOLVE USERS pointing to the list of authorized users This version of Kerberized NetSolve pe
54. ETSOLVE DIRNtesting This directory contains various sample binary test programs that you can run to verify your installation The installation process is quite simple a Run the exe you downloaded from the NetSolve webpage to extract the files to a directory b Then run the executable netsolve install exe to set the registry keys for NetSolve To determine the agent host name the user can issue the following command from a DOS prompt a C icd NETSOLVE_DIR tools b C gt getagent To set a new agent host name the user must issue the following command a C gt cd NETSOLVE_DIR tools b C gt setagent agent host name If the agent host name is not specified on the command line you will be prompted for a host name You will have the option of specifying a name or accepting the current agent name set in the registry The de installation process is quite similar a C gt cd NETSOLVE DIR b C gt netsolve_install uninstall The above program removes the keys from the Windows registry c C Nx rmdir s NETSOLVE DIR Testing the Windows installation You can use the various programs in the NETSOLVE_DIR testing directory to test your NetSolve installation Remember that a valid NetSolve agent and server should already be running and the 13 c test Chapter 5 Downloading installing and testing the Client required problems should be installed on the servers Here is a list of test programs a
55. IR where SCALAPACK LIB denotes the name of the ScaLAPACK library BLACS LIB denotes the name s of the MPIBLACS libraries and BLAS LIB denotes the name s of the BLAS library If these libraries are not already available on the user s machine he can download ScaLAPACK from the ScaLAPACK web page http www netlib org scalapack scalapack tgz and the MPIBLACS from the BLACS web page http www netlib org blacs mpiblacs tgz If an optimized BLAS library is not available on the user s machine he can view the BLAS FAQ http www netlib org blas faq html 1 6 for details of availability otherwise he can download ATLAS from the ATLAS webpage http www netlib org atlas and it will automatically generate an optimized BLAS library for the installation architecture MPI DIR denotes the location of the MPI library assumes the standard MPICH distribution The user must then uncomment the respective line problems scalapack in the PROBLEMS section of the SNETSOLVE_ROOT server_config file by removing the from the beginning of the line And lastly the user must recompile the server by typing make server in the SNETSOLVE_ROOT directory Or use the dynamic server feature described in the Section called Dynamic Servers in Chapter 15 by sending kill USRI to the highest server PID Enabling Sparse Iterative Solvers PETSc Aztec and ITPACK NetSolve offers a sparse iterative solve service as a convenie
56. Lroubleshooting NS F NOOPT FLAGS F_NOOPT_FLAGS INCDIR S ARCHCFLAGS LINKER FC LDF LAGS LD MSG OFF 15 84 n32 mips4 r12000 MEX usr local matlab bin mex MEXFLAGS O MEXEXT mexsg NS MEXFLAGS S MEXFLAGS HBMFLAG F2CFLAG OUTPUT LEVEL ARCHMFLAGS S INCDIR S PROXY S CPU_STAT S IBPFLAG S AUTHENTICATION S DSIFLAGS g DMATLAB JAVAC NS_JAVAFLAGS classpath NETSOLVE ROOT src PDF GUI classes PDFGUICLASSDIR d PDFGUICLASSDIR HH HH HE EH aE EH HH HO OE EEE aE EE EE EEE LIBS DIRS AND DEFINES HH HH Ht EE aE aE HH HO EOE OE EE EE EEE EEE LIBS 1m lc INCDIR IS NETSOLVE ROOT include S NWS_INCDIR IBP_INCDIR MPI INCDIR ARCHCFLAGS D NETSOLVE OS D F2CSTR D F2CINT D F2CNAMES D RUSAGE DNETSOLVE_ROOT S NETSOLVE_ROOT A DNETSOLVE ARCH N NETSOLVE ARCH N DMPI DIR N S MPI DIR ARCHMFLAGS D NETSOLVE OS Gl DS F2CSTR D F2CINT D F2CNAMES D RUSAG D NETSOLVE ROOT N S NETSOLVE ROOT N D NETSOLVE_ARCH S NETSOLVE_ARCH SF2CINT options FINT2CLONG F77 INTEGER gt C long FINT2CINT F77 INTEGER gt C int default FINT2CSHORT F77 INTEGER gt C short F2CINT FINT2CINT
57. Octave interface 3 The NetSolve management tools described in Chapter 16 give access to that information from the UNIX prompt Naming Scheme for a NetSolve problem The full name of a NetSolve problem has two parts 1 the path and li the nickname Let us demonstrate this with an example The problem nicknamed ddot which computes the inner product of two double precision vectors has the full name BLAS Levell ddot This problem can be found in NETSOLVE ROOT problems blas This full name has two purposes First when we display a list of problems they are sorted alphabetically by their full name and the problems are grouped by directory Second by convention the first element of the full name e g BLAS is the name of the numerical library containing the operation problem This convention has proven to be useful as seen in the Section called What is the Calling Sequence in Chapter 5 17 Chapter 5 C and Fortran77 Interfaces Introduction As mentioned in the Section called Installation on Unix Systems using ns install in Chapter 3 the C Fortran77 client interfaces for NetSolve are built by typing UNIX make C Fortran in the directory NETSOLVE ROOT This compilation produces the following two shared libraries NETSOLVE ROOT lib NETSOLVE ARCH libnetsolve a theC library e NETSOLVE ROOT lib NETSOLVE ARCH libfnetsolve a the Fortran77 library
58. PManageError Error in IBP internals while closing 104 Chapter ZU Distributed Storage Infrastructure DSL in NetSolve NetSolveDsiDisabled If DSI is not enabled in the NetSolve configuration DSI OBJECT ns dsi write vector DSI FILE dsi file void data int count int data type dsi file The name of the DSI file where the vector will be written data Vector to write to the DSI storage count Number of elements in the vector data type One of netsolve data types ns dsi write vector is used for writing a vector of a particular datatype to a DSI file On success ns dsi write vector returns a pointer to the DSI object created for the vector On failure returns NULL Following are the various error values set in case of failure NetSolveIBPStoreError Error while storing the vector in IBP NetSolveDsiEACCESS Not enough permissions for writing to the DSI file NetSolveDsiDisabled If DSI is not enabled in the NetSolve configuration DSI OBJECT ns dsi write matrix DSI FILE dsi file void data int rows int cols int data type Same functionality and return values as ns dsi write vector exceptns dsi write matrix is used to write matrix of rows rows and cols columns int ns dsi read vector DSI OBJECT dsi obj void data int count int data type 105 dsi obj Chapter ZU Distributed Storage Infrastructure DSL in NetSolve Pointer to the DSI object that c
59. R gt NUMBER lt VARNAME gt lt OPENANGLE gt gt lt lt CLOSEANGLE gt gt gt lt NNZVAR gt IN int lt VARNAME gt lt INDEXVAR gt gt IN int lt VARNAME gt lt VECTORATTR gt lt POINTERVAR gt gt IN int lt VARNAME gt lt VECTORATTR gt lt PROBLEMNAME gt IDENTIFIER lt FUNCNAME gt IDENTIFIER lt TYPESTRING gt sequential parallel lt INOUTSTRING gt IN OUT INOUT lt DATATYPE gt int float double char scomplex dcomplex string file lt VARNAME gt IDENTIFIER Example 2 The following IDL file demonstrates the use of sparse matrix data structure in the IDL file 94 Chapter 1 he Problem Description rile PROBLEM sparse direct solve C ROUTINE sparse direct solve IN string package IN int N IN double SM N N nnz indices pointer IN int nnz IN int indices nnz IN int pointer N IN double rhs N IN double pivot IN int permutation OUT double sol N sparse direct solve ma28 and superlu LIBS home vss idltopdf sparse_direct_wrapper o lm L NETSOLVE ROOT lib NETSOLVE ARCH lnetsolve ma28 lnetsolve superlu serial lnetsolve aux lnetsolve direct driver lnetsolve tester LIBDIR libma28 a SUPERLU LIB LINK S LAPACK LIB LINK S BLAS LIB LINK L MPI DIR lib lmpich In the above IDL file the third parameter SM is a sparse matrix represented by a compressed row fo
60. RCH a LIB home stuff add o linsol FORTRAN L LinearAlgebra LinearSystems ION A is a double precision matrix of dimension NxN B is a double precision matrix of dimension NxNRHS X is the INPUT 2 Square linear system A X B Wher solution OBJECT MATRIX DA Matrix A NxN OBJECT MATRIX D B Matrix B NxNRHS QOUTPUT 1 OBJECT MATRIX D X Solution X NxNRHS COMPLEXITY 3 3 CALLINGSEQUENCE ARG IO ARG 11 00 ARG nIO mIO mII1 ARG nIl ARG 110 ARG 111 100 CODE linsol 10 11 mI0 nI1 1I0 1I1 COOR 11 mO0 mI1 Setting the number of rows nO0 nI1 Setting the number of columns END_CODE Pointing to the overwritten input x7 T 92 Chapter 1 he Problem Description rile PDF Generator The process of creating new problem descriptions can be difficult especially for a first time user It is true that after writing a few files it becomes rather routine and several NetSolve users have already generated a good number of working PDFs for a variety of purposes including linear algebra optimization image processing etc However we have designed a graphical Java GUI application that helps users in creating PDFs To compile this GUI type UNIX make pdfgui from the SNETSOLVE ROOT directory This creates a set of Java classfiles needed to run the GUI application and places them in t
61. Sc Aztec and ITPACK interfaces and check the validity of the computed solution Alternatively the user can generate a series of Harwell Boeing matrix types 1 5 using the generate m script To see a list of Harwell Boeing matrix types that can be generated type gt gt generate 0 And then call the functions petsc m and or aztec m by typing A rhs generate 1 gt gt xl itsl petsc A rhs gt gt x2 its2 aztec A rhs Note that the user can query for the list of arguments in the calling sequence to the routine by using the NetSolve tool routine 32 Chapter 6 Matlab Interjace gt gt netsolve sparse iterative solve Optional Testing the NetSolve sparse direct solve interface The NetSolve sparse direct solve interface to MA28 and SuperLU can only be tested if the user has enabled sparse direct solve in the SNETSOLVE ROOT server config file and has configured NetSolve with the respective paths to the SuperLU and MPI libraries The MA28 library is distributed with NetSolve in SNETSOLVE ROOT src SampleNumericalSoftware MA28 as a small modification to the library was necessary to enable its use in NetSolve The SuperLU library is not included as default numerical software for the server and must be installed separately as well as MPI Refer to the Section called Enabling Sparse Direct Solvers SuperLU and MA26 in Chapter 13 for further details This interface can be
62. Solv Requests 0 eig ted to torc3 cs utk edu pending requests submit 128 169 93 74 was started 41 seconds ago netsolveProbeRequest returned 1 ns errno 0 Completed Requests 1 eig submit ted to torc3 cs utk edu 128 169 93 74 was started 23 seconds ago netsolveProbeRequest returned 1 ns errno 0 Completed The user can check what request he has sent so far and obtain an estimation of the completion times By using the status action the user can also determine whether a request is still running or has been completed By sending multiple non blocking requests to NetSolve and relying on the agent for load balancing the user can achieve parallelism Testing scripts Test scripts are also included in NetSolve distribution and will be available in the SN ETSOLV E ROOT bin N ETSOLV E_ARCH NS_octave directory after the Octave interface is built These scripts help in testing the Octave interface and also serve as examples for using the Octave interface 122 V References Chapter 24 Matlab Reference Manual gt gt gt gt gt gt In this appendix we describe all of the NetSolve calls that can be invoked from within Matlab In the case of an error all of these calls will print very simple and explicit error messages The user should refer to Chapter 27 for a list of all possible NetSolve error messages netsolve Prints to the sc
63. This is done by constantly measuring the throughput of the computations 45 Chapter 9 NetSolve Request Sequencing Goals and Methodologies Our aim in request sequencing is to decrease network traffic amongst NetSolve client and server components in order to decrease overall request response time Our design ensures that i no unnecessary data is transmitted and ii all necessary data is transferred As briefly discussed below we also reduce execution time by executing computational modules simultaneously when possible All this is accomplished by performing a detailed analysis of the input and output parameters of every request in the sequence to produce a directed acyclic graph DAG that represents the tasks and their execution dependences This DAG is then sent to a server in the system where it is scheduled for execution In order to build the DAG or task graph we need to analyze every input and output in the sequence of requests We evaluate two parameters as the same if they share the same reference We use the size fields and reference pointer of the input parameters to calculate when inputs overlap in the memory space Only matrices and vectors are checked for recurrences on the premise that these are the only objects that tend to be large enough for the overhead of the analysis to pay dividends Through this analysis we build a DAG in which the nodes represent computational modules or NetSolve services and the arcs represent data dependen
64. To run the ScaLAPACK test suite type scalapack test at the Matlab prompt Optional Testing the NetSolve sparse iterative solve interface The NetSolve sparse iterative solve interface to PETSc Aztec and ITPACK can only be tested if the user has enabled sparse iterative solvein the SNETSOLVE ROOT server config file and has configured NetSolve with the respective paths to the PETSc library Aztec library and MPI library The PETSc Aztec and ITPACK libraries are not included as default numerical software for the server and must be installed separately as well as MPI Refer to the Section called Enabling Sparse Iterative Solvers PETSc Aztec and ITPACK in Chapter 13 for further details This interface can be tested most effectively by using sparse matrices generated from collections such as the Harwell Boeing test collection on the Matrix Market homepage http math nist gov MatrixMarket Refer to the section on the webpage entitled Software where the test matrices are available in C Fortran and Matlab For ease of testing several of the test matrices from this collection are included in the distribution of NetSolve After Matlab has been invoked the user can then call the test scripts petsc_test m aztec_test m and itpack test minthe NETSOLVE ROOT src Testing matlab directory by typing gt gt petso test and gt gt aztec test and gt gt itpack test These scripts invoke the PET
65. Users Guide to NetSolve V2 0 http icl cs utk edu netsolve Dorian Arnold Sudesh Agrawal Susan Blackford Jack Dongarra Christoph Fabianek Tomo Hiroyasu Eric Meek Michelle Miller Kiran Sagi Keith Seymour Zhiao Shi Sathish Vadhiyar Users Guide to NetSolve V2 0 http icl cs utk edu netsolve by Dorian Arnold Sudesh Agrawal Susan Blackford Jack Dongarra Christoph Fabianek Tomo Hiroyasu Eric Meek Michelle Miller Kiran Sagi Keith Seymour Zhiao Shi and Sathish Vadhiyar version 2 0 Edition Copyright O 1995 2003 by The NetSolve Project Innovative Computing Laboratory Department of Computer Science University of Tennessee Legal Restrictions Allowed Usage Users may use NetSolve in any capacity they wish We only ask that proper credit and citations be used when the NetSolve system is being leveraged in other software systems Redistribution Users are allowed to freely distribute the NetSolve system in unmodified form At no time is a user to accept monetary or other compensation for redistributing parts or all of the NetSolve system Modification of Code Users are free to make whatever changes they wish to the NetSolve system to suit their personal needs We mandate however that you clearly highlight which portions are of the original system and which are a result of the third party modification Warranty Disclaimer USER ACKNOWLEDGES AND AGREES THAT A NEITHER THE NetSolve TEAM NOR THE BOARD OF REGENTS OF THE UNI
66. VERSITY OF TENNESSEE SYSTEM REGENTS MAKE ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER ABOUT THE SUITABILITY OF NetSolve FOR ANY PURPOSE B NetSolve IS PROVIDED ON AN AS IS WITH ALL DEFECTS BASIS WITHOUT EXPRESS OR IMPLIED WARRANTIES INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT C NEITHER THE NetSolve TEAM NOR THE REGENTS SHALL BE LIABLE FOR ANY DAMAGE OR LOSS OF ANY KIND ARISING OUT OF OR RESULTING FROM USER S POSSESSION OR USE OF NetSolve INCLUDING DATA LOSS OR CORRUPTION REGARDLESS OF WHETHER SUCH LIABILITY IS BASED IN TORT CONTRACT OR OTHERWISE AND D NEITHER THE NetSolve TEAM NOR THE REGENTS HAVE AN OBLIGATION TO PROVIDE DEBUGGING MAINTENANCE SUPPORT UPDATES ENHANCEMENTS OR MODIFICATIONS EXCEPT WHERE EXPLICIT WRITTEN ARRANGEMENTS HAVE BEEN PRE ARRANGED Damages Disclaimer USER ACKNOWLEDGES AND AGREES THAT IN NO EVENT WILL THE NetSolve TEAM OR THE REGENTS BE LIABLE TO USER FOR ANY SPECIAL CONSEQUENTIAL INDIRECT OR SIMILAR DAMAGES INCLUDING ANY LOST PROFITS OR LOST DATA ARISING OUT OF THE USE OR INABILITY TO USE NetSolve EVEN IF THE NetSolve TEAM OR THE REGENTS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Attribution Requirement User agrees that any reports publications or other disclosure of results obtained with NetSolve will attribute its use by an appropriate citation The appropriate reference for NetSolve is The NetSolve Software Program NetSolve was develo
67. Y USE IN COMBINATION WITH with cc CFLAGS will be set to C OPT FLAGS C NOOPT FLAGS with fc determine which Fortran compiler to use with fnooptflags set compiler flags that don t deal with optimization ONLY USE IN COMBINATION WITH with fc FFLAGS will be set to F OPT FLAGS F NOOPT FLAGS with foptflags set compiler optimization flags ONLY USE IN COMBINATION WITH with fc FFLAGS will be set to F OPT FLAGS F NOOPT FLAGS with ldflags set loader flags NetSolve Run Time Options with nws NWSDIR location of NWS installation dir with ibp IBPDIR location of IBP installation dir with kerberos KRBDIR use Kerberos5 client authentication with proxy which Proxy netsolve globus with outputlevel output level debug view none NetSolve Service Options with petsc PETSCDIR location of PETSc installation dir with petsclibdir PETSC LIB DIR location of PETSc library with aztec AZTEC DIR location of Aztec installation dir with azteclib AZTEC LIB Aztec link line with superlu SUPERLU DIR location of SuperLU installation dir with superlulib SUPERLU LIB SuperLU link line with ma28 if ma28 is to be included in the NetSolve services 61 Chapter 13 Downloading Installing and lesting the Agent and Server with itpack if itpack is to be included in the Net Solve services
68. _ROOT bin SNETSOLVE_ARCH netsolve_err mex SNETSOLVE_ROOT bin SNETSOLVE_ARCH netsolve_errmsg mex The part of the extension depends on the architecture for instance the extension is mexsol for the Solaris Operating System These four files alone are the Matlab interface to NetSolve To make these four files accessible to Matlab the user must modify the MATLABPATH environment variable as UNIX setenv MATLAB VERSION R13 or R12 1 UNIX setenv MATLABPATH NETSOLVE ROOT bin NETSOLVE ARCH MATLAB S MATLAB VERSION It is also possible to use the Matlab command addpath For more information about mex files the user can refer to matlab In the following sections the user will learn how to call the four new functions from Matlab netsolve netsolve nb netsolve err and netsolve errmsg What to Do First Let us assume that the user has compiled the Matlab interface set an agent name started a Matlab session and is now ready to use NetSolve In this section we describe those features of the interface that allow the user to obtain information about the currently available NetSolve system As stated briefly in the Section called Problems that can be solved with NetSolve in Chapter 4 it is possible to obtain the list of solvable problems from Matlab as well as from the homepage CGI scripts or the management tools In the case of Matlab this information is obtained by typing the following command
69. able name substitutions such as NETSOLVE ROOT QFUNCTION lt name gt specifies the name of a function from the underlying numerical software library that is being called to solve the problem There can be several such lines as a problem can call several functions QLANGUAGE C FORTRAN specifies whether the underlying numerical library is written in C or in Fortran This is used in conjunction with the function names specified with amp FUNCTION to handle multi language interoperability MAJOR COL ROW specifies what major should be used to store the input matrices before calling the underlying numerical software For instance if the numerical library is LAPACK lapack the major must be COL QPATH lt path gt specifies a path like name for the problems This path is only a naming convention and is used for presentation purposes QNON MOVABLE 1 marks a problem as non moveable i e the problem cannot be moved by the Hardware Software server feature to another server Use this for problems which depend on specific software installed on a particular machine which may not be available on other servers e g SCALAPACK DESCRIPTION marks the beginning of the textual description of the problem This sub section is mandatory as it is used by the NetSolve management tools to provide information to the NetSolve users clients about a specific problem Input Specification QINPUT lt num
70. ample domain gt yourkey gpg Now mail that key in an attachment to someone who the netsolve server trusts and who is willing to sign your key By default netsolve servers trust the key associated with netsolve masterOnetlib org but your netsolve server may trust other keys instead of or in addition to this key Netsolve master will not sign your key unless we know you and trust you We will expect you to appear in person and verify your key fingerprint before we will sign the key sending the key by email just gets it to our computer where we can sign it 3 Incorporating the signed key in your keyring Finally when you get the signed key back in the mail save it in a file call it signedkey gpg and import it into your keyring Again this can be done two ways directly using gpg or with the provided script NS import key NS import key takes one parameter the file containing your signed key UNIX NS import key signedkey gpg UNIX gt gpg import signedkey gpg 4 Signing problems A script called NS_sign_problemis used to sign problems once they are compiled and linked To use it type UNIX gt NS_sign_problem problem filename key id For instance if you wanted to sign a problem named service superlu you would type UNIX NS sign problem service superlu usernamet netsolve your example domain This will produce a file named superlu nsp This is the signed problem which can then be installed on a Netsolve software serve
71. an be called at any time in the user s program in C netslmajor col netslmajor row or in Fortran77 CALL FNETSLMAJOR col CALL FNETSLMAJOR row All of the subsequent calls to NetSolve will assume the corresponding major The default values are of course row wise for C and column wise for Fortran77 Limitations of the Fortran77 interface Due to Fortran77 s restrictions for the use of pointer and its inability to dynamically allocate memory the Fortran77 interface to NetSolve does not support the PACKEDFILES and STRINGLIST object type It also does not support output objects of type STRING Built in examples C and Fortran77 examples are included in the NetSolve distribution in NETSOLVE ROOT src Examples To build them modify the Makefiles as needed in each example directory The examples use different problems that are available on servers at the University of Tennessee They should help the user to understand how the system works We also have full examples in C and Fortran in Appendix C and Appendix D 23 Chapter 6 Matlab Interface Introduction Building the Matlab interface by typing UNIX make matlab in the directory NETSOLVE ROOT produces the following fourmex files SNETSOLVE_ROOT bin S NETSOLVE_ARCH netsolve mex SNETSOLVE_ROOT bin SNETSOLVE_ARCH netsolve_nb mex SNETSOLVE
72. ber gt specifies the number of objects in input to the problem This line is followed by that corresponding number of object descriptions see below QOBJECT object type data type name specifies an object type data type and name The name is only used for presentation purposes This line is followed by a mandatory textual description of the object The data types are abbreviated by replacing NETSOLVE I by I NETSOLVE CHAR by CHAR NETSOLVE BYTE by B NETSOLVE FLOAT by S NETSOLVE DOUBLE by D NETSOLVE SCOMPLEX by C and NETSOLVE DCOMPLEX by 2 see Table 17 1 Similarly the object types are abbreviated by replacing NETSOLVE SCALAR by SCALAR NETSOLVE VECTOR by VECTOR NETSOLVE MATRIX by MATRIX NETSOLVE SPARSEMATRIX by SPARSEMATRIX NETSOLVE FILE by FILE NETSOLVE PACKEDFILES by PACKEDFILES NETSOLVE UPF by UPF SOLVE STRING by STRING and NETSOLVE STRINGLIST by STRINGLIST see Table 17 2 The ek of object type FILE STRING UPF and PACKEDFILES do not have a data type Here are a few examples OBJECT VECTOR I X An integer vector named X 87 Chapter 1 he Problem Description rile GOBJECT MATRIX D A A double precision real matrix named A OBJECT FILE foo A file na
73. ble to the forecaster when it makes its request A nameserver must be started first in an NWS system as all other NWS processes depend upon it After starting the nameserver memories can then register themselves and sensor or forecaster processes can be initialized on any host The default port numbers reserved for the NWS processes nameserver memory forecaster and sensor are specified in the file SNETSOLVE ROOT include nwsutils h The integration of NWS into NetSolve requires the startup of NWS processes their management and the accurate use of the forecaster The NWS processes nameserver memory forecaster and sensor can be started in various places within NetSolve We now present our design for the integration and motivate our choices NetSolve agent and the NWS nameserver memory and forecast As previously stated only one NWS nameserver can exist in an NWS system and this process must be placed in NetSolve where it will have full knowledge of the computational resources and be visible to all components of the NetSolve system The Netsolve agent is the brain of the NetSolve system knowing how many resources exist and where they are located and making all decisions on the execution of requests in the system Moreover the NetSolve agent is known by all components of the NetSolve system Thus the logical choice for the placement of the NWS nameserver is on the NetSolve agent During the agents initialization a
74. blocking fashion 151 C For dges Vo Appendix D Complete rortran Example the right hand side is overwritten C with the solution WRITE Calling NetSolve for dgesv non blocking CALL F NET SLNB dgesv REQUEST M 1 A2 MAX PIVOT B2 MAX IERR IF RE QUE ST LT 0 THEN CALL FN STOP END IF WRITE x Ok H E 14 CON UE NET TSLERR REQUEST Request INFO being processed Probing uz f SLPR REQUEST INFO IF IN 21 CON GO END IF IF I FO 21 FEL TIN TO FO EQ NetSolveNotReady THEN II 1 50 II 3 II U 1 gt p EQ NetSolveOK ETSLWT REQUEST INFO E 0 THE T H Cannot solve for this Matrix and right hand side JOokckckck ck ck ck k kk kk Success Jokckckckckck kc ck k kk kl d Result pr B2 I 16 CON C Calling Net solve for linsol in a blocking fashion For linsol the right hand side is overwritten with the solution WRITE Calling NetSolve for linsol blocking CALL F NET SL linsol INFO M 1 A3 MAX B3 MAX IF INFO LT O THEN CALL FNETSLERR INFO ELSE WRI E
75. c using already generated matrices a b and c In 17 aC a 2a I Qut t S709 9 X9 Ty 226s 3 L4 39 6 Lr ie ade Ig 9 6L5 9 ke LE In 18 be ub Out 1 8 1 Ae I9 I 4 12 Ib 4 12 Ir I0 30 I4 42 6 I 9 gt 2V 1 In 19 request NetSolve zmatmul ac bc contacting server cetus2a cs utk edu Out 19 0 In 20 NetSolveProbe request Out 20 0 As the computation is still in progress the user can choose to perform other work or wait for the request to complete In 21 NetSolveWait request Out 21 1 1 340 340 I 415 415 I 1 330 330 I 675 4 6754 1 Catching Errors As in the Matlab interface it is possible to detect errors with the functions NetSolveError and NetSolveErrorMsg The first function returns an integer which is the error code of the last executed NetSolve function Net SolveErrorMsg takes an error code as an input argument and returns a string describing the error With these two functions it is possible to write Mathematica scripts that call NetSolve and handle all of the NetSolve errors at runtime 39 Chapter Mathematica Interface Demo A NetSolve Mathematica demo is available with the NetSolve distribution It invokes and explains the various NetSolve features available within Mathematica The main script is called NSdemo m and is located in SNETSOLVE ROOT src Testing mathematica To run the demo
76. case of an error the request handler actually contains the negative NetSolve error code The next step is to check the status of the request As in the Matlab interface the user can choose to probe or to wait for the request Probing is done by calling netslpr or FNETSLPR which returns a NetSolve error code CALL FNETSLPR REQUEST INFO and in C info netslpr request Typical error codes returned are NetSolveNotReady and Net SolveOk see Chapter 27 Waiting is done by using netslwt or FNETSLWT This function blocks until the computation is complete and the result is available Here is the Fortran77 call CALL FNETSLWT REQUEST INFO and the C call info netslwt request If the call is successful the function subroutine returns the error code Net SolveOK and the result is in the user memory space Catching errors Given a NetSolve error code there is a function in the C and Fortran77 interface that prints explicit error messages to the standard error The C call is netslerr info and in Fortran77 22 Chapter 5 C and rortran Interfaces CALL FNETSLERR INFO The user should refer to Chapter 27 for a list of all possible error codes Row or column major To allow the NetSolve user to store her his matrices either in row wise or column wise fashion we also provide the function net slmajor in C and FNETSLMAJOR in Fortran77 This function c
77. chanisms of the underlying GridRPC implementation such as the NetSolve agent grpc function handle init creates a new function handle with a server explicitly specified by the user grpc function handle destruct releases the memory associated with the specified function handle 110 Chapter z1 Griakr C grpc get handle returns the function handle corresponding to the given session ID that is corresponding to that particular non blocking request GridRPC Call Functions The four GridRPC call functions may be categorized by a combination of two properties block ing behavior and calling sequence A call may be either blocking synchronous or non blocking asynchronous and it may use either a variable number of arguments like printf or anargument stack calling sequence The argument stack calling sequence allows building the list of arguments to the function at runtime through elementary stack operations such as push and pop grpc call makes a blocking remote procedure call with a variable number of arguments grpc call async makes a non blocking remote procedure call with a variable number of arguments grpc call argstack makes a blocking call using the argument stack e grpc call argstack async makes a non blocking call using the argument stack Asynchronous GridRPC Control Functions The following functions apply only to previously submitted non blocking requests grpc probe checks whether the asynchrono
78. cies amongst these modules The graph is acyclic because looping control structures are not allowed within the sequence and therefore a node can never be its own descendant The Application Programming Interface For request sequencing we add three functions to the NetSolve client API void netsl sequence begin This function takes no arguments and returns nothing It notifies the NetSolve system to collect information from subsequent calls to nets1 from which to construct a DAG as explained above The netsolve services will not be scheduled for execution until a subsequent call to netsl sequence end int netsl sequence end void This function takes as arguments an NS NULL terminated list of pointers For technical reasons the user must use the special variable NS NULL defined in the net solve h header file These pointers are to be references to objects designated as output pointers in previous calls made to nets1 after the most recent call to nets1 sequence begin These pointers designate to the NetSolve system which output parameters NOT to return to the client program In other words these output parameters serve only as intermediary input to calls within the chain or sequence At the point where netsl sequence end is called the NetSolve system will transfer the collected sequence in the form of a DAG to a computational server s for execution netsl sequence end returns an error code that ca
79. ctave netsolve NetSolve List of available problems BLAS wrappers Level3 dmatmul BLAS wrappers Level3 zmatmul BLAS Levell daxpy BLAS Levell ddot BLAS Levell zaxpy BLAS Level2 dgemv BLAS Level3 dgemm BLAS Level3 zgemm LAPACK wrapper Simple Eig and Singular eig gt gt Where each line contains a full problem name If the user would like more detailed information on a specific problem for example eig he can type octave gt gt netsolve eig 117 Chapter 25 Using Octave with Netsolve The output produced by this command is as follows ig Wrapper around the LAPACK routine DGEEV Simplified version of DGEEV Computes th igenvalues of a double precision real matrix A Returns two double precision real vectors containing respectively the real parts and the imaginary parts of the eigenvalues MATLAB Example r i netsolve eig a objects in INPUT input 0 Matrix Double Precision Real Matrix A 2 objects in OUTPUT output 0 Vector Double Precision Real Real parts of the eigen values output 1 Vector Double Precision Real Imaginary parts of the eigen values Output Objects 0 and 1 can be merged This output gives a short description of the problem an example in Octave using netsolve the input objects that must be supplied by the user and the output that will be returned to the user The particular problem requires on
80. cts of a given problem we need to develop some kind of syntax We decided to term this syntax mnemonics A mnemonic is a character string typically 2 or 3 characters long that is used to access low level details of the different input and output objects We index the list of objects starting at 0 Therefore the first object in input to a problem is the input object number 0 and the third object in output to a problem is the output object number 2 for instance We use an I or an O to specify whether an object is in input or output Here are the eight types of mnemonics for an object indexed x Pointer to the data I O x Number of rows n 11 0 x only for matrices vectors packed files and string lists Number of columns n I O x only for matrices Leading dimensions 1 110 x only for matrices e Special descriptor d I O x only for distributed memory objects Nonzero values of the sparse matrix f I O x Row pointers for the sparse matrix p I O x Column indices for the sparse matrix i I O x For example m14 designates the number of rows of the input object number 4 whereas 01 designates the pointer to the data of output object number 1 In the following discussion we describe the different sections that are necessary to build a problem description file and will see how the mnemonics are used Sections of a Problem Description The structure of a problem description file is very similar to that
81. cute and not a workload estimate obtained at a time prior to the request There are also other characteristics of distributed metacomputing resources such as the CPU speed of the resource the amount of physical memory of the resource as well as the latency bandwidth from the client to the computational resource that can be effectively utilized in scheduling decisions for the computational resources The Network Weather Service NWS is a system which provides a way of forecasting dynamically changing performance characteristics such as the workload from distributed metacomputing resources Integrating NWS into NetSolve improves the load balancing strategy by taking into account the future load instead of the current load of the computational resources Using NWS To use NWS within NetSolve one must enable the NWS feature by typing UNIX configure with nws NWS DIR during the configure phase of NetSolve where NWS DIR denotes the location of the NWS directory NWS is downloadable from the NWS web page http nws cs ucsb edu Note Note NWS_DIR bin ARCH should be in your PATH NWS Components utilized in NetSolve Nameserver This process implements a DNS like directory capability used to bind process and data names with low level contact information It knows which hosts are running in the NWS system and provides a database name location function for the NWS processes To ensure that all hosts are known and well referenced ther
82. d Octave Octave is available from http www octave org The user should use the configure option with octave include to specify the path for the Octave include directory You may also need to include the configure option enable shared when building Octave The user should set the environment variable NETSOLVE ROOT to the top level NetSolve directory before building the interface For instance UNIX setenv NETSOLVE ROOT path to NetSolve To build the Octave interface type UNIX make octave In the top level NetSolve directory NETSOLVE ROOT The following files will be created on a successful build SNETSOLVE ROOT bin S NETSOLVE ARCH NS octave netsolve oct SNETSOLVE ROOT bin SNETSOLVE ARCH NS octave netsolve nb oct SNETSOLVE ROOT bin S NETSOLVE ARCH NS octave libnsoct so The above files are the Octave interface to NetSolve and should be made accessible to Octave In the following sections the user will learn to call new functions netsolve and netsolve_nb from octave What to Do First Let us assume that the user has compiled the Octave interface set an agent name started an Octave session and is now ready to use NetSolve In this section we describe those features of the interface that allow to the user to obtain information about the currently available NetSolve system To obtain a list of solvable problems from Octave type the following command o
83. d with the NetSolve distribution as default numerical software for the server The user has now two possible courses of action to find out about the problem Let us assume that the user chooses to use the UNIX command line management tools see Chapter 16 for a complete description of these tools The alternative would be to use the CGI scripts on the NetSolve homepage the Section called Expanding the Server Capabilities in Chapter 13 shows how the servers specify the calling sequence to a given problem It is usual for servers to enforce the same calling sequence as the original numerical software and to give a problem the name of the original library function In the example dgesv is the name of an LAPACK subroutine and the user can therefore expect the calling sequence for the problem dgesv to match the one of the subroutine One can see in the problem list returned by NS problems a problem called 1inso1 In this example 1insol is a simplified version of dgesv and has a simplified calling sequence chosen by whomever started the first server that provides access to that problem Since 1inso1 is not the name of an LAPACK subroutine its calling sequence can be arbitrary UNIX NS problems netsolve cs utk edu LAPACK LinearSystems dgesv LAPACK LinearSystems linsol gt En Next two situations are possible First the user already knows the numerical software e g LAPACK and may even have code already written in terms of this soft
84. de the function dgemm provided by the BLAS package http netlib org blas you only have to uncomment the line problems blas_subset In the file SNETSOLVE ROOT server config NetSolve provides a subset of the BLAS package in the NetSolve directory SNETSOLVE_ROOT src SampleNumericalSoftware BLAS Hint NetSolve also provides a subset of LaPack If you want to include the complete LaPack uncomment problems lapack In SNETSOLVE_ROOT server_config and rerun configure with the following additional options with blaslib path to libblas a with lapack lib path to liblapack a Note All these steps have to be performed at the machine where your server is running Also make sure to kill the server if it is currently running 136 Appendix A Netsolve Lutorials 3 Invoking the Function Via NetSolve The file myprog c demonstrates how to invoke the function calc via NetSolve in C When you compile it you have to provide the include and library directory of NetSolve If you have set the NETSOLVE_ROOT environment variable to your NetSolve directory and running this tutorial on x86 under Linux the command would be UNIX gcc myprog c o myprog IS NETSOLVE ROOT include lnetsolve LS NETSOLVE ROOT 1ib i686 pc linux gnu Invoking myprog uses 3 arguments matrix size integer with the dimension of the used matrix mode 1 blocking call 2 non blocking call 3 task farming rout
85. de uses Legion data flow graphs to keep track of data dependencies This effort has been extended only to the FORTRAN interfaces and was done by the Legion group at the University of Virginia metaNEOS The metaNEOS project http www unix mcs anl gov metaneos integrates fundamental algorithmic research in optimization with research and infrastructure tool development in distributed systems management Algorithms that can exploit the powerful but heterogeneous high latency and possibly failure prone virtual hardware platform typical of metacomputing Chapter z Kelated Projects and Systems platforms have been developed in such areas as global optimization integer linear optimization integer nonlinear optimization combinatorial optimization and stochastic optimization Ninf Ninf http ninf apgrid org and NetSolve are remote computing systems which are oriented to provide numerical computations These two systems are very similar to each other in their design and motivation Adapters have been implemented to enable each system to use numerical routines installed on the other NWS Network Weather Service NWS http nws cs ucsb edu is a system that uses sensor processes on workstations to monitor the cpu and network connection It constantly collects statistics on these entities and has the ability to incorporate statistical models to run on the collected data to generate a forecast of future behavior NetSolve has integrated NWS
86. dle all of the NetSolve errors at runtime Demo A NetSolve Matlab demo is available with the NetSolve distribution It consists of a set of Matlab scripts that call NetSolve to compute parts of the Mandelbrot set The main script is called mande1 m and is located in NETSOLVE ROOT src Demo mandelbrot To run the demo just type mandel at the Matlab prompt Optional Testing the NetSolve BLAS interfaces A NetSolve Matlab BLAS test suite is available with the NetSolve distribution and tests a subset of BLAS routines available in the NetSolve distribution The user can test the reference implementation BLAS included in NetSolve or he could have enabled an optimized BLAS library during the configuration phase of NetSolve configure with blaslib BLAS LIB The user must then enable the BLAS in the NETSOLVE ROOT server config file and then he is ready to run this test suite The test suite consists of a set of Matlab scripts that test each of the BLAS interfaces available in NetSolve The main script is called blas_test m and is located in NETSOLVE ROOT src Testing matlab To run the BLAS test suite type blas test at the Matlab prompt Optional Testing the NetSolve LAPACK interfaces A NetSolve Matlab LAPACK test suite is available with the NetSolve distribution If the user enabled LAPACK and BLAS during the configuration phase of NetSolve as instructed in the Section called Enabling the LAPACK librar
87. du 128 169 93 74 0 failures 118 Chapter 25 Using Octave with Netsolve The same information can be obtained from the NetSolve web site under Resources or the management tools in SNETSOLVE ROOT bin S5NETSOLVE ARCH directory Calling netsolve to perform computations The easiet way to perform a numerical computation in NetSolve is to call the function netsolve With this function the user sends a blocking request to NetSolve By blocking we mean that after typing the command in the Octave session the user resumes control only when the computation has been successfully completed on a server The other way to perform computation is to send a nonblocking request as described in later sections Let us continue with the eig example we started to develop in the preceding section The user now knows that he has to provide a double precision square matrix to NetSolve and he knows that he is going to get two real vectors back or one single complex vector He first creates a 300 X 300 matrix for instance octave a rand 300 The call to NetSolve is now gt gt x y netsolve eig a All the calls to netsolve will look the same following a similar convention as those in the Matlab section The left hand side must contain the arguments in the same order as listed in the output description The first argument to netsolve is always the name of the problem After this first argument the input arguments are listed in the sa
88. duction of living creatures The crossover exchanges the information of the chromosomes among individuals Mutation is an operation that imitates the failure that occurs when copying the information of DNA Mutating the individuals in a proper probability maintains the diversity of the population Distributed Genetic Algorithm DGA Since GA is a stochastic and multi point search a lot of iterations are necessary to derive the optimum solution This leads to take a huge time One of the solutions of this problem is performing GA in parallel There are several types of parallel GA Distributed Genetic Algorithm is one of models of parallel GAs In a conventional GA there is only one population In DGA total population is divided into sub populations In each population normal GA operations are performed for several iterations After some iterations some of the individuals are chosen and moved to the other islands This operation is called migration Therefore sometimes sub population is called an island and DGA is called island model After the migration normal GA operations restart again The population size of each island is small That leads the early convergence However because of the existence of migration operation total diversity of the solutions is maintained Compared to the conventional model DGA has higher searching capability It can be said that DGA is suitable model not only from the parallel point of view but also from the searchi
89. e Problem Description rile QCOMP lt mnemonic gt lt expression gt specifies that the number of rows or columns or the leading dimension of an input object has not been supplied as an argument in the calling sequence but can be computed using arguments in the calling sequence Here are some examples COMP mIl 2mIO COMP mIO op mI3 1 performs an addition COMP mI3 array 12 0 performs an indirection COMP mIl 0p array I0 op mI0 1 1 COMP mI2 0p O0p array 11 0 1 op array 10 0 2 COMP mI2 if array 10 0 N mI1 if array 1I0 0 T nI1 op 0 1 conditionals where the op notation is used to perform addition and subtraction and the array notation is used to access the value of a specific element of an array For example m13 is equal to the value of the zero th element of the array 12 This feature of NetSolve is rarely used and is only necessary in routines when the user s array storage differs from the array storage passed to the computational routine A good example of such an occurrence is in the interfaces to the LAPACK routines for band and tridiagonal matrices Pseudo Code QCODE marks the beginning of the pseudo code section QEND CODE marks the end of the pseudo code section The pseudo code is C code that uses the mnemonics described in the Section called Mnemonics This code contains call s to the numerical library function s that the proble
90. e Server Capabilities It is possible to add new functionalities to a NetSolve computational server by specifying additional problem description files in the server configuration file In fact a number of PDFs have been written for a variety of serial and parallel software packages ARPACK Aztec BLAS ITPACK LAPACK MA28 PETSc ScaLAPACK and SuperLU These PDFs are available in the NETSOLVE ROOT problems 63 Chapter 13 Downloading Installing and lesting the Agent and Server directory If a user has one of these software libraries compiled on the architecture to which he is installing NetSolve he can easily add this functionality to his server in three steps During the configure phase of NetSolve specify the configure option s for enabling the respective library Refer to the Section called Installation on Unix Systems using ns install for details This step will set the required variables in the NETSOLVE ROOT conf Makefile S NETSOLVE ARCH inc file Uncomment the respective line in the section PROBLEMS section of the SNETSOLVE ROOT server config file Recompile the server by typing make server in the NETSOLVE ROOT directory Or use the dynamic server feature described in the Section called Dynamic Servers in Chapter 15 by sending kill USR1 to the highest server PID Note If you are enabling sparse iterative sovle or sparse direct solve you will need to
91. e Software server 4 GPG options If you selected to use GPG then you will be prompted to use version 1 2 3 If this version is present in your PATH you can choose to use it Otherwise you may select to download GPG yourself see http www gnupg org or let the script handle this download for you or use a tarball already present You may also skip GPG at this time 5 Finally you will be prompted for any additional arguements to be passed to configure Options are listed below under 2 1 Command line arguements For example if you wanted to limit the number of ports used by NetSolve to 9001 thru 9204 simply enter enable port restriction 6 The script will now configure and build the components selected If successful you should see NetSolve installation complete 7 Starting the Agent bin S NETSOLVE ARCH NS agent 8 Starting the Server You should check the file SNETSOLVE ROOT server config to be sure the AGENT parameter is set for the Agent that you intend to use then run bin SNETSOLVE ARCH NS server 9 To test your installation you can run bin S NETSOLVE ARCH Test Installation on Unix Systems The NetSolve distribution tar file is available from the NetSolve homepage http icl cs utk edu netsolve downloads Once the file has been downloaded the following UNIX commands will create the Net Solve 2 0 directory gunzip c NetSolve 2 0 tgz tar xvf Chapter 5
92. e for 9 AGENT to point to your own NetSolve agent Step 3 Installation of Client Software 1 Compiling ga2k NetSolve First move to client ga2k ns directory LINUX cd NETSOLVE_ROOT C examples gaExample client ga2k ns Then compile ga2k NetSolve Ga2k is our GA implementation and it is modified for NetSolve LINUX gt cd ga2k ns LINUX gt configur nable ms netsolv with netsolve NETSOLVE ROOT LINUX make Then set the NETSOVE AGENT environment variable if it is not already set to your agent LINUX export NETSOLVE AGENT your agent for NetSolve 142 Appendix b C Examples Step 4 Starting the NetSolve Agent Server First start the NetSolve agent LINUX gt cd SNETSOLVE_ROOT bin i686_pc_linux_gnu LINUX agent Then start NetSolve server If you want to use the special configuration file when you start the server you can use f option LINUX server f SNETSOLVE_ROOT server_config rastrigin Start Optimization Start GA optimization using ga2k LINUX cd NETSOLVE_ROOT C examples gaExample client ga2k ns LINUX ga2k ms netsolve O When you use option O the output file fitness out is created In this file the generation and the best value of the generations are illustrated The default function is the Rastrigin function There are several options for ga2k i number of islands p population size in each
93. e is divided into six parts These parts are aimed at the needs of different types of users Therefore it is not necessary for a user to read all chapters of this users guide Part I Introduction This part of the users guide provides a general overview of the NetSolve system as well as a discussion of related projects Part II The User s Manual These chapters are aimed at the average user of NetSolve who is only interested in utilizing the client interfaces They provide installation instructions for the client software a discussion of the available client interfaces and how to utilize specific features of the NetSolve system such as request farming security and user supplied functions and a troubleshooting section to explain error handling within the NetSolve system Part III The Administrator s Manual These chapters are aimed at the user who will be installing and customizing a stand alone NetSolve system They give installation instructions for the agent and server software and the management tools explanations of how to add new software to the NetSolve system and a thorough explanation of the design of features in the NetSolve system such as request farming security and the user supplied function Part IV Miscellaneous Features These chapters provide detailed information on miscellaneous features of the NetSolve system such as the Network Weather Service NWS Condor G Distributed Storage Infrastructure DSI GridRP
94. e must be only one nameserver per NWS system The address of the nameserver process is the only well known address used by the system allowing both data and service to be distributed All NWS processes must register their name their location and their 114 Sensor Memory Chapter zz Using the Network Weather Service function with the nameserver as soon as they are started One role of the nameserver is to know at any time where is the memory corresponding to a sensor The sensor is a monitoring process running on each resource It periodically measures the workload of the resource and sends this information to the memory process described below Moreover it empirically measures the network weather between a collection of specified hosts A sensor executes infinitely to provide recent measurements at any time The earlier the process is started the more numerous are the measurements and thus the more accurate are the forecasts The memory process stores measurements sent by sensors and retrieves measurements for the forecaster As these measurements represent a key in NWS they are immediately written to the memory and stored with a time stamp and a value name corresponding to the host experiment to which they correspond Forecaster The forecaster generates predictions by requesting the relevant measurement history from the memory process As the measurements are continually updated by a sensor the most recent data will be availa
95. e nb probe r Not ready yet 120 status 1 octave gt gt status netsolve nb probe r Result Available status 0 Chapter 25 Using Octave with Netsolve To obtain the result of the computation one must call netsolve_nb with the wait action octave gt gt x y netsolve nb wait r x y 10 1204 0 0 9801 0 8991 0 9801 0 8991 1 0195 0 0 6416 0 6511 As with the netsolve function one can merge the real part and the imaginary part into a single complex vector The typical scenario is to call netsolve nb with the action send then make repeated calls with the action probe until there is nothing more to do than wait for the result The user then calls netsolve nb with the action wait It is of course possible to call netsolve nb with the action wait before making any call with the action probe One last action can be passed to netsolve nb as shown here octave netsolve nb status This command will return a description of all the pending requests Let us see how it works on this last complete example octave gt gt a rand 100 b rand 150 octave gt gt rl netsolve nb send eig a rd request id 0 rl octave gt gt r2 netsolve_nb send eig b rd gt request_id 1 r2 Now let us see what status does 121 Chapter 25 Using Octave with Netdolve octave gt gt netsolve_nb status Net
96. e only object in output Possible preparations could be for instance the creation of workspace test of input values to detect mistakes test of matching dimensions In this case we may want to check that the dimension of vector b agrees with the number of columns of matrix a This can be done as follows CODE if mI1 nI0 return NS_PROT_DIM_MISMATCH The macro NS_PROT_DIM_MISMATCH is defined by NetSolve Other macros available are NS_PROT_BAD_VALUES for invalid input parameters NS_PROT_INTERNAL_FAILURE fora malfunction of the numerical software or NS_PROT_NO_SOLUTION sometimes useful if no numerical solution has been found and the client is interactive Notice the use of for accessing the integers at addresses mI1 and nI0 The second part of the pseudo code consists of calling the function mat vec and is matvec I0 I1 mI0 mI0 A few things can be said on this call First we use the to access integers via the pointers Note that if matvec were a Fortran subroutine we would pass the addresses themselves see Example below Second the leading dimension is taken to be equal to the dimension This code is executed at the server level where the matrix or sub matrix has been received from the client over the network As such it has been stored contiguously in memory and has a leading dimension equal to its number of rows As a general rule the mnemonics 81 I 0 neve
97. e principal should be named netsolve foo bar com UNIX kadmin f you don t have a Kerberos ticket yet kadmin will try to get one for you based on your UNIX username If there is a Kerberos principal for that username and that principal has the ability to create new principals just type in your password when asked to do so Otherwise run kinit to get a ticket for some other principal one that has the ability to create new principals and then run kadmin again UNIX kadmin addprincipal randkey netsolve foo bar com UNIX kadmin ktadd k etc netsolve keytab netsolve foo bar com This will extract the key into the file etc netsolve keytab You can put this keytab any place you want it but it must be on a local filesystem If you put the file on a NFS mounted filesystem then a you will compromise the security of your server by exposing the key to eavesdroppers and b there s a good chance that NFS file locking bugs will cause your NetSolve server to get wedged e While you re at it you might want to define other service principals for the same host For instance a service principal of the form host foo bar com is needed if you want to allow Kerberized logins to that host This is straightforward UNIX kadmin addprincipal randkey host foo bar com UNIX kadmin ktadd host foo bar com f Make sure that etc netsolve keytab is readable only by the UNIX user id that will run the NetSolve server Permissions should be 0
98. e usual procedures of adding a problem to a server should be followed 96 Chapter 18 Security in NetSolve Introduction This version of NetSolve has rudimentary Kerberos support NetSolve components include clients agents and servers Currently the only requests that require authentication are requests that the client makes to the server and of those only the run problem request Other requests could be authenticated an obvious one being kill server but drastic changes along these lines would probably require drastic restructuring of NetSolve For instance a client can currently inform an agent that a particular server is down and the agent will not advertise that server for use in other problems It seems of dubious value to require authentication for such requests until there is a mechanism for specifying the trust relationship between clients and agents An attempt has been made to allow Kerberized NetSolve clients to interoperate with both Kerberized and non Kerberized NetSolve servers In either case the client sends a request to the server An ordinary server will return a status code indicating that he will accept the requested operation By contrast a Kerberized server will immediately return an authentication required error in response to the request The client is then required to send Kerberos credentials to the server before the request will be processed This allows the server to require authentication of the client
99. e values of the nonzero entries length nnz int col index the column index of each entry of the vector A length nnz e int row ptr index to first nonzero entry at each row in col index length size 1 with row_ptr size 1 nnz 138 Appendix A Netsolve Lutorials 2 Installing the Problem to the NetSolve Repository Use idltopdf to convert pebbles idl to pebbles pdf and add the function to the problems list in the file SNETSOLVE_ROOT server_config Set NSPEBBLES LIB to HOME pebbles libpebbles and recompile the server with the command UNIX make server 3 Testing the Software from C and Matlab The file test pebbles c demonstrates how to invoke the newly created function pebbles via NetSolve Compile it with with the following command UNIX gcc test pebbles c o test pebbles IS NETSOLVE ROOT include lnetsolve LS NETSOLVE ROOT lib S NETSOLVE ARCH Running UNIX test pebbles Should give the following output Initializing NetSolve Initializing NetSolve Complet Sending Input to Server visitorl cs utk edu Downloading Output from Server visitorl cs utk edu PEBBLES started size 4 nnz 4 maxrowsize 1 setup phase solution phase writting the solution PEBBLES finished Solution 1 000000 0 500000 gt 0 333333 0 250000 In Matlab run the follwing commnds assuming you have compiled the
100. ection called Testing the Software in Chapter 13 To build the Matlab client interface to NetSolve type UNIX make matlab and to build the Mathematica client interface to NetSolve type UNIX make mathematica After a successful compilation process the appropriate binaries and or libraries can be found in the SNETSOLVE_ROOT bin NETSOLVE_ARCH and or SNETSOLVE ROOT lib S NETSOLVE ARCH directories respectively Thus to execute a NetSolve binary the user must either execute the command from within the SNETSOLVE ROOT bin S NETSOLVE ARCH directory or add this directory name to his UNIX path variable 11 Chapter 5 Downloading installing and testing the Client Note It is recommended that you set the environment variables NETSOLVE_ROOT and NETSOLVE_ARCH prior to running configure Testing the Unix installation Testing solely the client software means that a pre existing NetSolve system will be contacted possibly the default agent and servers running at the University of Tennessee That system can be contacted via the host netsolve cs utk edu which should always be running an agent The step by step procedure to test your NetSolve client installation is as follows 1 cd NetSolve 2 make tester 3 setenv NETSOLVE AGENT netsolve cs utk edu 4 SNETSOLVE ROOT bin 5NETSOLVE ARCHv Test While the tester is running it prints messages about its execution This t
101. ed remotely the user must wait to regain control of the prompt To address this drawback we provide a nonblocking function net solve_nb The user can then do work in parallel and check for the completion of the request later He can even send multiple requests to NetSolve Thanks to the load balancing strategy implemented in the NetSolve agent all these requests will be solved on different machines if possible achieving some NetSolve parallelism Let us now describe this function with the eig example As in the Section called Calling netsolve to perform computation the user creates a 300 x 300 matrix and calls NetSolve gt gt a rand 300 gt gt r netsolve nb send eig a Obviously the calling sequence to net solve_nb is a little different from the one to netsolve The left hand side always contains one single argument Upon completion of this call it will contain a 27 Chapter 6 Matlab Interjace NetSolve request handler The right hand side is composed of two parts the action to perform and the arguments that would be passed to net solve In this example the action to perform is send which means that we send a request to NetSolve Throughout this section we will encounter all of the possible actions and they will be summarized in Chapter 24 Let us resume our example and see what NetSolve answers to the first call to netsolve_nb gt gt r netsolve nb send eig a Sending I
102. ed in con Makefile inc These inc files are included by the Makefiles that build the NetSolve system Manually editing these configuration files is strongly discouraged However details of the NETSOLVE ROOT conf Makefile NETSOLVE ARCH inc file are explained in the Section called Details of the Makefile NETSOLVE ARCH inc File in Chapter 12 Typing make in the Net Solve directory will give instructions to complete the compilation A typical agent and server compilation includes UNIX make standard to build the agent server NetSolve management tools see Chapter 16 and NetSolve test suite see the Section called Testing the Software After a successful compilation process the appropriate binaries and or libraries can be found in the SNETSOLVE ROOT bin NETSOLVE ARCH and or NETSOLVE ROOT lib NETSOLVE ARCH directories respectively Thus to execute a NetSolve binary the user must either execute the command from within the SNETSOLVE ROOT bin SNETSOLVE ARCH directory or add this directory name to his UNIX path variable 62 Chapter 13 Downloading Installing and lesting the Agent and Server Testing the Software Testing the software consists of starting an agent and a server and running a client test the Section called Agent Server Client Test Alternatively the default agent and servers running at the University of Tennessee can be us
103. ed to test the client only see the Section called Testing the Unix installation in Chapter 3 We describe here the step by step procedure that involves manipulations that will be detailed and explained in the following chapters Agent Server Client Test 1 Choose a machine to run the agent server and client say my machine net 2 Edit the file server_config to replace netsolve cs utk edu by my machine net and save the file 3 Then enter the following commands uNIX gt SNETSOLVE_ROOT bin SNETSOLVE_ARCH NS_agent UNIX gt SNETSOLVE_ROOT bin SNETSOLVE_ARCH NS_server UNIX cd NETSOLVE ROOT bin NETSOLVE ARCH UNIX gt Test UNIX gt setenv NETSOLVE_AGENT my machine net While the test suite is running it prints messages about its execution This test tests the C Fortran interfaces as well as farming and sequencing See Chapter 6 for details on how to test the Matlab interface Successful completion of these tests assures you that you have properly installed the NetSolve agent and server If an error is encountered during testing try the following to help resolve the error Check that your envirnoment varibles have been set correctly Try using netsolve cs utk edu for your agent Check for compilation errors Refer to the Troubleshooting section of the Errata file http icl cs utk edu netsolve errata html for NetSolve Expanding th
104. ems into NetSolve First set the environment variable CLASSIC FUNCTIONS PATH LINUX export CLASSIC FUNCTIONS PATH S NETSOLVE ROOT C examples gaExample server Then copy the PDF files from CLASSIC FUNCTIONS PATH NetSolve problems into NETSOLVE ROOT problems LINUX cp CLASSIC FUNCTIONS PATH NetSolve problems NETSOLVE_ROOT problems Then you can add the following lines into PROBLEMS of SNETSOLVE ROOT server config problems rastrigin problems schwefel problems griewank problems ridge problems rosenbrock You can perform make server in SNETSOLVE ROOT directory and service rastrigin and others should be generated in NETSOLVE ROOT bin 5NETSOLVE ARCH 141 Appendix b C Examples LINUX gt cd SNETSOLVE_ROOT LINUX gt make server 3 Install the server config files In these examples there are five test functions 1 Rastrigin 2 Schwefel 3 Griewank 4 Ridge 5 Rosenbrock We prepare five different configuration files one for each function Therefore you can choose your function at each server The configuration files are located at NETSOLVE_ROOT C examples gaExample server NetSolve server_config You can copy these files into NETSOLVE_ROOT directory LINUX gt cp NETSOLVE_ROOT C examples gaExample server NetSolve server_config SNET SOLVE ROOT After finishing the copy you can edit the files At least you should change the valu
105. er options for INFOSERVERFLAGS INFOSERVERFLAGS blank means do not use INFOSERVERFLAGS DINFOSERVER use as part of agent INFOSERVERFLAGS DINFOSERVER DSTANDALONEISERV use in standalone mode INFOSERVERFLAGS INFOSERVER Workload Prober 55 CPU STAT DNS WORKLOAD DSIFLAGS HEHE EH HE AE FE FE AE HE HEE EHH AUXILIARY PACKAGES HEHE EH EE EEE EH HE HEE EHH AUTHENTICATION options are NO AUTH KERBEROS5 AUTHENTICATION DNO AUTH AUTH LIBS MPI DIR usr local mpich MPI INCLUDE DIR MPI DIR include MPI INCDIR I MPI INCLUDE DIR IBP INCDIR IBPLIB IBPOBJS STUB IBPOBJS IBPFLAG GLOBUS DIR Which probes options are NWS NS WORKLOAD include GLOBUS_DIR etc makefile header G LIBS L GLOBUS DIR lib GLOBUS GRAM CLIENT LIBS NetSolve Chapter 12 Lroubleshooting LIBS 56 Chapter 12 Lroubleshooting G CFLAGS GLOBUS_GRAM_CLIENT_CFLAGS I GLOBUS DIR include G LDFLAGS S GLOBUS GRAM CLIENT LDFLAGS LDAP DIR usr local ldap LDAP LIBS L LDAP DIR lib LDAP CFLAGS IS LDAP DIR include LDAP LDFLAGS lldap l1lber Auxiliary Libs HAVE_petsc 0 PETSC DIR src icl2 petsc petsc
106. eral tools have been developed to alleviate these difficulties such tools themselves are usually available on only a limited number of computer systems and are rarely freely distributed Matlab matlab and Mathematica mathematica are examples of such tools These considerations motivated the establishment of the NetSolve http icl cs utk edu netsolve project project The basic philosophy of NetSolve is to provide a uniform portable and efficient way to access computational resources over a network Overview and Architecture The NetSolve project is being developed at the University of Tennessee s Computer Science Department It provides remote access to computational resources both hardware and software Built upon standard Internet protocols like TCP IP sockets it is available for all popular variants of the UNIX operating system and parts of the system are available for the Microsoft Windows 2000 and Windows XP platforms The NetSolve system is comprised of a set of loosely connected machines By loosely connected we mean that these machines are on the same local wide or global area network and may be administrated by different institutions and organizations Moreover the NetSolve system is able to support these interactions in a heterogeneous environment i e machines of different architectures operating systems and internal data representations can participate in the system at the same time Chapter 1 A Netsolve Overv
107. ere the include files can be found SUPERLU LIBis the link line for the SuperLU library LAPACK LIB denotes the name of the LAPACK library BLAS LIB denotes the name s of the BLAS library and P1 DIR denotes the 66 Chapter 13 Downloading Installing and lesting the Agent and Server location of the MPI library assumes the standard MPICH distribution If these libraries are not already available on the user s machine he can download and install the software from the respective webpage SuperLU homepage http www nersc gov xiaoye SuperLU The MA28 library is distributed with NetSolve in SNETSOLVE_ROOT src SampleNumericalSoftware MA28 since a small modification to the library was necessary to enable its use in NetSolve LAPACK can be downloaded from the LAPACK web page http www netlib org lapack lapack tgz If an optimized BLAS library is not available on the user s machine he can view the BLAS FAQ http www netlib org blas faq html 1 6 for details of availability otherwise he can download ATLAS from the ATLAS webpage http www netlib org atlas and it will automatically generate an optimized BLAS library for the installation architecture The user must then uncomment the respective line 4 problems sparse direct solve in the PROBLEMS section of the SNETSOLVE ROOT server config file by removing the from the beginning of the line And lastly the user must compile the server by t
108. es that the software enabled in the problem description file is parallel and uses MPI Thus MPI must be installed on the server to which you are enabling this service Calling Sequence The calling sequence to the problem must be defined so that the NetSolve client using the C or Fortran interfaces can call the problem The material described in this section is ignored by NetSolve when the 88 Chapter 1 Lhe Problem Description rile client is Matlab or Mathematica To clarify let us take an example Let us say that the problem toto takes a matrix in input and returns a matrix in output The call from the Matlab interface looks like gt gt b netsolve toto a for instance However there can be several possible calling sequences from C or Fortran Assuming the following declarations in Fortran DOUBLE PRECISION A M N DOUBLE PRECISION B K L the following calling sequences are all possible CALL FNETSL toto A B M N K L CALL FNETSL toto A M N B K L CALL FNETSL toto M N A K L B The Calling Sequence sub section in the problem description specifies the order of the arguments represented with mnemonics in the C and Fortran interface calling sequence Indeed still with the same example the integer N can be represented by the mnemonic nT 0 and the pointer B can be represented by the mnemonic 00 It is very important to note that the number of rows or colu
109. es the additional software that may be necessary Before you start a tutorial make sure that NetSolve is properply installed by running C test and farm test If these functions do not work consult the NetSolve User Guide and fix the issue The following tutorials are included basic demonstrates the use of the following basic data types int double char includes server library PDF and client program file demonstrates the way of sending files with NetSolve to remotely execute programs includes server library PDF and client program matrix demonstrates the handling of matrices and vectors when performing a matrix vector multiplication includes client program sparse demonstrates how to include your own software library on the basis of an example which uses a solver for sparse linear systems ie it uses the sparse matrix format includes server library PDF and client program Tutorial for basic data types int double char This tutorial develops a little library which performs a basic operation on two numbers It shows how to compile and include the problem into the NetSolve repository and how to invoke the function This include the following steps 1 Building the library 2 Installing the problem to the NetSolve repository 3 Invoking the function via NetSolve Requirements The following files are needed they should be in the current directory 131 Appendix A Netsolve Lutorials e libcalc c Co
110. est tests only the C and Fortran77 interfaces Details of this process are explained in the following chapters For more information on the C and Fortran77 interfaces see Chapter 5 Chapter 6 and Chapter 7 detail how to test the Matlab and Mathematica interfaces respectively If an error is encountered during testing refer to the Troubleshooting section of the Errata file http icl cs utk edu netsolve errata html for NetSolve If the error experienced is not listed here you can email netsolve cs utk edu for assistance Installation on Windows systems NETSOLVE NETSOLVE NETSOLVE This section describes the installation and testing of the Windows version of the NetSolve client software At present the software is distributed in the form of a self extracting exe file The Windows client only works with Windows 2000 and Windows XP It will not run on Windows 98 or earlier The contents of the self extracting exe file are as follows where NETSOLVE_DIR refers to the directory where you have unzipped the distribution _DIR This directory contains the readme file and an installation script _DIR lib This directory contains the NetSolve client library _DIR matlab This directory contains the Matlab binaries 12 Chapter 5 Downloading installing and testing the Client NETSOLVE DIRNtools This directory contains various tools for managing NetSolve N
111. etSolve octave gt gt a rand 300 octave gt gt r netsolve nb send eig a Obviously the calling sequence to netsolve nb is a little different from the one to netsolve The left hand side always contains one single argument Upon completion of this call it will contain a NetSolve request handler The right hand side is composed of two parts the action to perform and the arguments that would be passed to netsolve In this example the action to perform is send which means that we send a request to NetSolve Through out this section we will encounter all of the possible actions and they will be summarized in chapter 22 Let us resume our example and see what NetSolve answers to the first call to netsolve nb octave gt gt r netsolve nb send eig a rd request id 0 netsolve_nb returns a request handler 0 This request handler will be used in the subsequent calls to the function The request is being processed on cupid and the result will eventually return The user can obtain this result in one of two ways The first one is to call netsolve nb with the probe action octave status netsolve nb probe r netsolve nb returns the status of a pending request The right hand side contains the action as is required for netsolve nb and the request handler This call returns immediately and prints a message Here are the two possible scenarios octave gt gt status netsolv
112. ew the BLAS FAQ http www netlib org blas faq html 1 6 for details of availability otherwise he can download ATLAS from the ATLAS webpage http www netlib org atlas and it will automatically generate an optimized BLAS library for the installation architecture The ITPACK library is distributed with NetSolve in SNETSOLVE ROOT src SampleNumericalSoftware ITPACK since a small modification to the library was necessary to enable its use in NetSolve The user must then uncomment the respective line d problems sparse iterative solv in the PROBLEMS section of the SNETSOLVE ROOT server config file by removing the from the beginning of the line And second the user must compile the server by typing make wrappers and make server in the NETSOLVE ROOT directory Enabling Sparse Direct Solvers SuperLU and MA28 NetSolve offers a sparse direct solve service as a convenient interface to sparse direct methods packages such as SuperLU and MA28 If the user would like to enable SuperLU or MA28 within NetSolve he must perform the following steps During the configure phase of the NetSolve installation type for example to enable SuperLU UNIX configure with superlu SUPERLU DIR with superlulib SUPERLU LIB with lapacklib LAPACK LIB with blaslib BLAS LIB with mpidir MPI DIR with ma28 where SUPERLU DIR denotes the location of the SuperLU directory wh
113. ey expires in n months lt n gt y key expires in n years Key is valid for 0 Specify a reasonable expiration date here It is recommended that you not generate a key that doesn t expire Real name Enter your real name here Email address This should be an address that is specifically associated with NetSolve rather than your normal email address since you want to have different keys for NetSolve than for ordinary GPG signatures If your mail server supports subaddresses you might try using a syntax like username netsolve your example domain Comment Enter something descriptive here such as Netsolve key Enter passphrase 74 Chapter 15 Kunning the Netdolve Server Now enter a pass phrase which will be used to encrypt your private key You will need to use your passphrase when signing a problem Pick a phrase that you will remember but which nobody else will guess Several nonesense words or random seeming characters are better than short easily recognized phrases 2 Getting the key signed First you need to export your key This can also be done directly using gpg or with the provided script NS export key NS export key takes two parameters first your key id you can use the email address that you entered above followed by the name of the file you wish to export to UNIX2NS export key usernametnetsolve your example domain yourkey gpg Or UNIX gt gpg export usernametnetsolve your ex
114. f 15 possible simultaneous requests Dynamic Servers Previously NetSolve servers had been designed such that a server has a specific set of problems which cannot be modified once the server has been started If the server provider needed to make any modification he had to bring down the server make the modification and compile it again In any Grid environment however this could be a big maintainance issue However now the server code has been modified in such a way that the server provider can just modify the NETSOLVE ROOT server config file adding or removing a problem and then running the executable NS updateserver NS updateserver takes two parameters first the Agent name then the name of the Server to be updated 71 Chapter 12 Kunning the Netdolve Server UNIX gt NS_updateserver lt agent name gt lt server name gt This would send a signal to the server on receiving this signal from the user the server would read the SNETSOLVE_ROOT server_config file and make the neccessary changes dynamically The new changes could be seen by using the SNETSOLVE_ROOT bin SNETSOLVE_ARCH NS_problems tool Hardware Software Servers The current NetSolve has been modified in a way that servers can be registered as a Hardware Software server a Hardware server or a Software server When a server is started it is by default a Hardware Software server It provides it s own problems to
115. fact only the first character is used by NetSolve 126 Chapter 26 Fortran Reference Manual We describe here all the possible calls to NetSolve from Fortran All these calls return a NetSolve code status The list of the possible code status is given in Chapter 27 CALL FNETSL lt problem name gt INFO Sends a blocking request to NetSolve FNETSL takes as argument the name of the problem an integer and the list of arguments in the calling sequence See the Section called What is the Calling Sequence in Chapter 5 for a discussion about this calling sequence When the call returns the integer INFO contains the NetSolve status code If the call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence CALL FNETSLNB problem name gt INFO Sends a nonblocking request to NetSolve FNETSLNB takes as argument the name of the problem an integer and the list of arguments in the calling sequence See the Section called What is the Calling Sequence in Chapter 5 for a discussion about this calling sequence It returns the NetSolve status code integer status If the call is successful status contains the request handler CALL FNETSLWT request handler INFO Waits for a request completion FNETSLWT takes as argument a request handler and an integer When the call returns INFO contains the NetSolve status code If t
116. for that address to NOT be the normal address of the user who runs the NetSolve hardware server For example it might be useful to set up an alias named ns hw server mydomain org that gets forwarded to joe sysadmin mydomain org 3 Decide how much to trust the netsolve master key If you want your hardware server to be able to accept code signed by other netsolve developers that we the primary developers trust you will need to change the parameters to trust the netsolve master key By default this key was trusted but that s because it was signed by the netsolve hardware server key which you have deleted Having created your own key you now need to re establish trust from that key in the netsolve master key If you want to trust the netsolve master key you must do two things sign the key change the trust parameters in the key to indicate that it is trusted If you do not want to trust it you should not sign the key But you should change the parameters anyway to indicate that you don t trust it just to be sure To sign the key do UNIX gt gpg sign key netsolve master it will prompt you for the duration of your signature and your passphrase To change the trust parameters do UNIX gt gpg dit key netsolve master At the prompt type trust gpg will then display something like this pub 2048R AABD3F7C created 2003 07 12 expires never trust f f 1 NetSolve Master Key lt netsolve master netlib org gt
117. gpg list sigs How to add a key to NetSolve server s keyring The person whose key you want to add needs to send it to you in a file He can extract it into a file by doing UNIX gt gpg export key id gt key gpg Then once you ve verified that this key really belongs to that person you can do UNIX gt gpg import key gpg Then you can sign the key and or change its trust parameters per the examples above How to delete a key UNIX gt gpg delete key key id 78 Chapter 12 Kunning the Netdolve Server See the gpg man page or other gpg documentation for more information 79 Chapter 16 NetSolve Management Tools for Administrators The NetSolve distribution comes with a set of tools to manage query a NetSolve system After compiling the tools as explained in the Section called Installation on Unix Systems using ns install in Chapter 13 the following six executables are available NETSOLVE ROOT bin SNETSOLVE ARCH NS conf NETSOLVE ROOT bin SNETSOLVE ARCH NS problems NETSOLVE ROOT bin SNETSOLVE ARCH NS probdesc NETSOLVE ROOT bin SNETSOLVE ARCH NS killagent NETSOLVE ROOT bin SNETSOLVE ARCH NS killserver NETSOLVE ROOT bin 5NETSOLVE ARCH NS killall Let us review these executables one by one NS config This executable takes one argument on the command line the name of a host running a NetSolve agent UNIX NS config netsolve cs utk edu It prints the list of hosts participating in the NetSolve system AGENT
118. he NETSOLVE ROOT bin NETSOLVE ARCH directory After this compilation you can also find a shell script named NS pdfgui that can be used from any directory to properly run the GUI application which needs to locate the abovementioned classfiles Apart from being easy to use the GUI also has a help menu that offers great help so we defer other details about running the GUI to those help files One note that we must mention is that currently the GUI does not have the capability of loading PDFs so while using it to create PDFs we recommend keeping the GUI open until you are assured the PDF is correct This prevents having to start from scratch once errors are found to exist in the PDF PDF Wizard There is a newer PDF generator available online as a Java Applet This can be found from the NetSolve Web Site http icl cs utk edu netsolve This applet can assist with the process of creating the Problem Description File PDF Documentation for using the PDF Wizard is availble online as well You can find screen by screen descriptions there to help with using the PDF Wizard NetSolve IDL Simplified PDF In an effort to help the library writers to easily integrate their problems into NetSolve we are developing an IDL Interface Definition Language for NetSolve The NetSolve IDL has a simpler format than the existing PDF Problem Description File mechanisms Example 1 An example IDL is given below PROBLEM dgesv
119. he call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence during the call to FNETSLNB CALL FNETSLPR request handler INFO Probes for a request completion FNETSLPR takes as argument a request handler and an integer When the call returns INFO contains the NetSolve status code If the call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence during the call to FNETSLNB CALL FNETSLERR error code Displays an explicit error message given a NetSolve error code CALL FNETSLMAJOR lt major gt Sets the way the user has stored her matrices row or column wise The argument can be col or row It is case insensitive and in fact only the first character is used by NetSolve 127 Chapter 27 Error Handling in NetSolve If an error occurs during the invocation of NetSolve a variety of diagnostic runtime error messages as well as error codes that can be returned when calling a NetSolve function from the C or Fortran interfaces are provided Table 27 1 lists all of the possible error codes that can be returned when invoking a NetSolve function from the C or Fortran interfaces These error codes are listed in the SNETSOLVE ROOT include netsolveerror h include file Each of these return codes has an equivalent runtime error message also lis
120. he function handle represents a mapping from a function name to an instance of that function on a particular server The GridRPC API does not dictate the mechanics of resource discovery since different underlying GridRPC implementations may usevastly different protocols Once a particular function to server mapping has been established by initializing a function handle all RPC calls using that function handle will be executed on the server specified in that binding A session ID is an identifier representing a particular non blocking RPC call The session ID is used throughout the API to allow users to obtain the status of a previously submitted non blocking call to wait for a call to complete to cancel a call or to check the error code of a call Initializing and Finalizing Functions The initialize and finalize functions are similar to the MPI initialize and finalize calls Client GridRPC calls before initialization or after finalization will fail grpc initialize reads the configuration file and initializes the required modules grpc finalize releases any resources being used by GridRPC Remote Function Handle Management Functions The function handle management group of functions allows creating and destroying function handles grpc function handle default creates a new function handle using the default server This could be a pre determined server name or it could be a server that is dynamically chosen by the resource discovery me
121. ically transferred from the software server to the hardware server This however is done only once when the software arrives at the hardware site the hardware server can cache the software The hardware server administrator decides the caching policy Currently the hardware server can cache a maximum of 10 problems and after that it removes the problem on LRU basis To mark a problem as non moveable i e the problem cannot be moved by the Hardware Software server feature to another server use the MOVEABLE 0 statement in the problem description file This applies for problems which depends on specific software installed on a particular machine which may not be available on other servers e g SCALAPACK Hardware Software Server Security Due to the software transfer between the Software Server to Hardware Servers there exists a need to ensure the code being transfered can be trusted Security is important to prevent any malicious code from being executed on the Hardware Server Keeping this in mind the NetSolve team has implemented a security mechanism in NetSolve using GPG 72 Chapter 12 Kunning the Netdolve Server GnuPG stands for GNU Privacy Guard and is GNU s tool for secure communication and data storage It can be used to encrypt data and to create digital signatures It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC 2440 As such i
122. id Forum Research Group on Programming Models apme The initial work on GridRPC reported in grpcapi shows that client access to existing grid computing systems such as NetSolve and Ninf ninf can be unified via a common API a task that has proven to be problematic in the past Starting with version 2 0 NetSolve includes an implementation of the GridRPC API Use of this API is optional and has not superseded the original NetSolve API For full details of the specification of the GridRPC API see grpcapi Compilation Instructions You should configure NetSolve before attempting to compile the GridRPC library Compiling all of NetSolve isn t necessary to compile the GridRPC client library however the NetSolve client library will be automatically built first if it hasn t been built already Therefore to build the GridRPC API from the NETSOLVE_ROOT it should suffice to simply type UNIX make gridrpc This creates a file named SNETSOLVE ROOT lib S NETSOLVE ARCH libnsgrpc a as well as the NetSolve client library if necessary named SNETSOLVE ROOT lib S NETSOLVE ARCH libnetsolve a Testing Of course this requires that you have access to a NetSolve agent and server running somewhere You can start your own or use the agent at netsolve cs utk edu In any case don t forget to set your NetSolve environment variables UNIX S NETSOLVE ROOT bin NETSOLVE ARCH C test grpc Add
123. iew Figure 1 1 The NetSolve System A NS Applications Client Librar Users VEN NS Agent Resource Discovery Load Balancing Resource Allocation Fault Tolerance Server Server Server JU Figure 1 1 shows the global conceptual picture of the NetSolve system In this figure we can see the three major components of the system The NetSolve client The NetSolve agent The NetSolve computational resources or servers The figure also shows the relation NetSolve has to the applications that use it NetSolve and systems like it are often referred to as Grid Middleware this figure helps to make the reason for this terminology clearer The shaded parts of the figure represent the NetSolve system It can be seen that NetSolve acts as a glue layer that brings the application or user together with the hardware and or software it needs to complete useful tasks At the top tier the NetSolve client library is linked in with the user s application The application then makes calls to NetSolve s application programming interface API for specific services Through the API NetSolve client users gain access to aggregate resources without the users needing to know anything about computer networking or distributed computing In fact the user does not even have to know remote resources are involved The NetSolve agent maintains a database of NetSo
124. in Chapter 13 section following the notes that talk about authentication and authentication libraries In part this involves editing the 50 Chapter 11 Security in NetSolve Client NETSOLVE ROOT conf Makefile NETSOLVE ARCH inc and modifying the KLIBS field to point to the appropriate Kerberos libraries and setting the AUTHENTICATION field to KERBEROSS Running a Kerberized NetSolve Client 1 Set up the necessary environment variables UNIX gt setenv NETSOLVE_AGENT netsolve agent host 2 Run kinit to get a ticket granting ticket for yourself You don t have to do this if you already have a ticket and it has not expired 3 Run your NetSolve program If the server contacted requires authentication the NetSolve client automatically contacts the Kerberos Key Distribution Center for a ticket and sends it to the server If this client is authorized to utilize the NetSolve server services will be granted to the client if not an AUTHENTICATION_REJECTED error will be returned to the client 51 Chapter 12 Troubleshooting If an error occurs during the invocation of NetSolve a variety of diagnostic runtime error messages as well as error codes that can be returned when calling a NetSolve function from the C or Fortran interfaces are provided The error codes and runtime error messages are listed in Chapter 27 and may have several possible explanations causes If one of these error messages occurs
125. in a region and gives back the total area under the curve Thus using the normal NetSolve call the user would invoke this problem as area netsolve totalarea xstart xend One way to solve this problem is to divide the function into many sub areas and make multiple requests to the totalarea problem passing different start and end points on the x axis The NetSolve program that uses the task farming interface for this method is given below function total area totalarea func a b num strips strip length b a num strips xl cell num strips 1 x2 cell num strips 1 x1 1 a for i 1 num strips funcs i func x2 i xl i strip_length if i lt num_strips x1 1 1 x2 1 end end strl i 0 str2 int2str num strips 1 str strl str2 area netsolve farm str area funcs xl x2 total_area 0 0 for i 1 num strips 44 Chapter Netdolve Request Farming total area total_areatarea i end end fprintf 2 total_area f n total area Current Implementation One of the advantages of farming is that the user does not have the responsibility of managing the requests As it would be unreasonable to send all of the requests if there are not enough servers to perform the computations the nets1_farm farming algorithm avoids this problem by dynamically tuning the maximum number of pending requests to reflect changes in the computational server pool size and load
126. ine 1 custom function matmul in libmatmul c 2 dgemm from the BLAS package Note Be sure to have an agent and your newly compiled server running Also check that the NETSOLVE AGENT enironment variable is set on your client it should be the same value as the AGENT line in server config in the NETSOLVE ROOT directory Tutorial for Sparse Matrices This tutorial shows how to use sparse matrices It also demonstrates how to include an existing application into NetSolve The application to be used is called Pebbles and provides a solver for large sparse linear systems It was developed at the University of Linz Austria and you have to obtain a copy of this software But even if you don t have Pebbles you should be able after reading through this tutorial to handle sparse matrices within NetSolve The tutorial includes the following steps 1 Building and configuring the library 2 Installing the problem to the NetSolve repository 3 Testing the software from C and Matlab Requirements on each server 137 Appendix A Netsolve Lutorials interface cc the wrapper function for Pebbles to NetSolve e outback cc extern h a modification of Pebbles on how to pass options e pebbles idl a modification of Pebbles on how to pass options into the NetSolve repository Interface Definition Language Pebbles information about how to obtain Pebbles at http www numa uni linz ac at Research Projects pebbles html Requirements on the
127. ing else expected from a job queuing system It is a program that manages both a queue of jobs and the resources from one or more sites where those jobs can execute Condor G communicates with these resources and transfers files to and from these resources using Globus mechanisms It is possible to start a NetSolve server as a front end to a Condor pool transparently to the NetSolve user The user now can access grid resources without any interference To Use Condor G with NetSolve Before using Condor G with NetSolve Condor Condor G and Globus should be properly installed and configured Condor and Globus can be downloaded at http www cs wisc edu condor http www globus org To use Condor G with NetSolve one should start a specialized Condor G server in NetSolve This is done by inserting CONDORG lt path gt 1 into NETSOLVE_ROOT server_config file After making server by typing UNIX gt make server one can start the specially configured server Currently the grid resource manager is set at the server side and should be changed accordingly In order to let the NetSolve client be able to use the grid resources the server creator must have the proper permission Globus certificate to use the resources managed by the resource manager Before submitting a problem to Condor G server you have to create a grid proxy by running grid proxy init The user NetSolve client does not need to have permissions to access those
128. ired for signing software for use with NetSolve and the Harfdware Software server are described below Note A problem with MOVABLE set to 1 must be signed to run even on the server that it is located on Software Server Setup Generating a key In order for movable code to be accepted by Netsolve hardware servers the code must be signed In order to sign code you must have a GPG key that is trusted by the Netsolve hardware servers There are three steps to getting this key 1 generating the key 2 getting the key signed by someone the netsolve hardware server trusts 3 incorporating the signed key into your keyring 73 Chapter 12 Kunning the Netdolve Server Generating the key First verify that you have gpg 1 2 3 or later installed UNIX gt gpg version Next generate a key This can be done two ways one using gpg directly the other using the provided script NS gen key found in SNETSOLVE ROOT bin 5NETSOLVE ARCH Type either UNIX NS gen key Or UNIX gt gpg gen key 1 DSA and ElGamal default 2 DSA sign only 5 RSA sign only Your selection Select option 5 when from the choices above You will then see the next screen What keysize do you want 1024 Selecting the default value of 1024 is fine here Requested keysize is 1024 bits Please specify how long the key should be valid 0 key does not expir n key expires in n days lt n gt w key expires in n weeks lt n gt m k
129. is trusted to sign someone s key for email might not be trusted to sign netsolve code These files are stored in a directory that the NetSolve server finds using the environment variable GPGHOME There is a program named ns gpg which is used to affect keys used by the NetSolve server instead of the keys ordinarily used by gpg It is just a shell script that calls gpg with additional options You use it to mainipulate keys and trust parameters just like you would use gpg How to change the default trust parameters If you wish to change the default trust parameters you must go through the following steps delete the netsolve hardware server key create your own key for the hardware server decide whether to trust netsolve master key 1 Delete the netsolve hardware server key UNIX gt gpg delete key netsolve hardware server 2 Create your own key for the hardware server UNIX gt NS_gen_key 76 Chapter 15 Kunning the Netdolve Server gpg will then prompt you for the name and size of the key to use see above We recommend RSA sign only keys A key size of 1024 should be sufficient for most purposes but you may make it larger if necessary If you make it larger signing and verifying will be slower To avoid conflicts the name of the key should be an email address that you control It s also occasionally handy if the person who runs the server can be reached by sending email to the address However it might also be desirable
130. island D problem size dimension g generation number For example LINUX ga2k ms netsolve O i2 p20 D2 g30 Means there are 40 population 2 20 and 30 generations are used for two dimension Rastrigin function If you want to use another test function you can use F option LINUX ga2k ms netsolve O i2 p20 D2 g30 Frosenbrock There are five types of test functions prepared rastrigin Schwefel griewank ridge 143 Appendix b C Examples Rosenbrock 144 Appendix C Complete C Example KK KK KK RR RR RARA A A RR A A RARA RARA kc I kk kk ke e ke x x f Example of the C call to NetSolve This program sends One blocking request for the problem dgesv ss One non blocking request for the problem dgesv and as One blocking request for the problem linsol IR One non blocking request for the problem linsol The problem linsol is a simplified version of dgesv The matrices are stored column wise in a Fortran fashion WARNING The matrix may be singular in which case NetSolve will print out an error message xy uy uA A El Py ee Ef el xy el tf l t7 J KCECKCECKCECKCECKCECKCECKCECKCECKCKCKCECKC A A A A A A A Ck Kk I A A A A ck okck kok ko kk ke ke e ke x e x f include stdio h include netsolve h include stdio h include lt stdlib h gt include lt string h gt include lt ti
131. itional examples are available in NETSOLVE_ROOT src GridRPC To build these example programs UNIX cd NETSOLVE ROOT src GridRPC UNIX make tests Some of these tests rely on software that may not be enabled in your server so if you encounter problems check the file NETSOLVE ROOT server configto verify that the problem description file containing the required problem is enabled 109 Chapter z1 Griakr C Additional Notes on Writing and Compiling GridRPC Programs To use the GridRPC API you should include the header file grpc h in your C program This header file defines the various constants and function prototypes you may need when writing GridRPC programs Also when compiling append NETSOLVE ROOT src GridRPC to your include path This is typically done with the I flag At link time you will need to link the GridRPC client library as well as the NetSolve client library with your program This would normally be specified when linking as Insgrpc Inetsolve Also the library path may need to be specified at this time using LSNETSOLVE_ROOT ib NETSOLVE_ARCH Finally on some platforms such as Solaris you may need to link in additional libraries for certain system calls e g socket If you encounter linker errors try adding Insl Isocket to your link command Function Handles and Session IDs Two fundamental objects in the GridRPC model are function handles and the session IDs T
132. ittle effort the server can be configured to submit the client s request to an existing CONDOR pool collect the results and send them to the client Globus The Globus project http www globus org is developing the fundamental technology that is needed to build computational grids execution environments that enable an application to integrate geographically distributed instruments displays and computational and information resources Such computations may link tens of thousands of these resources In its testing phase is a new NetSolve client which implements a Globus proxy to allow the client to utilize the Globus grid infrastructure if available If not the client resorts to its present behavior IBP Internet Backplane Protocol IBP http loci cs utk edu ibp is a storage management system which serves up writable storage as a wide area network resource allows for the remote direction of storage activities and decouples the notion of user identification from storage Currently available in NetSolve are IBP enabled clients and servers that allow NetSolve to allocate and schedule storage resources as part of its resource brokering This leads to much improved performance and fault tolerance when resources fail Legion Legion http Negion virginia edu has been incorporated in such a way to allow the client user to program using the NetSolve interface while leveraging the Legion meta computing resources The NetSolve client si
133. just type NSdemo at the Mathematica prompt Optional Testing the NetSolve BLAS interfaces A NetSolve Mathematica BLAS test suite is available with the NetSolve distribution and tests a subset of BLAS routines available in the NetSolve distribution The user can test the reference implementation BLAS included in NetSolve or he can enable an optimized BLAS library during the configuration phase of NetSolve configure with blaslib BLAS LIB The user must then enable the BLAS in the NETSOLVE ROOT server config file and then he is ready to run this test suite The test suite consists of a set of Mathematica scripts that test each of the BLAS interfaces available in NetSolve The main script is called NSblastest m and is located in NETSOLVE ROOT src Testing mathematica To run the BLAS test suite type lt lt NSblastest at the Mathematica prompt Optional Testing the NetSolve LAPACK interfaces A NetSolve Mathematica LAPACK test suite is available with the NetSolve distribution If the user enabled LAPACK during the configuration phase of NetSolve as instructed in the Section called Enabling the LAPACK library in Chapter 13 and has enabled LAPACK and BLAS in the NETSOLVE ROOT server config file he she may choose to run this test suite Note that only a subset of LAPACK is included in the NetSolve distribution The complete LAPACK library is not included as default numerical software for the server and must be i
134. l be set to C OPT FLAGS C NOOPT FLAGS determine which Fortran compiler to use set compiler flags that don t deal with optimization ONLY USE IN COMBINATION WITH with fc FFLAGS will be set to F OPT FLAGS F NOOPT FLAGS set compiler optimization flags ONLY USE IN COMBINATION WITH with fc FFLAGS will be set to F OPT FLAGS F NOOPT FLAGS set loader flags location of NWS installation dir location of IBP installation dir use Kerberos5 client authentication which Proxy netsolve globus output level debug view none location of PETSc installation dir location of PETSc library 10 Chapter 5 Downloading installing and testing the Client with aztec AZTEC DIR location of Aztec installation dir with azteclib AZTEC LIB Aztec link line with superlu SUPERLU DIR location of SuperLU installation dir with superlulib SUPERLU LIB SuperLU link line with ma28 if ma28 is to be included in the NetSolve services with itpack if itpack is to be included in the Net Solve services with arpacklib ARPACK LIB Arpack link line with mpi MPI DIR location of MPI Root Directory with lapacklib LAPACK LIB LAPACK link line with scalapacklib SCALAPACK LIB SCALAPACK link line with blaslib BLAS LIB BLAS link line with blacslib BLACS LIB BLACS link line with mldk MLDK PATH Path t
135. le malloc m sizeof double b2 double malloc Vy b3 double malloc m sizeof double b4 double malloc m sizeof double for i 0 i lt m itt m sizeof double init 2315 init 65536 b1 i double double init 32768 0 16384 0 b2 i bl il b3 i bl il b4 i bl il pivot int malloc m sizeof double Calling Netsolve for dgesv in a blocking fashion For dgesv the right hand side is overwritten X with the solution netslmajor Col fprintf stderr Calling NetSolve for dgesv blocking n info netsl dgesv m 1 al m pivot bl m amp ierr if info lt 0 netslerr info exit 0 if ierr 0 fprintf stderr Cannot solve for this Matrix and right hand side n 146 Appendix C Complete C Example else fprintf stderr Solution n for i 0 i lt m 1 fprintf stderr gt fAn b1 1 Calling Netsolve for dgesv in a non blocking fashion For dgesv the right hand side is overwritten x with the solution f fprintf stderr Calling NetSolve for dgesv non blocking n request netslnb dgesv m 1 a2 m pivot b2 m amp ierr if request lt 0 netslerr request exit 0 fprintf stderr Request d being processed n request fprintf stderr Probing n info netslpr request while info NetSolveNotReady sleep 4 fprintf stderr fflush s
136. le t handle grpc call async grpo function handle t handle grpc call argstack grpc function handle t handle ArgStack args grpc call argstack async grpc function handle t handle ArgStack args Asynchronous GridRPC Control Functions int int grpc probe int sessionID grpc cancel int sessionID Asynchronous GridRPC Wait Functions int int int int int grpc wait int sessionID grpc wait and int idArray int length grpc wait or int idArray int length int idPtr grpc wait all grpc wait any int idPtr Error Reporting Functions void grpc_perror char str char grpc error string int error code int int grpc get error int sessionID grpc get last error Argument Stack Functions ArgStack newArgStack int maxsize int pushArg ArgStack stack void arg void popArg ArgStack stack int destructArgStack ArgStack stack 113 Chapter 22 Using the Network Weather Service Introduction In NetSolve as in other metacomputing systems the scheduling of tasks to available resources is difficult NetSolve uses a limited load balancing strategy to improve the utilization of computational resources This load balancing strategy takes into account the current workload of the computational resources available in the NetSolve system In scheduling the client s requests over a network the workload estimate should be forecast for when the computation will exe
137. lent to a call to LAPACK One detail however needs to be mentioned Most numerical software is written in Fortran77 and requires users to provide workspace arrays as well as data since there is no possibility for dynamic memory allocation Because we preserved the exact calling sequence of the numerical software we require the user to pass those arrays But since the computation is performed remotely workspace on the client side is meaningless It will in fact be dynamically created on the server side Therefore when the numerical software would require workspace the NetSolve user may provide a one length array for workspace This is signaled in the output of NS probdesc by an argument description such as Argument 6 ignored 21 Chapter gt C and rortran Interjaces Nonblocking Call The nonblocking call allows the user to have some sort of NetSolve parallelism The nonblocking version of nets1 is nets1nb Similarly the nonblocking version of FNETSL is FNETSLNB The user calls it exactly as he would call nets1 or FNETSL If the call to nets1nb or FNETSLNB is successful it returns a request handler in the form of a positive integer If it is not successful it returns an error code Continuing with our example CALL FNETSLNB DGESV REQUEST N 1 A LDA IPIV amp B LDB INFO and in C request netslnb dgesv n 1 a max ipiv b max amp info In
138. les contains interfaces to a number of problems subroutines from a particular software library If a particular problem description file is enabled in the server configuration file then the problems subroutines contained therein become available on that server A number of PDFs have been written for a variety of software packages but the default NetSolve installation only enables a small subset as there is only a limited amount of software included with the NetSolve distribution Details of description files are given in the Section called Expanding the Server Capabilities in Chapter 13 RESTRICTIONS marks the beginning of the list of access restrictions that are applicable to the NetSolve server The list consists of lines formatted as domain name number of pending requests allowed The symbol is used as a wildcard in the domain name For instance the line edu 10 means that only 10 requests from clients residing on a edu machine can be serviced simultaneously When the server receives a request from some machine it determines which line in the list must be used to accept or reject the request by taking the most refined domain name For instance if the list of the restrictions is edu 5 utk edu 10 then the server accepts at most 5 simultaneous requests coming from edu machines that are not in the utk edu sub domain and at most 10 requests that come from machines in the utk edu sub domain for a total o
139. like Monte Carlo simulation where multiple simulation runs are executed across different machines and the results from the simulation runs are combined to form the final output The Matlab task farming uses cell function calls in Matlab The NetSolve user needs to have Matlab version 6 x or higher to use this functionality The user calls the matlab task farm as netsolve_farm iterator string problem name argument cell 0 argument cell 1 43 Chapter Netsolve Kequest Farming The iterator string represents the number of requests to be made to the netsolve problem whose name is represented by problem name argument The value of the iterator string assumes the form i 0 number of requests 1 The netsolve arguments needed by the netsolve problem are passed as cells Each cell is a one dimensional array and the size of the cell is equal to the number of requests in the farming Each element in the cell corresponds to a single argument need by the NetSolve problem The i th element corresponds to the argument for the i th request in the farm An example In this example the Matlab task farming interface is invoked to make multiple requests to a NetSolve problem totalarea The inputs to the problem are the name of a function which is a string the starting point on the x axis which is an integer and the ending point on the x axis which is another integer value The problem computes the area of the function under the curve bounded with
140. lve servers along with their capabilities hardware performance and allocated software and dynamic usage statistics It uses this information to allocate server resources for client requests The agent finds servers that will service requests the quickest balances the load amongst its servers and keeps track of failed ones The NetSolve server is a daemon process that awaits client requests The server can run on single workstations clusters of workstations symmetric multi processors or machines with massively parallel Chapter 1 A Netsolve Overview processors A key component of the NetSolve server is a source code generator which parses a NetSolve problem description file PDF This PDF contains information that allows the NetSolve system to create new modules and incorporate new functionalities In essence the PDF defines a wrapper that NetSolve uses to call functions being incorporated The hidden semantics of a NetSolve request are i Client contacts the agent for a list of capable servers ii Client contacts server and sends input parameters 111 Server runs appropriate service iv Server returns output parameters or error status to client No root superuser Administrator privileges are needed to install or use any component of the NetSolve system Who is the NetSolve User There are two types of NetSolve users The first type of user is one who installs and accesses only the client interface s and utilizes existing pools
141. ly one double precision matrix on input Notice that this matrix must be square as stated in the description of the problem If the user tries to call NetSolve for this problem with a rectangular matrix he will receive an error message stating that the dimensions of the input are invalid On output the problems eig will return two vectors the real and imaginary parts of the eigenvalues of the input matrix respectively Since Octave provides a mechanism to manipulate complex objects it is probable that the user would like to have eig return one single complex vector instead of two separate real vectors Thus in the Octave interface it is possible to merge these two real output vectors into one complex vector This point is further developed in the next section The Octave interface has another feature that is concerned not with the actual problem solving but with providing information about the NetSolve configuration itself We have just seen how to get information about the problems handled by the NetSolve servers it is also possible to obtain the physical location of these servers Let us assume that our NETSOLVE AGENT environment variable is set to netsolve cs utk edu The command octave netsolve Produces the following output NetSolve List of available agents netsolve cs utk edu 128 169 93 161 NetSolve List of available servers maruti cs berkeley edu 128 32 36 83 cupid cs utk edu 128 169 94 221 torc3 cs utk e
142. m is supposed to use as part of its algorithm The arguments in the calling sequences of these library routines will be primarily the different mnemonics In the pseudo code the mnemonics are pre and ap pended by a Q to facilitate the parsing Let us review again the meaning of some possible mnemonics in the pseudo code e QI08 pointer to the elements of the first object in input e QmI06 pointer to an integer that is number of rows of the first object in input e n01 pointer to an integer that is number of columns of the second object in output Usually the pseudo code is organized in three parts First the preparation of the input if necessary Second the call to the numerical library function s Third the update of the output pointer and sizes At this point it is best to give an example Let us assume that we have access to a hypothetical numerical C library that possesses a function matvec that performs a matrix vector multiply for square matrices The prototype of the function is void matvec float a float b int n int 1 90 Chapter 1 Lhe Problem Description rile where a is a pointer to the matrix b is a pointer to the vector n is the dimension of the matrix 1 is the leading dimension of the matrix and the result is stored in b overwriting the input We may define the problem such that the matrix is the first object in the input the vector the second object in the input and the result th
143. me h gt include unistd h main int argc char argv int m Size of the matrix and right hand side double al bl Matrix and right hand side for the 1st double a2 b2 Matrix and right hand side for the 2nd double a3 b3 Matrix and right hand side for the 3rd double a4 b4 Matrix and right hand side for the 4th int pivot Vector of pivots returned by dgesv int ierr dgesv error code a Tite d Loop index int init 1325 Seed of the random number generator int info NetSolve error code int request NetSolve request handler if argc 2 fprintf stderr Usage s lt size gt n argv 0 exit 0 call call call call e EN ay e el A A 145 Appendix C Complete C Example if m atoi argv 1 lt 0 fprintf stderr s Should be a positive integer n argv 1 exit 0 Generating the random mxm matrices as well as the random right hand sides EN fprintf stderr Generating the problem n al double malloc m m sizeof double a2 double malloc m m sizeof double a3 double malloc m m sizeof double a4 double malloc m m sizeof double for i20 i m m i init 2315 init 65536 double double init 32768 0 16384 0 al i ey al i In this example we solve 4 times the same problem al i al i a2 i a3 i a4 i bl doub
144. me order as they are listed in the input description This function does not have a fixed calling sequence since the number of inputs and outputs depends on the problem that needs to be solved Let us see what happens when we type octave gt gt x y netsolve eig a x y 10 1204 0 0 9801 0 8991 0 9801 0 8991 1 0195 0 0 6416 0 6511 As mentioned earlier the user can decide to regroup x and y into one single complex vector Let us make it clear again that this possibility is a specificity of eig and is not available in general for all problems To merge x and y the user has to type octave gt gt x netsolve eig a 10 1204 119 Chapter 25 Using Octave with Netsolve 0 9801 048991 0 9801 0 8991 1 0195 0 6416 0 6511 Calling netsolve nb The obvious drawback of the function netsolve is that while the computation is being performed remotely the user must wait to regain control of the prompt To address this drawback we provide a nonblocking function netsolve nb The user can then do work in parallel and check for the completion of the request later He can even send multiple requests to NetSolve Thanks to the load balancing strategy implemented in NetSolve agent all these requests will be solved on different machines if possible achieving some NetSolve parallelism Let us describe this function with the eig example As in the previous section the user creates a 300 x 300 matrix and calls N
145. med foo Output Specification QOUTPUT number specifies the number of objects in output from the problem This line is followed by the corresponding number of object descriptions see below QOBJECT object type data type name specifies an object type a data type and a name This line is followed by a mandatory textual description of the object The abbreviations for data types and object types are as defined previously in the Section called Input Specification Additional Information The following list of tags are optional QMATLAB MERGE numberl number2 specifies that the output objects number lt number1 gt and number2 can be merged as a complex object upon receipt of the numerical results from the Matlab client interface see Chapter 6 QCOMPLEXITY numberl number2 specifies that given the size of the problem say n the asymptotic complexity say C of the problem in number of floating point operations is C numberl n number2 QCUSTOMIZED lt name gt is an internal customization used by the code developers It means that the NetSolve server code will do something different or custom before invoking a routine For example this option is used for the enablement of ScaLAPACK and the sparse solvers The functionality of this keyword will be expanded in the future Novice users are advised to avoid using this keyword e PARALLEL MPI specifi
146. mns or the leading dimension of input and output arguments must be specified in the CALLINGSEQUENCE sub section If a dimension is not passed as an input argument or equivalenced with an existing input argument via ARG it must be set computed using COMP QCALLINGSEQUENCE marks the beginning of a calling sequence description This description consists of a list of argument specifications see below QARG comma separated list of mnemonics gt specifies an argument of the calling sequence For instance the line ARG IO specifies that the current argument in the calling sequence is the pointer to the data of the first object in input The line ARG mIO 110 specifies that the current argument in the calling sequence is the number of rows and the leading dimension of the first object in input which in this case is a matrix The line GARG specifies that the current argument in the calling sequence should be ignored by NetSolve useful in some cases Note that no argument description contains mnemonics of the form m n 0 QCONST lt mnemonic gt lt number gt specifies that the number of rows or columns or the leading dimension of an input object is constant and can not be found in the calling sequence For instance the line CONST mI4 12 means that the number of rows of the fifth object in input is always 12 and is not passed in by the NetSolve user 89 Chapter 1 Lh
147. mponent of the sequence are forbidden within the sequence with the exception of calls to the NetSolve API itself that the system can track This is because during the data analysis only references to the data are stored So if changed the data transferred at the end of the sequence will not be the same as the data that was present when the request was originally made We contemplated saving the entire data rather than just the references but this directly conflicts with one of our premises that the data sets are large multiple copies of these data are not desirable Execution Scheduling at the Server Once the entire DAG is constructed it is transferred to a NetSolve computational server In this first version of request sequencing the NetSolve agent uses a large granularity and decides which server should execute the entire sequence We execute a node if all its inputs are available and there are no conflicts with its output parameters Currently the only mode of execution we support is on a single NetSolve server though that server may be a symmetric multi processor SMP For data partitioning we transfer the union of the input parameter sets to the selected server host This makes input for all nodes except those which are intermediate output from prior nodes available for the execution of the sequence Our scheduling algorithm can be summarized as follows while problems left to execute execute all problems with satisfied
148. n OUTPUT output 0 Vector Double Precision Real Real parts of the eigen values output 1 Vector Double Precision Real Imaginary parts of the eigen values Output Objects 0 and 1 can be merged gt gt This output gives a short description of the problem an example in Matlab using net solve the input objects that must be supplied by the user and the output that will be returned to the user This particular problem requires only one double precision matrix on input Notice that this matrix must be square as stated in the description of the problem If the user tries to call NetSolve for this problem with a rectangular matrix he will receive an error message stating that the dimensions of the input are invalid On output the problem eig will return two vectors the real and imaginary parts of the eigenvalues of the input matrix respectively Since Matlab provides a mechanism to manipulate complex objects it is probable that the user would like to have eig return one single complex vector instead of two separate real vectors Thus in the 25 Chapter 6 Matlab Interjace Matlab interface it is possible to merge these two real output vectors into one complex vector This point is further developed in the next section The Matlab interface has another feature that is concerned not with the actual problem solving but with providing information about the NetSolve configuration itself We have just seen how to get informati
149. n be used to determine success or failure and the cause in the case of the latter int netsl sequence status This function takes no arguments and returns TRUE non zero if the system is currently collecting 46 Chapter 9 Netdolve Kequest Sequencing NetSolve requests 1 e constructing a DAG or is in the middle of a sequence and FALSE zero otherwise Figure 9 1 illustrates what a sequencing call might look like Two points to note in this example i for all requests only the last parameter is an output and ii the user is instructing the system not to return the intermediate results of command1 and command2 Figure 9 1 Sample C Code Using Request Sequencing Constructs begin sequence n submit request commandl A B C submit request command2 A C D submit request command3 D E F begin end C D NS NULL For the system to be well behaved we must impose certain restrictions upon the user Our first restriction is that no control structure that may change the execution path is allowed within a sequence We impose this restriction because the conditional clause of this control structure may be dependent upon the result of a prior request in the sequence and since the requests are not scheduled for execution until the end of the sequence the results will likely not be what the programmer expects The other restriction is that statements that would change the value of any input parameter of any co
150. n by agent_name netsolveproblems exe agent_name provides a list of problems that can be solved within the NetSolve framework as seen by agent_name 15 Chapter 4 Introduction to the NetSolve Client NetSolve Problem Specification Solving a computational problem with NetSolve is a function evaluation output name input where name is a character string containing the name of the problem e input is a list of input objects and output is a list of output objects An object is itself described by an object type and a data type The types available in the current version of NetSolve are shown in Table 17 1 and Table 17 2 Rather than giving examples for each object type we refer the reader to the programs in NETSOLVE ROOT src Examples SNETSOLVE_ROOT src Testing and NETSOLVE ROOT src Tutorial The user can also refer to the Section called Mnemonics in Chapter 17 for a description of the requirements for each NetSolve object type as it relates to the problem description file Available Client Interfaces NetSolve provides a variety of client interfaces C Fortran interfaces are detailed in Chapter 5 Matlab interface is detailed in Chapter 6 Mathematica interface is detailed in Chapter 7 Octave interface is detailed in Chapter 23 An Excel interface called ActiveSheets is also being developed Problems that can be solved with NetSolve
151. n obvious one being kill server but drastic changes along these lines would probably require drastic restructuring of NetSolve For instance a client can currently inform an agent that a particular server is down and the agent will not advertise that server for use in other problems It seems of dubious value to require authentication for such requests until there is a mechanism for specifying the trust relationship between clients and agents An attempt has been made to allow Kerberized NetSolve clients to interoperate with both Kerberized and non Kerberized NetSolve servers In either case the client sends a request to the server An ordinary server will return a status code indicating that he will accept the requested operation By contrast a Kerberized server will immediately return an authentication required error in response to the request The client is then required to send Kerberos credentials to the server before the request will be processed This allows the server to require authentication of the client Currently there is no mechanism to allow the client to insist on authentication of the server A Kerberized client will happily talk with either Kerberized or non Kerberized servers The server implements access control via a simple list of Kerberos principal names This list is kept in a text file which is consulted by the server A request to a NetSolve server must be made on behalf of one of those principal names If the principal
152. name associated with the Kerberos credentials in the request appears in the list and the credentials are otherwise valid the request will be honored Otherwise the request will be denied Since the NetSolve server was not designed to run as a set uid program it is not currently feasible to have the NetSolve server run processes using the user id of the particular UNIX user who submitted the request NetSolve thus uses its own service principal name of netsolve rather than using the host principal What this means among other things is that you need to generate service principals and keytabs for each of your NetSolve servers even if you already have host principals in place The NetSolve server by default runs in non Kerberized mode To start up the server in Kerberized mode you need to add the k option to the command line and also set environment variables NETSOLVE KEYTAB pointing to the keytab and NETSOLVE USERS pointing to the list of authorized users This version of Kerberized NetSolve performs no encryption of the data exchanged among NetSolve clients servers or agents Nor is there any integrity protection for the data stream Compiling a Kerberized Server 1 Compile Kerberos See the Kerberos V5 Installation Guide for instructions for how to do this 2 Compile the NetSolve client libraries with Kerberos support Refer to the instructions in the the Section called Installation on Unix Systems using ns install
153. nction Handles and Session IDs ener 110 Initializing and Finalizing Functions eese nennen nee 110 Remote Function Handle Management Functions ooconoccocnonncononnnonnnnnonnnon cnn cono co eene 110 GudRPC Call Functions eR tO inca 111 Asynchronous GridRPC Control Functions esee eene 111 Asynchronous GridRPC Wait Functions eese nennen enne 111 Error Reporting Functions eee etre SE E UAE eee ER e tee Pene Clans 112 Argument Stack Eunctions eee tie meti obe dr e P Ree 112 Detailed GridRPC API Specification sess eene 112 22 Using the Network Weather Service sess ener eene 114 Intro duct Ons is ced et e pe ERE i Dei teh pi e aiite ia dad 114 Using NWS x n gusnnpQev ege eee odo pedet 114 NWS Components utilized in NetSolve essere 114 NetSolve agent and the NWS nameserver memory and forecast sess 115 NetSolve server and the NWS sensor tenere enne 116 23 Using Octave with NetSolve sonet ed robe tbe e d e eR eie pene 117 Building the Octave Interface esee eene nennen tree 117 What to Do Ettst ieget eee eri C e RUP UE mera e tete dae 117 Calling netsolve to perform computations esses nennen 119 Calling netsol Ve nb wisi tto c rt PE PERGERET 120 Testing SCrpts lt x etude pate RU RR qe ede ee persto 122 V References
154. nd 300 The call to NetSolve is now gt gt x y netsolve eig a The calls to net solve will look the same The left hand side must contain the output arguments in the same order as listed in the output description see the Section called What to Do First The first argument to net solve is always the name of the problem After this first argument the input arguments are listed in the same order as they are listed in the input description see the Section called What to Do First Let us see what happens when we type gt gt x y netsolve eig a 26 Chapter 6 Matlab Interjace Sending Input to Server zoot cs utk edu Downloading Output from Server zoot cs utk edu x y 10 1204 0 0 9801 0 8991 0 9801 0 8991 1 0195 0 0 6416 0 65 1 1 As mentioned earlier the user can decide to merge x and y into one single complex vector Let us make it clear again that this possibility is a specificity only to functions that state in the end of their problem specification Output objects a and b can be merged and is not available in general for all problems To merge x and y the user has to type gt gt x netsolve eig a Sending Input to Server zoot cs utk edu Downloading Output from Server zoot cs utk edu 10 1204 0 9801 0 8991i 04 9801 0 89911 1 0195 0 6416 0 6511i Calling netsolve_nb The obvious drawback of the function netsolve is that while the computation is being perform
155. nd the problems they make use of chartest doubletest inttest stringlisttest stringtest totaltest farming_test doubletest sequence_test mpass vpass pass multipass For example to perform a sample run of c test the user must do the following a Use setagent to point to the correct agent host e g setagent netsolve cs utk edu b Run c test exe from the testing directory Using NetSolve from Windows Matlab A user new to Netsolve will find the Matlab interface very simple The matlab interface is in NETSOLVE_DIR matlab To access the interface a Start up Matlab b Click on File gt Set Path c Add the NETSOLVE DIRWmatlab directory to the path The interface consists of 4 NetSolve calls netsolve dll netsolve nb dll netsolve err dll netsolve errmsg dll Testing NetSolve within Matlab involves the following steps netsolve netsolve This command prints the agent and servers currently available This command prints the list of problems that can be solved Help on any call can be obtained by typing just the call on the Matlab prompt 14 Chapter 5 Downloading installing and testing the Client Using the NetSolve Management Tools in Windows There are various tools in the NETSOLVE_DIR tools directory that allow the user to explore the NetSolve metacomputing system netsolveconfig exe agent_name provides a list of agents and servers as see
156. ng capability ga2k ga2k is an implementation of DGA that is developed by Intelligent Systems Design Lab Doshisha University The web page Japanese of ga2k is http mikilab doshisha ac jp dia research pdga archive index html You can access this document in English here http mikilab doshisha ac jp dia research pdga archive 20020925 ver1 3e ga2k doc E2 pdf Step 1 Installation of NetSolve We have tested this examples on x86 architectures Linux 2 4 xx and gcc 2 96 In this INSTALL we assume you are using 140 Appendix b C Examples 1 You are using Linux 2 You are using bash shell First you should install NetSolve if you haven t already done so Please substitute lt version gt with the version of your NetSolve LINUX gt gunzip NetSolve lt version gt tar gz LINUX gt tar xfz NetSolve lt version gt tar LINUX gt cd NetSolve lt version gt LINUX gt configure LINUX gt make standard Step 2 Installation of Server service 1 Install libraries of optimization problems You can move to classic functions directory and install the libraries of the optimization problems LINUX cd SNETSOLVE_ROOT C examples gaExample server classic functions LINUX aclocal LINUX autoheader 2 53 LINUX autoconf 2 53 LINUX automake LINUX configure prefix SNETSOLVE_ROOT C texamples gaExample server LINUX make LINUX make install 2 Assign the probl
157. nnen nennen ene 38 Catching Errors tii P eae v Re yiip E eO pde eet 39 Demozi cese RE RD 39 Optional Testing the NetSolve BLAS interfaces 40 Optional Testing the NetSolve LAPACK interfaces sese 40 8 NetSolve Request Farming eee dere ete ee peti eor eH Eier Ret 41 Calling Farming aaa 41 Amexample 5 orem avem M RENDERE URSI betes asda 42 Catch Sci o m ee o ERR a teed A ee A acetic 43 Calling Farming in Matlab escorial ternas Ups ee th prie eee reete 43 An example siet RE e EUER e etie e en dert RUE 44 Current Implementation ence eei ene tette Ha RE ERES RP EG EES Esas risi 45 9 NetSolve Request Sequencing cesses esee een tet nenne tenente tente trennen non neon er trennen nennen 46 Goals and Methodologies dete eerte eto be E REESE n 46 The Application Programming Interface esee eren enne 46 Execution Scheduling at the Server eeu ettet en tee iret ce e 47 10 Asynchronous Request Handling eese eere 48 netslpr NN 48 Inl S 48 metil 49 netsh assignment 4n een aed acu de Oe UR D teens 49 11 Security in NetSolve Client occi he be Re o etel 50 Introduction eode uera eap te ia ees dee a e 50 Compiling a Kerberized Server eaten te tede et e oii roro TERS aiiis 50 Running a Kerberized NetSolve Client oocononociocnonnnoncononnconncnnonononoco non nc n
158. nput to Server zoot cs utk edu rd request id 0 gt gt netsolve nb returns a request handler O This request handler will be used in the subsequent calls to the function The request is being processed on zoot and the result will eventually return The user can obtain this result in one of two ways The first one is to call netsolve nb with the probe action gt gt status netsolve nb probe r netsolve nb returns the status of a pending request The right hand side contains the action as is required for netsolve nb and the request handler This call returns immediately and prints a message Here are the two possible scenarios gt gt status netsolve nb probe r Not ready yet status 1 gt gt status netsolve nb probe r Result available status 1 To obtain the result of the computation one must call netsolve nb with the wait action gt gt x y netsolve nb wait r Downloading Output from Server zoot cs utk edu x y 10 1204 0 0 9801 0 8991 0 9801 0 8991 1 0195 0 0 6416 0 6511 28 Chapter 6 Matlab Interjace As with the net solve function one can merge the real part and the imaginary part into a single complex vector The typical scenario is to call netsolve_nb with the action send then make repeated calls with the action probe until there is nothing more to do than wait for the result The user then calls netsolve nb with the
159. nputVec il status netsl iqsort length inputVec outputVec printf AIninSorted Elements An for i 0 i lt length i printf d outputVec i printf Xn return 0 Figure 20 2 Example 2 using DSI int main int i int length int inputVec int outputVec int status DSI FILE dsi file DSI OBJECT dvec printf Enter the number of vector elements An scanf Sd amp length inputVec int malloc sizeof int length outputVec int malloc sizeof int length for i 0 i lt length i printf Element Sd We cedo s scanf d amp inputVec i dsi file ns dsi open torcl cs utk edu O CREAT O RDWR 744 3000 IBP if dsi file NULL printf error in open n dvec ns dsi write vector dsi file inputVec 10 NETSOLVE D if dvec NULL printf error in write n 107 Chapter ZU Distributed Storage Infrastructure DSL in Netdolve status netsl igsort length dvec outputVec printf NnMnSorted Elements An for i 0 i lt length i printf d outputVec i printf Xn ns dsi close dsi file return 0 108 Chapter 21 GridRPC Introduction The GridRPC API represents ongoing work to standardize and implement a portable and simple remote procedure call RPC mechanism for grid computing This standardization effort is being pursued through the Global Gr
160. nstalled separately The test suite consists of a set of Mathematica scripts that test each of the LAPACK interfaces available in NetSolve The main script is called NS1apacktest m and is located in NETSOLVE ROOT src Testing mathematica To run the LAPACK test suite type NSlapacktest at the Mathematica prompt 40 Chapter 8 NetSolve Request Farming Farming is a way of calling NetSolve to manage large numbers of requests for a single NetSolve problem Many NetSolve users are confronted by situations when many somewhat similar computations must be performed in parallel One way to do this in NetSolve is to write non blocking calls to nets1nb in C for instance However this can become cumbersome In the present distribution this call nets1_farm is only available from C and Matlab A Fortran interface will most likely not be provided because of pointer management Calling Farming in C ns int Like nets1 and nets1nb the netsl farm function takes a variable number of arguments Its first argument is a string that describes the iteration range This string is of the form i2 d d in C string format symbols The second argument is a problem name appended with an opening and a closing parenthesis The arguments following are similar in intent to the ones supplied to net s1 but are iterators as opposed to integers or pointers Where the user was passing say an integer to nets1 he now needs to pass
161. nt interface to sparse iterative methods packages such as PETSc Aztec and ITPACK If the user would like to enable PETSc Aztec or 65 Chapter 13 Downloading Installing and lesting the Agent and Server ITPACK within NetSolve he must perform the following steps During the configure phase of the NetSolve installation type UNIX configure with petsc PETSC DIR with aztec AZTEC DIR with azteclib AZTEC LIB with lapacklib LAPACK LIB with blaslib BLAS LIB with mpidir MPI DIR with itpack where PETSC DIR denotes the location of the PETSc directory containing the standard distribution AZTEC DIR denotes the location of the Aztec directory where the include files can be found AZTEC LIBis the link line for the Aztec library LAPACK LIB denotes the name of the LAPACK library BLAS LIB denotes the name s of the BLAS library and MPI DIR denotes the location of the MPI library assumes the standard MPICH distribution If these libraries are not already available on the user s machine he can download and install the software from the respective webpages PETSc homepage http www fp mcs anl gov petsc and Aztec homepage http www cs sandia gov CRF aztec1 html The PETSc interface is compatible with PETSc version 2 0 29 LAPACK can be downloaded from the LAPACK web page http www netlib org lapack lapack tgz If an optimized BLAS library is not available on the user s machine he can vi
162. ntains the function which should perform the calculation e calc idi A file which describes how the problem should be included into the NetSolve repository Interface Definition Language myprog c An example program which invokes the newly created NetSolve function Instructions 1 Building the Library NetSolve provides all functions through statically linked libraries Execute the following steps on the server to build 1ibcalc a UNIX gcc c libcalc c UNIX ar rc libcalc a libcalc o 2 Installing the Problem to the NetSolve Repository Use idltopdf to convert povray idlto povray pdf Then copy povray pdf to your problems subdirectory and add an entry in the file NETSOLVE ROOT server config Set NSPOVRAY LIB to the path where libpovray a is located and recompile the server with the command UNIX make server Note Since the library makes an external call to a program it can not take advantage of the Hardware Software server feature of NetSolve i e it cannot be transfered from one server to another To mark a problem as non moveable use the keyword NONMOVEABLE in the IDL 3 Invoking the Function Via NetSolve The file myprog c demonstrates how to invoke the function calc via NetSolve When you compile it you have to provide the include and library directory of NetSolve Set the NETSOLVE ROOT environment variable to your NetSolve directory and NETSOLVE AGENT to your architecture you can use the following or similar shell scri
163. o MathLink Development Kit with rpclib RPC LIB Full path of RPC library with octave include OCTAVE INC DIR location of Octave include directory with rpcinc RPC INC Directory containing RPC header files with gpg GPGPATH Full path of gpg binary with buildgpg BUILDGPG Location of gpg tar gz file The configure script creates two main files conf Makefile NETSOLVE_ARCH inc and conf Makefile inc These files are created from the templates conf Makefile generic arch and Jconf Makefile inc in respectively SNETSOLVE ARCH is the string printed by the command Jconf config guess with all and characters converted to _ characters The variable NETSOLVE ROOT is the complete path name to the installed NetSolve directory and is defined in con Makefile inc These inc files are included by the Makefiles that build the NetSolve system Manually editing these configuration files is strongly discouraged However if the user prefers to edit this file details of the SNETSOLVE_ROOT conf Makefile SNETSOLVE_ARCH inc file are explained in the Section called Details of the Makefile NETSOLVE ARCH inc File in Chapter 12 Typing make in the Net Solve directory will give instructions to complete the compilation A typical client compilation includes UNIX make C Fortran tools tester to build the C and Fortran client interfaces NetSolve management tools see Chapter 16 and NetSolve test suite see the S
164. o cnnonncnn nro nonnonnnnncnnos 51 12 Troubleshooting epic are are EU eti pO ee 52 Details of the Makefile NETSOLVE_ARCH inc File eene 52 III The Administrator s Manual eee esee eres ee reete entes tn eren tn ota tn stato tatnen estan instat tnos insta esta tn eos 58 13 Downloading Installing and Testing the Agent and Server sese 59 Installation on Unix Systems using ns install esee 59 Installation on Unix Systems using ns install eese 59 Installation on Unix Systems using configure sese neennenennrenene 60 Testing the SOIWAEe desee one ipd ii nece s 62 Agent Server Client Test esee E E eene theme nennen nennen ene 63 Expanding the Server Capabilities eese nennen ener 63 Enabling the LAPACK library essen nennen ener nennen enne 64 Enabling the ScaLAPACK library sees emen 65 Enabling Sparse Iterative Solvers PETSc Aztec and ITPACK 65 Enabling Sparse Direct Solvers SuperLU and MA28 sese 66 14 Running the NetSolve Agent oooooncnocnconccononcnnnonncononononccanonnnononnnonn enne nen nennen treten etre nenne ene 68 15 Running the NetSolve Servet i ii 69 Starting a Server x sse 69 The Server Configuration File eue ec e e tee eet e ipei ns 70 Dynamic Servers esee aa d inerte n ARES Che ihe e
165. objects in OUTPUT output 0 Matrix Double Precision Real Solution Calling sequence from C or Fortran 6 arguments Argument 40 number of rows of input object 0 A number of columns of input object 0 A number of rows of input object 1 RHS Argument 1 number of columns of input object 1 RHS Argument 2 pointer to input object 40 A Argument 3 leading dimension of input object 0 A Argument 4 pointer to input object 1 RHS pointer to output object 0 SOLUTION Argument 5 leading dimension of input object 41 RHS It the problem is marked as NON MOVEABLE it prints a note in the second line povray allows the remote execution of PovRay this is a non moveable problem NS killagent This executable takes one argument on its command line the name of a host running a NetSolve agent After a basic user authentication the executable kills the agent UNIX NS killagent netsolve cs utk edu Agent on netsolve cs utk edu killed 1 Chapter 16 Netsolve Management tools jor Administrators NS killserver This executable takes two arguments on its command line the name of a host running a NetSolve agent and the name of a host running a NetSolve server After a basic user authentication the executable kills the server using the agent as an entry point into the system UNIX NS killserver netsolve cs utk edu cupid cs utk edu Server on cupid cs utk
166. ocking problem solving NetSolve ProblemName arguments This function is a blocking call to NetSolve to solve a certain problem When utilizing this type of call to NetSolve the user does not regain execution control until the result becomes available Nonblocking problem solving NetSolveNB ProblemName arguments This function is a non blocking call to NetSolve to solve a certain problem Unlike a blocking call to NetSolve a non blocking call returns the execution control as well as a request handler immediately to the user The request handler can then be probed for the status of the calculation Getting setting an agent NetSolveGetAgent NetSolveSetAgent AgentName NetsolveGetAgent returns a string containing the host name of the agent The user can change the current agent by the Net SolveSetAgent function at any time Let us now assume that the user has started Mathematica and is ready to use NetSolve We can check our agent by typing In 1 NetSolveGetAgent Out 1 netsolve cs utk edu If there is no agent set the result would be the Nu11 symbol One can change the agent by the function Net SolveSetAgent For instance In 2 NetSolveSetAgent netsolve cs utk edu The agent can be changed at any time provided there is another NetSolve agent running on the host whose name has been passed as an argument However if the agent is changed then the set of servers and possibly the set
167. of solvable problems has also been changed A list of the solvable problems can be obtained by the function Net Solve problems Here is a possible list clipped to save space In 3 NetSolve problems BLAS Matrices dgemm BLAS Matrices dmatmul BLAS Matrices zgemm BLAS Matrices zmatmul BLAS Vectors daxpy BLAS Vectors ddot BLAS Vectors zaxpy LAPACK Matrices EigenValues eig LAPACK Matrices LinearSystem dgesv LAPACK Matrices LinearSystem linsol MinPack hybrdl MinPack lmdif1 QuickSort DoublePrecision dqsort QuickSort Integer iqsort 35 Chapter Mathematica Interface Similarly a list of the servers can be printed by the function Net Solve servers In 4 NetSolve servers netsolve cs utk edu 128 169 93 161 tSolve Agent st Up Server Running tusla cs utk edu 128 169 94 21 ndles 24 problems tuslb cs utk edu 128 169 94 22 ndles 24 problems st Up Server Running tusic cs utk edu 128 169 94 23 Handles 24 problems e O e a Host Up Server Running e a O e Host Up Server Running For every server associated with a specific agent the following information is given its name IP address host and server status and how many different problems it can solve The user can easily determine information about a specific problem iqsort for instance by typing NetSolve iqsort The brackets after the problem name are req
168. omparable to Matlab Condor G support NetSolve can now use Condor G providing a transparent front end to a Condor pool and the related functionality of a job queuing system Chapter 1 A Netsolve Overview Distributed Storage Interface DSI NetSolve can now be integrated with DSI to provide enhanced data transfer and storage e GridRPC this new feature provides a simple remote procedure call mechanism for grid computing using a common API Interface Definition Language IDL provides library writers with an improved interface for easier integration of new problems into NetSolve Cygwin Mac OSX support the NetSolve agent server and client can now be built and ran on Windows operating systems using Cygwin or Mac OSX visPerf Monitor Improved monitoring system to monitor NetSolve activities using a Java Webstart application NetSolve has been recognized as a significant effort in research and development and was named in R amp D Magazine s top 100 list for 1999 Chapter 2 Related Projects and Systems There are a variety of related projects CONDOR Condor http www cs wisc edu condor is a software system that runs on a cluster of workstations to harness wasted CPU cycles A Condor pool consists of any number of machines of possibly different architectures and operating systems that are connected by a network NetSolve currently has the ability to access CONDOR pools as its computational resource With l
169. on about the problems handled by the NetSolve servers it is also possible to obtain the physical locations of these servers Let us assume that our NETSOLVE AGENT environment variable is set to netsolve cs utk edu see Chapter 14 The command gt gt netsolve produces the following output NetSolve List of available agents netsolve cs utk edu 160 36 58 109 NetSolve List of available servers maruti cs berkeley edu 128 32 36 223 cupid cs utk edu 160 36 58 63 torc3 cs utk edu 160 36 56 202 0 failures The same information can be obtained from the homepage CGI scripts or the management tools Calling netsolve to perform computation The easiest way to perform a numerical computation in NetSolve is to call the function net solve With this function the user sends a blocking request to NetSolve By blocking we mean that after typing the command in the Matlab session the user resumes control only when the computation has been successfully completed on a server The other way to perform computation is to send a nonblocking request as described in the Section called Calling netsolve nb Let us continue with the eig example we started to develop in the preceding section The user now knows that he has to provide a double precision square matrix to NetSolve and he knows that he is going to get two real vectors back or one single complex vector He first creates a 300 x 300 matrix for instance gt gt a ra
170. on even easier It is recommended that you use this script to assist with the configuration and install of NetSolve It will step you through the configuration prompting for the necessary information to complete the install and then run configure You can bypass this script and run configure yourself if you are comfortable doing so Installation on Unix Systems using ns install The NetSolve distribution tar file is available from the NetSolve web site Attp icl cs utk edu netsolve downloads Once the file NetSolve 2 0 tgz has been downloaded the following UNIX commands will create the Net Solve 2 0 directory Installation on Unix Systems using ns install 1 Run ns_install from the new NetSolve 2 0 directory where the NetSolve package was uncompressed UNIX gt ns_install 2 The script will first prompt for the components to be installed GridRPC API Matlab interface 1 Standard Client Server Agent Testers Tools 2 Client 3 Server 4 Agent 5 Tools 6 Testers 7 8 9 Octave interface Common components for a client install include 2 additionally 5 6 7 8 and 9 might also be included 3 Chapter 5 Downloading installing and testing the Client If your selection above included the Server component you will be asked whether you want to enable GPG for signing software when using the Hardware Software server feature It is recommended that you enter y here 1f you wish to use the Hardwar
171. ontains the data to read data Actual vector to read count Number of elements of the vector to read data type One of NetSolve data types On success returns the number of elements read On failure returns 1 Following are the various error values set in case of failure NetSolveIBPLoadError Err or while loading the vector from IBP NetSolveDsiEACCESS Not enough permissions for reading from the DSI file NetSolveDsiDisa bled If DSI is not enabled in the NetSolve configuration int ns dsi read matrix DSI OBJECT dsi obj void data int rows int cols int da ta type Same functionality and return values as ns dsi read vector exceptns dsi read matrix is used to read matrix of rows rows and cols columns DSI Example This section shows two example programs The first program solves quick sort without using the DSI feature The second program solves the same quick sort but with using the dsi feature Figure 20 1 Example 1 without using DSI int main Int int length int inputVec int outputVec int status printf Enter the number of vector elements n 106 Scanf d amp length Chapter ZU Distributed Storage Infrastructure DSL in Netdolve inputVec int malloc sizeof int length outputVec int malloc sizeof int length for i 0 i lt length i printf Element Sd i 1 scanf Sd amp i
172. other machines of the same architecture as Software server but can also execute problems from other machines of the same architecture But if a user wants to provide newly created functions without donating his hardware resources to a NetSolve pool he can install the new problem to a server on his machine and start it with the s option So the agent will add the problem to the repository and when someone wants to execute it the binary will be transfered to a Hardware server and executed there When a user starts a server without the s option the default the machine becomes available to any NetSolve user for execution of his problem The agent then adds this server to the database in the hardware server list It also knows the architecture of the hardware server Thus if the client submits a request the agent can make a better decision whether to use this hardware server or not If other servers are overloaded it can select this hardware server as a potential server When the client makes a request the agent creates a mapping of the software server containing the particular software with all the hardware servers with the same architecture Thus the return value from the agent contains a mapping of hardware and software servers The client then contacts the hardware server with the set of input data The transfer of the software is done automatically The hardware server contacts the software server and fetches the software The software is dynam
173. ovray pdf Since the library makes an external call to a programm it can not take advantage of the Hardware Software server feature of NetSolve i e it cannot be transfered from one server to another To mark a problem as non moveable edit the newly created file povray pdf and add the following line after the PATH statement MOVEABLE 0 Then copy the PDF to your NETSOLVE problems directory and add the function to the problems list in the file SNETSOLVE_ROOT server_config Set NSPOVRAY LIB to the path where libpovray ais located and recompile the server with the command UNIX make server 3 Rendering a Test Image Via NetSolve The file nspovray c demonstrates how to invoke the newly created function povray via NetSolve I Edit nspovray c and provide in the first three lines the path to ImageMagick mpeg encode and mmv II Edit animation parm and set in the 4th line the path to the programm tgatoppm if it is not in your PATH III Compile nspovray then with the following command UNIX gcc nspovray c o nspovray ISNETSOLVE ROOT include lnetsolve L NETSOLVE ROOT lib NETSOLVE ARCH Note On Solaris you may need to add the following two libraries Isocket and Insl To render an example file you have the following options I blocking calls provides exactly the same syntax as calling povray but use the command nspovray instead e g 134 Appendix
174. ped by the NetSolve Team at the Computer Science Department of the University of Tennessee Knoxville All rights title and interest in NetSolve are owned by the NetSolve Team Compliance with Applicable Laws User agrees to abide by copyright law and all other applicable laws of the United States including but not limited to export control laws Table of Contents A M i Who Should Read This Document eecseeeesseeseceeeceseecseceaecescecsuceeaeeeneceseecseeeneceeeeceeecseeseneceeeses 1 Organization of This Document eseeseeseeeeee eene nennen ener etre mentre trennen eene 1 Document CON NON roto tee ii 11 Requestior Comments citas iii ennn i IP WEST Overview REI P 1 An Introduction to Distributed Computing ooooocioccocccononnnancnnnononnncnnonnnon con ncnn conc cn cnn non crnnoncco nono 1 Whatis NetSolve taen ii te hr E eee Eee ir eere pe Pecan puede 1 Back LOU ssi eR ERE eR A UE Laveen 1 Overview and Architecture eee eeesecssncesseeescceeceesecesseeeeceeacesseeceeeeaaeeseecseeesaeeeesenseee 1 Whoas the NetSolve US amp r e titi ee bein dei eet nete e eere 3 The Status of NetSolve eet peer eter prier pre teer peres perpe 3 2 Related Projects and Systems verine e it err rr I RUPEE RES eL pea A ete nada 5 Lr
175. plex problem such as the Level 3 BLAS subroutine dgemm which calculates where op X X or op X X The routine dgemm requires the following 7 arguments Let us generate three random matrices In 11 RandomMatrix m n Table Ceiling 10 Random m n In 12 a RandomMatrix 2 3 QUELLZIS EL 2 Sh 75 64 35 933 In 13 b RandomMatrix 3 2 Out 13 6 4 4 10 2 9 In 14 c RandomMatrix 2 2 Out 14 4 7 4 8 and call dgemm In 15 NetSolve dgemm N N 2 a b 3 c contacting server cetus2a cs utk edu Out 15 148 187 144 294 In 16 LO ut dint 3e C Out 16 148 187 144 294 38 Chapter Mathematica Interface Nonblocking Call to NetSolve As in the Matlab interface see Chapter 6 the Mathematica interface can be called in an asynchronous fashion Nonblocking calls are performed by the function Net SolveNB and its calling sequence is the same as the blocking call NetSolve The difference is in the result returned Net SolveNB always returns a request handler NetSolveProbe returns an integer value to indicate if the problem has been completed A value of 0 indicates that the result is available and a value of 1 indicates that the computation is still in progress Other values are error codes see the Section called Catching Errors Let us multiply two complex matrices using Net SolveNB We generate the matrices ac and b
176. processors 1 for a single processor 72 for a dual processor 4 for a quad processor that can be used by the server to perform simultaneous computations on the local hosts There can only be one such line in the configuration file QMPIHOSTS filename lt number gt specifies the path to the file that contains the list of machines that can be used by MPI and the maximum number of processors that can be spawned by MPI QWORKLOADMAX max specifies the value of the workload beyond which the server refuses new requests e g WORKLOADMAX 100 A value of 1 means that the server accepts requests regardless of the workload 70 Chapter 12 Kunning the Netdolve Server QSCRATCH path specifies where the NetSolve server can put temporary directories and files The default is tmp QCONDOR path specifies that the NetSolve server is using a Condor condor1 condor2 pool as a computing resource The path to the Condor base directory must be provided There can be only one such line in the configuration file QCONDORG path specifies that the NetSolve server is using a Condor G job management part of Condor The path to the Condor G base directory must be provided There can be only one such line in the configuration file QPROBLEMS marks the beginning of the list of problem description file PDF names that are enabled in the NetSolve server installation Each of these problem description fi
177. pt to set it UNIX export NETSOLVE ARCH NETSOLVE ROOT conf config guess sed s _ g Then use the following command to compile UNIX gcc myprog c o myprog IS NETSOLVE ROOT include lnetsolve LS NETSOLVE ROOT lib NETSOLVE ARCH Invoking myprog with 3 arguments uses the blocking call UNIX myprog 1 2 1 To use non blocking calls use UNIX gt myprog 0 number of requests and for task farming 132 Appendix A Netsolve Lutorials UNIX gt myprog 1 number of requests Note Be sure to have an agent and your newly compiled server running Also check that the NETSOLVE AGENT enironment variable is set it should be the same value as the AGENT line in server config in the NetSolve directory Tutorial for Handling Files This tutorial shows how to pass files to and from a remote host In the example a tool is developed which allows you to distribute the task of rendering POV files across a NetSolve network Povray is executed at the servers to render a part of the picture and the parts from all the servers are put together from the client The tutorial includes the following steps 1 Building and configuring the library 2 Installing the problem to the NetSolve repository 3 Rendering a test image via NetSolve Requirements on each server libpovray c povray idl a file which describes how the problem should be included in
178. r Hardware Server Setup Incorporating a key By default a NetSolve hardware server will not accept mobile code In order for the server to accept mobile code it has to be configured to use gpg to verify the authenticity and integrity of code 75 Chapter 12 Kunning the Netdolve Server If you configure your hardware server to run gpg by default the hardware server will accept any code which is either signed by netsolve master netlib org signed by a third party whose key is signed by netsolve master netlib org This section describes how to change which keys your server trusts In order for your server to trust a signature the following conditions are necessary that key is trusted by the server that key is signed by someone the server trusts By default NetSolve is set up to trust the following keys e netsolve hardware server example org is trusted ultimately netsolve master G netlib org is trusted fully netsolve hardware server 9 example org is a dummy key that is used as the identity of the hardware server in the default configuration If you wish to change the hardware server s trust parameters you will need to delete this key and create your own key NetSolve s copies of GPG files The NetSolve server maintains its own copies of gpg files pubring gpg secring gpg trustdb gpg It does this so that there is no conflict between NetSolve s use of gpg and ordinary personal uses of gpg A user which
179. r appear in the pseudo code The last thing to do at this point is to update the output ROOG QILLQ mO0 mI1 END_CODE The first line expresses the fact that the input has been overwritten by the output The second line sets the number of rows of the output The following section gives a complete example with all of the sections of the problem description A Simple Example Let us imagine that we have access to a Fortran numerical library that contains a function say LINSOL to solve a linear system according to the following prototype SUBROUTINE LINSOL A B N NRHS LDA LDB DOUBLE PRECISION A LDA Left hand side NxN DOUBLE PRECISION B LDB Right hand side NxNRHS overwritten with the solution INTEGER N INTEGER NRHS 91 I I NTEGER NTEGER DA Leading Dimension of A DB Leading Dimension of B Chapter 1 he Problem Description File Then an appropriate description for a problem that solves a linear system using LINSOL and that expects from the client the same calling sequence as the one for LINSOL is Q Q Q O QQ D c cO cO e c U S PROBLE INCLUD INCLUDI IB L h LIB 1st E E FUNCTIO ANGUAGE MAJOR CO PATH ESCRIPT olves th linsol lt math h gt home me my_header h ome lib uff LIB home me lib NETSOLVE A
180. reen the list of all problems that are available in the NetSolve system netsolve lt problem name gt Prints all information available from Matlab about a specific problem netsolve Prints the list of all the agents and servers in the NetSolve system that is the NetSolve system containing the host whose name is in the environment variable NETSOLVE AGENT netsolve lt problem name gt Sends a blocking request to NetSolve The left hand side contains the output arguments The right hand side contains the problem name and the input arguments The arguments are listed according to the problem description Upon completion of this call the output arguments contain the result of the computation r netsolve nb send problem name gt Sends a non blocking request to NetSolve The right hand side contains the keyword send the problem name and the list of input arguments These arguments are listed according to the problem description The left hand side will contain a request handler upon completion of the call netsolve nb wait r Waits for a request s completion The right hand side contains the keyword wait and the request handler The left hand side contains the output arguments These arguments are listed according to the problem description Upon completion of this call the output arguments contain the result of the computation status netsolve_nb probe r
181. resources How it works A job is submitted for execution to a Condor G server The server will then prepare a temporary submit description file similar to this xecutabl homes shi NetSolve bin sparc_sun_solaris2_8 service lapack_subset globusscheduler msc03 cs utk edu jobmanager universe globus output condor out error condor error arguments 0 homes shi NetSolve bin sparc sun solaris2 8 101 Chapter 19 Using Conaor G with Netdolve queue The globusscheduler command is dependent on the scheduling software available on the remote resource This required command should be changed based on the Grid resource intended for execution of the job All Condor G jobs are submitted to the Globus universe The NetSolve server then issues condor submit to submit the job for execution on the Globus resources After the job is finished on the remote machines the server will collect the results and send them to the client 102 Chapter 20 Distributed Storage Infrastructure DSI in NetSolve DSI Introduction The Distributed Storage Infrastructure DSI is an attempt towards achieving coscheduling of the computation and data movement over the NetSolve Grid The DSI APIs help the user in controlling the placement of data that will be accessed by a NetSolve service This is useful in situations where a given service accesses a single block of data a number of times Instead of multiple transmissions of the same data from the clien
182. rforms no encryption of the data exchanged among NetSolve clients servers or agents Nor is there any integrity protection for the data stream Compiling a Kerberized Server 1 Compile Kerberos See the Kerberos V5 Installation Guide for instructions for how to do this 2 Compile the NetSolve server with Kerberos support configure with kerberos 97 Chapter 16 Security in Netdolve Installing a Kerberized Server 1 Install Kerberos on the server machine See Kerberos V5 Installation Guide for instructions for how to do this You do not have to install all of the Kerberos clients just to run a NetSolve server but you do need kadmin and components that deal with Kerberos tickets like kinit and kdestroy 2 Define a Kerberos service principal for the NetSolve server To define the principal for machine foo bar com a Get the name and the password of a Kerberos principal that is authorized to run kadmin and create principals b Log on to the machine where you want to install the Kerberized NetSolve server Make sure you have a secure connection to the client machine perhaps you re typing on the machine s keyboard or perhaps you re using ssh to log in to that machine so that your password will not be exposed on the net c Do a kinit to acquire a ticket that identifies you as someone who can create principals d Create a service principal for the NetSolve server on your host If your host is named foo bar com the servic
183. rmat N is the number of rows and columns of the sparse matrix nnz is the number of non zeros indices is a vector of column indices and pointer is a vector containing a pointer to the first non zero element in each row Limitations The NetSolve IDL is in the early stages of development and does not support all the features supported by PDF 1 The number of elements in a vector or the number of rows and columns in a matrix can be either constants or one of the input integer parameters It cannot be an arithmetic expression 2 Files and strings are not supported by the NetSolve IDL 3 The IDL does not contain a code section where the user can write program statements idltopdf Utility As part of the standard make in NetSolve an executable called idltopdf is created in the NETSOLVE ROOT bin NETSOLVE ARCH directory After creating the IDL file you can create the corresponding PDF by using the id1topaf utility For example after creating an IDL file by the name problem idl you can create problem pdf by executing UNIX idltopdf problem idl in the command prompt Please note that the IDL file should have the idl extension This problem can then be integrated into the NetSolve server by copying the problem pdf to NETSOLVE ROOT problems directory and adding problems problem pdf 95 Chapter 1 Lhe Problem Description rile in the NETSOLVE ROOT server config file Then th
184. rns the error code associated with a given non blocking request grpc get last error returns the error code for the last invoked GridRPC call Argument Stack Functions When describing the GridRPC call functions we mentioned that there is an alternate calling style that uses an argument stack With the following functions it is possible to construct the arguments to a function call at run time When interpreted as a list of arguments the stack is ordered from bottom up That is to emulate a function call f a b c the user would push the arguments in the same order push a push b push c e newArgStack creates a new argument stack pushArg pushes the specified argument onto the stack popArg removes the top element from the stack destructArgStack frees the memory associated with the specified argument stack Detailed GridRPC API Specification Initializing and Finalizing Functions int grpc initialize char config file name int grpc finalize Remote Function Handle Management Functions int grpc function handle default grpc function handle t handle char func name int grpc function handle init grpo function handle t handle char host name int port char func name int grpc function handle destruct grpc function handle t handle 112 Chapter z1 Griakr C grpc function handle t grpc get handle int sessionId GridRPC Call Functions int int int int grpc call grpc function hand
185. s in Fortran77 one calls the function FNETSL This C function returns an error code It takes as arguments the name of a problem and the list of input data These inputs are listed according to the calling sequence discussed in the Section called What is the Calling Sequence The C prototype of the function is int netsl char problem name argument list and the Fortran77 prototype is SUBROUTINE FNETSL PROBLEM NAME STATUS argument list where PROBLEM NAME is a string and STATUS is the integer status code returned by NetSolve Let us resume our example of the call to dgesv In Fortran77 the direct call to LAPACK looks like CALL DGESV N 1 A LDA IPIV B LDB INFO The equivalent blocking call to NetSolve is CALL FNETSL DGESV STATUS N 1 A LDA IPIV B LDB INFO The call in C is status netsl dgesv n 1 a lda ipiv b 1ldb amp info Notice that the name of the problem is case insensitive and that it is appended by an opening and a closing parenthesis The parentheses are used by NetSolve to handle Fortran C interoperability on certain platforms In Fortran77 every identifier represents a pointer but in C we actually had the choice to use pointers or not We chose to use integer int for the sizes of the matrices vectors but pointers for everything else From the user s point of view the call to NetSolve is exactly equiva
186. sfully Otherwise the return status represents the specific error that occurred netslkill Cancelling a request To cancel a previously submitted asynchronous request you should use the netslkill call It notifies the server that the request has been cancelled by the user Below is a short code example Submit the asynchronous request status netslnb inttest amp i Cancel the request status netslkill request Upon return status is NetSolveOK the request has been successfully cancelled NetSolveInvalidRequestID the request ID didn t correspond to a request that you previously submitted Otherwise the return status represents the specific error that occurred nets assignment Assigned server requests If you want to submit a request to a specific server you should use the netsl assignment function or netsInb assignment for asynchronous requests The server name is specified before the problem name in the call for example status netslnb assignment 160 36 56 200 inttest amp i Notice that the format is serverip probname Currently the server must be specified as an ip address 49 Chapter 11 Security in NetSolve Client Introduction NetSolve components include clients agents and servers Currently the only requests that require authentication are requests that the client makes to the server and of those only the run problem request Other requests could be authenticated a
187. sitory myprog c An example program which invokes the NetSolve function Instructions 1 Building the Library NetSolve provides all functions through statically linked libraries Execute the following steps on the server to build 1ibmatmul a UNIX gcc c libmatmul c UNIX ar rc libmatmul a libmatmul o 2 Installing the Problem and Adding BLAS to the NetSolve Repository 135 Appendix A Netsolve Lutorials To invoke a new function from the NetSolve client you have to add the function to the problems list in a NetSolve server and recompile the server Perform the following steps to include matmul Create a problem description file with UNIX SNETSOLVE_ROOT bin SNETSOLVE_ARCH idltopdf matmul idl Which generates the file matmul pdf Copy the file natmul pdf to the NETSOLVE ROOT problems directory Edit the file SNETSOLVE ROOT server configin your NetSolve directory and add the following line in the PROBLEMS section problems matmul pdf To rebuild the server you have to set an environment variable which points to the directory of the previously created library required by the problems definition file Depending on you shell execute UNIX export NSMATMUL LIB path to libmatmul or UNIX gt setenv NSMATMUL_LIB path to libmatmul afterwards rebuild the server with the command UNIX gt make server In your NETSOLVE_ROOT directory To inclu
188. son Z Bai C Bischof S Blackford J Demmel J Dongarra J Du Croz A Greenbaum S Hammarling A McKenney and D Sorensen apme 2002 Global Grid Forum Applications Programming Models and Environments http www gridforum org 7 APM APS htm rpcapi 2002 Proceedings of the Third International Workshop on Grid Computing Overview of GridRPC A Remote Procedure Call API for Grid Computing K Seymour H Nakada S Matsuoka J Dongarra C Lee and H Casanova ninf 1999 Future Generation Computing Systems Metacomputing Issue Design and Implementations of Ninf Towards a Global Computing Infrastructure 649 658 15 H Nakada M Sato and S Sekiguchi 154
189. sorted array 0 sortedl Then nets1_farm can be called as 42 Chapter Netsolve Request Farming Status array netsl_farm i 0 199 iqsort ns_int_array size_array i ns_ptr_array ptr_array i ns ptr array sorted array i In short nets1_farm is a concise convenient way of farming out groups of requests Of course it uses nets1nb underneath thereby ensuring fault tolerance and load balancing Catching errors netsl farm returns an integer array That array is dynamically allocated and must be freed by the user after the call The array is at least of size 1 The first element of the array is either 0 or 1 If it is 0 then the call was completed successfully and the array is of size 1 If first element of the array is 1 then at least one of the requests failed The array is then of size one plus the number of requests and the 1 1 th element of the array is the error code for the i th request Here is an example on how to print error messages status netsl farm i 0 200 if status 0 0 fprintf stderr Success n free status else for i 1 1 lt 201 i fprintf stderr Request d i netslerr status i free status Calling Farming in Matlab NetSolve provides the Matlab user with a convenient interface whereby he can make multiple requests to the same NetSolve program possibly with different arguments This facility is useful in task farming problems
190. t is aimed to be compatible with PGP from NAI Inc For more information on GPG consult http www gnupg org Within the scope of NetSolve Software providers are able to sign software using keys signed by the NetSolve Admin or others if they choose to The Hardware Server provider would be able to specify trustworthy parties using GPG trust framework By default the hardware server trusts the NetSolve Admin Thus to take advantage of software transfer both the parties should have GPG and should enable the software transfer NetSolve provides a good level of flexibility in the implementation of Hardware Software feature and GPG There are 2 main cases CASE 1 GPG is disabled In this case the user has GPG disabled Hence the software problem will not be transfered by the Software Server nor will the software be transfered to the Hardware Server This is the default NetSolve mechanism CASE 2 GPG is enabled In this case the default software provided in the original NetSolve distribution will not be transfered See PDFs in NETSOLVE ROOT problems directory This is done by having MOVABLE set to 0 in the PDF However if the server admin decides to make new software and have that software moveable transferable then he needs to set MOVABLE to 1 in the PDF MOVABLE 1 He also needs to sign the software with a GPG key provided by someone whom the hardware server trusts Typically this would be the NetSolve admin The steps requ
191. t to the server the DSI feature helps to transfer the data from the client to a storage server just once and relatively cheap multiple transmissions from the storage server to the computational server Thus the present DSI feature helps NetSolve to operate in a cache like setting Presently only Internet Backplane Protocol IBP is used for providing the storage service In the future we hope to integrate other commonly available storage service systems Using DSI To use DSI one should enable the DSI feature both at the NetSolve client and the server Type UNIX configure with ibp IBP DIR during the initial configure of NetSolve Here 1BP DIR denotes the location of the IBP directory This is specifically the directory of the IBP full distribution downloadable from the IBP web site http icl cs utk edu ibp Note When using IBP in a server pool that has both IBP enabled servers and those that aren t IBP enabled one should use the assigned server feature to ensure that the problem submission goes to a server with IBP enabled DSI APIs The DSI APIs are modeled after the UNIX file manipulation commands open close etc with a few extra parameters that are specific to the concepts of DSI This section provides the syntax and semantics of the different DSI APIs available to the NetSolve user DSI FILE ns dsi open char host name int flag int permissions int size dsi type storage system 103 Chapter ZU Distributed Storage
192. tderr info netslpr request fprintf stderr Xn if info NetSolveOK info netslwt request Tf info lt 0 netslerr info else if ierr 0 fprintf stderr Cannot solve for this Matrix and right hand side n else fprintf stderr Solution n for i 0 i lt m i fprintf stderr At gt f n b2 i Calling Netsolve for linsol in a blocking fashion For linsol the right hand side is overwritten x with the solution Xy fprintf stderr Calling NetSolve for linsol blocking n info netsl linsol m 1 a3 m b3 m 147 Appendix C Complete C Example XI unio lt 2 netslerr info else fprintf stderr occ Ag fprintf stderr Success n fprintf stderr occ NM fprintf stderr Solution n for i 0 i lt m 1 fprintf stderr At gt f n b3 i Calling Netsolve for linsol in a non blocking fashion For linsol the right hand side is overwritten with the solution f fprintf stderr Calling NetSolve for linsol non blocking n request netslnb linsol m 1 a4 m b4 m if info 0 netslerr info exit 0 fprintf stderr Request d being processed n request fprintf stderr Probing Nn info netslpr request while info NetSolveNotReady sleep 4 fprintf stderr fflush stderr info netslpr request fprintf stderr Xn
193. te the original log file so if the information is needed it must be copied to another file To terminate an existing agent or query an existing NetSolve system the user should refer to the NetSolve management tools particularly NS killagent as outlined in Chapter 16 68 Chapter 15 Running the NetSolve Server Starting a Server After compiling the server as explained in the Section called Installation on Unix Systems using ns install in Chapter 13 the executable of the NetSolve server is located in SNETSOLVE ROOT bin SNETSOLVE ARCH The proper command line for this program is NS server f config file 1 logfile k a IP address s This executable uses a configuration file for initializing the NetSolve server When invoked with no arguments as UNIX NS server the default configuration file located in NETSOLVE ROOT server configis used This is the file that should be used for first experiments and for testing the system However it is possible to customize or expand the functionality of a server the Section called The Server Configuration File or to specify another configuration file by calling the executable as in UNIX NS server f path to my config for instance The 1 option specifies the name of a file to use for logging purposes UNIX NS server 1 path to agent_logfile This file is where the server logs all of its interactions and possibly
194. ted in Table 27 1 These runtime error messages are defined in SNETSOLVE_ROOT src CoreFunctions netsolveerror c If one of these error messages occurs the user should first check the agent and server log files SNETSOLVE ROOT nsagent logoOr NETSOLVE ROOT nsserver log respectively These files may contain more information to clarify the reason for the error message Otherwise the user can refer to Chapter 12 for an explanation of possible causes for specific error messages Table 27 1 Error Codes ERROR CODE RUNTIME ERROR MESSAGE VALUE NS not ready NS NETSOLVE AGENT not set NS NETSOLVE ROOT not set NS NETSOLVE ARCH not set NetSolveInternalError NS internal error NetSolveUnknownHost NS Unknown host NetSolveNetworkError NS network error NetSolveUnknownProblem 8 NS unknown problem NetSolveProtocolError 9 NS protocol error 10 NS no available server NS bad problem input output NS not allowed NS bad input values NS dimension mismatch NS no solution NS unknown error NS invalid request ID 19 21 NetSolveBadProblemName NS invalid problem name NetSolveInvalidMajor 19 NS invalid major specification NetSolveTooManyPendingRequests NS too many pending requests NetSolveFileError 21 NS file I O error NetSolveUnknownDataFormat NS unknown machine type 128 Chapter z Error Handling in Netsolve ERROR CODE RUNTIME ERROR MESSAGE VALUE
195. tested most effectively by using sparse matrices generated from collections such as the Harwell Boeing test collection on the Matrix Market homepage http math nist gov MatrixMarket Refer to the section on the webpage entitled Software where the test matrices are available in C Fortran and Matlab For ease of testing several of the test matrices from this collection are included in the distribution of NetSolve After Matlab has been invoked the user can then call the test scripts ma28 test m and superlu test minthe SNETSOLVE ROOT src Testing matlab directory by typing gt gt ma28 test and gt gt superlu test These scripts invoke the MA28 and SuperLU interfaces and check the validity of the computed solution Alternatively the user can generate a series of Harwell Boeing matrix types 1 5 using the generate m script To see a list of Harwell Boeing matrix types that can be generated type gt gt generate 0 And then call the functions ma28 m and or superlu m by typing gt gt A rhs generate 1 gt gt xl ma28 A rhs gt gt x2 superlu A rhs Note that the user can query for the list of arguments in the calling sequence to the routine by using the NetSolve tool routine gt gt netsolve direct solve serial 33 Chapter 7 Mathematica Interface Introduction The Mathematica client interface for NetSolve is built by typing UNIX make mathematica in the directory
196. tional Journal of Supercomputer Applications and Performance Computing NetSolve A Network Server for Solving Computational Science Problems ieee cse 1997 1998 IEEE IEEE Computational Science amp Engineering NetSolve s Network Enabled Server Examples and Applications 57 67 5 3 Henri Casanova and Jack Dongarra sequencing 2000 Euro Par 2000 Parallel Processing Request Sequencing Optimizing Communication for the Grid 3 540 67956 1 D Arnold D Bachmann and J Dongarra ns impl 1998 UT Department of Computer Science Technical Report NetSolve version 1 2 Design and Implementation Henri Casanova and Jack Dongarra ns mathematica 1998 UNI C Technical Report UNIC 98 05 Mathematica Interface to NetSolve Henri Casanova Jack Dongarra A Karaivanov and Jerzy Wasniewski condor1 1988 Proceedings of the 8th International Conference of Distributed Computing Systems Condor A Hunter of Idle Workstations 104 111 M Litzkow M Livny and M W Mutka condor2 1990 IEEE Proceedings of the IEEE Workshop on Experimental Distributed Systems Experience with the Condor Distributed Batch System M Litzkow and M Livny ima 1998 Springer Verlag IMA Volumes in Mathematics and its Applications Algorithms for Parallel Processing Providing Uniform Dynamic Access to Numerical Software 345 355 105 Henri Casanova and Jack Dongarra lapack 1999 SIAM LAPACK Users Guide Third Edition 0 89871 447 8 E Ander
197. to the NetSolve repository Interface Definition Language the image renderer PovRay available at http www povray org Requirements on the client nspovray c the client program which invokes the various instances of PovRay via NetSolve and puts together the final image pov and ini sample PovRay files the image processing tool ImageMagick available at http www imagemagick org the mpeg encoder mpeg encode available at http bmrc berkeley edu frame research mpeg mpeg_encode html the Netpbm library available at http netpbm sourceforge net Instructions 1 Building and Configuring the Library 133 Appendix A Netsolve Lutorials I At first make sure to have a working copy of PovRay http www povray org on the server Either it is already installed or download it and run configure and make To test povray try to render a POV file on the server e g assuming icl pov in the current directory UNIX home user povray src povray Iicl pov Oicl png L home user povray include II Edit 1ibpovray c and provide in the first two lines the povray executable If the executable is not in your PATH include the path and the path to the PovRay include directory contains all the INC files III Execute the following steps to build 1ibpovray a UNIX gcc c libpovray c UNIX ar rc libpovray a libpovray o 2 Installing the Problem to the NetSolve Repository Use idltopdf to convert povray id1 to p
198. tributed Computing The efficient solution of large problems is an ongoing thread of research in scientific computing An increasingly popular method of solving these types of problems is to harness disparate computational resources and use their aggregate power as if it were contained in a single machine This mode of using computers that may be distributed in geography as well as ownership has been termed Distributed Computing Some of the major issues concerned with Distributed Computing are resource discovery resource allocation and resource management fault tolerance security and access control scalability flexibility and performance Various organizations have developed mechanisms that attempt to address these issues each with their own perspectives of how to resolve them What is NetSolve NetSolve http icl cs utk edu netsolve is an example of a Distributed Computing system that hopes to present functionalities and features that a wide variety of scientists will find highly useful and helpful Background Various mechanisms have been developed to perform computations across diverse platforms The most common mechanism involves software libraries Unfortunately the use of such libraries presents several difficulties Some software libraries are highly optimized for only certain platforms and do not provide a convenient interface to other computer systems Other libraries demand considerable programming effort from the user While sev
199. tus code integer status If the call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence netslnb lt problem name gt Sends a nonblocking request to NetSolve netslnb takes as argument the name of the problem and the list of arguments in the calling sequence See the Section called What is the Calling Sequence in Chapter 5 for a discussion about this calling sequence It returns the NetSolve status code integer status If the call is successful status contains the request handler netslwt request handler Waits for a request completion netslwt takes as argument a request handler an integer If the call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence during the call to nets1nb netslpr request handler Probes for a request completion netslpr takes as argument a request handler an integer If the call is successful the result of the computation is stored in the output arguments The output arguments are specified in the calling sequence during the call to nets1nb netslerr lt error code Displays an explicit error message given a NetSolve error code netslmajor lt major gt Sets the way the user has stored her matrices row or column wise The argument can be col or row Itis case insensitive and in
200. uired because every NetSolve problem is treated as a function defined in Mathematica The output of that command is as follows In 5 NetSolve iqsort iqsort Quicksort Sorts a vector of integers Input 0 Integer Vector Vector of integers to Sort Output 0 Integer Vector Sorted Vector Mathematica example rIO NetSolvel igqsort 10 examples for types Char Byte Integer Single Double Scalars ce 42 66 32 Vector vector 1 2 3 3 4 5 7 Matrix line 1 1 2 3 6 4 2 1 Complex 4 71 35 754531 8 1 2I 3 441 36 Chapter Mathematica Interface line 2 4 5 6 7 1 2 4 5 61 NF The first part of the output is a brief general description of the problem The second part describes the input and output objects their type and description And lastly an example is provided If the user does not provide the number the type and the sequence of arguments correctly an error message message will be printed and the Nu11 symbol will be returned The arguments shown in the example are variables but the user may also choose to pass numerical values symbols with assigned data or function calls Here are some rules the user must remember 1 Characters are passed as strings only the first character is used 2 Integers can be passed instead of reals and vice versa conversion is performed automatically 3 Integers and reals can be passed instead of complex numbers
201. us GridRPC call has completed grpc cancel cancels the specified asynchronous GridRPC call Asynchronous GridRPC Wait Functions The following five functions apply only to previously submitted non blocking requests These calls allow an application to express desired non deterministic completion semantics to the underlying system rather than repeatedly polling on a set of sessions IDs From an implementation standpoint such information could be conveyed to the OS scheduler to reduce cycles wasted on polling e grpc wait blocks until the specified non blocking requests to complete e grpc wait and blocks until all of the specified non blocking requests in a given set have completed grpc wait or blocks until any of the specified non blocking requests in a given set has completed e grpc wait all blocks until all previously issued non blocking requests have completed grpc wait any blocks until any previously issued non blocking request has completed 111 Chapter z1 Griakr C Error Reporting Functions Of course it is possible that some GridRPC calls can fail so we need to provide the ability to check the error code of previously submitted requests The following error reporting functions provide error codes and human readable error descriptions grpc perror prints the error string associated with the last GridRPC call grpc error string returns the error description string given a numeric error code grpc get error retu
202. ut we strongly recommend the use of the PDF Wizard described in the Section called PDF Wizard or the Interface Definition Language IDL described in the Section called NetSolve IDL Simplified PDF to assist in creating new PDFs The rationale for the syntax of the description files is explained in ima Each description file is composed of several problem descriptions Before explaining how to create a problem description we reiterate the concept of objects in NetSolve and then define the concept of mnemonics NetSolve Objects As detailed in the Section called NetSolve Problem Specification in Chapter 4 the syntax of a NetSolve problem specification is a function evaluation output lt name gt input where name is a character string containing the name of the problem input is a list of input objects output is a list of output objects An object is itself described by an object type and a data type The types available in the current version of NetSolve are shown in Table 17 1 and Table 17 2 Table 17 1 Available data types Data Type Description Note NETSOLVE 1 integer NETSOLVE_CHAR Character NETSOLVE_BYTE never XDR encoded 83 Chapter 1 Lhe Problem Description rile Data Type Description Note NETSOLVE FLOAT Single precision real EN NETSOLVE DOUBLE Double precision real NENNEN NETSOLVE SCOMPLEX Single precision complex NETSOLVE DCOMPLEX Double precision comple
203. ware In this case the switching to NetSolve is immediate The second possibility is that the user does not know the software If this is the case he needs to pay close attention to the output given by NS probdesc The output from this command first gives the calling sequence as it would be invoked from Matlab and then gives the calling sequence from C Fortran UNIX NS probdesc netsolve cs utk edu dgesv dgesv From LAPACK Compute the solution to a real system of linear equations A X pb where A is an N by B matrix and X and B are N by NRHS matrices Matlab Example x y z info netsolve dgesv a b http www netlib org lapack index html 2 objects in INPUT input 0 Matrix Double Precision Real Matrix A input 1 Matrix Double Precision Real Right hand side 4 objects in OUTPUT output 0 Matrix Double Precision Real LU factors A P L U 19 Chapter 5 C and rortran Interjaces output 1 Vector Integer Vector of pivots defines the P matrix output 2 Matrix Double Precision Real Solution output 3 Scalar Integer INFO 0 successful 0 error on calling gt 0 OR algorithm failed Calling sequence from C or Fortran 8 arguments Argument 40 number of rows of input object 0 A number of columns of input object 0 A number of rows of input object 41 RHS Argument 41 number of columns of input object 1 RHS Argument 42 pointer to input object 0
204. x Table 17 2 Available object types Object Type Description Note INETSOLVE SCALAR scalar vector pO INETSOLVE MATRIX matrix 3 O NETSOLVE_SPARSEMATRIX sparse matrix Compressed Row Storage CRS format NETSOLVE_FILE file only of data type NETSOLVE_CHAR NETSOLVE_PACKEDFILES packed files only of data type NETSOLVE_CHAR NETSOLVE_UPF User Provided Function only of data type NETSOLVE_CHAR NETSOLVE_STRING Character string only of data type NETSOLVE_CHAR NETSOLVE_STRINGLIST Character string list only of data type NETSOLVE_CHAR A problem description file PDF uses these objects to define a problem specification for a given service the Section called Mnemonics describes the requirements for each NetSolve object type as it relates to the problem description file Sparse Matrix Representation in NetSolve NetSolve uses the Compressed Row Storage CRS format for storing sparse matrices The CRS format puts the subsequent nonzeros of the matrix rows in contiguous memory locations Assuming we have a nonsymmetric sparse matrix we create vectors one for floating point numbers val and the other two for integers col ind row ptr The val vector stores the values of the nonzero elements of the matrix as they are traversed in a row wise fashion The col ind vector stores the column indexes of the elements in the val vector The row ptr vector stores the locations in the val vector that start a row For example if pi
205. y 71 Hardwate Software Servers ia I Ud e ERE x e ERREUR 12 Hardware Software Server Security essent 72 Software Server Setup Generating a Key sss 73 Hardware Server Setup Incorporating a key ooccocnonnicnnonnonncononnnnnnnnnnancn non nconocnncnnonnos 75 16 NetSolve Management Tools for Administrators essere 80 RNV liada 80 NS problems occiso didactica ee educ etes 80 NS probd Sc s rn ec a a eec tede TRE ROO HD ao EHE NEIN HE das 80 NS Killa gent ii oT RR PD TER A TREO TERI 81 NS Kills ver ov e ae e Na 82 NS Killall 5 3 EE eon is 82 17 The Problem Description File ia encontre deine tecto ree Hed 83 Contents of a Problem Description File ooooncnocnncnnonocnnonconcnnncnnnancnncn nono cnnonncnn enne 83 NetSolve Objects iie i ete ette eerie rdg 83 Sparse Matrix Representation in NetSolve see 84 MInetfnonlCS iecur eye hi ic ee eg eda eed ort le ae he ay 85 Sections of a Problem Description eene entren ennt 86 Problem ID and General InformatiQN ooccincnonnnonocononcnnocncononncnnncnnnnnc nn con nc ee 86 Input Specification ote oreet ete eroe rete ps 87 Output Specification 5 ei eit o eee ope eri eei 88 Additional Information eese eee enne 88 Calling Sequence eei o eti eee bie eei t 88 Pseudo Code regere nU tet 90 A Simple Example hg rie pre elucet a 91
206. y in Chapter 13 and has enabled LAPACK and BLAS in the NETSOLVE ROOT server config file he she may choose to run this test suite Note that only a subset of LAPACK is included in the NetSolve distribution The complete LAPACK library is not included as default numerical software for the server and must be installed separately The test suite consists of a set of Matlab scripts that test each of the LAPACK interfaces available in NetSolve The main script is called lapack_test m and is located in NETSOLVE ROOT src Testing matlab To run the LAPACK test suite type lapack_test at the Matlab prompt Optional Testing the NetSolve ScaLAPACK interfaces Likewise a NetSolve Matlab ScaLAPACK test suite is available with the NetSolve distribution If the user enabled ScaLAPACK during the configuration phase of NetSolve as instructed in the Section called Enabling the ScaLAPACK library in Chapter 13 and has enabled ScaLAPACK MPIBLACS BLAS and MPI libraries in the SNETSOLVE_ROOT server_config file then he may choose to run this test suite 3l Chapter 6 Matlab Interjace The ScaLAPACK library is not included as default numerical software for the server and must be installed separately as well as MPI The test suite consists of a set of Matlab scripts that test each of the ScaLAPACK interfaces available in NetSolve The main script is called scalapack test mandis located in NETSOLVE ROOT src Testing matlab
207. yping make wrappers and make server in the SNETSOLVE_ROOT directory 67 Chapter 14 Running the NetSolve Agent After compiling the agent as explained in the Section called Installation on Unix Systems using ns install in Chapter 13 the executable of the NetSolve agent is located in SNETSOLVE ROOT bin SNETSOLVE ARCH The proper command line for this program is NS agent l logfile When invoked with no arguments a stand alone agent is started This agent is now available for registrations of NetSolve servers wanting to participate in a new NetSolve system After servers are registered client programs can contact this agent and have requests serviced by one or more of the registered servers Note Only one NetSolve agent can be running on a given machine at a given time The 1 option specifies the name of a file to use for logging purposes UNIX NS agent 1 home me agent logfile This file is where the agent logs all of its interactions and possibly errors since it is a daemon with no controlling terminal and therefore has no way to do this otherwise This log file also produces very useful information about requests among other things that helps administrators know how their NetSolve system is being used If no 1 option is specified the default log file is NETSOLVE ROOT nsagent 1log This means that successive runs of the agent with no specification of a log file will overwri
Download Pdf Manuals
Related Search
Related Contents
OUTSPOT_3W_54__rgbw_user_manual AS 531 2T MK B MON PARCOURS DECOUVERTE Facade_Manual de usuario-ES_V02_1301-EN Touch2/Eye9 User`s Manual User`s Manual ASSMANN Electronic DN-70181 Bushnell COMPACT 800 User's Manual A B C D E - Lidl Service Website Samsung ML-2950NDR Наръчник за потребителя Copyright © All rights reserved.
Failed to retrieve file