diff --git a/pfarm/cpu/example_job_scripts/exdig_mpi_omp_atom_4x16.slurm b/pfarm/cpu/example_job_scripts/exdig_mpi_omp_atom_4x16.slurm new file mode 100644 index 0000000000000000000000000000000000000000..2eda8b9f97d605936a9ab41e4cad7de1995d98f9 --- /dev/null +++ b/pfarm/cpu/example_job_scripts/exdig_mpi_omp_atom_4x16.slurm @@ -0,0 +1,37 @@ +#!/bin/bash --login +# Slurm job options (job-name, compute nodes, job time) +#SBATCH --job-name=exd_cpu_at_4x16 +#SBATCH --time=0:20:0 +#SBATCH --nodes=4 +#SBATCH --tasks-per-node=1 +#SBATCH --cpus-per-task=16 + +# Replace [budget code] below with your project code (e.g. t01) +#SBATCH --account=c01-hec +#SBATCH --partition=standard +#SBATCH --qos=standard + +# Set the number of threads to 16 and specify placement +# There are 16 OpenMP threads per MPI process +# We want one thread per physical core +export OMP_NUM_THREADS=16 +export OMP_PLACES=cores + +# Environment settings for exdig_atom +export RMX_NSECT_FINE=16 +export RMX_NSECT_COARSE=16 +export RMX_NL_FINE=22 +export RMX_NL_COARSE=10 + +# Launch the parallel job +# Using 4 MPI processes +# 1 MPI processes per node +# 16 OpenMP threads per MPI process +# Additional srun options to pin one thread per physical core +srun --hint=nomultithread --distribution=block:block ./exdig_mpi_omp_atom + + + + + + diff --git a/pfarm/cpu/example_job_scripts/exdig_mpi_omp_mol_4x16.slurm b/pfarm/cpu/example_job_scripts/exdig_mpi_omp_mol_4x16.slurm new file mode 100644 index 0000000000000000000000000000000000000000..cae4960cf2f5e93c832e1746ab608b6b94046dff --- /dev/null +++ b/pfarm/cpu/example_job_scripts/exdig_mpi_omp_mol_4x16.slurm @@ -0,0 +1,37 @@ +#!/bin/bash --login +# Slurm job options (job-name, compute nodes, job time) +#SBATCH --job-name=exd_cpu_mo_4x16 +#SBATCH --time=0:20:0 +#SBATCH --nodes=4 +#SBATCH --tasks-per-node=1 +#SBATCH --cpus-per-task=16 + +# Replace [budget code] below with your project code (e.g. t01) +#SBATCH --account=c01-hec +#SBATCH --partition=standard +#SBATCH --qos=standard + +# Set the number of threads to 16 and specify placement +# There are 16 OpenMP threads per MPI process +# We want one thread per physical core +export OMP_NUM_THREADS=16 +export OMP_PLACES=cores + +# Environment settings for exdig_atom +export RMX_NSECT_FINE=64 +export RMX_NSECT_COARSE=64 +export RMX_NL_FINE=10 +export RMX_NL_COARSE=10 + +# Launch the parallel job +# Using 4 MPI processes +# 1 MPI processes per node +# 16 OpenMP threads per MPI process +# Additional srun options to pin one thread per physical core +srun --hint=nomultithread --distribution=block:block ./exdig_mpi_omp_atom + + + + + + diff --git a/pfarm/cpu/setup_run_cpu_atom.scr b/pfarm/cpu/setup_run_cpu_atom.scr index 73abc50c1c3041c367d2c332ff874d2f048acb47..040d8c6be69c916e16f25639f567740520033d61 100755 --- a/pfarm/cpu/setup_run_cpu_atom.scr +++ b/pfarm/cpu/setup_run_cpu_atom.scr @@ -5,11 +5,12 @@ mkdir $1 cd $1 -ln -s ../../data/test_case_1_atom/HXJ030 . -ln -s ../../data/test_case_1_atom/XJTARMOM . -cp ../../data/test_case_1_atom/phzin.ctl . +ln -s ../../../data/test_case_1_atom/HXJ030 . +ln -s ../../../data/test_case_1_atom/XJTARMOM . +cp ../../../data/test_case_1_atom/phzin.ctl . ln -s ../bin/exdig_mpi_omp_atom . cp ../example_job_scripts/exdig_mpi_omp_atom_4x16.pbs . +cp ../example_job_scripts/exdig_mpi_omp_atom_4x16.slurm . cd .. diff --git a/pfarm/cpu/setup_run_cpu_mol.scr b/pfarm/cpu/setup_run_cpu_mol.scr index 2ef66ac35e317853c5edd7f8b711b3df03772ad7..4057b4167e4ada86909b4f19663ae180d4cdac0d 100755 --- a/pfarm/cpu/setup_run_cpu_mol.scr +++ b/pfarm/cpu/setup_run_cpu_mol.scr @@ -9,5 +9,6 @@ ln -s ../../data/test_case_2_mol/H . cp ../../data/test_case_2_mol/phzin.ctl . ln -s ../bin/exdig_mpi_omp_mol . cp ../example_job_scripts/exdig_mpi_omp_mol_4x16.pbs . +cp ../example_job_scripts/exdig_mpi_omp_mol_4x16.slurm . cd .. diff --git a/pfarm/cpu/src_mpi_omp_atom/DEFS b/pfarm/cpu/src_mpi_omp_atom/DEFS index 3ff5f0aca031f720231bd20377ada8a2ccf2c7b7..44428e18485b86261d498b19ea5fcfa6d0e59a32 120000 --- a/pfarm/cpu/src_mpi_omp_atom/DEFS +++ b/pfarm/cpu/src_mpi_omp_atom/DEFS @@ -1 +1 @@ -DEFS_cray \ No newline at end of file +DEFS_intel_skl \ No newline at end of file diff --git a/pfarm/cpu/src_mpi_omp_atom/DEFS.karthee b/pfarm/cpu/src_mpi_omp_atom/DEFS.karthee deleted file mode 100644 index e1eb065fd89d59f3a9737766eed8bd7a1686bd7a..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/DEFS.karthee +++ /dev/null @@ -1,16 +0,0 @@ -#LIBS = -L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -L/usr/local/packages/vampir/lib64 -lVT -lld -LIBS = -L$(MAGMADIR)/lib -L$(CUDADIR)/lib64 -lmagma -lcudart -lcublas -STATIC_LIBS = -Wl,--start-group -L/home/cseg/scarf474/xdr_cliff_new -lfxdr -Wl,--end-group - -F90 = mpiifort - -F90FLAGS = -fpp -DHAVE_CUBLAS -mkl=parallel -O3 -I$(MAGMADIR)/include -I$(CUDADIR)/include -Dmagma_devptr_t="integer(kind=8)" -#-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1 \ -# -qsuffix=f=f90 -g -qessl -q64 -#F90FLAGS = -g -C -qextchk -qflag=I:I -qlanglvl=95pure -qnoopt \ -# -qflttrap=overflow:underflow:invalid:zerodivide \ -# -qinitauto=7FF7FFFF -qsuffix=f=f90 -q64 -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) -LDFLAGS_STAT1= -Wl,--start-group -LDFLAGS_STAT2= -Wl,--end-group diff --git a/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_knl b/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_knl deleted file mode 100644 index e1eb065fd89d59f3a9737766eed8bd7a1686bd7a..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_knl +++ /dev/null @@ -1,16 +0,0 @@ -#LIBS = -L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -L/usr/local/packages/vampir/lib64 -lVT -lld -LIBS = -L$(MAGMADIR)/lib -L$(CUDADIR)/lib64 -lmagma -lcudart -lcublas -STATIC_LIBS = -Wl,--start-group -L/home/cseg/scarf474/xdr_cliff_new -lfxdr -Wl,--end-group - -F90 = mpiifort - -F90FLAGS = -fpp -DHAVE_CUBLAS -mkl=parallel -O3 -I$(MAGMADIR)/include -I$(CUDADIR)/include -Dmagma_devptr_t="integer(kind=8)" -#-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1 \ -# -qsuffix=f=f90 -g -qessl -q64 -#F90FLAGS = -g -C -qextchk -qflag=I:I -qlanglvl=95pure -qnoopt \ -# -qflttrap=overflow:underflow:invalid:zerodivide \ -# -qinitauto=7FF7FFFF -qsuffix=f=f90 -q64 -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) -LDFLAGS_STAT1= -Wl,--start-group -LDFLAGS_STAT2= -Wl,--end-group diff --git a/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_skl b/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_skl index ee44ee26f05f6aa1b0a040ac0a45982de21f80ed..9f4a04c7690157f6c0ffe01ef528c09d3602474e 100644 --- a/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_skl +++ b/pfarm/cpu/src_mpi_omp_atom/DEFS_intel_skl @@ -1,5 +1,5 @@ LIBS = -STATIC_LIBS = -L../lib -lfxdr +STATIC_LIBS = -L../../lib -lfxdr -ltirpc F90 = mpif90 @@ -7,7 +7,7 @@ F90 = mpif90 #F90FLAGS = -mtune=knl -mkl=parallel -O3 # Skylake options -F90FLAGS = -mtune=skylake -mkl=parallel -O3 +F90FLAGS = -mtune=skylake -mkl=parallel -Ofast F90FLAGS1 = $(F90FLAGS) LDFLAGS=$(F90FLAGS) diff --git a/pfarm/cpu/src_mpi_omp_atom/DEFS_pgi b/pfarm/cpu/src_mpi_omp_atom/DEFS_pgi deleted file mode 100644 index ab4c9604152eb495cf68d8b5c7108683e315a41e..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/DEFS_pgi +++ /dev/null @@ -1,14 +0,0 @@ -#LIBS = -L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -L/usr/local/packages/vampir/lib64 -lVT -lld -LIBS = -L../xdr -lfxdr -#-L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -F90 = ftn - - -F90FLAGS = -r8 -#-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1 \ -# -qsuffix=f=f90 -g -qessl -q64 -#F90FLAGS = -g -C -qextchk -qflag=I:I -qlanglvl=95pure -qnoopt \ -# -qflttrap=overflow:underflow:invalid:zerodivide \ -# -qinitauto=7FF7FFFF -qsuffix=f=f90 -q64 -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) diff --git a/pfarm/cpu/src_mpi_omp_atom/amp.f90 b/pfarm/cpu/src_mpi_omp_atom/amp.f90 index eb428a308b6a1a82adca9df75ca1ea76ba8cdba9..b687cdd1237a5757ec1b1ae425402a44d1954e8c 100644 --- a/pfarm/cpu/src_mpi_omp_atom/amp.f90 +++ b/pfarm/cpu/src_mpi_omp_atom/amp.f90 @@ -25,11 +25,11 @@ contains integer, intent(in) :: st ! second target spin integer, intent(in) :: sect ! sector id integer, intent(in) :: imesh ! mesh id - character(len=11) :: hname + character(len=13) :: hname character(len=2) :: sp, l character(len=1) :: p character(len=4) :: stem - character(len=2) :: isect + character(len=4) :: isect integer :: ios, qn(3), status integer :: nspn ! scattering spin. @@ -56,7 +56,7 @@ contains end if write (l,'(i2.2)') abs(qn(1)) write (p, '(i1.1)') qn(3) - write (isect, '(i2.2)') sect + write (isect, '(i4.4)') sect hname = stem // sp // l // p // isect if (xdr) then ! open XDR output file for Hamiltonian @@ -90,13 +90,15 @@ contains use energy_grid, only: fine_mesh use slp, only: qno, val_qno use rmx1_in, only: xdr, split_prop - use mpi + !use mpi + include 'mpif.h' + type(qno), intent(in) :: sqno ! scattering q#s integer, intent(in) :: st ! second target spin - character(len=11) :: hname - character(len=2) :: sp, l, s_mpi + character(len=13) :: hname + character(len=2) :: sp, l character(len=1) :: p - character(len=4) :: stem + character(len=4) :: stem, s_mpi integer :: ios, qn(3), status integer :: nspn ! scattering spin. integer ( kind = 4 ) ierr @@ -123,7 +125,7 @@ contains end if write (l,'(i2.2)') abs(qn(1)) write (p, '(i1.1)') qn(3) - write (s_mpi, '(i2.2)') taskid + write (s_mpi, '(i4.4)') taskid hname = stem // sp // l // p // s_mpi diff --git a/pfarm/cpu/src_mpi_omp_atom/amp.f90.ori b/pfarm/cpu/src_mpi_omp_atom/amp.f90.ori deleted file mode 100644 index 6296cd3ac38fe9aac3253234e427d4159cc9529f..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/amp.f90.ori +++ /dev/null @@ -1,200 +0,0 @@ -module rw_amplitudes -! calculated sector reduced-width amplitudes -! Time-stamp: "2003-10-06 14:23:21 cjn" - use io_units, only: fo, fa - use precisn, only: wp - use def_sectors, only: nh, nsect - implicit none - - integer, save :: ixdro ! XDR unit number for rwa file - - private - public start_sa_file, ampltd - -contains - - subroutine start_sa_file (sqno, st) -! open XDR file to hold sector reduced width amplitudes - use xdr_files, only: open_xdr, xdr_io - use energy_grid, only: fine_mesh - use slp, only: qno, val_qno - use rmx1_in, only: xdr, split_prop - type(qno), intent(in) :: sqno ! scattering q#s - integer, intent(in) :: st ! second target spin - character(len=9) :: hname - character(len=2) :: sp, l - character(len=1) :: p - character(len=4) :: stem - integer :: ios, qn(3), status - integer :: nspn ! scattering spin. - -! File naming convention: -! AMPCSSLLP: coarse mesh, 1st partition (or all channels) -! AMPFSSLLP: fine mesh, 1st partition (or all channels) -! AMPCTTLLP: coarse mesh, 2nd partition. TT = target spin multiplicity -! AMPFTTLLP: fine mesh, 2nd partition, TT = target spin multiplicity -! For no-exchange LS files target spin multiplicity is used -! For J files L is replaced by 2*J and total spin multiplicity by 0 -! or target spin multiplicity by 2*K -! For no-exchange files L is replaced by 2*K -! and total spin multiplicity by 0 - - ixdro = fa - stem = 'AMPC' - if (fine_mesh) stem = 'AMPF' - qn = val_qno(sqno) - if (split_prop) then ! channel splitting in use - write (sp,'(i2.2)') st ! use target spin (splitting parameter) - else - if (qn(1) < 0) qn(2) = 0 ! for jpi_coupling - write (sp,'(i2.2)') abs(qn(2)) ! scattering spin (0 for jpi_coupling) - end if - write (l,'(i2.2)') abs(qn(1)) - write (p, '(i1.1)') qn(3) - hname = stem // sp // l // p - - if (xdr) then ! open XDR output file for Hamiltonian - ixdro = open_xdr (file=TRIM(hname), action='write') - call xdr_io (ixdro, nh) - call xdr_io (ixdro, nsect) - else - open (unit=ixdro, file=TRIM(hname), access='sequential', & - status='replace', form='unformatted', action='write', & - iostat=ios) - if (ios /= 0) then - write (fo,'(a,i6)') 'start_sa_file: error opening ' // & - TRIM(hname) // ' iostat = ', ios - stop - end if - write (ixdro) nh, nsect - end if - if (xdr) then - write (fo,'(a)') 'XDR Representation Amplitude file: ' // & - &TRIM(hname) - else - write (fo,'(a)') 'Native Representation Amplitude file: ' // & - &TRIM(hname) - end if - end subroutine start_sa_file - - subroutine ampltd (ra1, ra2, nc, nl, nh) -! ampltd : computes surface amplitudes and writes to file - use xdr_files, only: xdr_io - use sec_ham, only: vbl, vbr - use dist_mat, only: evals - use rmx1_in, only: bug8, xdr - use blacs, only: p0, q0, ctxt, io_processor, p_error, dlen_, & - ctxt_, mb_ - use dist_mat, only: z, descz - integer, intent(in) :: nc ! # channels - integer, intent(in) :: nl ! # Legendre functions - integer, intent(in) :: nh ! sec Hamiltonian dimension - real(wp), intent(in) :: ra1, ra2 ! end pt radii of subrange - real(wp), allocatable :: ampal(:), ampar(:) ! local amps - real(wp), allocatable :: evec(:) - integer :: k, j, ik, i, jj, status - integer :: mm, nn, lwork, mb, nb, rsrc, csrc - integer :: ldd, isize, istart, iend - integer :: jsize, jstart, jend - real(wp) :: alpha, beta, sml, smr - integer :: descx(dlen_) - - if (io_processor) then - allocate (ampal(nc), ampar(nc), stat=status) - if (status /= 0) then - write (fo,'(a,i6)') 'ampltd: allocation error = ', status - call BLACS_ABORT (ctxt, status) - end if - - if (bug8 > 0) then - write (fo,'(a,e20.12)') 'Sector eigenvalue sum = ', SUM(evals) - else if (bug8 > 1) then - write (fo,'(a)') 'R-Matrix Eigenvalues (Ryd)' - write (fo,'(5f12.5)') evals - end if - -! write eigenvalues to disk - if (xdr) then - call xdr_io (ixdro, evals, nh) ! write R-matrix eigenvalues - else - write (ixdro) evals - end if - end if - - allocate (evec(nh), stat=status) - call p_error (status, 'ampltd: evec allocation') - lwork = descz(mb_) ! eigenvectgor block size - ctxt = descz(ctxt_) ! context - -! form descriptor for evec - mm = MAX(1, MIN(nh, lwork)) - nn = MAX(1, INT(lwork / mm)) - mb = mm - nb = nn - rsrc = p0 - csrc = q0 - ldd = MAX(1, mm) - call descset (descx, mm, nn, mb, nb, rsrc, csrc, ctxt, ldd) - - alpha = 1.0_wp - beta = 0.0_wp - sml = 0.0_wp - smr = 0.0_wp - jst: do jstart = 1, nh, nn - jend = MIN(nh, jstart+nn-1) - jsize = jend - jstart + 1 - evec = 0.0_wp - - row_blocks: do istart = 1, nh, mm - iend = MIN(nh, istart+mm-1) - isize = iend - istart + 1 - call pdgeadd ('notrans', isize, jsize, alpha, z, istart, & - jstart, descz, beta, evec(istart:iend), 1, 1, descx) - end do row_blocks - call BLACS_BARRIER (ctxt, 'A') -! now have the full eigenvector on the i/o processor: - - if (io_processor) then - ampal = 0.0_wp - ampar = 0.0_wp - ik = 0 - do i = 1, nc - do j = 1, nl - ik = ik + 1 - ampal(i) = ampal(i) + evec(ik) * vbl(j) - ampar(i) = ampar(i) + evec(ik) * vbr(j) - end do - end do - - if (bug8 > 0) then - sml = sml + SUM(ampal) - smr = smr + SUM(ampar) - else if (bug8 > 2) then - write (fo,'(a,f10.5,a,i4)') 'Amplitudes (a.u.) at ', ra1,& - ' Column: ', jstart - write (fo,'(5e14.6)') ampal - write (fo,'(a,f10.5,a,i4)') 'Amplitudes (a.u.) at ', ra2,& - ' Column: ', jstart - write (fo,'(5e14.6)') ampar - end if - -! write sector reduced width amplitudes to disk - if (xdr) then - call xdr_io (ixdro, ampal, nc) ! write left amplitudes to disk - call xdr_io (ixdro, ampar, nc) ! write right amplitudes to disk - else - write (ixdro) ampal(1:nc) - write (ixdro) ampar(1:nc) - end if - end if - end do jst - if (io_processor) then - if (bug8 > 0) write (fo,'(a,2e20.12)') 'RWAmplitude sums = ', & - sml, smr - deallocate (ampal, ampar, evec, stat=status) - else - deallocate (evec, stat=status) - end if - call p_error (status, 'ampltd: deallocation') - end subroutine ampltd -end module rw_amplitudes diff --git a/pfarm/cpu/src_mpi_omp_atom/dist_mat.f90.2stage b/pfarm/cpu/src_mpi_omp_atom/dist_mat.f90.2stage deleted file mode 100644 index 16f991bf1a345a9d3d97d8bb7819058e97bebc67..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/dist_mat.f90.2stage +++ /dev/null @@ -1,252 +0,0 @@ -module magma_opts - -! DSYEVD Constants as defined in magmamic-1.1.0/include 10/07/2014 - -integer, parameter :: MagmaUpper = 121 -integer, parameter :: MagmaLower = 122 -integer, parameter :: MagmaNoVec = 301 -integer, parameter :: MagmaVec = 302 -integer, parameter :: MagmaErr = -100 - -contains - - function magma_jobz(jobz) - ! Convert character to integer for Magmamic DSYEVD call - integer :: magma_jobz - character, intent(in) :: jobz - - select case(jobz) - case('V') - magma_jobz = MagmaVec - case('v') - magma_jobz = MagmaVec - case('N') - magma_jobz = MagmaNoVec - case('n') - magma_jobz = MagmaNoVec - case default - magma_jobz = MagmaErr - end select - -end function magma_jobz - - function magma_uplo(uplo) - ! Convert character to integer for Magmamic DSYEVD call - integer :: magma_uplo - character, intent(in) :: uplo - - select case(uplo) - case('L') - magma_uplo = MagmaLower - case('l') - magma_uplo = MagmaLower - case('U') - magma_uplo = MagmaUpper - case('u') - magma_uplo = MagmaUpper - case default - magma_uplo = MagmaErr - end select - -end function magma_uplo - -end module magma_opts - -module dist_mat -! Form diestributed sector Hamiltonian matrix and diagonalize -! Time-stamp: "2003-09-23 17:08:23 cjn" - use io_units, only: fo - use precisn, only: wp -! use blacs, only: ctxt, myrow, mycol, p, q, nblock, mynumrows,& -! mynumcols, p_error, dlen_, nb_, csrc_ - use error_out, only: error_check - use magma - use magma_opts - implicit none - - integer, save :: ny ! a dimension - real(wp), allocatable, save :: a(:) ! distributed matrix - real(wp), allocatable, save :: z(:) ! eigenvectors - real(wp), allocatable, save :: evals(:) ! eigenvalues -! integer, save :: desca(dlen_) ! Hamiltonian descriptor -! integer, save :: descz(dlen_) ! Eigenvector descriptor - - private - public A_fill, sh_diag, kill_az - public evals, z - -contains - - subroutine A_fill (n) -! fill lower triangle of symmetric matrix, A - use sec_ham, only: h_el - integer, intent(in) :: n ! matrix dimension - integer :: j, jj, jloc, jglob, i, ii, iloc, iglob - integer :: status, info, numroc - integer :: ind - - ny = n - -! Compute local dimensions of matrix A -! mynumrows = NUMROC(n, nblock, myrow, 0, p) -! mynumcols = NUMROC(n, nblock, mycol, 0, q) - -! Allocate local part of A - allocate (a(ny*ny), z(ny*ny), stat=status) - call error_check (status, ' Allocation Error, A_fill') - - a = 0.0_wp ! initialize A - -! Form array descriptor od destributed matrix A -! call descinit (desca, n, n, nblock, nblock, 0, 0, ctxt, mynumrows,& -! info) -! descz = desca - -! do j = 1, mynumcols, nblock ! local column blocks -! do jj = 1, MIN(nblock, mynumcols-j+1) ! all columns -! jloc = j - 1 + jj ! local column index -! jglob = (j-1) * q + mycol * nblock + jj ! global column index - -! do i = 1, mynumrows, nblock -! do ii = 1, MIN(nblock, mynumrows-i+1) -! iloc = i - 1 + ii ! local index -! iglob = (i-1) * p + myrow * nblock + ii ! global index -! if (iglob > jglob) cycle - -! a(iloc+(jloc-1)*mynumrows) = h_el(iglob, jglob) - -! end do -! end do -! end do -! end do - -! sequential version - full matrix - ind = 0 - do j = 1, ny - do i = 1, j - ind = ind + 1 - a(ind) = h_el(i,j) - end do - end do - - end subroutine A_fill - - subroutine sh_diag -! diagonalize the matrix a - real(wp), allocatable, save :: r(:) - real(wp), allocatable :: work(:) - integer, allocatable :: iwork(:) - integer :: lwork, liwork - real(wp) :: alpha, beta - character(len=1) :: jobz, uplo, MagmaRange - logical :: ismycol - real(wp) :: dnorm2 - integer :: status, ii, nstrt, trilwmin - integer :: np, nq, lda, iproc, info, numroc - integer :: indxg2p, lwork1, ip, iq, imyrow, imycol - integer :: rows, cols - real(wp) :: t0, t1 - integer :: c0, c1, cr - real(wp), external :: dnrm2 -! Magma settings - integer :: ijobz = 999 ! default setting - integer :: iuplo = 999 ! default setting - magma_devptr_t :: dA, dEvals, dWork, dIwork - integer :: nGPU=8 - integer :: sizeof_double=8 - integer :: sizeof_int=4 - integer :: queue = -66 - real(wp):: vl, vu - integer :: il, iu - integer, pointer :: mout(:) - -! initialize eigenvector distributed array, z. - alpha = 0.0_wp - beta = 1.0_wp -! call pdlaset ('all', ny, ny, alpha, beta, z, 1, 1, descz) -! np = mynumrows -! nq = mynumcols5 - -! perform diagonalization: - jobz = 'V' - uplo = 'U' - liwork = 3 + 5*ny - lwork = 1 + 6*ny + 2*ny*ny - - vl=0.0 - vu=0.0 - il=1 - iu=ny - MagmaRange = 'A' - !ijobz = magma_jobz(jobz) - !iuplo = magma_uplo(uplo) - - !call cublas_alloc( lwork, sizeof_int, dWork ) - !call cublas_alloc( liwork, sizeof_int, dIwork ) - !call cublas_alloc( ny, sizeof_double, dEvals ) - !call cublas_alloc( ny*ny, sizeof_double, dA) - !allocate (r(ny*ny) , stat=status) - !call error_check (status, ' Allocation Error, r') - - !call CUBLAS_SET_VECTOR(lwork , sizeof_int , work , 1, dWork , 1) - !call CUBLAS_SET_VECTOR(liwork, sizeof_int , iwork , 1, dIwork, 1) - !call CUBLAS_SET_VECTOR(ny , sizeof_double , evals , 1, dEvals, 1) - !call cublas_set_matrix(ny, ny, sizeof_double , a , ny, dA, ny) - - allocate (work(lwork), iwork(liwork), evals(ny), stat=status) - call error_check (status, 'sh_diag: allocation error') - - write (fo,'(/,a,/)') 'start of DSYEVD' - call cpu_time (t0) - call system_clock (count=c0) - - !call magmaf_dsyevd(jobz, uplo, ny, a, ny, evals, work, lwork, iwork,liwork, info) - !call magmaf_dsyevd_gpu(jobz, uplo, ny, dA, ny, evals, r, ny, work, lwork, iwork,liwork, info) - !call magmaf_dsyevdx_m(nGPU, jobz, uplo, ny, a, ny, evals, work, lwork, iwork,liwork, info) - call magmaf_dsyevdx( jobz, MagmaRange, uplo, ny, a, ny, vl, vu, il, iu, mout, evals, work, lwork, iwork,liwork, info) - !call dsyevd (jobz, uplo, ny, a, ny, evals, work, lwork, iwork, liwork, info) - - write (fo,'(/,a,/)') 'end of DSYEVD' - call cpu_time (t1) - write (fo,'(a,f16.4,a)') 'DSYEVD CPU time = ', t1 - t0, ' secs' - call system_clock (count=c1, count_rate=cr) - write (fo,'(a,f16.4,a)') 'DSYEVD Elapsed time = ', REAL(c1-c0,wp) / & - REAL(cr,wp), ' secs' - - call error_check (info, 'sh_diag: pdsyevd error') - - deallocate (work, iwork, stat=status) - call error_check (status, 'sh_diag: deallocation error') - - !call cublas_get_vector (ny, sizeof_double, dEvals, 1, evals, 1) - - print *, "DEBUG : Eigen value = ",evals(1) - print *, "DEBUG : Eigen value = ",evals(ny) - - z = a - evecs: do ii = 1, ny ! normalize eigenvectors -! indxg2p computes process coord which posseses entry of a -! distributed matrix specified by a global index INDXGLOB. -! iproc = indxg2p(ii, descz(nb_), mycol, descz(csrc_), q) -! ismycol = (iproc == mycol) -! if (ismycol) then -! call pdnrm2 (ny, dnorm2, z, 1, ii, descz, 1) - - dnorm2 = dnrm2(ny,z,1) - alpha = 1.0_wp / REAL(dnorm2,wp) - call dscal(ny, alpha, z, 1) -! end if - end do evecs - !call cublas_free( dA ) - !deallocate (r, stat=status) - !call error_check (status, 'r : deallocation error') - end subroutine sh_diag - - subroutine kill_az - integer :: status - deallocate (a, z, evals, stat=status) - call error_check (status, 'kill_az: deallocation error') - end subroutine kill_az - -end module dist_mat - diff --git a/pfarm/cpu/src_mpi_omp_atom/libfxdr.a b/pfarm/cpu/src_mpi_omp_atom/libfxdr.a deleted file mode 100644 index 9a6fb5bfe193414d63ee72bb939781197b08d9a3..0000000000000000000000000000000000000000 Binary files a/pfarm/cpu/src_mpi_omp_atom/libfxdr.a and /dev/null differ diff --git a/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90 b/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90 index 8852d3151e21c036653fe928be567eebadac87ac..4a4ef2e960672299215faf57a9dbf2cd3113c5f5 100644 --- a/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90 +++ b/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90 @@ -28,7 +28,8 @@ contains use error_out, only: error_check use mpi_params, only: io_processor, taskid, numtasks ! use magma - use mpi +! use mpi + include 'mpif.h' integer, intent(in) :: nc ! # channels integer, intent(in) :: ncp diff --git a/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90.ori b/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90.ori deleted file mode 100644 index 13db386ba8e49360654d47ff6892aa2e59ae28f0..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/pdg_ctl.f90.ori +++ /dev/null @@ -1,84 +0,0 @@ -module pdg_ctl -! control diagonalization of sector Hamiltonians and RWA calculation -! Time-stamp: "2003-10-14 12:49:30 cjn" -! modified for jpi_coupling april to dec 2006 vmb - use precisn, only: wp - use io_units, only: fo - implicit none - - private - public pdiag - -contains - - subroutine pdiag (nc, ncp, spins, sqno) - use hfile_data, only: lchl, kschl, tchl - use rw_amplitudes, only: start_sa_file, ampltd - use potl_cofs, only: cfs, cfsj, del_cf - use rmx1_in, only: inc_lrp_prop - use slp, only: qno - use def_sectors, only: nsect, nl, nx, w_sect, asect, reset_sec, & - sectors - use sector_potl, only: potl, potl_pams, reset_potl - use dist_mat, only: a_fill, sh_diag, kill_az - use blacs, only: ctxt, p, q, myrow, mycol, io_processor, p0, & - q0, p_error - use sec_ham, only: h_reset, gauleg, legndr, def_rb_vals, xi, def_ncq - use rmx1_in, only: bug9, jpi_coupling - integer, intent(in) :: nc ! # channels - integer, intent(in) :: ncp - type(qno), intent(in) :: sqno ! scattering q#s - integer, intent(in) :: spins(2) ! target spins - real(wp), allocatable :: r(:) - real(wp) :: ral, rar - integer :: sect, st, status, nh, pp, qq - - call sectors (nc) ! define sector boundaries - if (io_processor) then - call start_sa_file (sqno, spins(1)) - end if - - call gauleg ! quadrature formula - call legndr ! Legendre functions - call potl_pams (nc, nx, ncp) - call def_ncq (ncp) ! pass ethr offset in h_el - -! generate asymptotic potential coefficients - if (inc_lrp_prop) then - if (.not. jpi_coupling) then - call cfs (nc, tchl(ncp:), lchl(ncp:), sqno, spins) - else - call cfsj (nc, tchl(ncp:), lchl(ncp:), kschl(ncp:), sqno, spins) - end if - end if - allocate (r(nx), stat=status) - call p_error (status, 'pdiag: allocation r') - - nh = nc * nl - if (io_processor .and. bug9 > 0) then - write (fo,'(a,i4)') 'Total Number of Sectors = ', nsect - write (fo,'(a,i4)') 'Partition Hamiltonian dimension = ', nh - end if - - do sect = 1, nsect - ral = asect(sect) - rar = asect(sect+1) - r = 0.5_wp * ((rar - ral) * xi + rar + ral) - call def_rb_vals (ral, rar) - call potl (nc, nx, r) - call A_fill (nh) ! form distributed sector H - call BLACS_BARRIER (ctxt, 'A') - call sh_diag ! diagonalize sector H - call ampltd (ral, rar, nc, nl, nh) - call kill_az - call BLACS_BARRIER (ctxt, 'A') - end do - call h_reset - call reset_sec - call reset_potl - if (inc_lrp_prop) call del_cf - deallocate (r, stat=status) - call p_error (status, 'pdiag: deallocation') - end subroutine pdiag - -end module pdg_ctl diff --git a/pfarm/cpu/src_mpi_omp_atom/rmx1.f90 b/pfarm/cpu/src_mpi_omp_atom/rmx1.f90 index 6ada883a2a1abe18869ad57ce9f4ccf8d87b70c6..9eefcf3298127c93699e8a7c4841e7fd3351da26 100644 --- a/pfarm/cpu/src_mpi_omp_atom/rmx1.f90 +++ b/pfarm/cpu/src_mpi_omp_atom/rmx1.f90 @@ -16,12 +16,12 @@ program rmx1 use pdg_ctl, only: diag use error_out, only: error_check use mpi_params, only: taskid, numtasks, io_processor - use mpi +! use mpi ! use blacs, only: nprocs, iam, ictxt, io_processor, p, q, ctxt, myrow,& ! mycol, p0, q0, set_cur_ctxt, p_error implicit none - ! include 'mpif.h' + include 'mpif.h' real(wp) :: e0 real(wp), allocatable, save :: ethr(:) ! threshold energies integer, pointer :: en_order(:) ! energy-order chl index diff --git a/pfarm/cpu/src_mpi_omp_atom/rmx1_ori.f90 b/pfarm/cpu/src_mpi_omp_atom/rmx1_ori.f90 deleted file mode 100644 index be80bf824776a033914a015a3539f9553d13ea59..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_atom/rmx1_ori.f90 +++ /dev/null @@ -1,166 +0,0 @@ -program rmx1 -! Electron-atom R-matrix external region calculation - STAGE 1 -! Time-stamp: "2003-09-23 17:06:43 cjn" -! modified for jpi_coupling april to dec 2006 vmb - use precisn, only: wp - use io_units, only: fo - use slp, only: qno, def_qno - use rmx1_in, only: targ_low_sce, targ_high_sce, rd_nmlst, split_prop,& - degeny, lrgl1, nspn1, npty1, distribute_indata, ne, bug1, & - start_mesh, jpi_coupling - use hfile_data, only: readh1, degtar, readh2, get_spins, & - reorder_chls, cparm, distribute_hdata, nc, nc1, nc2, & - readhj1, readhj2, distribute_hjdata, get_split - use energy_grid, only: energy_max, distribute_edata - use potl_cofs, only: rdtmom, rdjtmom - use pdg_ctl, only: pdiag - use blacs, only: nprocs, iam, ictxt, io_processor, p, q, ctxt, myrow,& - mycol, p0, q0, set_cur_ctxt, p_error - implicit none - real(wp) :: e0 - real(wp), allocatable, save :: ethr(:) ! threshold energies - integer, pointer :: en_order(:) ! energy-order chl index - real(wp) :: rafin, rmatr ! prop. limits - integer :: smx = 1 - type(qno) :: sqno - integer :: i, j, ion, ncp, ij, status - integer :: st1, st2 - real(wp) :: t0, t1 - integer :: nmesh, imesh - integer :: imycol, imyrow, ip, iq - integer :: BLACS_PNUM - integer :: c0, c1, cr - integer, allocatable :: map(:,:) - - call cpu_time (t0) - call system_clock (count=c0) - - call BLACS_PINFO (iam, nprocs) ! find process #, total # processors - call BLACS_GET (-1, 0, ictxt) ! find default context, ctxt -! define blacs grid to include all processes to broadcast information - call BLACS_GRIDINIT (ictxt, 'Row-major', 1, nprocs) - call BLACS_GRIDINFO (ictxt, ip, iq, imyrow, imycol) - io_processor = (imycol == 0) - call set_cur_ctxt (1) - - if (io_processor) then ! This is the i/o processor - write (fo,'(//,15x,a)') '=============' - write (fo,'(15x,a)') 'Program RMX1' - write (fo,'(15x,a,//)') '=============' - write (fo,'(a)') 'R-Matrix External Region: Sector Diagonalization' - write (fo,'(a,i6)') 'Number of processors = ', nprocs - - call rd_nmlst ! read input namelist - write (fo,'(a,2i6)') 'Blacs process dimensions, p, q = ', p, q - - ! targ_high_sce > 0 signals scattering energies between targets targ_low_sce and -! targ_high_sce. i.e. energies in the resonance region => nmesh = 1 -! ne(1) > 0 signals only a single step - if (targ_high_sce > 0 .or. ne(1) > 0) then - nmesh = 1 - else - nmesh = 2 - end if - - if (.not. jpi_coupling) then - call readh1 ! read first record on H file - else - call readhj1 - end if - -! set near degenerate target states as strictly degenerate: iterate - degeny = 0.1_wp * degeny - call degtar (degeny) - degeny = 5.0_wp * degeny - call degtar (degeny) - degeny = 2.0_wp * degeny - call degtar (degeny) - call degtar (degeny) - -! define required SLp or Jp case: - sqno = def_qno(lrgl1, nspn1, npty1) - write (fo,'(/a4,i3,a8,i3,a8,i2)') 'S = ', sqno%nspn,& - ' L = ', sqno%lrgl, ' P = ', sqno%npty - if (.not. jpi_coupling) then - call readh2 (lrgl1, nspn1, npty1) - else - call readhj2 (lrgl1, nspn1, npty1) - end if - call get_split (st1, st2) - - if (split_prop .and. st2 /= -999) then ! there is channel splitting - call reorder_chls - nc2 = nc - nc1 - if (bug1 > 0) then - write (fo,'(/a/)') 'Channel Splitting Used' - write (fo,'(a,i6)') 'Number of spin 1 Channels = ', nc1 - write (fo,'(a,i6/)') 'Number of Spin 2 channels = ', nc2 - end if - else ! no channel_splitting - nc1 = nc - split_prop = .false. - end if - call cparm ! form ethr using reordered channel data - end if - - call distribute_indata - if (.not. jpi_coupling ) then - call rdtmom ! read target transition moments and distribute - call distribute_hdata (st1, st2, lrgl1, nspn1, npty1, start_mesh, & - nmesh) - else - call rdjtmom - call distribute_hjdata (st1, st2, lrgl1, nspn1, npty1, start_mesh, & - nmesh) - end if - sqno = def_qno(lrgl1, nspn1, npty1) - if (io_processor) io_processor = .false. - - allocate (map(p,q), stat=status) - call p_error (status, 'rmx1: allocate map') - ij = 0 - do j = 1, q - do i = 1, p - map(i,j) = ij - ij = ij + 1 - end do - end do -! call BLACS_GRIDEXIT (ctxt) ! kill current mesh - call BLACS_GET (-1, 0, ctxt) ! find default context, ctxt - call BLACS_GRIDMAP (ctxt, map, p, p, q) -! call BLACS_GRIDINIT (ctxt, 'Row-major', p, q) - call BLACS_GRIDINFO (ctxt, ip, iq, myrow, mycol) - if (myrow >= 0 .and. myrow < p .and. mycol >= 0 .and. mycol < q) then - p0 = 0 - q0 = 0 - io_processor = (myrow == p0 .and. mycol == q0) - call set_cur_ctxt (2) - mesh_loop: do imesh = start_mesh, nmesh - if (io_processor) call energy_max (imesh, nmesh) ! find ebig - call distribute_edata ! broadcast ebig - - ! initialize full or 1st split partition sector data - ncp = 1 - call pdiag (nc1, ncp, (/st1,st2/), sqno) - - if (nc1 /= nc) then ! initialize 2nd split partition data - nc2 = nc - nc1 - ncp = nc1 + 1 - call pdiag (nc2, ncp, (/st2, -999/), sqno) - end if - end do mesh_loop - - if (io_processor) then - write (fo,'(/,a,/)') 'end of RMX1' - call cpu_time (t1) - write (fo,'(a,f16.4,a)') 'CPU time = ', t1 - t0, ' secs' - call system_clock (count=c1, count_rate=cr) - write (fo,'(a,f16.4,a)') 'Elapsed time = ', REAL(c1-c0,wp) / & - REAL(cr,wp), ' secs' - end if - call BLACS_GRIDEXIT (ctxt) - end if - call BLACS_BARRIER (ictxt, 'All') - call BLACS_EXIT() - stop -end program rmx1 diff --git a/pfarm/cpu/src_mpi_omp_mol/DEFS_cray b/pfarm/cpu/src_mpi_omp_mol/DEFS_cray index cefab1d8c89024c709b23dc3291f100fcb93acfc..8b4d3eb24d3a6df61312a2c80bc56476c2d249aa 100644 --- a/pfarm/cpu/src_mpi_omp_mol/DEFS_cray +++ b/pfarm/cpu/src_mpi_omp_mol/DEFS_cray @@ -2,7 +2,7 @@ LIBS = STATIC_LIBS = -L../../lib -lfxdr # Default Archer2 environment (Cray) -F90 = ftn +F90 = ftn -Ofast # Skylake options #F90FLAGS = -mtune=skylake -mkl=parallel -O3 diff --git a/pfarm/cpu/src_mpi_omp_mol/DEFS_cray~ b/pfarm/cpu/src_mpi_omp_mol/DEFS_cray~ new file mode 100644 index 0000000000000000000000000000000000000000..cefab1d8c89024c709b23dc3291f100fcb93acfc --- /dev/null +++ b/pfarm/cpu/src_mpi_omp_mol/DEFS_cray~ @@ -0,0 +1,14 @@ +LIBS = +STATIC_LIBS = -L../../lib -lfxdr + +# Default Archer2 environment (Cray) +F90 = ftn + +# Skylake options +#F90FLAGS = -mtune=skylake -mkl=parallel -O3 + +# AMD options +F90FLAGS = -O3 + +F90FLAGS1 = $(F90FLAGS) +LDFLAGS=$(F90FLAGS) diff --git a/pfarm/cpu/src_mpi_omp_mol/DEFS_knl b/pfarm/cpu/src_mpi_omp_mol/DEFS_knl deleted file mode 100644 index 6699fe71f77d7e7132c6f7efc47a58d7bd43fc98..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_mol/DEFS_knl +++ /dev/null @@ -1,8 +0,0 @@ -LIBS = -STATIC_LIBS = -L../lib -lfxdr - -F90 = mpif90 -F90FLAGS = -mtune=knl -mkl=parallel -O3 - -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) diff --git a/pfarm/cpu/src_mpi_omp_mol/DEFS_pgi b/pfarm/cpu/src_mpi_omp_mol/DEFS_pgi deleted file mode 100644 index ab4c9604152eb495cf68d8b5c7108683e315a41e..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_mol/DEFS_pgi +++ /dev/null @@ -1,14 +0,0 @@ -#LIBS = -L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -L/usr/local/packages/vampir/lib64 -lVT -lld -LIBS = -L../xdr -lfxdr -#-L/usr/local/lib -lblacsF77init -lblacs -lscalapack -lessl -F90 = ftn - - -F90FLAGS = -r8 -#-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1 \ -# -qsuffix=f=f90 -g -qessl -q64 -#F90FLAGS = -g -C -qextchk -qflag=I:I -qlanglvl=95pure -qnoopt \ -# -qflttrap=overflow:underflow:invalid:zerodivide \ -# -qinitauto=7FF7FFFF -qsuffix=f=f90 -q64 -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) diff --git a/pfarm/cpu/src_mpi_omp_mol/Makefile_ori b/pfarm/cpu/src_mpi_omp_mol/Makefile_ori deleted file mode 100644 index c7bdb111bdbb307cd9bb4af96385fb3667c21bff..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_mol/Makefile_ori +++ /dev/null @@ -1,61 +0,0 @@ -PROG = rmx95 - -include DEFS - -XDR = xdr_files -ULIBS= - - -SRCS = amp.f90 def_sectors.f90 pdg_ctl.f90 dist_mat.f90 \ - energy_grid.f90 io_units.f90 rmx1.f90 potl.f90 scaling.f90 \ - potl_coefs.f90 precisn.f90 rd_Hfile.f90 rmx1_in.f90 \ - sec_ham.f90 slp.f90 blacs.f90 -SRC1 = $(XDR).f90 - - -OBJS = $(SRCS:.f90=.o) -OBJ1 = $(SRC1:.f90=.o) - - -all: $(PROG) - -$(PROG): $(OBJ1) $(OBJS) $(ULIBS) - $(F90) $(LDFLAGS) -o $@ $(OBJS) $(OBJ1) $(LIBS) $(ULIBS) - -$(OBJ1): $(SRC1) - $(F90) $(F90FLAGS) -c $< - -clean: - rm -f $(OBJS) *.mod *~ -very_clean: - rm -f $(PROG) $(OBJS) *.mod *~ - -.SUFFIXES: $(SUFFIXES) .f90 - -.f90.o: - $(F90) $(F90FLAGS) -c $< - -amp.o: amp.f90 def_sectors.o dist_mat.o energy_grid.o \ - io_units.o precisn.o slp.o $(XDR).o blacs.o -def_sectors.o: def_sectors.f90 energy_grid.o io_units.o precisn.o \ - rd_Hfile.o rmx1_in.o blacs.o -pdg_ctl.o: pdg_ctl.f90 amp.o def_sectors.o dist_mat.o io_units.o potl.o \ - potl_coefs.o precisn.o rd_Hfile.o rmx1_in.o slp.o -dist_mat.o: dist_mat.f90 io_units.o precisn.o sec_ham.o blacs.o -energy_grid.o: energy_grid.f90 io_units.o precisn.o rd_Hfile.o \ - rmx1_in.o blacs.o -error_prt.o: error_prt.f90 io_units.o -rmx1.o: rmx1.f90 pdg_ctl.o energy_grid.o io_units.o precisn.o rd_Hfile.o \ - rmx1_in.o slp.o blacs.o -potl.o: potl.f90 io_units.o potl_coefs.o precisn.o rd_Hfile.o rmx1_in.o -potl_coefs.o: potl_coefs.f90 io_units.o precisn.o scaling.o slp.o $(XDR).o -rd_Hfile.o: rd_Hfile.f90 io_units.o precisn.o rmx1_in.o scaling.o $(XDR).o blacs.o -rmx1_in.o: rmx1_in.f90 io_units.o precisn.o blacs.o -scaling.o: scaling.f90 io_units.o precisn.o -sec_ham.o: sec_ham.f90 precisn.o io_units.o potl.o blacs.o -$(XDR).o: $(XDR).f90 io_units.o precisn.o -slp.o: slp.f90 -io_units.o: io_units.f90 -precisn.o: precisn.f90 -blacs.o: blacs.f90 io_units.o - diff --git a/pfarm/cpu/src_mpi_omp_mol/libfxdr.a b/pfarm/cpu/src_mpi_omp_mol/libfxdr.a deleted file mode 100644 index 9a6fb5bfe193414d63ee72bb939781197b08d9a3..0000000000000000000000000000000000000000 Binary files a/pfarm/cpu/src_mpi_omp_mol/libfxdr.a and /dev/null differ diff --git a/pfarm/cpu/src_mpi_omp_mol/pdg_ctl.f90.ori b/pfarm/cpu/src_mpi_omp_mol/pdg_ctl.f90.ori deleted file mode 100644 index 13db386ba8e49360654d47ff6892aa2e59ae28f0..0000000000000000000000000000000000000000 --- a/pfarm/cpu/src_mpi_omp_mol/pdg_ctl.f90.ori +++ /dev/null @@ -1,84 +0,0 @@ -module pdg_ctl -! control diagonalization of sector Hamiltonians and RWA calculation -! Time-stamp: "2003-10-14 12:49:30 cjn" -! modified for jpi_coupling april to dec 2006 vmb - use precisn, only: wp - use io_units, only: fo - implicit none - - private - public pdiag - -contains - - subroutine pdiag (nc, ncp, spins, sqno) - use hfile_data, only: lchl, kschl, tchl - use rw_amplitudes, only: start_sa_file, ampltd - use potl_cofs, only: cfs, cfsj, del_cf - use rmx1_in, only: inc_lrp_prop - use slp, only: qno - use def_sectors, only: nsect, nl, nx, w_sect, asect, reset_sec, & - sectors - use sector_potl, only: potl, potl_pams, reset_potl - use dist_mat, only: a_fill, sh_diag, kill_az - use blacs, only: ctxt, p, q, myrow, mycol, io_processor, p0, & - q0, p_error - use sec_ham, only: h_reset, gauleg, legndr, def_rb_vals, xi, def_ncq - use rmx1_in, only: bug9, jpi_coupling - integer, intent(in) :: nc ! # channels - integer, intent(in) :: ncp - type(qno), intent(in) :: sqno ! scattering q#s - integer, intent(in) :: spins(2) ! target spins - real(wp), allocatable :: r(:) - real(wp) :: ral, rar - integer :: sect, st, status, nh, pp, qq - - call sectors (nc) ! define sector boundaries - if (io_processor) then - call start_sa_file (sqno, spins(1)) - end if - - call gauleg ! quadrature formula - call legndr ! Legendre functions - call potl_pams (nc, nx, ncp) - call def_ncq (ncp) ! pass ethr offset in h_el - -! generate asymptotic potential coefficients - if (inc_lrp_prop) then - if (.not. jpi_coupling) then - call cfs (nc, tchl(ncp:), lchl(ncp:), sqno, spins) - else - call cfsj (nc, tchl(ncp:), lchl(ncp:), kschl(ncp:), sqno, spins) - end if - end if - allocate (r(nx), stat=status) - call p_error (status, 'pdiag: allocation r') - - nh = nc * nl - if (io_processor .and. bug9 > 0) then - write (fo,'(a,i4)') 'Total Number of Sectors = ', nsect - write (fo,'(a,i4)') 'Partition Hamiltonian dimension = ', nh - end if - - do sect = 1, nsect - ral = asect(sect) - rar = asect(sect+1) - r = 0.5_wp * ((rar - ral) * xi + rar + ral) - call def_rb_vals (ral, rar) - call potl (nc, nx, r) - call A_fill (nh) ! form distributed sector H - call BLACS_BARRIER (ctxt, 'A') - call sh_diag ! diagonalize sector H - call ampltd (ral, rar, nc, nl, nh) - call kill_az - call BLACS_BARRIER (ctxt, 'A') - end do - call h_reset - call reset_sec - call reset_potl - if (inc_lrp_prop) call del_cf - deallocate (r, stat=status) - call p_error (status, 'pdiag: deallocation') - end subroutine pdiag - -end module pdg_ctl diff --git a/pfarm/gpu/example_job_scripts/exdig_gpu_mol_8x4.slurm b/pfarm/gpu/example_job_scripts/exdig_gpu_mol_8x4.slurm index 8c41893dfb4d1555320993b6105ed2d5c540ed9c..93b88c9d5fa941a8e660e8d8a1d7988d1a9a398c 100644 --- a/pfarm/gpu/example_job_scripts/exdig_gpu_mol_8x4.slurm +++ b/pfarm/gpu/example_job_scripts/exdig_gpu_mol_8x4.slurm @@ -22,7 +22,7 @@ echo $LD_LIBRARY_PATH export OMP_NUM_THREADS=1 # Environment settings for exdig_mol -export RMX_NSECT_COARSE=64 +export RMX_NSECT_COARSE=16 export RMX_NL_COARSE=10 # Set the number of GPUs per node here @@ -37,5 +37,5 @@ srun -l echo $CUDA_VISIBLE_DEVICES # Run the PRMAT executable date -srun ../rmx95 +srun ../exdig_mpi_gpu_mol date diff --git a/pfarm/gpu/setup_run_gpu_atom.scr b/pfarm/gpu/setup_run_gpu_atom.scr index e04e44dca07b3fdfc8d7e71cb34f8dbb7546aab0..d6106bc2b7ce6534867eceb62efb381eb6521580 100755 --- a/pfarm/gpu/setup_run_gpu_atom.scr +++ b/pfarm/gpu/setup_run_gpu_atom.scr @@ -5,9 +5,9 @@ mkdir $1 cd $1 -ln -s ../../data/test_case_1_atom/H . -ln -s ../../data/test_case_1_atom/XJTARMOM . -cp ../../data/test_case_1_atom/phzin.ctl . +ln -s ../../../data/test_case_1_atom/HXJ030 . +ln -s ../../../data/test_case_1_atom/XJTARMOM . +cp ../../../data/test_case_1_atom/phzin.ctl . ln -s ../bin/exdig_mpi_gpu_atom . cp ../example_job_scripts/exdig_gpu_atom_8x4.slurm . cd .. diff --git a/pfarm/gpu/setup_run_gpu_mol.scr b/pfarm/gpu/setup_run_gpu_mol.scr index 1875fae725c87a7064e70679f8c47e162bcc9b55..da370352342e7e49420451ab38fc1818beb7e3ca 100755 --- a/pfarm/gpu/setup_run_gpu_mol.scr +++ b/pfarm/gpu/setup_run_gpu_mol.scr @@ -5,10 +5,10 @@ mkdir $1 cd $1 -ln -s ../../data/test_case_2_mol/H . -cp ../../data/test_case_2_mol/phzin.ctl . -ln -s ../bin/exdig_mpi_gpu_mol . -cp ../example_job_scripts/exdig_gpu_mol_8x4.slurm . +ln -s ../../../data/test_case_2_mol/H . +cp ../../../data/test_case_2_mol/phzin.ctl . +ln -s ../../bin/exdig_mpi_gpu_mol . +cp ../../example_job_scripts/exdig_gpu_mol_8x4.slurm . cd .. diff --git a/pfarm/gpu/src_mpi_gpu_atom/DEFS b/pfarm/gpu/src_mpi_gpu_atom/DEFS deleted file mode 100644 index 502077b10e1ab7bfa30c6888df4cc8cd4489741d..0000000000000000000000000000000000000000 --- a/pfarm/gpu/src_mpi_gpu_atom/DEFS +++ /dev/null @@ -1,11 +0,0 @@ -LIBS = -L$(MAGMADIR)/lib -L$(CUDA_HOME)/lib64 -L. -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -llapack -lblas - -STATIC_LIBS = -L../../lib -lfxdr - -F90 = mpif90 - -F90FLAGS = -cpp -DHAVE_CUBLAS -O3 -I$(MAGMADIR)/include -I$(CUDA_HOME)/include -Dmagma_devptr_t="integer(kind=8)" - -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) - diff --git a/pfarm/gpu/src_mpi_gpu_atom/DEFS b/pfarm/gpu/src_mpi_gpu_atom/DEFS new file mode 120000 index 0000000000000000000000000000000000000000..6d27c7eef86426e61f6bdd28715f11b926be5f0c --- /dev/null +++ b/pfarm/gpu/src_mpi_gpu_atom/DEFS @@ -0,0 +1 @@ +DEFS_Juwels_Booster \ No newline at end of file diff --git a/pfarm/gpu/src_mpi_gpu_atom/DEFS_Juwels_Booster b/pfarm/gpu/src_mpi_gpu_atom/DEFS_Juwels_Booster new file mode 100644 index 0000000000000000000000000000000000000000..da75f9e7c2f63af61ce3c352f93c64089c9b06aa --- /dev/null +++ b/pfarm/gpu/src_mpi_gpu_atom/DEFS_Juwels_Booster @@ -0,0 +1,16 @@ +# GPU LIB Settings for different platforms +# Cineca Marconi 100 +#LIBS = -L$(MAGMADIR)/lib -L$(CUDA_HOME)/lib64 -L. -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -llapack -lblas + +# Juwels Booster (lapack and blas loaded by default) +LIBS = -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -L../../lib -lfxdr + +STATIC_LIBS = -L../../lib -lfxdr -ltirpc + +F90 = mpif90 + +F90FLAGS = -Ofast -march=core-avx2 -mkl -cpp -DHAVE_CUBLAS -I$(MAGMA_INCLUDE) -I$(CUDA_HOME)/include -Dmagma_devptr_t="integer(kind=8)" + +F90FLAGS1 = $(F90FLAGS) +LDFLAGS=$(F90FLAGS) + diff --git a/pfarm/gpu/src_mpi_gpu_atom/amp.f90 b/pfarm/gpu/src_mpi_gpu_atom/amp.f90 index 61eba43760e250df6884a3afd92b1ee4a9f6342b..febed8165543f1f33dc981c475b93d21c76a9b49 100644 --- a/pfarm/gpu/src_mpi_gpu_atom/amp.f90 +++ b/pfarm/gpu/src_mpi_gpu_atom/amp.f90 @@ -24,11 +24,11 @@ contains type(qno), intent(in) :: sqno ! scattering q#s integer, intent(in) :: st ! second target spin integer, intent(in) :: sect ! sector id - character(len=11) :: hname + character(len=13) :: hname character(len=2) :: sp, l character(len=1) :: p character(len=4) :: stem - character(len=2) :: isect + character(len=4) :: isect integer :: ios, qn(3), status integer :: nspn ! scattering spin. @@ -55,7 +55,7 @@ contains end if write (l,'(i2.2)') abs(qn(1)) write (p, '(i1.1)') qn(3) - write (isect, '(i2.2)') sect + write (isect, '(i4.4)') sect hname = stem // sp // l // p // isect if (xdr) then ! open XDR output file for Hamiltonian @@ -91,10 +91,10 @@ contains use mpi type(qno), intent(in) :: sqno ! scattering q#s integer, intent(in) :: st ! second target spin - character(len=11) :: hname - character(len=2) :: sp, l, s_mpi + character(len=13) :: hname + character(len=2) :: sp, l character(len=1) :: p - character(len=4) :: stem + character(len=4) :: stem, s_mpi integer :: ios, qn(3), status integer :: nspn ! scattering spin. integer ( kind = 4 ) ierr @@ -121,7 +121,7 @@ contains end if write (l,'(i2.2)') abs(qn(1)) write (p, '(i1.1)') qn(3) - write (s_mpi, '(i2.2)') taskid + write (s_mpi, '(i4.4)') taskid hname = stem // sp // l // p // s_mpi diff --git a/pfarm/gpu/src_mpi_gpu_atom/dist_mat.f90 b/pfarm/gpu/src_mpi_gpu_atom/dist_mat.f90 index 5d62a9aa51e0a3006de5521a1de89fc5789673b1..d38b37bf28636821a90d40e99ec3ffc408edb170 100644 --- a/pfarm/gpu/src_mpi_gpu_atom/dist_mat.f90 +++ b/pfarm/gpu/src_mpi_gpu_atom/dist_mat.f90 @@ -6,7 +6,7 @@ module dist_mat ! use blacs, only: ctxt, myrow, mycol, p, q, nblock, mynumrows,& ! mynumcols, p_error, dlen_, nb_, csrc_ use error_out, only: error_check - use magma +! use magma implicit none integer, save :: ny ! a dimension diff --git a/pfarm/gpu/src_mpi_gpu_atom/pdg_ctl.f90 b/pfarm/gpu/src_mpi_gpu_atom/pdg_ctl.f90 index cb689c7dd4d9c38443c6f3f40754f1f9dc989105..1938ab97daab6dd73b77e7164472a47150af5460 100644 --- a/pfarm/gpu/src_mpi_gpu_atom/pdg_ctl.f90 +++ b/pfarm/gpu/src_mpi_gpu_atom/pdg_ctl.f90 @@ -27,7 +27,7 @@ contains use rmx1_in, only: bug9, jpi_coupling use error_out, only: error_check use mpi_params, only: io_processor, taskid, numtasks - use magma +! use magma use mpi integer, intent(in) :: nc ! # channels diff --git a/pfarm/gpu/src_mpi_gpu_mol/DEFS b/pfarm/gpu/src_mpi_gpu_mol/DEFS deleted file mode 100644 index 5fd443f4265c6ab6dbd5a469825c70ae7cc1404b..0000000000000000000000000000000000000000 --- a/pfarm/gpu/src_mpi_gpu_mol/DEFS +++ /dev/null @@ -1,10 +0,0 @@ -LIBS = -L$(MAGMADIR)/lib -L$(CUDADIR)/lib64 -L. -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -llapack -lrefblas - -STATIC_LIBS = -L../../lib -lfxdr - -F90 = mpif90 -fopenmp - -F90FLAGS = -cpp -DHAVE_CUBLAS -O3 -I$(MAGMADIR)/include -I$(CUDADIR)/include -I/gpfs/panther/local/apps/gcc/openmpi/2.0.2/lib -Dmagma_devptr_t="integer(kind=8)" - -F90FLAGS1 = $(F90FLAGS) -LDFLAGS=$(F90FLAGS) diff --git a/pfarm/gpu/src_mpi_gpu_mol/DEFS b/pfarm/gpu/src_mpi_gpu_mol/DEFS new file mode 120000 index 0000000000000000000000000000000000000000..6d27c7eef86426e61f6bdd28715f11b926be5f0c --- /dev/null +++ b/pfarm/gpu/src_mpi_gpu_mol/DEFS @@ -0,0 +1 @@ +DEFS_Juwels_Booster \ No newline at end of file diff --git a/pfarm/gpu/src_mpi_gpu_mol/DEFS_Juwels_Booster b/pfarm/gpu/src_mpi_gpu_mol/DEFS_Juwels_Booster new file mode 100644 index 0000000000000000000000000000000000000000..da75f9e7c2f63af61ce3c352f93c64089c9b06aa --- /dev/null +++ b/pfarm/gpu/src_mpi_gpu_mol/DEFS_Juwels_Booster @@ -0,0 +1,16 @@ +# GPU LIB Settings for different platforms +# Cineca Marconi 100 +#LIBS = -L$(MAGMADIR)/lib -L$(CUDA_HOME)/lib64 -L. -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -llapack -lblas + +# Juwels Booster (lapack and blas loaded by default) +LIBS = -lmagma -lcudart -lcublas -lcusparse -lstdc++ -lpthread -L../../lib -lfxdr + +STATIC_LIBS = -L../../lib -lfxdr -ltirpc + +F90 = mpif90 + +F90FLAGS = -Ofast -march=core-avx2 -mkl -cpp -DHAVE_CUBLAS -I$(MAGMA_INCLUDE) -I$(CUDA_HOME)/include -Dmagma_devptr_t="integer(kind=8)" + +F90FLAGS1 = $(F90FLAGS) +LDFLAGS=$(F90FLAGS) + diff --git a/pfarm/gpu/src_mpi_gpu_mol/dist_mat.f90 b/pfarm/gpu/src_mpi_gpu_mol/dist_mat.f90 index 5d62a9aa51e0a3006de5521a1de89fc5789673b1..d38b37bf28636821a90d40e99ec3ffc408edb170 100644 --- a/pfarm/gpu/src_mpi_gpu_mol/dist_mat.f90 +++ b/pfarm/gpu/src_mpi_gpu_mol/dist_mat.f90 @@ -6,7 +6,7 @@ module dist_mat ! use blacs, only: ctxt, myrow, mycol, p, q, nblock, mynumrows,& ! mynumcols, p_error, dlen_, nb_, csrc_ use error_out, only: error_check - use magma +! use magma implicit none integer, save :: ny ! a dimension diff --git a/pfarm/gpu/src_mpi_gpu_mol/rmx1_ori.f90 b/pfarm/gpu/src_mpi_gpu_mol/rmx1_ori.f90 deleted file mode 100644 index be80bf824776a033914a015a3539f9553d13ea59..0000000000000000000000000000000000000000 --- a/pfarm/gpu/src_mpi_gpu_mol/rmx1_ori.f90 +++ /dev/null @@ -1,166 +0,0 @@ -program rmx1 -! Electron-atom R-matrix external region calculation - STAGE 1 -! Time-stamp: "2003-09-23 17:06:43 cjn" -! modified for jpi_coupling april to dec 2006 vmb - use precisn, only: wp - use io_units, only: fo - use slp, only: qno, def_qno - use rmx1_in, only: targ_low_sce, targ_high_sce, rd_nmlst, split_prop,& - degeny, lrgl1, nspn1, npty1, distribute_indata, ne, bug1, & - start_mesh, jpi_coupling - use hfile_data, only: readh1, degtar, readh2, get_spins, & - reorder_chls, cparm, distribute_hdata, nc, nc1, nc2, & - readhj1, readhj2, distribute_hjdata, get_split - use energy_grid, only: energy_max, distribute_edata - use potl_cofs, only: rdtmom, rdjtmom - use pdg_ctl, only: pdiag - use blacs, only: nprocs, iam, ictxt, io_processor, p, q, ctxt, myrow,& - mycol, p0, q0, set_cur_ctxt, p_error - implicit none - real(wp) :: e0 - real(wp), allocatable, save :: ethr(:) ! threshold energies - integer, pointer :: en_order(:) ! energy-order chl index - real(wp) :: rafin, rmatr ! prop. limits - integer :: smx = 1 - type(qno) :: sqno - integer :: i, j, ion, ncp, ij, status - integer :: st1, st2 - real(wp) :: t0, t1 - integer :: nmesh, imesh - integer :: imycol, imyrow, ip, iq - integer :: BLACS_PNUM - integer :: c0, c1, cr - integer, allocatable :: map(:,:) - - call cpu_time (t0) - call system_clock (count=c0) - - call BLACS_PINFO (iam, nprocs) ! find process #, total # processors - call BLACS_GET (-1, 0, ictxt) ! find default context, ctxt -! define blacs grid to include all processes to broadcast information - call BLACS_GRIDINIT (ictxt, 'Row-major', 1, nprocs) - call BLACS_GRIDINFO (ictxt, ip, iq, imyrow, imycol) - io_processor = (imycol == 0) - call set_cur_ctxt (1) - - if (io_processor) then ! This is the i/o processor - write (fo,'(//,15x,a)') '=============' - write (fo,'(15x,a)') 'Program RMX1' - write (fo,'(15x,a,//)') '=============' - write (fo,'(a)') 'R-Matrix External Region: Sector Diagonalization' - write (fo,'(a,i6)') 'Number of processors = ', nprocs - - call rd_nmlst ! read input namelist - write (fo,'(a,2i6)') 'Blacs process dimensions, p, q = ', p, q - - ! targ_high_sce > 0 signals scattering energies between targets targ_low_sce and -! targ_high_sce. i.e. energies in the resonance region => nmesh = 1 -! ne(1) > 0 signals only a single step - if (targ_high_sce > 0 .or. ne(1) > 0) then - nmesh = 1 - else - nmesh = 2 - end if - - if (.not. jpi_coupling) then - call readh1 ! read first record on H file - else - call readhj1 - end if - -! set near degenerate target states as strictly degenerate: iterate - degeny = 0.1_wp * degeny - call degtar (degeny) - degeny = 5.0_wp * degeny - call degtar (degeny) - degeny = 2.0_wp * degeny - call degtar (degeny) - call degtar (degeny) - -! define required SLp or Jp case: - sqno = def_qno(lrgl1, nspn1, npty1) - write (fo,'(/a4,i3,a8,i3,a8,i2)') 'S = ', sqno%nspn,& - ' L = ', sqno%lrgl, ' P = ', sqno%npty - if (.not. jpi_coupling) then - call readh2 (lrgl1, nspn1, npty1) - else - call readhj2 (lrgl1, nspn1, npty1) - end if - call get_split (st1, st2) - - if (split_prop .and. st2 /= -999) then ! there is channel splitting - call reorder_chls - nc2 = nc - nc1 - if (bug1 > 0) then - write (fo,'(/a/)') 'Channel Splitting Used' - write (fo,'(a,i6)') 'Number of spin 1 Channels = ', nc1 - write (fo,'(a,i6/)') 'Number of Spin 2 channels = ', nc2 - end if - else ! no channel_splitting - nc1 = nc - split_prop = .false. - end if - call cparm ! form ethr using reordered channel data - end if - - call distribute_indata - if (.not. jpi_coupling ) then - call rdtmom ! read target transition moments and distribute - call distribute_hdata (st1, st2, lrgl1, nspn1, npty1, start_mesh, & - nmesh) - else - call rdjtmom - call distribute_hjdata (st1, st2, lrgl1, nspn1, npty1, start_mesh, & - nmesh) - end if - sqno = def_qno(lrgl1, nspn1, npty1) - if (io_processor) io_processor = .false. - - allocate (map(p,q), stat=status) - call p_error (status, 'rmx1: allocate map') - ij = 0 - do j = 1, q - do i = 1, p - map(i,j) = ij - ij = ij + 1 - end do - end do -! call BLACS_GRIDEXIT (ctxt) ! kill current mesh - call BLACS_GET (-1, 0, ctxt) ! find default context, ctxt - call BLACS_GRIDMAP (ctxt, map, p, p, q) -! call BLACS_GRIDINIT (ctxt, 'Row-major', p, q) - call BLACS_GRIDINFO (ctxt, ip, iq, myrow, mycol) - if (myrow >= 0 .and. myrow < p .and. mycol >= 0 .and. mycol < q) then - p0 = 0 - q0 = 0 - io_processor = (myrow == p0 .and. mycol == q0) - call set_cur_ctxt (2) - mesh_loop: do imesh = start_mesh, nmesh - if (io_processor) call energy_max (imesh, nmesh) ! find ebig - call distribute_edata ! broadcast ebig - - ! initialize full or 1st split partition sector data - ncp = 1 - call pdiag (nc1, ncp, (/st1,st2/), sqno) - - if (nc1 /= nc) then ! initialize 2nd split partition data - nc2 = nc - nc1 - ncp = nc1 + 1 - call pdiag (nc2, ncp, (/st2, -999/), sqno) - end if - end do mesh_loop - - if (io_processor) then - write (fo,'(/,a,/)') 'end of RMX1' - call cpu_time (t1) - write (fo,'(a,f16.4,a)') 'CPU time = ', t1 - t0, ' secs' - call system_clock (count=c1, count_rate=cr) - write (fo,'(a,f16.4,a)') 'Elapsed time = ', REAL(c1-c0,wp) / & - REAL(cr,wp), ' secs' - end if - call BLACS_GRIDEXIT (ctxt) - end if - call BLACS_BARRIER (ictxt, 'All') - call BLACS_EXIT() - stop -end program rmx1 diff --git a/pfarm/src_xdr/DEFS b/pfarm/src_xdr/DEFS index 3ff5f0aca031f720231bd20377ada8a2ccf2c7b7..5e7e47a7bdc42832fcddea9fafac2cc5b65458a7 120000 --- a/pfarm/src_xdr/DEFS +++ b/pfarm/src_xdr/DEFS @@ -1 +1 @@ -DEFS_cray \ No newline at end of file +DEFS_intel \ No newline at end of file diff --git a/pfarm/src_xdr/DEFS_intel b/pfarm/src_xdr/DEFS_intel index 7fcb82368139b16a9e31e107df5bb4edf6f36679..e6c9f7c58e1bbacced85da901eea94eadb9b1547 100644 --- a/pfarm/src_xdr/DEFS_intel +++ b/pfarm/src_xdr/DEFS_intel @@ -23,3 +23,4 @@ CC = icc COPTS = FOPTS = LIBS = + diff --git a/pfarm/src_xdr/DEFS_intel_rpc b/pfarm/src_xdr/DEFS_intel_rpc new file mode 100644 index 0000000000000000000000000000000000000000..5a497d4b4b0319cd4c2ac303d4137ca5cd5aa032 --- /dev/null +++ b/pfarm/src_xdr/DEFS_intel_rpc @@ -0,0 +1,26 @@ +#====================================================================== +# +# -- FXDR library (f90 version 1.0) -- +# Daresbury Laboratory +# August 15, 1997 +# +#====================================================================== +# +# Intel DEFS for fxdr library. +# +# Makefile requires GNU make at least version 3.62 to handle conditionals +# + +SHELL = /bin/sh +SRC := ./ + +# Intel Compiler settings +AR = ar rcs +RANLIB = echo +F90 = ifort +F90OPTS = +CC = icc +COPTS = -I . +FOPTS = +LIBS = -ltirpc + diff --git a/pfarm/src_xdr/IO_UNITS.mod b/pfarm/src_xdr/IO_UNITS.mod deleted file mode 100644 index b4d8279e536ad7a16d7106a03f65b4a489719f41..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/IO_UNITS.mod and /dev/null differ diff --git a/pfarm/src_xdr/PRECISN.mod b/pfarm/src_xdr/PRECISN.mod deleted file mode 100644 index f9e83de1537298a7c39dcd10e76591bef62c761b..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/PRECISN.mod and /dev/null differ diff --git a/pfarm/src_xdr/XDR_FILES.mod b/pfarm/src_xdr/XDR_FILES.mod deleted file mode 100644 index 6e72e53bee5b7b0ed1d3b66bb63e7f4e9b06f31c..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/XDR_FILES.mod and /dev/null differ diff --git a/pfarm/src_xdr/core b/pfarm/src_xdr/core deleted file mode 100644 index 736db8cac9bf4f17d44ecc96acf3d5fb23e7d294..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/core and /dev/null differ diff --git a/pfarm/src_xdr/io_units.o b/pfarm/src_xdr/io_units.o deleted file mode 100644 index 11be7fb8c822e629d0b599e36fad3de1924685df..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/io_units.o and /dev/null differ diff --git a/pfarm/src_xdr/libfxdr.a b/pfarm/src_xdr/libfxdr.a deleted file mode 100644 index abf6b476f5bb467ec7b1239c34747ca6cf5435a9..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/libfxdr.a and /dev/null differ diff --git a/pfarm/src_xdr/precisn.o b/pfarm/src_xdr/precisn.o deleted file mode 100644 index 5d0b2d79a7691a08adb33fafd6634a20e4dacbeb..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/precisn.o and /dev/null differ diff --git a/pfarm/src_xdr/rpc/auth.h b/pfarm/src_xdr/rpc/auth.h new file mode 100644 index 0000000000000000000000000000000000000000..b25dcfc116302ab6928c38c68d021d600e4db446 --- /dev/null +++ b/pfarm/src_xdr/rpc/auth.h @@ -0,0 +1,210 @@ +/* + * auth.h, Authentication interface. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The data structures are completely opaque to the client. The client + * is required to pass a AUTH * to routines that create rpc + * "sessions". + */ + +#ifndef _RPC_AUTH_H + +#define _RPC_AUTH_H 1 +#include <features.h> +#include <rpc/xdr.h> + +__BEGIN_DECLS + +#define MAX_AUTH_BYTES 400 +#define MAXNETNAMELEN 255 /* maximum length of network user's name */ + +/* + * Status returned from authentication check + */ +enum auth_stat { + AUTH_OK=0, + /* + * failed at remote end + */ + AUTH_BADCRED=1, /* bogus credentials (seal broken) */ + AUTH_REJECTEDCRED=2, /* client should begin new session */ + AUTH_BADVERF=3, /* bogus verifier (seal broken) */ + AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ + AUTH_TOOWEAK=5, /* rejected due to security reasons */ + /* + * failed locally + */ + AUTH_INVALIDRESP=6, /* bogus response verifier */ + AUTH_FAILED=7 /* some unknown reason */ +}; + +union des_block { + struct { + u_int32_t high; + u_int32_t low; + } key; + char c[8]; +}; +typedef union des_block des_block; +extern bool_t xdr_des_block (XDR *__xdrs, des_block *__blkp) __THROW; + +/* + * Authentication info. Opaque to client. + */ +struct opaque_auth { + enum_t oa_flavor; /* flavor of auth */ + caddr_t oa_base; /* address of more auth stuff */ + u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ +}; + +/* + * Auth handle, interface to client side authenticators. + */ +typedef struct AUTH AUTH; +struct AUTH { + struct opaque_auth ah_cred; + struct opaque_auth ah_verf; + union des_block ah_key; + struct auth_ops { + void (*ah_nextverf) (AUTH *); + int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */ + int (*ah_validate) (AUTH *, struct opaque_auth *); + /* validate verifier */ + int (*ah_refresh) (AUTH *); /* refresh credentials */ + void (*ah_destroy) (AUTH *); /* destroy this structure */ + } *ah_ops; + caddr_t ah_private; +}; + + +/* + * Authentication ops. + * The ops and the auth handle provide the interface to the authenticators. + * + * AUTH *auth; + * XDR *xdrs; + * struct opaque_auth verf; + */ +#define AUTH_NEXTVERF(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) +#define auth_nextverf(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) + +#define AUTH_MARSHALL(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) +#define auth_marshall(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) + +#define AUTH_VALIDATE(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) +#define auth_validate(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) + +#define AUTH_REFRESH(auth) \ + ((*((auth)->ah_ops->ah_refresh))(auth)) +#define auth_refresh(auth) \ + ((*((auth)->ah_ops->ah_refresh))(auth)) + +#define AUTH_DESTROY(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) +#define auth_destroy(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) + + +extern struct opaque_auth _null_auth; + + +/* + * These are the various implementations of client side authenticators. + */ + +/* + * Unix style authentication + * AUTH *authunix_create(machname, uid, gid, len, aup_gids) + * char *machname; + * int uid; + * int gid; + * int len; + * int *aup_gids; + */ +extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid, + int __len, __gid_t *__aup_gids); +extern AUTH *authunix_create_default (void); +extern AUTH *authnone_create (void) __THROW; +extern AUTH *authdes_create (const char *__servername, u_int __window, + struct sockaddr *__syncaddr, des_block *__ckey) + __THROW; +extern AUTH *authdes_pk_create (const char *, netobj *, u_int, + struct sockaddr *, des_block *) __THROW; + + +#define AUTH_NONE 0 /* no authentication */ +#define AUTH_NULL 0 /* backward compatibility */ +#define AUTH_SYS 1 /* unix style (uid, gids) */ +#define AUTH_UNIX AUTH_SYS +#define AUTH_SHORT 2 /* short hand unix style */ +#define AUTH_DES 3 /* des style (encrypted timestamps) */ +#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */ +#define AUTH_KERB 4 /* kerberos style */ + +/* + * Netname manipulating functions + * + */ +extern int getnetname (char *) __THROW; +extern int host2netname (char *, const char *, const char *) __THROW; +extern int user2netname (char *, const uid_t, const char *) __THROW; +extern int netname2user (const char *, uid_t *, gid_t *, int *, gid_t *) + __THROW; +extern int netname2host (const char *, char *, const int) __THROW; + +/* + * + * These routines interface to the keyserv daemon + * + */ +extern int key_decryptsession (char *, des_block *); +extern int key_decryptsession_pk (char *, netobj *, des_block *); +extern int key_encryptsession (char *, des_block *); +extern int key_encryptsession_pk (char *, netobj *, des_block *); +extern int key_gendes (des_block *); +extern int key_setsecret (char *); +extern int key_secretkey_is_set (void); +extern int key_get_conv (char *, des_block *); + +/* + * XDR an opaque authentication struct. + */ +extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *) __THROW; + +__END_DECLS + +#endif /* rpc/auth.h */ diff --git a/pfarm/src_xdr/rpc/auth_des.h b/pfarm/src_xdr/rpc/auth_des.h new file mode 100644 index 0000000000000000000000000000000000000000..6c22610ca9e7f99976572fa3ace6aaab5a5db85e --- /dev/null +++ b/pfarm/src_xdr/rpc/auth_des.h @@ -0,0 +1,111 @@ +/* Copyright (C) 1996-2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _RPC_AUTH_DES_H +#define _RPC_AUTH_DES_H 1 + +#include <sys/cdefs.h> +#include <rpc/auth.h> + +__BEGIN_DECLS + +/* There are two kinds of "names": fullnames and nicknames */ +enum authdes_namekind + { + ADN_FULLNAME, + ADN_NICKNAME + }; + +/* A fullname contains the network name of the client, + a conversation key and the window */ +struct authdes_fullname + { + char *name; /* network name of client, up to MAXNETNAMELEN */ + des_block key; /* conversation key */ + uint32_t window; /* associated window */ + }; + +/* A credential */ +struct authdes_cred + { + enum authdes_namekind adc_namekind; + struct authdes_fullname adc_fullname; + uint32_t adc_nickname; + }; + +/* A timeval replacement for !32bit platforms */ +struct rpc_timeval + { + uint32_t tv_sec; /* Seconds. */ + uint32_t tv_usec; /* Microseconds. */ + }; + +/* A des authentication verifier */ +struct authdes_verf + { + union + { + struct rpc_timeval adv_ctime; /* clear time */ + des_block adv_xtime; /* crypt time */ + } + adv_time_u; + uint32_t adv_int_u; + }; + +/* des authentication verifier: client variety + + adv_timestamp is the current time. + adv_winverf is the credential window + 1. + Both are encrypted using the conversation key. */ +#define adv_timestamp adv_time_u.adv_ctime +#define adv_xtimestamp adv_time_u.adv_xtime +#define adv_winverf adv_int_u + +/* des authentication verifier: server variety + + adv_timeverf is the client's timestamp + client's window + adv_nickname is the server's nickname for the client. + adv_timeverf is encrypted using the conversation key. */ +#define adv_timeverf adv_time_u.adv_ctime +#define adv_xtimeverf adv_time_u.adv_xtime +#define adv_nickname adv_int_u + +/* Map a des credential into a unix cred. */ +extern int authdes_getucred (const struct authdes_cred * __adc, + uid_t * __uid, gid_t * __gid, + short *__grouplen, gid_t * __groups) __THROW; + +/* Get the public key for NAME and place it in KEY. NAME can only be + up to MAXNETNAMELEN bytes long and the destination buffer KEY should + have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */ +extern int getpublickey (const char *__name, char *__key) __THROW; + +/* Get the secret key for NAME and place it in KEY. PASSWD is used to + decrypt the encrypted key stored in the database. NAME can only be + up to MAXNETNAMELEN bytes long and the destination buffer KEY + should have HEXKEYBYTES + 1 bytes long to fit all characters from + the key. */ +extern int getsecretkey (const char *__name, char *__key, + const char *__passwd) __THROW; + +extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep, + struct rpc_timeval *__timeout) __THROW; + +__END_DECLS + + +#endif /* rpc/auth_des.h */ diff --git a/pfarm/src_xdr/rpc/auth_unix.h b/pfarm/src_xdr/rpc/auth_unix.h new file mode 100644 index 0000000000000000000000000000000000000000..2f4ee1d61b5d66260b408e5621125bc67bb91376 --- /dev/null +++ b/pfarm/src_xdr/rpc/auth_unix.h @@ -0,0 +1,86 @@ +/* + * auth_unix.h, Protocol for UNIX style authentication parameters for RPC + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * The system is very weak. The client uses no encryption for it + * credentials and only sends null verifiers. The server sends backs + * null verifiers or optionally a verifier that suggests a new short hand + * for the credentials. + */ + +#ifndef _RPC_AUTH_UNIX_H +#define _RPC_AUTH_UNIX_H 1 + +#include <features.h> +#include <sys/types.h> +#include <rpc/types.h> +#include <rpc/auth.h> +#include <rpc/xdr.h> + +__BEGIN_DECLS + +/* The machine name is part of a credential; it may not exceed 255 bytes */ +#define MAX_MACHINE_NAME 255 + +/* gids compose part of a credential; there may not be more than 16 of them */ +#define NGRPS 16 + +/* + * Unix style credentials. + */ +struct authunix_parms + { + u_long aup_time; + char *aup_machname; + __uid_t aup_uid; + __gid_t aup_gid; + u_int aup_len; + __gid_t *aup_gids; + }; + +extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p) + __THROW; + +/* + * If a response verifier has flavor AUTH_SHORT, + * then the body of the response verifier encapsulates the following structure; + * again it is serialized in the obvious fashion. + */ +struct short_hand_verf + { + struct opaque_auth new_cred; + }; + +__END_DECLS + +#endif /* rpc/auth_unix.h */ diff --git a/pfarm/src_xdr/rpc/clnt.h b/pfarm/src_xdr/rpc/clnt.h new file mode 100644 index 0000000000000000000000000000000000000000..f4d4a941c751adb3e984a18ed5b195e3311a7fa9 --- /dev/null +++ b/pfarm/src_xdr/rpc/clnt.h @@ -0,0 +1,418 @@ +/* + * clnt.h - Client side remote procedure call interface. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_CLNT_H +#define _RPC_CLNT_H 1 + +#include <features.h> +#include <sys/types.h> +#include <rpc/types.h> +#include <rpc/auth.h> +#include <sys/un.h> + +__BEGIN_DECLS + +/* + * Rpc calls return an enum clnt_stat. This should be looked at more, + * since each implementation is required to live with this (implementation + * independent) list of errors. + */ +enum clnt_stat { + RPC_SUCCESS=0, /* call succeeded */ + /* + * local errors + */ + RPC_CANTENCODEARGS=1, /* can't encode arguments */ + RPC_CANTDECODERES=2, /* can't decode results */ + RPC_CANTSEND=3, /* failure in sending call */ + RPC_CANTRECV=4, /* failure in receiving result */ + RPC_TIMEDOUT=5, /* call timed out */ + /* + * remote errors + */ + RPC_VERSMISMATCH=6, /* rpc versions not compatible */ + RPC_AUTHERROR=7, /* authentication error */ + RPC_PROGUNAVAIL=8, /* program not available */ + RPC_PROGVERSMISMATCH=9, /* program version mismatched */ + RPC_PROCUNAVAIL=10, /* procedure unavailable */ + RPC_CANTDECODEARGS=11, /* decode arguments error */ + RPC_SYSTEMERROR=12, /* generic "other problem" */ + RPC_NOBROADCAST = 21, /* Broadcasting not supported */ + /* + * callrpc & clnt_create errors + */ + RPC_UNKNOWNHOST=13, /* unknown host name */ + RPC_UNKNOWNPROTO=17, /* unknown protocol */ + RPC_UNKNOWNADDR = 19, /* Remote address unknown */ + + /* + * rpcbind errors + */ + RPC_RPCBFAILURE=14, /* portmapper failed in its call */ +#define RPC_PMAPFAILURE RPC_RPCBFAILURE + RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ + RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */ + /* + * unspecified error + */ + RPC_FAILED=16, + RPC_INTR=18, + RPC_TLIERROR=20, + RPC_UDERROR=23, + /* + * asynchronous errors + */ + RPC_INPROGRESS = 24, + RPC_STALERACHANDLE = 25 +}; + + +/* + * Error info. + */ +struct rpc_err { + enum clnt_stat re_status; + union { + int RE_errno; /* related system error */ + enum auth_stat RE_why; /* why the auth error occurred */ + struct { + u_long low; /* lowest verion supported */ + u_long high; /* highest verion supported */ + } RE_vers; + struct { /* maybe meaningful if RPC_FAILED */ + long s1; + long s2; + } RE_lb; /* life boot & debugging only */ + } ru; +#define re_errno ru.RE_errno +#define re_why ru.RE_why +#define re_vers ru.RE_vers +#define re_lb ru.RE_lb +}; + + +/* + * Client rpc handle. + * Created by individual implementations, see e.g. rpc_udp.c. + * Client is responsible for initializing auth, see e.g. auth_none.c. + */ +typedef struct CLIENT CLIENT; +struct CLIENT { + AUTH *cl_auth; /* authenticator */ + struct clnt_ops { + enum clnt_stat (*cl_call) (CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, + caddr_t, struct timeval); + /* call remote procedure */ + void (*cl_abort) (void); /* abort a call */ + void (*cl_geterr) (CLIENT *, struct rpc_err *); + /* get specific error code */ + bool_t (*cl_freeres) (CLIENT *, xdrproc_t, caddr_t); + /* frees results */ + void (*cl_destroy) (CLIENT *); /* destroy this structure */ + bool_t (*cl_control) (CLIENT *, int, char *); + /* the ioctl() of rpc */ + } *cl_ops; + caddr_t cl_private; /* private stuff */ +}; + + +/* + * client side rpc interface ops + * + * Parameter types are: + * + */ + +/* + * enum clnt_stat + * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) + * CLIENT *rh; + * u_long proc; + * xdrproc_t xargs; + * caddr_t argsp; + * xdrproc_t xres; + * caddr_t resp; + * struct timeval timeout; + */ +#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) +#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) + +/* + * void + * CLNT_ABORT(rh); + * CLIENT *rh; + */ +#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) +#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) + +/* + * struct rpc_err + * CLNT_GETERR(rh); + * CLIENT *rh; + */ +#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) +#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) + + +/* + * bool_t + * CLNT_FREERES(rh, xres, resp); + * CLIENT *rh; + * xdrproc_t xres; + * caddr_t resp; + */ +#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) +#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) + +/* + * bool_t + * CLNT_CONTROL(cl, request, info) + * CLIENT *cl; + * u_int request; + * char *info; + */ +#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) +#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) + +/* + * control operations that apply to all transports + * + * Note: options marked XXX are no-ops in this implementation of RPC. + * The are present in TI-RPC but can't be implemented here since they + * depend on the presence of STREAMS/TLI, which we don't have. + */ +#define CLSET_TIMEOUT 1 /* set timeout (timeval) */ +#define CLGET_TIMEOUT 2 /* get timeout (timeval) */ +#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ +#define CLGET_FD 6 /* get connections file descriptor */ +#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) XXX */ +#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */ +#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy*/ +#define CLGET_XID 10 /* Get xid */ +#define CLSET_XID 11 /* Set xid */ +#define CLGET_VERS 12 /* Get version number */ +#define CLSET_VERS 13 /* Set version number */ +#define CLGET_PROG 14 /* Get program number */ +#define CLSET_PROG 15 /* Set program number */ +#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) XXX */ +#define CLSET_PUSH_TIMOD 17 /* push timod if not already present XXX */ +#define CLSET_POP_TIMOD 18 /* pop timod XXX */ +/* + * Connectionless only control operations + */ +#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ +#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ + +/* + * void + * CLNT_DESTROY(rh); + * CLIENT *rh; + */ +#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) +#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) + + +/* + * RPCTEST is a test program which is accessible on every rpc + * transport/port. It is used for testing, performance evaluation, + * and network administration. + */ + +#define RPCTEST_PROGRAM ((u_long)1) +#define RPCTEST_VERSION ((u_long)1) +#define RPCTEST_NULL_PROC ((u_long)2) +#define RPCTEST_NULL_BATCH_PROC ((u_long)3) + +/* + * By convention, procedure 0 takes null arguments and returns them + */ + +#define NULLPROC ((u_long)0) + +/* + * Below are the client handle creation routines for the various + * implementations of client side rpc. They can return NULL if a + * creation failure occurs. + */ + +/* + * Memory based rpc (for speed check and testing) + * CLIENT * + * clntraw_create(prog, vers) + * u_long prog; + * u_long vers; + */ +extern CLIENT *clntraw_create (const u_long __prog, const u_long __vers) + __THROW; + + +/* + * Generic client creation routine. Supported protocols are "udp", "tcp" and + * "unix" + * CLIENT * + * clnt_create(host, prog, vers, prot) + * char *host; -- hostname + * u_long prog; -- program number + * u_ong vers; -- version number + * char *prot; -- protocol + */ +extern CLIENT *clnt_create (const char *__host, const u_long __prog, + const u_long __vers, const char *__prot) + __THROW; + + +/* + * TCP based rpc + * CLIENT * + * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) + * struct sockaddr_in *raddr; + * u_long prog; + * u_long version; + * register int *sockp; + * u_int sendsz; + * u_int recvsz; + */ +extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, u_long __prog, + u_long __version, int *__sockp, u_int __sendsz, + u_int __recvsz) __THROW; + +/* + * UDP based rpc. + * CLIENT * + * clntudp_create(raddr, program, version, wait, sockp) + * struct sockaddr_in *raddr; + * u_long program; + * u_long version; + * struct timeval wait_resend; + * int *sockp; + * + * Same as above, but you specify max packet sizes. + * CLIENT * + * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) + * struct sockaddr_in *raddr; + * u_long program; + * u_long version; + * struct timeval wait_resend; + * int *sockp; + * u_int sendsz; + * u_int recvsz; + */ +extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, u_long __program, + u_long __version, struct timeval __wait_resend, + int *__sockp) __THROW; +extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr, + u_long __program, u_long __version, + struct timeval __wait_resend, int *__sockp, + u_int __sendsz, u_int __recvsz) __THROW; + + + + +/* + * AF_UNIX based rpc + * CLIENT * + * clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) + * struct sockaddr_un *raddr; + * u_long prog; + * u_long version; + * register int *sockp; + * u_int sendsz; + * u_int recvsz; + */ +extern CLIENT *clntunix_create (struct sockaddr_un *__raddr, u_long __program, + u_long __version, int *__sockp, + u_int __sendsz, u_int __recvsz) __THROW; + + +extern int callrpc (const char *__host, const u_long __prognum, + const u_long __versnum, const u_long __procnum, + const xdrproc_t __inproc, const char *__in, + const xdrproc_t __outproc, char *__out) __THROW; +extern int _rpc_dtablesize (void) __THROW; + +/* + * Print why creation failed + */ +extern void clnt_pcreateerror (const char *__msg); /* stderr */ +extern char *clnt_spcreateerror(const char *__msg) __THROW; /* string */ + +/* + * Like clnt_perror(), but is more verbose in its output + */ +extern void clnt_perrno (enum clnt_stat __num); /* stderr */ + +/* + * Print an English error message, given the client error code + */ +extern void clnt_perror (CLIENT *__clnt, const char *__msg); + /* stderr */ +extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW; + /* string */ + +/* + * If a creation fails, the following allows the user to figure out why. + */ +struct rpc_createerr { + enum clnt_stat cf_stat; + struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ +}; + +extern struct rpc_createerr rpc_createerr; + + + +/* + * Copy error message to buffer. + */ +extern char *clnt_sperrno (enum clnt_stat __num) __THROW; /* string */ + +/* + * get the port number on the host for the rpc program,version and proto + */ +extern int getrpcport (const char * __host, u_long __prognum, + u_long __versnum, u_int __proto) __THROW; + +/* + * get the local host's IP address without consulting + * name service library functions + */ +extern void get_myaddress (struct sockaddr_in *) __THROW; + +#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ +#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ + +__END_DECLS + +#endif /* rpc/clnt.h */ diff --git a/pfarm/src_xdr/rpc/des_crypt.h b/pfarm/src_xdr/rpc/des_crypt.h new file mode 100644 index 0000000000000000000000000000000000000000..77cca3cbedb8702098aef301839757f80b588f1b --- /dev/null +++ b/pfarm/src_xdr/rpc/des_crypt.h @@ -0,0 +1,96 @@ +/* + * @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC + * + * des_crypt.h, des library routine interface + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __DES_CRYPT_H__ +#define __DES_CRYPT_H__ 1 + +#include <features.h> + +__BEGIN_DECLS + +#define DES_MAXDATA 8192 /* max bytes encrypted in one call */ +#define DES_DIRMASK (1 << 0) +#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */ +#define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */ + + +#define DES_DEVMASK (1 << 1) +#define DES_HW (0*DES_DEVMASK) /* Use hardware device */ +#define DES_SW (1*DES_DEVMASK) /* Use software device */ + + +#define DESERR_NONE 0 /* succeeded */ +#define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */ +#define DESERR_HWERROR 2 /* failed, hardware/driver error */ +#define DESERR_BADPARAM 3 /* failed, bad parameter to call */ + +#define DES_FAILED(err) \ + ((err) > DESERR_NOHWDEVICE) + +/* + * cbc_crypt() + * ecb_crypt() + * + * Encrypt (or decrypt) len bytes of a buffer buf. + * The length must be a multiple of eight. + * The key should have odd parity in the low bit of each byte. + * ivec is the input vector, and is updated to the new one (cbc only). + * The mode is created by oring together the appropriate parameters. + * DESERR_NOHWDEVICE is returned if DES_HW was specified but + * there was no hardware to do it on (the data will still be + * encrypted though, in software). + */ + + +/* + * Cipher Block Chaining mode + */ +extern int cbc_crypt (char *__key, char *__buf, unsigned __len, + unsigned __mode, char *__ivec) __THROW; + +/* + * Electronic Code Book mode + */ +extern int ecb_crypt (char *__key, char *__buf, unsigned __len, + unsigned __mode) __THROW; + +/* + * Set des parity for a key. + * DES parity is odd and in the low bit of each byte + */ +extern void des_setparity (char *__key) __THROW; + +__END_DECLS + +#endif diff --git a/pfarm/src_xdr/rpc/key_prot.h b/pfarm/src_xdr/rpc/key_prot.h new file mode 100644 index 0000000000000000000000000000000000000000..74627e66ccee9e84250fa452f507eda2399acb0e --- /dev/null +++ b/pfarm/src_xdr/rpc/key_prot.h @@ -0,0 +1,343 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _KEY_PROT_H_RPCGEN +#define _KEY_PROT_H_RPCGEN + +#include <rpc/rpc.h> + +/* Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Compiled from key_prot.x using rpcgen. + * DO NOT EDIT THIS FILE! + * This is NOT source code! + */ +#define PROOT 3 +#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b" +#define HEXKEYBYTES 48 +#define KEYSIZE 192 +#define KEYBYTES 24 +#define KEYCHECKSUMSIZE 16 + +enum keystatus { + KEY_SUCCESS = 0, + KEY_NOSECRET = 1, + KEY_UNKNOWN = 2, + KEY_SYSTEMERR = 3, +}; +typedef enum keystatus keystatus; +#ifdef __cplusplus +extern "C" bool_t xdr_keystatus(XDR *, keystatus*); +#elif __STDC__ +extern bool_t xdr_keystatus(XDR *, keystatus*); +#else /* Old Style C */ +bool_t xdr_keystatus(); +#endif /* Old Style C */ + + +typedef char keybuf[HEXKEYBYTES]; +#ifdef __cplusplus +extern "C" bool_t xdr_keybuf(XDR *, keybuf); +#elif __STDC__ +extern bool_t xdr_keybuf(XDR *, keybuf); +#else /* Old Style C */ +bool_t xdr_keybuf(); +#endif /* Old Style C */ + + +typedef char *netnamestr; +#ifdef __cplusplus +extern "C" bool_t xdr_netnamestr(XDR *, netnamestr*); +#elif __STDC__ +extern bool_t xdr_netnamestr(XDR *, netnamestr*); +#else /* Old Style C */ +bool_t xdr_netnamestr(); +#endif /* Old Style C */ + + +struct cryptkeyarg { + netnamestr remotename; + des_block deskey; +}; +typedef struct cryptkeyarg cryptkeyarg; +#ifdef __cplusplus +extern "C" bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*); +#elif __STDC__ +extern bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*); +#else /* Old Style C */ +bool_t xdr_cryptkeyarg(); +#endif /* Old Style C */ + + +struct cryptkeyarg2 { + netnamestr remotename; + netobj remotekey; + des_block deskey; +}; +typedef struct cryptkeyarg2 cryptkeyarg2; +#ifdef __cplusplus +extern "C" bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*); +#elif __STDC__ +extern bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*); +#else /* Old Style C */ +bool_t xdr_cryptkeyarg2(); +#endif /* Old Style C */ + + +struct cryptkeyres { + keystatus status; + union { + des_block deskey; + } cryptkeyres_u; +}; +typedef struct cryptkeyres cryptkeyres; +#ifdef __cplusplus +extern "C" bool_t xdr_cryptkeyres(XDR *, cryptkeyres*); +#elif __STDC__ +extern bool_t xdr_cryptkeyres(XDR *, cryptkeyres*); +#else /* Old Style C */ +bool_t xdr_cryptkeyres(); +#endif /* Old Style C */ + +#define MAXGIDS 16 + +struct unixcred { + u_int uid; + u_int gid; + struct { + u_int gids_len; + u_int *gids_val; + } gids; +}; +typedef struct unixcred unixcred; +#ifdef __cplusplus +extern "C" bool_t xdr_unixcred(XDR *, unixcred*); +#elif __STDC__ +extern bool_t xdr_unixcred(XDR *, unixcred*); +#else /* Old Style C */ +bool_t xdr_unixcred(); +#endif /* Old Style C */ + + +struct getcredres { + keystatus status; + union { + unixcred cred; + } getcredres_u; +}; +typedef struct getcredres getcredres; +#ifdef __cplusplus +extern "C" bool_t xdr_getcredres(XDR *, getcredres*); +#elif __STDC__ +extern bool_t xdr_getcredres(XDR *, getcredres*); +#else /* Old Style C */ +bool_t xdr_getcredres(); +#endif /* Old Style C */ + + +struct key_netstarg { + keybuf st_priv_key; + keybuf st_pub_key; + netnamestr st_netname; +}; +typedef struct key_netstarg key_netstarg; +#ifdef __cplusplus +extern "C" bool_t xdr_key_netstarg(XDR *, key_netstarg*); +#elif __STDC__ +extern bool_t xdr_key_netstarg(XDR *, key_netstarg*); +#else /* Old Style C */ +bool_t xdr_key_netstarg(); +#endif /* Old Style C */ + + +struct key_netstres { + keystatus status; + union { + key_netstarg knet; + } key_netstres_u; +}; +typedef struct key_netstres key_netstres; +#ifdef __cplusplus +extern "C" bool_t xdr_key_netstres(XDR *, key_netstres*); +#elif __STDC__ +extern bool_t xdr_key_netstres(XDR *, key_netstres*); +#else /* Old Style C */ +bool_t xdr_key_netstres(); +#endif /* Old Style C */ + + +#ifndef opaque +#define opaque char +#endif + + +#define KEY_PROG ((u_long)100029) +#define KEY_VERS ((u_long)1) + +#ifdef __cplusplus +#define KEY_SET ((u_long)1) +extern "C" keystatus * key_set_1(opaque *, CLIENT *); +extern "C" keystatus * key_set_1_svc(opaque *, struct svc_req *); +#define KEY_ENCRYPT ((u_long)2) +extern "C" cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *); +extern "C" cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *); +#define KEY_DECRYPT ((u_long)3) +extern "C" cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *); +extern "C" cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *); +#define KEY_GEN ((u_long)4) +extern "C" des_block * key_gen_1(void *, CLIENT *); +extern "C" des_block * key_gen_1_svc(void *, struct svc_req *); +#define KEY_GETCRED ((u_long)5) +extern "C" getcredres * key_getcred_1(netnamestr *, CLIENT *); +extern "C" getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *); + +#elif __STDC__ +#define KEY_SET ((u_long)1) +extern keystatus * key_set_1(opaque *, CLIENT *); +extern keystatus * key_set_1_svc(opaque *, struct svc_req *); +#define KEY_ENCRYPT ((u_long)2) +extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *); +extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *); +#define KEY_DECRYPT ((u_long)3) +extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *); +extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *); +#define KEY_GEN ((u_long)4) +extern des_block * key_gen_1(void *, CLIENT *); +extern des_block * key_gen_1_svc(void *, struct svc_req *); +#define KEY_GETCRED ((u_long)5) +extern getcredres * key_getcred_1(netnamestr *, CLIENT *); +extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *); + +#else /* Old Style C */ +#define KEY_SET ((u_long)1) +extern keystatus * key_set_1(); +extern keystatus * key_set_1_svc(); +#define KEY_ENCRYPT ((u_long)2) +extern cryptkeyres * key_encrypt_1(); +extern cryptkeyres * key_encrypt_1_svc(); +#define KEY_DECRYPT ((u_long)3) +extern cryptkeyres * key_decrypt_1(); +extern cryptkeyres * key_decrypt_1_svc(); +#define KEY_GEN ((u_long)4) +extern des_block * key_gen_1(); +extern des_block * key_gen_1_svc(); +#define KEY_GETCRED ((u_long)5) +extern getcredres * key_getcred_1(); +extern getcredres * key_getcred_1_svc(); +#endif /* Old Style C */ +#define KEY_VERS2 ((u_long)2) + +#ifdef __cplusplus +extern "C" keystatus * key_set_2(opaque *, CLIENT *); +extern "C" keystatus * key_set_2_svc(opaque *, struct svc_req *); +extern "C" cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *); +extern "C" cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *); +extern "C" cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *); +extern "C" cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *); +extern "C" des_block * key_gen_2(void *, CLIENT *); +extern "C" des_block * key_gen_2_svc(void *, struct svc_req *); +extern "C" getcredres * key_getcred_2(netnamestr *, CLIENT *); +extern "C" getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *); +#define KEY_ENCRYPT_PK ((u_long)6) +extern "C" cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *); +extern "C" cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *); +#define KEY_DECRYPT_PK ((u_long)7) +extern "C" cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *); +extern "C" cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *); +#define KEY_NET_PUT ((u_long)8) +extern "C" keystatus * key_net_put_2(key_netstarg *, CLIENT *); +extern "C" keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *); +#define KEY_NET_GET ((u_long)9) +extern "C" key_netstres * key_net_get_2(void *, CLIENT *); +extern "C" key_netstres * key_net_get_2_svc(void *, struct svc_req *); +#define KEY_GET_CONV ((u_long)10) +extern "C" cryptkeyres * key_get_conv_2(opaque *, CLIENT *); +extern "C" cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *); + +#elif __STDC__ +extern keystatus * key_set_2(opaque *, CLIENT *); +extern keystatus * key_set_2_svc(opaque *, struct svc_req *); +extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *); +extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *); +extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *); +extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *); +extern des_block * key_gen_2(void *, CLIENT *); +extern des_block * key_gen_2_svc(void *, struct svc_req *); +extern getcredres * key_getcred_2(netnamestr *, CLIENT *); +extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *); +#define KEY_ENCRYPT_PK ((u_long)6) +extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *); +extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *); +#define KEY_DECRYPT_PK ((u_long)7) +extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *); +extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *); +#define KEY_NET_PUT ((u_long)8) +extern keystatus * key_net_put_2(key_netstarg *, CLIENT *); +extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *); +#define KEY_NET_GET ((u_long)9) +extern key_netstres * key_net_get_2(void *, CLIENT *); +extern key_netstres * key_net_get_2_svc(void *, struct svc_req *); +#define KEY_GET_CONV ((u_long)10) +extern cryptkeyres * key_get_conv_2(opaque *, CLIENT *); +extern cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *); + +#else /* Old Style C */ +extern keystatus * key_set_2(); +extern keystatus * key_set_2_svc(); +extern cryptkeyres * key_encrypt_2(); +extern cryptkeyres * key_encrypt_2_svc(); +extern cryptkeyres * key_decrypt_2(); +extern cryptkeyres * key_decrypt_2_svc(); +extern des_block * key_gen_2(); +extern des_block * key_gen_2_svc(); +extern getcredres * key_getcred_2(); +extern getcredres * key_getcred_2_svc(); +#define KEY_ENCRYPT_PK ((u_long)6) +extern cryptkeyres * key_encrypt_pk_2(); +extern cryptkeyres * key_encrypt_pk_2_svc(); +#define KEY_DECRYPT_PK ((u_long)7) +extern cryptkeyres * key_decrypt_pk_2(); +extern cryptkeyres * key_decrypt_pk_2_svc(); +#define KEY_NET_PUT ((u_long)8) +extern keystatus * key_net_put_2(); +extern keystatus * key_net_put_2_svc(); +#define KEY_NET_GET ((u_long)9) +extern key_netstres * key_net_get_2(); +extern key_netstres * key_net_get_2_svc(); +#define KEY_GET_CONV ((u_long)10) +extern cryptkeyres * key_get_conv_2(); +extern cryptkeyres * key_get_conv_2_svc(); +#endif /* Old Style C */ + +#endif /* !_KEY_PROT_H_RPCGEN */ diff --git a/pfarm/src_xdr/rpc/netdb.h b/pfarm/src_xdr/rpc/netdb.h new file mode 100644 index 0000000000000000000000000000000000000000..529a4ada218a25de05296ac623dc1d371ee588f2 --- /dev/null +++ b/pfarm/src_xdr/rpc/netdb.h @@ -0,0 +1,74 @@ +/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ +/* + * Copyright (c) 2010, Oracle America, Inc. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Cleaned up for GNU C library roland@gnu.ai.mit.edu: + added multiple inclusion protection and use of <sys/cdefs.h>. + In GNU this file is #include'd by <netdb.h>. */ + +#ifndef _RPC_NETDB_H +#define _RPC_NETDB_H 1 + +#include <features.h> + +#define __need_size_t +#include <stddef.h> + +__BEGIN_DECLS + +struct rpcent +{ + char *r_name; /* Name of server for this rpc program. */ + char **r_aliases; /* Alias list. */ + int r_number; /* RPC program number. */ +}; + +extern void setrpcent (int __stayopen) __THROW; +extern void endrpcent (void) __THROW; +extern struct rpcent *getrpcbyname (const char *__name) __THROW; +extern struct rpcent *getrpcbynumber (int __number) __THROW; +extern struct rpcent *getrpcent (void) __THROW; + +#ifdef __USE_MISC +extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf, + char *__buffer, size_t __buflen, + struct rpcent **__result) __THROW; + +extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf, + char *__buffer, size_t __buflen, + struct rpcent **__result) __THROW; + +extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer, + size_t __buflen, struct rpcent **__result) __THROW; +#endif + +__END_DECLS + +#endif /* rpc/netdb.h */ diff --git a/pfarm/src_xdr/rpc/pmap_clnt.h b/pfarm/src_xdr/rpc/pmap_clnt.h new file mode 100644 index 0000000000000000000000000000000000000000..1cc94b8feeede9b9110e3570724a267f622f5505 --- /dev/null +++ b/pfarm/src_xdr/rpc/pmap_clnt.h @@ -0,0 +1,95 @@ +/* + * pmap_clnt.h + * Supplies C routines to get to portmap services. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_PMAP_CLNT_H +#define _RPC_PMAP_CLNT_H 1 + +#include <features.h> +#include <rpc/types.h> +#include <rpc/xdr.h> +#include <rpc/clnt.h> + +__BEGIN_DECLS + +typedef bool_t (*resultproc_t) (caddr_t __resp, struct sockaddr_in *__raddr); + +/* + * Usage: + * success = pmap_set(program, version, protocol, port); + * success = pmap_unset(program, version); + * port = pmap_getport(address, program, version, protocol); + * head = pmap_getmaps(address); + * clnt_stat = pmap_rmtcall(address, program, version, procedure, + * xdrargs, argsp, xdrres, resp, tout, port_ptr) + * (works for udp only.) + * clnt_stat = clnt_broadcast(program, version, procedure, + * xdrargs, argsp, xdrres, resp, eachresult) + * (like pmap_rmtcall, except the call is broadcasted to all + * locally connected nets. For each valid response received, + * the procedure eachresult is called. Its form is: + * done = eachresult(resp, raddr) + * bool_t done; + * caddr_t resp; + * struct sockaddr_in raddr; + * where resp points to the results of the call and raddr is the + * address if the responder to the broadcast. + */ + +extern bool_t pmap_set (const u_long __program, const u_long __vers, + int __protocol, u_short __port) __THROW; +extern bool_t pmap_unset (const u_long __program, const u_long __vers) + __THROW; +extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW; +extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr, + const u_long __prog, + const u_long __vers, + const u_long __proc, + xdrproc_t __xdrargs, + caddr_t __argsp, xdrproc_t __xdrres, + caddr_t __resp, struct timeval __tout, + u_long *__port_ptr) __THROW; +extern enum clnt_stat clnt_broadcast (const u_long __prog, + const u_long __vers, + const u_long __proc, xdrproc_t __xargs, + caddr_t __argsp, xdrproc_t __xresults, + caddr_t __resultsp, + resultproc_t __eachresult) __THROW; +extern u_short pmap_getport (struct sockaddr_in *__address, + const u_long __program, + const u_long __version, u_int __protocol) + __THROW; + +__END_DECLS + +#endif /* rpc/pmap_clnt.h */ diff --git a/pfarm/src_xdr/rpc/pmap_prot.h b/pfarm/src_xdr/rpc/pmap_prot.h new file mode 100644 index 0000000000000000000000000000000000000000..e5fd7cb0a69af84ae45e7b60412fe5d7550ae6df --- /dev/null +++ b/pfarm/src_xdr/rpc/pmap_prot.h @@ -0,0 +1,105 @@ +/* + * pmap_prot.h + * Protocol for the local binder service, or pmap. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_PMAP_PROT_H +#define _RPC_PMAP_PROT_H 1 + +#include <features.h> + +#include <rpc/xdr.h> + +__BEGIN_DECLS + +/* The following procedures are supported by the protocol: + * + * PMAPPROC_NULL() returns () + * takes nothing, returns nothing + * + * PMAPPROC_SET(struct pmap) returns (bool_t) + * TRUE is success, FALSE is failure. Registers the tuple + * [prog, vers, prot, port]. + * + * PMAPPROC_UNSET(struct pmap) returns (bool_t) + * TRUE is success, FALSE is failure. Un-registers pair + * [prog, vers]. prot and port are ignored. + * + * PMAPPROC_GETPORT(struct pmap) returns (long unsigned). + * 0 is failure. Otherwise returns the port number where the pair + * [prog, vers] is registered. It may lie! + * + * PMAPPROC_DUMP() RETURNS (struct pmaplist *) + * + * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>) + * RETURNS (port, string<>); + * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); + * Calls the procedure on the local machine. If it is not registered, + * this procedure is quite; ie it does not return error information!!! + * This procedure only is supported on rpc/udp and calls via + * rpc/udp. This routine only passes null authentication parameters. + * This file has no interface to xdr routines for PMAPPROC_CALLIT. + * + * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. + */ + +#define PMAPPORT ((u_short)111) +#define PMAPPROG ((u_long)100000) +#define PMAPVERS ((u_long)2) +#define PMAPVERS_PROTO ((u_long)2) +#define PMAPVERS_ORIG ((u_long)1) +#define PMAPPROC_NULL ((u_long)0) +#define PMAPPROC_SET ((u_long)1) +#define PMAPPROC_UNSET ((u_long)2) +#define PMAPPROC_GETPORT ((u_long)3) +#define PMAPPROC_DUMP ((u_long)4) +#define PMAPPROC_CALLIT ((u_long)5) + +struct pmap { + long unsigned pm_prog; + long unsigned pm_vers; + long unsigned pm_prot; + long unsigned pm_port; +}; + +extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW; + +struct pmaplist { + struct pmap pml_map; + struct pmaplist *pml_next; +}; + +extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW; + +__END_DECLS + +#endif /* rpc/pmap_prot.h */ diff --git a/pfarm/src_xdr/rpc/pmap_rmt.h b/pfarm/src_xdr/rpc/pmap_rmt.h new file mode 100644 index 0000000000000000000000000000000000000000..f8680141ae661395285881f23d4ec0254bc55a14 --- /dev/null +++ b/pfarm/src_xdr/rpc/pmap_rmt.h @@ -0,0 +1,65 @@ +/* + * Structures and XDR routines for parameters to and replies from + * the portmapper remote-call-service. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_PMAP_RMT_H +#define _RPC_PMAP_RMT_H 1 + +#include <features.h> +#include <sys/types.h> +#include <rpc/types.h> +#include <rpc/xdr.h> + +__BEGIN_DECLS + +struct rmtcallargs { + u_long prog, vers, proc, arglen; + caddr_t args_ptr; + xdrproc_t xdr_args; +}; + +extern bool_t xdr_rmtcall_args (XDR *__xdrs, struct rmtcallargs *__crp) + __THROW; + +struct rmtcallres { + u_long *port_ptr; + u_long resultslen; + caddr_t results_ptr; + xdrproc_t xdr_results; +}; + +extern bool_t xdr_rmtcallres (XDR *__xdrs, struct rmtcallres *__crp) __THROW; + +__END_DECLS + +#endif /* rpc/pmap_rmt.h */ diff --git a/pfarm/src_xdr/rpc/rpc.h b/pfarm/src_xdr/rpc/rpc.h new file mode 100644 index 0000000000000000000000000000000000000000..173a4e31ea1142c5e26e79585f6412e8bff9f5c4 --- /dev/null +++ b/pfarm/src_xdr/rpc/rpc.h @@ -0,0 +1,94 @@ +/* + * rpc.h, Just includes the billions of rpc header files necessary to + * do remote procedure calling. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_RPC_H +#define _RPC_RPC_H 1 + +#include <rpc/types.h> /* some typedefs */ +#include <netinet/in.h> + +/* external data representation interfaces */ +#include <rpc/xdr.h> /* generic (de)serializer */ + +/* Client side only authentication */ +#include <rpc/auth.h> /* generic authenticator (client side) */ + +/* Client side (mostly) remote procedure call */ +#include <rpc/clnt.h> /* generic rpc stuff */ + +/* semi-private protocol headers */ +#include <rpc/rpc_msg.h> /* protocol for rpc messages */ +#include <rpc/auth_unix.h> /* protocol for unix style cred */ +#include <rpc/auth_des.h> /* protocol for des style cred */ + +/* Server side only remote procedure callee */ +#include <rpc/svc.h> /* service manager and multiplexer */ +#include <rpc/svc_auth.h> /* service side authenticator */ + +/* + * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION + * OF UNIX BASED ON NFSSRC. These systems will already have the structures + * defined by <rpc/netdb.h> included in <netdb.h>. + */ +/* routines for parsing /etc/rpc */ +#include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */ + +__BEGIN_DECLS + +/* Global variables, protected for multi-threaded applications. */ +extern fd_set *__rpc_thread_svc_fdset (void) __attribute__ ((__const__)); +#define svc_fdset (*__rpc_thread_svc_fdset ()) + +extern struct rpc_createerr *__rpc_thread_createerr (void) + __attribute__ ((__const__)); +#define get_rpc_createerr() (*__rpc_thread_createerr ()) +/* The people who "engineered" RPC should bee punished for naming the + data structure and the variable the same. We cannot always define the + macro 'rpc_createerr' because this would prevent people from defining + object of type 'struct rpc_createerr'. So we leave it up to the user + to select transparent replacement also of this variable. */ +#ifdef _RPC_MT_VARS +# define rpc_createerr (*__rpc_thread_createerr ()) +#endif + +extern struct pollfd **__rpc_thread_svc_pollfd (void) + __attribute__ ((__const__)); +#define svc_pollfd (*__rpc_thread_svc_pollfd ()) + +extern int *__rpc_thread_svc_max_pollfd (void) __attribute__ ((__const__)); +#define svc_max_pollfd (*__rpc_thread_svc_max_pollfd ()) + +__END_DECLS + +#endif /* rpc/rpc.h */ diff --git a/pfarm/src_xdr/rpc/rpc_des.h b/pfarm/src_xdr/rpc/rpc_des.h new file mode 100644 index 0000000000000000000000000000000000000000..2091f5241437c948465fe5b7933eac26c593dd4b --- /dev/null +++ b/pfarm/src_xdr/rpc/rpc_des.h @@ -0,0 +1,71 @@ +/* + * Generic DES driver interface + * Keep this file hardware independent! + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _DES_H +#define _DES_H + +#include <sys/types.h> + +#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */ +#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */ + +enum desdir + { + ENCRYPT, DECRYPT + }; +enum desmode + { + CBC, ECB + }; + +/* + * parameters to ioctl call + */ +struct desparams + { + unsigned char des_key[8]; /* key (with low bit parity) */ + enum desdir des_dir; /* direction */ + enum desmode des_mode; /* mode */ + unsigned char des_ivec[8]; /* input vector */ + unsigned des_len; /* number of bytes to crypt */ + union + { + unsigned char UDES_data[DES_QUICKLEN]; + unsigned char *UDES_buf; + } + UDES; +#define des_data UDES.UDES_data /* direct data here if quick */ +#define des_buf UDES.UDES_buf /* otherwise, pointer to data */ + }; + +#endif diff --git a/pfarm/src_xdr/rpc/rpc_msg.h b/pfarm/src_xdr/rpc/rpc_msg.h new file mode 100644 index 0000000000000000000000000000000000000000..273b187d14d681a1f1b0c0138aa8d26abbdda399 --- /dev/null +++ b/pfarm/src_xdr/rpc/rpc_msg.h @@ -0,0 +1,198 @@ +/* + * rpc_msg.h + * rpc message definition + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_MSG_H +#define _RPC_MSG_H 1 + +#include <sys/cdefs.h> + +#include <rpc/xdr.h> +#include <rpc/clnt.h> + +#define RPC_MSG_VERSION ((u_long) 2) +#define RPC_SERVICE_PORT ((u_short) 2048) + +__BEGIN_DECLS + +/* + * Bottom up definition of an rpc message. + * NOTE: call and reply use the same overall struct but + * different parts of unions within it. + */ + +enum msg_type { + CALL=0, + REPLY=1 +}; + +enum reply_stat { + MSG_ACCEPTED=0, + MSG_DENIED=1 +}; + +enum accept_stat { + SUCCESS=0, + PROG_UNAVAIL=1, + PROG_MISMATCH=2, + PROC_UNAVAIL=3, + GARBAGE_ARGS=4, + SYSTEM_ERR=5 +}; + +enum reject_stat { + RPC_MISMATCH=0, + AUTH_ERROR=1 +}; + +/* + * Reply part of an rpc exchange + */ + +/* + * Reply to an rpc request that was accepted by the server. + * Note: there could be an error even though the request was + * accepted. + */ +struct accepted_reply { + struct opaque_auth ar_verf; + enum accept_stat ar_stat; + union { + struct { + u_long low; + u_long high; + } AR_versions; + struct { + caddr_t where; + xdrproc_t proc; + } AR_results; + /* and many other null cases */ + } ru; +#define ar_results ru.AR_results +#define ar_vers ru.AR_versions +}; + +/* + * Reply to an rpc request that was rejected by the server. + */ +struct rejected_reply { + enum reject_stat rj_stat; + union { + struct { + u_long low; + u_long high; + } RJ_versions; + enum auth_stat RJ_why; /* why authentication did not work */ + } ru; +#define rj_vers ru.RJ_versions +#define rj_why ru.RJ_why +}; + +/* + * Body of a reply to an rpc request. + */ +struct reply_body { + enum reply_stat rp_stat; + union { + struct accepted_reply RP_ar; + struct rejected_reply RP_dr; + } ru; +#define rp_acpt ru.RP_ar +#define rp_rjct ru.RP_dr +}; + +/* + * Body of an rpc request call. + */ +struct call_body { + u_long cb_rpcvers; /* must be equal to two */ + u_long cb_prog; + u_long cb_vers; + u_long cb_proc; + struct opaque_auth cb_cred; + struct opaque_auth cb_verf; /* protocol specific - provided by client */ +}; + +/* + * The rpc message + */ +struct rpc_msg { + u_long rm_xid; + enum msg_type rm_direction; + union { + struct call_body RM_cmb; + struct reply_body RM_rmb; + } ru; +#define rm_call ru.RM_cmb +#define rm_reply ru.RM_rmb +}; +#define acpted_rply ru.RM_rmb.ru.RP_ar +#define rjcted_rply ru.RM_rmb.ru.RP_dr + + +/* + * XDR routine to handle a rpc message. + * xdr_callmsg(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW; + +/* + * XDR routine to pre-serialize the static part of a rpc message. + * xdr_callhdr(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW; + +/* + * XDR routine to handle a rpc reply. + * xdr_replymsg(xdrs, rmsg) + * XDR *xdrs; + * struct rpc_msg *rmsg; + */ +extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW; + +/* + * Fills in the error part of a reply message. + * _seterr_reply(msg, error) + * struct rpc_msg *msg; + * struct rpc_err *error; + */ +extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error) + __THROW; + +__END_DECLS + +#endif /* rpc/rpc_msg.h */ diff --git a/pfarm/src_xdr/rpc/svc.h b/pfarm/src_xdr/rpc/svc.h new file mode 100644 index 0000000000000000000000000000000000000000..9294afb31170594e364ed196029ffbd61b839e20 --- /dev/null +++ b/pfarm/src_xdr/rpc/svc.h @@ -0,0 +1,336 @@ +/* + * svc.h, Server-side remote procedure call interface. + * + * Copyright (C) 2012-2017 Free Software Foundation, Inc. + * This file is part of the GNU C Library. + * + * The GNU C Library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * The GNU C Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the GNU C Library; if not, see + * <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_SVC_H +#define _RPC_SVC_H 1 + +#include <features.h> +#include <rpc/rpc_msg.h> + +__BEGIN_DECLS + +/* + * This interface must manage two items concerning remote procedure calling: + * + * 1) An arbitrary number of transport connections upon which rpc requests + * are received. The two most notable transports are TCP and UDP; they are + * created and registered by routines in svc_tcp.c and svc_udp.c, respectively; + * they in turn call xprt_register and xprt_unregister. + * + * 2) An arbitrary number of locally registered services. Services are + * described by the following four data: program number, version number, + * "service dispatch" function, a transport handle, and a boolean that + * indicates whether or not the exported program should be registered with a + * local binder service; if true the program's number and version and the + * port number from the transport handle are registered with the binder. + * These data are registered with the rpc svc system via svc_register. + * + * A service's dispatch function is called whenever an rpc request comes in + * on a transport. The request's program and version numbers must match + * those of the registered service. The dispatch function is passed two + * parameters, struct svc_req * and SVCXPRT *, defined below. + */ + +enum xprt_stat { + XPRT_DIED, + XPRT_MOREREQS, + XPRT_IDLE +}; + +/* + * Server side transport handle + */ +typedef struct SVCXPRT SVCXPRT; +struct SVCXPRT { + int xp_sock; + u_short xp_port; /* associated port number */ + const struct xp_ops { + bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg); + /* receive incoming requests */ + enum xprt_stat (*xp_stat) (SVCXPRT *__xprt); + /* get transport status */ + bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args, + caddr_t __args_ptr); /* get arguments */ + bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg); + /* send reply */ + bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args, + caddr_t __args_ptr); + /* free mem allocated for args */ + void (*xp_destroy) (SVCXPRT *__xprt); + /* destroy this struct */ + } *xp_ops; + int xp_addrlen; /* length of remote address */ + struct sockaddr_in xp_raddr; /* remote address */ + struct opaque_auth xp_verf; /* raw response verifier */ + caddr_t xp_p1; /* private */ + caddr_t xp_p2; /* private */ + char xp_pad [256]; /* padding, internal use */ +}; + +/* + * Approved way of getting address of caller + */ +#define svc_getcaller(x) (&(x)->xp_raddr) + +/* + * Operations defined on an SVCXPRT handle + * + * SVCXPRT *xprt; + * struct rpc_msg *msg; + * xdrproc_t xargs; + * caddr_t argsp; + */ +#define SVC_RECV(xprt, msg) \ + (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) +#define svc_recv(xprt, msg) \ + (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) + +#define SVC_STAT(xprt) \ + (*(xprt)->xp_ops->xp_stat)(xprt) +#define svc_stat(xprt) \ + (*(xprt)->xp_ops->xp_stat)(xprt) + +#define SVC_GETARGS(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) +#define svc_getargs(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) + +#define SVC_REPLY(xprt, msg) \ + (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) +#define svc_reply(xprt, msg) \ + (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) + +#define SVC_FREEARGS(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) +#define svc_freeargs(xprt, xargs, argsp) \ + (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) + +#define SVC_DESTROY(xprt) \ + (*(xprt)->xp_ops->xp_destroy)(xprt) +#define svc_destroy(xprt) \ + (*(xprt)->xp_ops->xp_destroy)(xprt) + + +/* + * Service request + */ +struct svc_req { + rpcprog_t rq_prog; /* service program number */ + rpcvers_t rq_vers; /* service protocol version */ + rpcproc_t rq_proc; /* the desired procedure */ + struct opaque_auth rq_cred; /* raw creds from the wire */ + caddr_t rq_clntcred; /* read only cooked cred */ + SVCXPRT *rq_xprt; /* associated transport */ +}; + +#ifndef __DISPATCH_FN_T +#define __DISPATCH_FN_T +typedef void (*__dispatch_fn_t) (struct svc_req*, SVCXPRT*); +#endif + +/* + * Service registration + * + * svc_register(xprt, prog, vers, dispatch, protocol) + * SVCXPRT *xprt; + * rpcprog_t prog; + * rpcvers_t vers; + * void (*dispatch)(struct svc_req*, SVCXPRT*); + * rpcprot_t protocol; like TCP or UDP, zero means do not register + */ +extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog, + rpcvers_t __vers, __dispatch_fn_t __dispatch, + rpcprot_t __protocol) __THROW; + +/* + * Service un-registration + * + * svc_unregister(prog, vers) + * rpcprog_t prog; + * rpcvers_t vers; + */ +extern void svc_unregister (rpcprog_t __prog, rpcvers_t __vers) __THROW; + +/* + * Transport registration. + * + * xprt_register(xprt) + * SVCXPRT *xprt; + */ +extern void xprt_register (SVCXPRT *__xprt) __THROW; + +/* + * Transport un-register + * + * xprt_unregister(xprt) + * SVCXPRT *xprt; + */ +extern void xprt_unregister (SVCXPRT *__xprt) __THROW; + + +/* + * When the service routine is called, it must first check to see if it + * knows about the procedure; if not, it should call svcerr_noproc + * and return. If so, it should deserialize its arguments via + * SVC_GETARGS (defined above). If the deserialization does not work, + * svcerr_decode should be called followed by a return. Successful + * decoding of the arguments should be followed the execution of the + * procedure's code and a call to svc_sendreply. + * + * Also, if the service refuses to execute the procedure due to too- + * weak authentication parameters, svcerr_weakauth should be called. + * Note: do not confuse access-control failure with weak authentication! + * + * NB: In pure implementations of rpc, the caller always waits for a reply + * msg. This message is sent when svc_sendreply is called. + * Therefore pure service implementations should always call + * svc_sendreply even if the function logically returns void; use + * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows + * for the abuse of pure rpc via batched calling or pipelining. In the + * case of a batched call, svc_sendreply should NOT be called since + * this would send a return message, which is what batching tries to avoid. + * It is the service/protocol writer's responsibility to know which calls are + * batched and which are not. Warning: responding to batch calls may + * deadlock the caller and server processes! + */ + +extern bool_t svc_sendreply (SVCXPRT *__xprt, xdrproc_t __xdr_results, + caddr_t __xdr_location) __THROW; + +extern void svcerr_decode (SVCXPRT *__xprt) __THROW; + +extern void svcerr_weakauth (SVCXPRT *__xprt) __THROW; + +extern void svcerr_noproc (SVCXPRT *__xprt) __THROW; + +extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers, + rpcvers_t __high_vers) __THROW; + +extern void svcerr_auth (SVCXPRT *__xprt, enum auth_stat __why) __THROW; + +extern void svcerr_noprog (SVCXPRT *__xprt) __THROW; + +extern void svcerr_systemerr (SVCXPRT *__xprt) __THROW; + +/* + * Lowest level dispatching -OR- who owns this process anyway. + * Somebody has to wait for incoming requests and then call the correct + * service routine. The routine svc_run does infinite waiting; i.e., + * svc_run never returns. + * Since another (coexistent) package may wish to selectively wait for + * incoming calls or other events outside of the rpc architecture, the + * routine svc_getreq is provided. It must be passed readfds, the + * "in-place" results of a select system call (see select, section 2). + */ + +/* + * Global keeper of rpc service descriptors in use + * dynamic; must be inspected before each call to select + */ + +extern struct pollfd *svc_pollfd; +extern int svc_max_pollfd; +extern fd_set svc_fdset; +#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ + +/* + * a small program implemented by the svc_rpc implementation itself; + * also see clnt.h for protocol numbers. + */ +extern void svc_getreq (int __rdfds) __THROW; +extern void svc_getreq_common (const int __fd) __THROW; +extern void svc_getreqset (fd_set *__readfds) __THROW; +extern void svc_getreq_poll (struct pollfd *, const int) __THROW; +extern void svc_exit (void) __THROW; +extern void svc_run (void) __THROW; + +/* + * Socket to use on svcxxx_create call to get default socket + */ +#define RPC_ANYSOCK -1 + +/* + * These are the existing service side transport implementations + */ + +/* + * Memory based rpc for testing and timing. + */ +extern SVCXPRT *svcraw_create (void) __THROW; + +/* + * Udp based rpc. + */ +extern SVCXPRT *svcudp_create (int __sock) __THROW; +extern SVCXPRT *svcudp_bufcreate (int __sock, u_int __sendsz, u_int __recvsz) + __THROW; + +/* + * Tcp based rpc. + */ +extern SVCXPRT *svctcp_create (int __sock, u_int __sendsize, u_int __recvsize) + __THROW; + +/* + * FD based rpc. + */ +extern SVCXPRT *svcfd_create (int __sock, u_int __sendsize, u_int __recvsize) + __THROW; + +/* + * Unix based rpc. + */ +extern SVCXPRT *svcunix_create (int __sock, u_int __sendsize, u_int __recvsize, + char *__path) __THROW; + + +__END_DECLS + +#endif /* rpc/svc.h */ diff --git a/pfarm/src_xdr/rpc/svc_auth.h b/pfarm/src_xdr/rpc/svc_auth.h new file mode 100644 index 0000000000000000000000000000000000000000..4ba27411e7c711cb35b960681d76e6dbc2e970c3 --- /dev/null +++ b/pfarm/src_xdr/rpc/svc_auth.h @@ -0,0 +1,50 @@ +/* + * svc_auth.h, Service side of rpc authentication. + * + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_SVC_AUTH_H +#define _RPC_SVC_AUTH_H 1 + +#include <features.h> +#include <rpc/svc.h> + +__BEGIN_DECLS + +/* + * Server side authenticator + */ +extern enum auth_stat _authenticate (struct svc_req *__rqst, + struct rpc_msg *__msg) __THROW; + +__END_DECLS + +#endif /* rpc/svc_auth.h */ diff --git a/pfarm/src_xdr/rpc/types.h b/pfarm/src_xdr/rpc/types.h new file mode 100644 index 0000000000000000000000000000000000000000..beded5255595513cf0bd8b5e69a3a4e3ba630343 --- /dev/null +++ b/pfarm/src_xdr/rpc/types.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010, Oracle America, Inc. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* fixincludes should not add extern "C" to this file */ +/* + * Rpc additions to <sys/types.h> + */ +#ifndef _RPC_TYPES_H +#define _RPC_TYPES_H 1 + +typedef int bool_t; +typedef int enum_t; +/* This needs to be changed to uint32_t in the future */ +typedef unsigned long rpcprog_t; +typedef unsigned long rpcvers_t; +typedef unsigned long rpcproc_t; +typedef unsigned long rpcprot_t; +typedef unsigned long rpcport_t; + +#define __dontcare__ -1 + +#ifndef FALSE +# define FALSE (0) +#endif + +#ifndef TRUE +# define TRUE (1) +#endif + +#ifndef NULL +# define NULL 0 +#endif + +#include <stdlib.h> /* For malloc decl. */ +#define mem_alloc(bsize) malloc(bsize) +/* + * XXX: This must not use the second argument, or code in xdr_array.c needs + * to be modified. + */ +#define mem_free(ptr, bsize) free(ptr) + +#ifndef makedev /* ie, we haven't already included it */ +#include <sys/types.h> +#endif + +#if defined __APPLE_CC__ || defined __FreeBSD__ +# define __u_char_defined +# define __daddr_t_defined +#endif + +#ifndef __u_char_defined +typedef __u_char u_char; +typedef __u_short u_short; +typedef __u_int u_int; +typedef __u_long u_long; +typedef __quad_t quad_t; +typedef __u_quad_t u_quad_t; +typedef __fsid_t fsid_t; +# define __u_char_defined +#endif +#ifndef __daddr_t_defined +typedef __daddr_t daddr_t; +typedef __caddr_t caddr_t; +# define __daddr_t_defined +#endif + +#include <sys/time.h> +#include <sys/param.h> + +#include <netinet/in.h> + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK (u_long)0x7F000001 +#endif +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + +#endif /* rpc/types.h */ diff --git a/pfarm/src_xdr/rpc/xdr.h b/pfarm/src_xdr/rpc/xdr.h new file mode 100644 index 0000000000000000000000000000000000000000..d80d8f735d83a46b0aa0080115c0d58590a51236 --- /dev/null +++ b/pfarm/src_xdr/rpc/xdr.h @@ -0,0 +1,377 @@ +/* + * xdr.h, External Data Representation Serialization Routines. + * + * Copyright (c) 2010, 2012, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RPC_XDR_H +#define _RPC_XDR_H 1 + +#include <features.h> +#include <sys/types.h> +#include <rpc/types.h> + +/* We need FILE. */ +#include <stdio.h> + +__BEGIN_DECLS + +/* + * XDR provides a conventional way for converting between C data + * types and an external bit-string representation. Library supplied + * routines provide for the conversion on built-in C data types. These + * routines and utility routines defined here are used to help implement + * a type encode/decode routine for each user-defined type. + * + * Each data type provides a single procedure which takes two arguments: + * + * bool_t + * xdrproc(xdrs, argresp) + * XDR *xdrs; + * <type> *argresp; + * + * xdrs is an instance of a XDR handle, to which or from which the data + * type is to be converted. argresp is a pointer to the structure to be + * converted. The XDR handle contains an operation field which indicates + * which of the operations (ENCODE, DECODE * or FREE) is to be performed. + * + * XDR_DECODE may allocate space if the pointer argresp is null. This + * data can be freed with the XDR_FREE operation. + * + * We write only one procedure per data type to make it easy + * to keep the encode and decode procedures for a data type consistent. + * In many cases the same code performs all operations on a user defined type, + * because all the hard work is done in the component type routines. + * decode as a series of calls on the nested data types. + */ + +/* + * Xdr operations. XDR_ENCODE causes the type to be encoded into the + * stream. XDR_DECODE causes the type to be extracted from the stream. + * XDR_FREE can be used to release the space allocated by an XDR_DECODE + * request. + */ +enum xdr_op { + XDR_ENCODE = 0, + XDR_DECODE = 1, + XDR_FREE = 2 +}; + +/* + * This is the number of bytes per unit of external data. + */ +#define BYTES_PER_XDR_UNIT (4) +/* + * This only works if the above is a power of 2. But it's defined to be + * 4 by the appropriate RFCs. So it will work. And it's normally quicker + * than the old routine. + */ +#if 1 +#define RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1)) +#else /* this is the old routine */ +#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ + * BYTES_PER_XDR_UNIT) +#endif + +/* + * The XDR handle. + * Contains operation which is being applied to the stream, + * an operations vector for the particular implementation (e.g. see xdr_mem.c), + * and two private fields for the use of the particular implementation. + */ +typedef struct XDR XDR; +struct XDR + { + enum xdr_op x_op; /* operation; fast additional param */ + struct xdr_ops + { + bool_t (*x_getlong) (XDR *__xdrs, long *__lp); + /* get a long from underlying stream */ + bool_t (*x_putlong) (XDR *__xdrs, const long *__lp); + /* put a long to " */ + bool_t (*x_getbytes) (XDR *__xdrs, caddr_t __addr, u_int __len); + /* get some bytes from " */ + bool_t (*x_putbytes) (XDR *__xdrs, const char *__addr, u_int __len); + /* put some bytes to " */ + u_int (*x_getpostn) (const XDR *__xdrs); + /* returns bytes off from beginning */ + bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos); + /* lets you reposition the stream */ + int32_t *(*x_inline) (XDR *__xdrs, u_int __len); + /* buf quick ptr to buffered data */ + void (*x_destroy) (XDR *__xdrs); + /* free privates of this xdr_stream */ + bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip); + /* get a int from underlying stream */ + bool_t (*x_putint32) (XDR *__xdrs, const int32_t *__ip); + /* put a int to " */ + } + *x_ops; + caddr_t x_public; /* users' data */ + caddr_t x_private; /* pointer to private data */ + caddr_t x_base; /* private used for position info */ + u_int x_handy; /* extra private word */ + }; + +/* + * A xdrproc_t exists for each data type which is to be encoded or decoded. + * + * The second argument to the xdrproc_t is a pointer to an opaque pointer. + * The opaque pointer generally points to a structure of the data type + * to be decoded. If this pointer is 0, then the type routines should + * allocate dynamic storage of the appropriate size and return it. + * bool_t (*xdrproc_t)(XDR *, caddr_t *); + */ +typedef bool_t (*xdrproc_t) (XDR *, void *,...); + + +/* + * Operations defined on a XDR handle + * + * XDR *xdrs; + * int32_t *int32p; + * long *longp; + * caddr_t addr; + * u_int len; + * u_int pos; + */ +#define XDR_GETINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) +#define xdr_getint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) + +#define XDR_PUTINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) +#define xdr_putint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) + +#define XDR_GETLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) +#define xdr_getlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) + +#define XDR_PUTLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) +#define xdr_putlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) + +#define XDR_GETBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) +#define xdr_getbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) + +#define XDR_PUTBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) +#define xdr_putbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) + +#define XDR_GETPOS(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) +#define xdr_getpos(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) + +#define XDR_SETPOS(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) +#define xdr_setpos(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) + +#define XDR_INLINE(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) +#define xdr_inline(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) + +#define XDR_DESTROY(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) +#define xdr_destroy(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) + +/* + * Support struct for discriminated unions. + * You create an array of xdrdiscrim structures, terminated with + * an entry with a null procedure pointer. The xdr_union routine gets + * the discriminant value and then searches the array of structures + * for a matching value. If a match is found the associated xdr routine + * is called to handle that part of the union. If there is + * no match, then a default routine may be called. + * If there is no match and no default routine it is an error. + */ +#define NULL_xdrproc_t ((xdrproc_t)0) +struct xdr_discrim +{ + int value; + xdrproc_t proc; +}; + +/* + * Inline routines for fast encode/decode of primitive data types. + * Caveat emptor: these use single memory cycles to get the + * data from the underlying buffer, and will fail to operate + * properly if the data is not aligned. The standard way to use these + * is to say: + * if ((buf = XDR_INLINE(xdrs, count)) == NULL) + * return (FALSE); + * <<< macro calls >>> + * where ``count'' is the number of bytes of data occupied + * by the primitive data types. + * + * N.B. and frozen for all time: each data type here uses 4 bytes + * of external representation. + */ + +#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++)) +#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v))) +#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf)) +#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v)) + +/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms + * and shouldn't be used any longer. Code which use this defines or longs + * in the RPC code will not work on 64bit Solaris platforms ! + */ +#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf)) +#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v))) +#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf)) +#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v)) + + +#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) +#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf)) +#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf)) +#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf)) + +#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG(buf, (long)(v)) +#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG(buf, (long)(v)) +#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v)) +#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v)) + +/* + * These are the "generic" xdr routines. + * None of these can have const applied because it's not possible to + * know whether the call is a read or a write to the passed parameter + * also, the XDR structure is always updated by some of these calls. + */ +extern bool_t xdr_void (void) __THROW; +extern bool_t xdr_short (XDR *__xdrs, short *__sp) __THROW; +extern bool_t xdr_u_short (XDR *__xdrs, u_short *__usp) __THROW; +extern bool_t xdr_int (XDR *__xdrs, int *__ip) __THROW; +extern bool_t xdr_u_int (XDR *__xdrs, u_int *__up) __THROW; +extern bool_t xdr_long (XDR *__xdrs, long *__lp) __THROW; +extern bool_t xdr_u_long (XDR *__xdrs, u_long *__ulp) __THROW; +extern bool_t xdr_hyper (XDR *__xdrs, quad_t *__llp) __THROW; +extern bool_t xdr_u_hyper (XDR *__xdrs, u_quad_t *__ullp) __THROW; +extern bool_t xdr_longlong_t (XDR *__xdrs, quad_t *__llp) __THROW; +extern bool_t xdr_u_longlong_t (XDR *__xdrs, u_quad_t *__ullp) __THROW; +extern bool_t xdr_int8_t (XDR *__xdrs, int8_t *__ip) __THROW; +extern bool_t xdr_uint8_t (XDR *__xdrs, uint8_t *__up) __THROW; +extern bool_t xdr_int16_t (XDR *__xdrs, int16_t *__ip) __THROW; +extern bool_t xdr_uint16_t (XDR *__xdrs, uint16_t *__up) __THROW; +extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW; +extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW; +extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW; +extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW; +extern bool_t xdr_quad_t (XDR *__xdrs, quad_t *__ip) __THROW; +extern bool_t xdr_u_quad_t (XDR *__xdrs, u_quad_t *__up) __THROW; +extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW; +extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW; +extern bool_t xdr_array (XDR * _xdrs, caddr_t *__addrp, u_int *__sizep, + u_int __maxsize, u_int __elsize, xdrproc_t __elproc) + __THROW; +extern bool_t xdr_bytes (XDR *__xdrs, char **__cpp, u_int *__sizep, + u_int __maxsize) __THROW; +extern bool_t xdr_opaque (XDR *__xdrs, caddr_t __cp, u_int __cnt) __THROW; +extern bool_t xdr_string (XDR *__xdrs, char **__cpp, u_int __maxsize) __THROW; +extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp, + const struct xdr_discrim *__choices, + xdrproc_t __dfault) __THROW; +extern bool_t xdr_char (XDR *__xdrs, char *__cp) __THROW; +extern bool_t xdr_u_char (XDR *__xdrs, u_char *__cp) __THROW; +extern bool_t xdr_vector (XDR *__xdrs, char *__basep, u_int __nelem, + u_int __elemsize, xdrproc_t __xdr_elem) __THROW; +extern bool_t xdr_float (XDR *__xdrs, float *__fp) __THROW; +extern bool_t xdr_double (XDR *__xdrs, double *__dp) __THROW; +extern bool_t xdr_reference (XDR *__xdrs, caddr_t *__xpp, u_int __size, + xdrproc_t __proc) __THROW; +extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp, + u_int __obj_size, xdrproc_t __xdr_obj) __THROW; +extern bool_t xdr_wrapstring (XDR *__xdrs, char **__cpp) __THROW; +extern u_long xdr_sizeof (xdrproc_t, void *) __THROW; + +/* + * Common opaque bytes objects used by many rpc protocols; + * declared here due to commonality. + */ +#define MAX_NETOBJ_SZ 1024 +struct netobj +{ + u_int n_len; + char *n_bytes; +}; +typedef struct netobj netobj; +extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np) __THROW; + +/* + * These are the public routines for the various implementations of + * xdr streams. + */ + +/* XDR using memory buffers */ +extern void xdrmem_create (XDR *__xdrs, const caddr_t __addr, + u_int __size, enum xdr_op __xop) __THROW; + +/* XDR using stdio library */ +extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop) + __THROW; + +/* XDR pseudo records for tcp */ +extern void xdrrec_create (XDR *__xdrs, u_int __sendsize, + u_int __recvsize, caddr_t __tcp_handle, + int (*__readit) (char *, char *, int), + int (*__writeit) (char *, char *, int)) __THROW; + +/* make end of xdr record */ +extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow) __THROW; + +/* move to beginning of next record */ +extern bool_t xdrrec_skiprecord (XDR *__xdrs) __THROW; + +/* true if no more input */ +extern bool_t xdrrec_eof (XDR *__xdrs) __THROW; + +/* free memory buffers for xdr */ +extern void xdr_free (xdrproc_t __proc, char *__objp) __THROW; + +__END_DECLS + +#endif /* rpc/xdr.h */ diff --git a/pfarm/src_xdr/test_xdr b/pfarm/src_xdr/test_xdr deleted file mode 100755 index e906712bf62eec1ca1d67f57ca7fe1494a3668df..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/test_xdr and /dev/null differ diff --git a/pfarm/src_xdr/test_xdr.o b/pfarm/src_xdr/test_xdr.o deleted file mode 100644 index 1d741530069d6a35e5c844e69497ecbe660dd3f7..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/test_xdr.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_close.o b/pfarm/src_xdr/xdr_close.o deleted file mode 100644 index 0477db985c5ac3ac58fd41247f852b6f2756589d..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_close.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_dmat.o b/pfarm/src_xdr/xdr_dmat.o deleted file mode 100644 index d31d4d0432dd6a9cb540f852ae9bad8109c7de87..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_dmat.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_fdouble.o b/pfarm/src_xdr/xdr_fdouble.o deleted file mode 100644 index 39ccac400600fb8e875c04894464ef1d11347c84..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_fdouble.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_files.o b/pfarm/src_xdr/xdr_files.o deleted file mode 100644 index ff61248fd330123e7457ee82d984c15df1d3797e..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_files.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_fint.o b/pfarm/src_xdr/xdr_fint.o deleted file mode 100644 index f7af206323f10110f793123ea568d1e89371eec6..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_fint.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_fstring.o b/pfarm/src_xdr/xdr_fstring.o deleted file mode 100644 index 03afc3bdc73d7aa0b981af2a0043a063cc4f18b2..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_fstring.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_imat.o b/pfarm/src_xdr/xdr_imat.o deleted file mode 100644 index 1c95d3269db93362baae4c9fe7729f0b05700377..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_imat.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_open.o b/pfarm/src_xdr/xdr_open.o deleted file mode 100644 index b4a337d8371d35e99d16b55c7be46727c8de7235..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_open.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_real64.o b/pfarm/src_xdr/xdr_real64.o deleted file mode 100644 index 618409ced12014baa35c7490e6051ead0272f840..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_real64.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_rewind.o b/pfarm/src_xdr/xdr_rewind.o deleted file mode 100644 index 9909be0e01304bc2379bc43f1a1eb5048b2d07ec..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_rewind.o and /dev/null differ diff --git a/pfarm/src_xdr/xdr_rmat64.o b/pfarm/src_xdr/xdr_rmat64.o deleted file mode 100644 index 3749c8372be3d18df290bbdd3ff7948d47745f3e..0000000000000000000000000000000000000000 Binary files a/pfarm/src_xdr/xdr_rmat64.o and /dev/null differ